driver

package
v2.3.0-pre.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 51 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallRegistry

func CallRegistry(ctx context.Context, r Registry)

Types

type Options added in v2.3.0

type Options struct {
	// contains filtered or unexported fields
}

func NewOptions added in v2.3.0

func NewOptions(opts []OptionsModifier) *Options

type OptionsModifier

type OptionsModifier func(*Options)

func DisablePreloading

func DisablePreloading() OptionsModifier

DisablePreloading will not preload the config.

func DisableValidation

func DisableValidation() OptionsModifier

DisableValidation validating the config.

This does not affect schema validation!

func Inspect added in v2.3.0

func Inspect(f func(Registry) error) OptionsModifier

func SkipNetworkInit

func SkipNetworkInit() OptionsModifier

func WithConfig

func WithConfig(config *config.DefaultProvider) OptionsModifier

func WithExtraFositeFactories added in v2.2.0

func WithExtraFositeFactories(f ...fositex.Factory) OptionsModifier

func WithExtraMigrations added in v2.2.0

func WithExtraMigrations(m ...fs.FS) OptionsModifier

WithExtraMigrations specifies additional database migration.

func WithGoMigrations added in v2.2.0

func WithGoMigrations(m ...popx.Migration) OptionsModifier

func WithOptions

func WithOptions(opts ...configx.OptionModifier) OptionsModifier

func WithRegistryModifiers added in v2.3.0

func WithRegistryModifiers(f ...RegistryModifier) OptionsModifier

func WithTracerWrapper added in v2.2.0

func WithTracerWrapper(wrapper TracerWrapper) OptionsModifier

WithTracerWrapper sets a function that wraps the tracer.

type Registry

type Registry interface {
	dbal.Driver
	WritableRegistry

	Init(ctx context.Context, skipNetworkInit bool, migrate bool, ctxer contextx.Contextualizer, extraMigrations []fs.FS, goMigrations []popx.Migration) error

	x.HTTPClientProvider
	GetJWKSFetcherStrategy() fosite.JWKSFetcherStrategy

	contextx.Provider
	config.Provider
	persistence.Provider
	x.RegistryLogger
	x.RegistryWriter
	x.RegistryCookieStore
	client.Registry
	consent.Registry
	jwk.Registry
	trust.Registry
	oauth2.Registry
	PrometheusManager() *prometheus.MetricsManager
	x.TracingProvider
	FlowCipher() *aead.XChaCha20Poly1305

	kratos.Provider

	RegisterRoutes(ctx context.Context, admin *httprouterx.RouterAdmin, public *httprouterx.RouterPublic)
	ClientHandler() *client.Handler
	KeyHandler() *jwk.Handler
	ConsentHandler() *consent.Handler
	OAuth2Handler() *oauth2.Handler
	HealthHandler() *healthx.Handler
	OAuth2EnigmaStrategy() *enigma.HMACStrategy
	OAuth2AwareMiddleware() func(h http.Handler) http.Handler

	OAuth2HMACStrategy() foauth2.CoreStrategy
}

func NewRegistryFromDSN

func NewRegistryFromDSN(ctx context.Context, c *config.DefaultProvider, l *logrusx.Logger, skipNetworkInit bool, migrate bool, ctxer contextx.Contextualizer) (Registry, error)

func NewRegistryWithoutInit

func NewRegistryWithoutInit(c *config.DefaultProvider, l *logrusx.Logger) (Registry, error)

type RegistryModifier added in v2.3.0

type RegistryModifier func(r Registry) error

func RegistryWithHMACSHAStrategy added in v2.3.0

func RegistryWithHMACSHAStrategy(s func(r Registry) oauth2.CoreStrategy) RegistryModifier

func RegistryWithHsmContext added in v2.3.0

func RegistryWithHsmContext(h hsm.Context) RegistryModifier

type RegistrySQL

type RegistrySQL struct {
	// contains filtered or unexported fields
}

func NewRegistrySQL

func NewRegistrySQL(
	c *config.DefaultProvider,
	l *logrusx.Logger,
	version, hash, date string,
) *RegistrySQL

func (*RegistrySQL) AccessRequestHooks added in v2.3.0

func (m *RegistrySQL) AccessRequestHooks() []oauth2.AccessRequestHook

func (*RegistrySQL) AccessTokenJWTStrategy added in v2.3.0

func (m *RegistrySQL) AccessTokenJWTStrategy() jwk.JWTSigner

func (*RegistrySQL) AudienceStrategy added in v2.3.0

func (m *RegistrySQL) AudienceStrategy() fosite.AudienceMatchingStrategy

func (*RegistrySQL) AuditLogger added in v2.3.0

func (m *RegistrySQL) AuditLogger() *logrusx.Logger

func (*RegistrySQL) BuildDate added in v2.3.0

func (m *RegistrySQL) BuildDate() string

func (*RegistrySQL) BuildHash added in v2.3.0

func (m *RegistrySQL) BuildHash() string

func (*RegistrySQL) BuildVersion added in v2.3.0

func (m *RegistrySQL) BuildVersion() string

func (*RegistrySQL) CanHandle

func (m *RegistrySQL) CanHandle(dsn string) bool

func (*RegistrySQL) ClientAuthenticator

func (m *RegistrySQL) ClientAuthenticator() x.ClientAuthenticator

func (*RegistrySQL) ClientHandler added in v2.3.0

func (m *RegistrySQL) ClientHandler() *client.Handler

func (*RegistrySQL) ClientHasher added in v2.3.0

func (m *RegistrySQL) ClientHasher() fosite.Hasher

func (*RegistrySQL) ClientManager

func (m *RegistrySQL) ClientManager() client.Manager

func (*RegistrySQL) ClientValidator added in v2.3.0

func (m *RegistrySQL) ClientValidator() *client.Validator

func (*RegistrySQL) Config added in v2.3.0

func (m *RegistrySQL) Config() *config.DefaultProvider

Config returns the configuration for the given context. It may or may not be the same as the global configuration.

func (*RegistrySQL) ConsentHandler added in v2.3.0

func (m *RegistrySQL) ConsentHandler() *consent.Handler

func (*RegistrySQL) ConsentManager

func (m *RegistrySQL) ConsentManager() consent.Manager

func (*RegistrySQL) ConsentStrategy added in v2.3.0

func (m *RegistrySQL) ConsentStrategy() consent.Strategy

func (*RegistrySQL) Contextualizer added in v2.3.0

func (m *RegistrySQL) Contextualizer() contextx.Contextualizer

func (*RegistrySQL) CookieStore added in v2.3.0

func (m *RegistrySQL) CookieStore(ctx context.Context) (sessions.Store, error)

func (*RegistrySQL) ExtraFositeFactories added in v2.3.0

func (m *RegistrySQL) ExtraFositeFactories() []fositex.Factory

func (*RegistrySQL) FlowCipher added in v2.3.0

func (m *RegistrySQL) FlowCipher() *aead.XChaCha20Poly1305

func (*RegistrySQL) GetJWKSFetcherStrategy added in v2.3.0

func (m *RegistrySQL) GetJWKSFetcherStrategy() fosite.JWKSFetcherStrategy

func (*RegistrySQL) GrantManager

func (m *RegistrySQL) GrantManager() trust.GrantManager

func (*RegistrySQL) GrantValidator added in v2.3.0

func (m *RegistrySQL) GrantValidator() *trust.GrantValidator

func (*RegistrySQL) HSMContext added in v2.3.0

func (m *RegistrySQL) HSMContext() hsm.Context

func (*RegistrySQL) HTTPClient added in v2.3.0

func (m *RegistrySQL) HTTPClient(ctx context.Context, opts ...httpx.ResilientOptions) *retryablehttp.Client

func (*RegistrySQL) HealthHandler added in v2.3.0

func (m *RegistrySQL) HealthHandler() *healthx.Handler

func (*RegistrySQL) Init

func (m *RegistrySQL) Init(
	ctx context.Context,
	skipNetworkInit bool,
	migrate bool,
	ctxer contextx.Contextualizer,
	extraMigrations []fs.FS,
	goMigrations []popx.Migration,
) error

func (*RegistrySQL) JWTGrantHandler added in v2.3.0

func (m *RegistrySQL) JWTGrantHandler() *trust.Handler

func (*RegistrySQL) KeyCipher added in v2.3.0

func (m *RegistrySQL) KeyCipher() *aead.AESGCM

func (*RegistrySQL) KeyHandler added in v2.3.0

func (m *RegistrySQL) KeyHandler() *jwk.Handler

func (*RegistrySQL) KeyManager

func (m *RegistrySQL) KeyManager() jwk.Manager

func (*RegistrySQL) Kratos added in v2.3.0

func (m *RegistrySQL) Kratos() kratos.Client

func (*RegistrySQL) Logger added in v2.3.0

func (m *RegistrySQL) Logger() *logrusx.Logger

func (*RegistrySQL) OAuth2AwareMiddleware added in v2.3.0

func (m *RegistrySQL) OAuth2AwareMiddleware() func(h http.Handler) http.Handler

func (*RegistrySQL) OAuth2Config added in v2.3.0

func (m *RegistrySQL) OAuth2Config() *fositex.Config

func (*RegistrySQL) OAuth2EnigmaStrategy added in v2.3.0

func (m *RegistrySQL) OAuth2EnigmaStrategy() *hmac.HMACStrategy

func (*RegistrySQL) OAuth2HMACStrategy added in v2.3.0

func (m *RegistrySQL) OAuth2HMACStrategy() foauth2.CoreStrategy

func (*RegistrySQL) OAuth2Handler added in v2.3.0

func (m *RegistrySQL) OAuth2Handler() *oauth2.Handler

func (*RegistrySQL) OAuth2Provider added in v2.3.0

func (m *RegistrySQL) OAuth2Provider() fosite.OAuth2Provider

func (*RegistrySQL) OAuth2ProviderConfig added in v2.3.0

func (m *RegistrySQL) OAuth2ProviderConfig() fosite.Configurator

func (*RegistrySQL) OAuth2Storage

func (m *RegistrySQL) OAuth2Storage() x.FositeStorer

func (*RegistrySQL) OpenIDConnectRequestValidator added in v2.3.0

func (m *RegistrySQL) OpenIDConnectRequestValidator() *openid.OpenIDConnectRequestValidator

func (*RegistrySQL) OpenIDJWTStrategy added in v2.3.0

func (m *RegistrySQL) OpenIDJWTStrategy() jwk.JWTSigner

func (*RegistrySQL) Persister added in v2.3.0

func (m *RegistrySQL) Persister() persistence.Persister

func (*RegistrySQL) Ping

func (m *RegistrySQL) Ping() error

func (*RegistrySQL) PingContext added in v2.3.0

func (m *RegistrySQL) PingContext(ctx context.Context) error

func (*RegistrySQL) PrometheusManager added in v2.3.0

func (m *RegistrySQL) PrometheusManager() *prometheus.MetricsManager

func (*RegistrySQL) RegisterRoutes added in v2.3.0

func (m *RegistrySQL) RegisterRoutes(ctx context.Context, admin *httprouterx.RouterAdmin, public *httprouterx.RouterPublic)

func (*RegistrySQL) SoftwareKeyManager

func (m *RegistrySQL) SoftwareKeyManager() jwk.Manager

func (*RegistrySQL) SubjectIdentifierAlgorithm added in v2.3.0

func (m *RegistrySQL) SubjectIdentifierAlgorithm(ctx context.Context) map[string]consent.SubjectIdentifierAlgorithm

func (*RegistrySQL) Tracer added in v2.3.0

func (m *RegistrySQL) Tracer(_ context.Context) *otelx.Tracer

func (*RegistrySQL) WithConfig added in v2.3.0

func (m *RegistrySQL) WithConfig(c *config.DefaultProvider) Registry

func (*RegistrySQL) WithConsentStrategy added in v2.3.0

func (m *RegistrySQL) WithConsentStrategy(c consent.Strategy)

WithConsentStrategy forces a consent strategy which is only used for testing.

func (*RegistrySQL) WithContextualizer added in v2.3.0

func (m *RegistrySQL) WithContextualizer(ctxer contextx.Contextualizer) Registry

func (*RegistrySQL) WithExtraFositeFactories added in v2.3.0

func (m *RegistrySQL) WithExtraFositeFactories(f []fositex.Factory) Registry

func (*RegistrySQL) WithHsmContext added in v2.3.0

func (m *RegistrySQL) WithHsmContext(h hsm.Context)

func (*RegistrySQL) WithKratos added in v2.3.0

func (m *RegistrySQL) WithKratos(k kratos.Client) Registry

func (*RegistrySQL) WithLogger added in v2.3.0

func (m *RegistrySQL) WithLogger(l *logrusx.Logger) Registry

func (*RegistrySQL) WithOAuth2Provider added in v2.3.0

func (m *RegistrySQL) WithOAuth2Provider(f fosite.OAuth2Provider)

WithOAuth2Provider forces an oauth2 provider which is only used for testing.

func (*RegistrySQL) WithTracer added in v2.3.0

func (m *RegistrySQL) WithTracer(t trace.Tracer) Registry

func (*RegistrySQL) WithTracerWrapper added in v2.3.0

func (m *RegistrySQL) WithTracerWrapper(wrapper TracerWrapper) Registry

func (*RegistrySQL) Writer added in v2.3.0

func (m *RegistrySQL) Writer() herodot.Writer

type TracerWrapper added in v2.2.0

type TracerWrapper func(*otelx.Tracer) *otelx.Tracer

type WritableRegistry added in v2.3.0

type WritableRegistry interface {
	WithConfig(c *config.DefaultProvider) Registry
	WithContextualizer(ctxer contextx.Contextualizer) Registry
	WithLogger(l *logrusx.Logger) Registry
	WithTracer(t trace.Tracer) Registry
	WithTracerWrapper(TracerWrapper) Registry
	WithKratos(k kratos.Client) Registry
	WithExtraFositeFactories(f []fositex.Factory) Registry
	ExtraFositeFactories() []fositex.Factory
	WithOAuth2Provider(f fosite.OAuth2Provider)
	WithConsentStrategy(c consent.Strategy)
	WithHsmContext(h hsm.Context)
}

WritableRegistry is a deprecated interface that should not be used anymore.

Deprecate this at some point.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL