Documentation ¶
Index ¶
- Constants
- Variables
- func GetAuthConfig(ctx context.Context) (*auth.AuthConfig, error)
- func GetDatabase(ctx context.Context) (db.Database, error)
- func GetMailClient(ctx context.Context) (mail.EmailClient, error)
- func GetNow() time.Time
- 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 IsAuthenticated(ctx context.Context) bool
- func WithAuthConfig(ctx context.Context, config auth.AuthConfig) context.Context
- func WithDatabase(ctx context.Context, database db.Database) context.Context
- func WithEnv(ctx context.Context, env KeelEnv) context.Context
- func WithIdentity(ctx context.Context, identity *Identity) context.Context
- func WithIssuersFromEnv(ctx context.Context) context.Context
- func WithMailClient(ctx context.Context, client mail.EmailClient) 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 EnvKeyContextType
- type Identity
- 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 GetAuthConfig ¶
func GetAuthConfig(ctx context.Context) (*auth.AuthConfig, error)
func GetMailClient ¶
func GetMailClient(ctx context.Context) (mail.EmailClient, error)
func GetPrivateKey ¶
func GetPrivateKey(ctx context.Context) (*rsa.PrivateKey, error)
func IsAuthenticated ¶
func WithAuthConfig ¶
func WithIssuersFromEnv ¶
Backwards compatibility with the previous env var config.
func WithMailClient ¶
func WithPrivateKey ¶
func WithRequestHeaders ¶
Types ¶
type EnvKeyContextType ¶
type EnvKeyContextType string
type Identity ¶
Click to show internal directories.
Click to hide internal directories.