oauth

package
v5.0.0-...-2679821 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: AGPL-3.0 Imports: 67 Imported by: 0

Documentation

Overview

Package oauth provides OAuth service

Index

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

func GetRedirectURIFromRequestValues(values url.Values) (string, error)

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.

func NewClientConfigDriver

func NewClientConfigDriver(ctx context.Context) client.Manager

NewClientConfigDriver creates a client.Manager directly reading from configuration

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 (*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 (m *AbstractRegistry) CookieStore(ctx context.Context) (sessions.Store, error)

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 (*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) Migrate

func (m *AbstractRegistry) Migrate(ctx context.Context) error

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

func (*ProviderContextualizer) Config

func (pc *ProviderContextualizer) Config(ctx context.Context, provider *hconfx.Provider) *hconfx.Provider

Config returns the config for the given context.

func (*ProviderContextualizer) Network

func (pc *ProviderContextualizer) Network(ctx context.Context, network uuid.UUID) uuid.UUID

Network returns the network id for the given context.

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) Init

func (c *PruneTokensAction) Init(job *jobs.Job, action *jobs.Action) error

Init pass parameters

func (*PruneTokensAction) Run

Run the actual action code

Directories

Path Synopsis
dao
sql
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

Jump to

Keyboard shortcuts

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