Documentation ¶
Overview ¶
Package oauth provides OAuth service
Index ¶
- Variables
- func GetRedirectURIFromRequestValues(values url.Values) (string, error)
- func NewClientConfigDriver(ctx context.Context) client.Manager
- type AbstractRegistry
- func (m *AbstractRegistry) AccessRequestHooks() []oauth2.AccessRequestHook
- func (m *AbstractRegistry) AccessTokenJWTStrategy() jwk.JWTSigner
- func (m *AbstractRegistry) AudienceStrategy() fosite.AudienceMatchingStrategy
- func (m *AbstractRegistry) AuditLogger() *logrusx.Logger
- func (*AbstractRegistry) CanHandle(dsn string) bool
- func (m *AbstractRegistry) ClientHasher() fosite.Hasher
- func (m *AbstractRegistry) ClientManager() client.Manager
- func (m *AbstractRegistry) ClientValidator() *client.Validator
- func (m *AbstractRegistry) Config() *hconfig.DefaultProvider
- func (m *AbstractRegistry) Connectors(ctx context.Context) []auth.ConnectorConfig
- func (m *AbstractRegistry) ConsentManager() consent.Manager
- func (m *AbstractRegistry) ConsentStrategy() consent.Strategy
- func (*AbstractRegistry) Contextualizer() contextx.Contextualizer
- func (m *AbstractRegistry) CookieStore(ctx context.Context) (sessions.Store, error)
- func (m *AbstractRegistry) ExtraFositeFactories() []fositex.Factory
- func (m *AbstractRegistry) FlowCipher() *aead.XChaCha20Poly1305
- func (m *AbstractRegistry) GetJWKSFetcherStrategy() fosite.JWKSFetcherStrategy
- func (m *AbstractRegistry) GetLoginRequestAsFlow(ctx context.Context, challenge string) (*flow.Flow, error)
- func (m *AbstractRegistry) GrantManager() trust.GrantManager
- func (m *AbstractRegistry) GrantValidator() *trust.GrantValidator
- func (m *AbstractRegistry) HTTPClient(ctx context.Context, opts ...httpx.ResilientOptions) *retryablehttp.Client
- func (m *AbstractRegistry) Init(ctx context.Context, skipNetworkInit bool, migrate bool, ...) error
- func (m *AbstractRegistry) KeyCipher() *aead.AESGCM
- func (m *AbstractRegistry) KeyManager() jwk.Manager
- func (m *AbstractRegistry) Logger() *logrusx.Logger
- func (m *AbstractRegistry) Migrate(ctx context.Context) error
- func (m *AbstractRegistry) OAuth2Config() *fositex.Config
- func (m *AbstractRegistry) OAuth2HMACStrategy() *foauth2.HMACSHAStrategy
- func (m *AbstractRegistry) OAuth2Provider() fosite.OAuth2Provider
- func (m *AbstractRegistry) OAuth2ProviderConfig() fosite.Configurator
- func (m *AbstractRegistry) OAuth2Storage() x.FositeStorer
- func (m *AbstractRegistry) OpenIDConnectRequestValidator() *openid.OpenIDConnectRequestValidator
- func (m *AbstractRegistry) OpenIDJWTStrategy() jwk.JWTSigner
- func (m *AbstractRegistry) Persister() persistence.Persister
- func (m *AbstractRegistry) Ping() error
- func (m *AbstractRegistry) PublicRouter() *httprouterx.RouterPublic
- func (m *AbstractRegistry) SoftwareKeyManager() jwk.Manager
- func (m *AbstractRegistry) SubjectIdentifierAlgorithm(ctx context.Context) map[string]consent.SubjectIdentifierAlgorithm
- func (m *AbstractRegistry) Tracer(ctx context.Context) *otelx.Tracer
- func (m *AbstractRegistry) Writer() herodot.Writer
- type PatDAO
- type ProviderContextualizer
- type PruneTokensAction
- func (c *PruneTokensAction) GetDescription(lang ...string) actions.ActionDescription
- func (c *PruneTokensAction) GetName() string
- func (c *PruneTokensAction) GetParametersForm() *forms.Form
- func (c *PruneTokensAction) Init(job *jobs.Job, action *jobs.Action) error
- func (c *PruneTokensAction) Run(ctx context.Context, channels *actions.RunnableChannels, ...) (*jobs.ActionMessage, error)
- type Registry
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ConfigCorePath = []string{"services", common.ServiceWebNamespace_ + common.ServiceOAuth}
)
View Source
var (
PatDrivers service.StorageDrivers
)
View Source
var (
RegistryDrivers service.StorageDrivers
)
Functions ¶
func GetRedirectURIFromRequestValues ¶
GetRedirectURIFromRequestValues extracts the redirect_uri from values but does not do any sort of validation.
Considered specifications
- https://tools.ietf.org/html/rfc6749#section-3.1 The endpoint URI MAY include an "application/x-www-form-urlencoded" formatted (per Appendix B) query component ([RFC3986] Section 3.4), which MUST be retained when adding additional query parameters.
Types ¶
type AbstractRegistry ¶
type AbstractRegistry struct { Storage persistence.Persister sql.Dependencies // contains filtered or unexported fields }
func (*AbstractRegistry) AccessRequestHooks ¶
func (m *AbstractRegistry) AccessRequestHooks() []oauth2.AccessRequestHook
func (*AbstractRegistry) AccessTokenJWTStrategy ¶
func (m *AbstractRegistry) AccessTokenJWTStrategy() jwk.JWTSigner
func (*AbstractRegistry) AudienceStrategy ¶
func (m *AbstractRegistry) AudienceStrategy() fosite.AudienceMatchingStrategy
func (*AbstractRegistry) AuditLogger ¶
func (m *AbstractRegistry) AuditLogger() *logrusx.Logger
func (*AbstractRegistry) CanHandle ¶
func (*AbstractRegistry) CanHandle(dsn string) bool
func (*AbstractRegistry) ClientHasher ¶
func (m *AbstractRegistry) ClientHasher() fosite.Hasher
func (*AbstractRegistry) ClientManager ¶
func (m *AbstractRegistry) ClientManager() client.Manager
func (*AbstractRegistry) ClientValidator ¶
func (m *AbstractRegistry) ClientValidator() *client.Validator
func (*AbstractRegistry) Config ¶
func (m *AbstractRegistry) Config() *hconfig.DefaultProvider
func (*AbstractRegistry) Connectors ¶
func (m *AbstractRegistry) Connectors(ctx context.Context) []auth.ConnectorConfig
Connectors lists all defined connectors
func (*AbstractRegistry) ConsentManager ¶
func (m *AbstractRegistry) ConsentManager() consent.Manager
func (*AbstractRegistry) ConsentStrategy ¶
func (m *AbstractRegistry) ConsentStrategy() consent.Strategy
func (*AbstractRegistry) Contextualizer ¶
func (*AbstractRegistry) Contextualizer() contextx.Contextualizer
func (*AbstractRegistry) CookieStore ¶
func (*AbstractRegistry) ExtraFositeFactories ¶
func (m *AbstractRegistry) ExtraFositeFactories() []fositex.Factory
func (*AbstractRegistry) FlowCipher ¶
func (m *AbstractRegistry) FlowCipher() *aead.XChaCha20Poly1305
func (*AbstractRegistry) GetJWKSFetcherStrategy ¶
func (m *AbstractRegistry) GetJWKSFetcherStrategy() fosite.JWKSFetcherStrategy
func (*AbstractRegistry) GetLoginRequestAsFlow ¶
func (m *AbstractRegistry) GetLoginRequestAsFlow(ctx context.Context, challenge string) (*flow.Flow, error)
GetLoginRequestAsFlow bypasses ConsentManager.GetLoginRequest to get the complete *flow.Flow instead of *flow.LoginRequest
func (*AbstractRegistry) GrantManager ¶
func (m *AbstractRegistry) GrantManager() trust.GrantManager
func (*AbstractRegistry) GrantValidator ¶
func (m *AbstractRegistry) GrantValidator() *trust.GrantValidator
func (*AbstractRegistry) HTTPClient ¶
func (m *AbstractRegistry) HTTPClient(ctx context.Context, opts ...httpx.ResilientOptions) *retryablehttp.Client
func (*AbstractRegistry) Init ¶
func (m *AbstractRegistry) Init(ctx context.Context, skipNetworkInit bool, migrate bool, ctxer contextx.Contextualizer) error
Init implements Registry interface
func (*AbstractRegistry) KeyCipher ¶
func (m *AbstractRegistry) KeyCipher() *aead.AESGCM
func (*AbstractRegistry) KeyManager ¶
func (m *AbstractRegistry) KeyManager() jwk.Manager
func (*AbstractRegistry) Logger ¶
func (m *AbstractRegistry) Logger() *logrusx.Logger
func (*AbstractRegistry) OAuth2Config ¶
func (m *AbstractRegistry) OAuth2Config() *fositex.Config
func (*AbstractRegistry) OAuth2HMACStrategy ¶
func (m *AbstractRegistry) OAuth2HMACStrategy() *foauth2.HMACSHAStrategy
func (*AbstractRegistry) OAuth2Provider ¶
func (m *AbstractRegistry) OAuth2Provider() fosite.OAuth2Provider
func (*AbstractRegistry) OAuth2ProviderConfig ¶
func (m *AbstractRegistry) OAuth2ProviderConfig() fosite.Configurator
func (*AbstractRegistry) OAuth2Storage ¶
func (m *AbstractRegistry) OAuth2Storage() x.FositeStorer
func (*AbstractRegistry) OpenIDConnectRequestValidator ¶
func (m *AbstractRegistry) OpenIDConnectRequestValidator() *openid.OpenIDConnectRequestValidator
func (*AbstractRegistry) OpenIDJWTStrategy ¶
func (m *AbstractRegistry) OpenIDJWTStrategy() jwk.JWTSigner
func (*AbstractRegistry) Persister ¶
func (m *AbstractRegistry) Persister() persistence.Persister
func (*AbstractRegistry) Ping ¶
func (m *AbstractRegistry) Ping() error
func (*AbstractRegistry) PublicRouter ¶
func (m *AbstractRegistry) PublicRouter() *httprouterx.RouterPublic
func (*AbstractRegistry) SoftwareKeyManager ¶
func (m *AbstractRegistry) SoftwareKeyManager() jwk.Manager
func (*AbstractRegistry) SubjectIdentifierAlgorithm ¶
func (m *AbstractRegistry) SubjectIdentifierAlgorithm(ctx context.Context) map[string]consent.SubjectIdentifierAlgorithm
func (*AbstractRegistry) Tracer ¶
func (m *AbstractRegistry) Tracer(ctx context.Context) *otelx.Tracer
func (*AbstractRegistry) Writer ¶
func (m *AbstractRegistry) Writer() herodot.Writer
type PatDAO ¶
type PatDAO interface { // Load finds a corresponding, non-expired PAT based on the AccessToken. Load(accessToken string) (*auth.PersonalAccessToken, error) // Store inserts a PAT in the storage. Store(accessToken string, token *auth.PersonalAccessToken, update bool) error // Delete removes a PAT by its UUID. Delete(patUuid string) error // List lists all known PAT with optional filters. List(byType auth.PatType, byUser string) ([]*auth.PersonalAccessToken, error) // PruneExpired removes expired PAT from the storage. PruneExpired() (int, error) }
PatDAO interface
type ProviderContextualizer ¶
type ProviderContextualizer struct {
// contains filtered or unexported fields
}
func GetProviderContextualizer ¶
func GetProviderContextualizer() *ProviderContextualizer
type PruneTokensAction ¶
type PruneTokensAction struct {
common.RuntimeHolder
}
func (*PruneTokensAction) GetDescription ¶
func (c *PruneTokensAction) GetDescription(lang ...string) actions.ActionDescription
func (*PruneTokensAction) GetName ¶
func (c *PruneTokensAction) GetName() string
GetName Unique identifier
func (*PruneTokensAction) GetParametersForm ¶
func (c *PruneTokensAction) GetParametersForm() *forms.Form
func (*PruneTokensAction) Run ¶
func (c *PruneTokensAction) Run(ctx context.Context, channels *actions.RunnableChannels, input *jobs.ActionMessage) (*jobs.ActionMessage, error)
Run the actual action code
type Registry ¶
type Registry interface { Init(ctx context.Context, skipNetworkInit bool, migrate bool, ctxer contextx.Contextualizer) error hconfig.Provider persistence.Provider client.Registry consent.Registry consent.InternalRegistry oauth2.Registry oauth2.InternalRegistry jwk.Registry jwk.InternalRegistry x.RegistryLogger x.RegistryCookieStore GetLoginRequestAsFlow(ctx context.Context, challenge string) (*flow.Flow, error) OAuth2HMACStrategy() *foauth2.HMACSHAStrategy PublicRouter() *httprouterx.RouterPublic Connectors(ctx context.Context) []auth.ConnectorConfig }
Directories ¶
Path | Synopsis |
---|---|
dao
|
|
service
Package service spins an OpenID Connect Server
|
Package service spins an OpenID Connect Server |
Package lang provides auth-related i18n strings
|
Package lang provides auth-related i18n strings |
service
Package service provides REST access to the TokenServiceApi
|
Package service provides REST access to the TokenServiceApi |
web
|
|
service
Package service spins an OpenID Connect Server
|
Package service spins an OpenID Connect Server |
Click to show internal directories.
Click to hide internal directories.