Documentation ¶
Index ¶
- Constants
- Variables
- func GetMailClient(ctx context.Context) (mail.EmailClient, error)
- func GetNow() time.Time
- func GetOAuthConfig(ctx context.Context) (*config.AuthConfig, error)
- func GetPrivateKey(ctx context.Context) (*rsa.PrivateKey, error)
- func GetRequestHeaders(ctx context.Context) (map[string][]string, error)
- func GetSecret(ctx context.Context, secret string) (string, error)
- func GetSecrets(ctx context.Context) map[string]string
- func WithAuthConfig(ctx context.Context, config AuthConfig) context.Context
- func WithEnv(ctx context.Context, env KeelEnv) context.Context
- func WithIssuersFromEnv(ctx context.Context) context.Context
- func WithMailClient(ctx context.Context, client mail.EmailClient) context.Context
- func WithOAuthConfig(ctx context.Context, config *config.AuthConfig) context.Context
- func WithPrivateKey(ctx context.Context, privateKey *rsa.PrivateKey) context.Context
- func WithRequestHeaders(ctx context.Context, headers map[string][]string) context.Context
- func WithSecrets(ctx context.Context, secrets map[string]string) context.Context
- type AuthConfig
- type EnvKeyContextType
- type ExternalIssuer
- type KeelAuthConfig
- type KeelEnv
Constants ¶
View Source
const ( ContextIdentityField = "identity" ContextIsAuthenticatedField = "isAuthenticated" ContextNowField = "now" ContextEnvField = "env" ContextSecretField = "secret" )
View Source
const ContextTarget string = "ctx"
View Source
const (
ExternalIssuersEnvKey string = "KEEL_EXTERNAL_ISSUERS"
)
View Source
const (
SecretContextKey secretContextKey = "secret"
)
Variables ¶
View Source
var ContextFieldTypes = map[string]proto.Type{ ContextIdentityField: proto.Type_TYPE_MODEL, ContextIsAuthenticatedField: proto.Type_TYPE_BOOL, ContextNowField: proto.Type_TYPE_DATETIME, ContextEnvField: proto.Type_TYPE_OBJECT, ContextSecretField: proto.Type_TYPE_SECRET, }
Functions ¶
func GetMailClient ¶
func GetMailClient(ctx context.Context) (mail.EmailClient, error)
func GetOAuthConfig ¶ added in v0.372.0
func GetOAuthConfig(ctx context.Context) (*config.AuthConfig, error)
func GetPrivateKey ¶
func GetPrivateKey(ctx context.Context) (*rsa.PrivateKey, error)
func WithAuthConfig ¶
func WithAuthConfig(ctx context.Context, config AuthConfig) context.Context
func WithIssuersFromEnv ¶
Backwards compatibility with the previous env var config.
func WithMailClient ¶
func WithOAuthConfig ¶ added in v0.372.0
func WithPrivateKey ¶
func WithRequestHeaders ¶
Types ¶
type AuthConfig ¶ added in v0.368.0
type AuthConfig struct { // If enabled, will verify tokens using any OIDC compatible issuer AllowAnyIssuers bool `json:"AllowAllIssuers"` Issuers []ExternalIssuer `json:"issuers"` Keel *KeelAuthConfig `json:"keel"` }
func GetAuthConfig ¶
func GetAuthConfig(ctx context.Context) (*AuthConfig, error)
type EnvKeyContextType ¶
type EnvKeyContextType string
type ExternalIssuer ¶ added in v0.368.0
type KeelAuthConfig ¶ added in v0.368.0
Click to show internal directories.
Click to hide internal directories.