Documentation ¶
Index ¶
- type CookieIdentityManager
- func (im *CookieIdentityManager) AddRoutes(ctx context.Context, router *mux.Router)
- func (im *CookieIdentityManager) ApproveScopes(ctx context.Context, sub string, audience string, ...) (string, error)
- func (im *CookieIdentityManager) ApprovedScopes(ctx context.Context, sub string, audience string, ref string) (map[string]bool, error)
- func (im *CookieIdentityManager) Authenticate(ctx context.Context, rw http.ResponseWriter, req *http.Request, ...) (identity.AuthRecord, error)
- func (im *CookieIdentityManager) Authorize(ctx context.Context, rw http.ResponseWriter, req *http.Request, ...) (identity.AuthRecord, error)
- func (im *CookieIdentityManager) ClaimsSupported(claims []string) []string
- func (im *CookieIdentityManager) EndSession(ctx context.Context, rw http.ResponseWriter, req *http.Request, ...) error
- func (im *CookieIdentityManager) Fetch(ctx context.Context, userID string, sessionRef *string, scopes map[string]bool, ...) (identity.AuthRecord, bool, error)
- func (im *CookieIdentityManager) Name() string
- func (im *CookieIdentityManager) OnSetLogon(func(ctx context.Context, rw http.ResponseWriter, user identity.User) error) error
- func (im *CookieIdentityManager) OnUnsetLogon(func(ctx context.Context, rw http.ResponseWriter) error) error
- func (im *CookieIdentityManager) RegisterManagers(mgrs *managers.Managers) error
- func (im *CookieIdentityManager) ScopesSupported(scopes map[string]bool) []string
- type DummyIdentityManager
- func (im *DummyIdentityManager) AddRoutes(ctx context.Context, router *mux.Router)
- func (im *DummyIdentityManager) ApproveScopes(ctx context.Context, sub string, audience string, ...) (string, error)
- func (im *DummyIdentityManager) ApprovedScopes(ctx context.Context, sub string, audience string, ref string) (map[string]bool, error)
- func (im *DummyIdentityManager) Authenticate(ctx context.Context, rw http.ResponseWriter, req *http.Request, ...) (identity.AuthRecord, error)
- func (im *DummyIdentityManager) Authorize(ctx context.Context, rw http.ResponseWriter, req *http.Request, ...) (identity.AuthRecord, error)
- func (im *DummyIdentityManager) ClaimsSupported(claims []string) []string
- func (im *DummyIdentityManager) EndSession(ctx context.Context, rw http.ResponseWriter, req *http.Request, ...) error
- func (im *DummyIdentityManager) Fetch(ctx context.Context, userID string, sessionRef *string, scopes map[string]bool, ...) (identity.AuthRecord, bool, error)
- func (im *DummyIdentityManager) Name() string
- func (im *DummyIdentityManager) OnSetLogon(func(ctx context.Context, rw http.ResponseWriter, user identity.User) error) error
- func (im *DummyIdentityManager) OnUnsetLogon(func(ctx context.Context, rw http.ResponseWriter) error) error
- func (im *DummyIdentityManager) ScopesSupported(scopes map[string]bool) []string
- type EncryptionManager
- func (em *EncryptionManager) Decrypt(ciphertext []byte) ([]byte, error)
- func (em *EncryptionManager) DecryptHexToString(ciphertextHex string) (string, error)
- func (em *EncryptionManager) Encrypt(plaintext []byte) ([]byte, error)
- func (em *EncryptionManager) EncryptStringToHexString(plaintext string) (string, error)
- func (em *EncryptionManager) GetKeySize() int
- func (em *EncryptionManager) SetKey(key []byte) error
- type GuestIdentityManager
- func (im *GuestIdentityManager) AddRoutes(ctx context.Context, router *mux.Router)
- func (im *GuestIdentityManager) ApproveScopes(ctx context.Context, sub string, audience string, ...) (string, error)
- func (im *GuestIdentityManager) ApprovedScopes(ctx context.Context, sub string, audience string, ref string) (map[string]bool, error)
- func (im *GuestIdentityManager) Authenticate(ctx context.Context, rw http.ResponseWriter, req *http.Request, ...) (identity.AuthRecord, error)
- func (im *GuestIdentityManager) Authorize(ctx context.Context, rw http.ResponseWriter, req *http.Request, ...) (identity.AuthRecord, error)
- func (im *GuestIdentityManager) ClaimsSupported(claims []string) []string
- func (im *GuestIdentityManager) EndSession(ctx context.Context, rw http.ResponseWriter, req *http.Request, ...) error
- func (im *GuestIdentityManager) Fetch(ctx context.Context, userID string, sessionRef *string, scopes map[string]bool, ...) (identity.AuthRecord, bool, error)
- func (im *GuestIdentityManager) Name() string
- func (im *GuestIdentityManager) OnSetLogon(cb func(ctx context.Context, rw http.ResponseWriter, user identity.User) error) error
- func (im *GuestIdentityManager) OnUnsetLogon(cb func(ctx context.Context, rw http.ResponseWriter) error) error
- func (im *GuestIdentityManager) RegisterManagers(mgrs *managers.Managers) error
- func (im *GuestIdentityManager) ScopesSupported(scopes map[string]bool) []string
- type IdentifierIdentityManager
- func (im *IdentifierIdentityManager) AddRoutes(ctx context.Context, router *mux.Router)
- func (im *IdentifierIdentityManager) ApproveScopes(ctx context.Context, sub string, audience string, ...) (string, error)
- func (im *IdentifierIdentityManager) ApprovedScopes(ctx context.Context, sub string, audience string, ref string) (map[string]bool, error)
- func (im *IdentifierIdentityManager) Authenticate(ctx context.Context, rw http.ResponseWriter, req *http.Request, ...) (identity.AuthRecord, error)
- func (im *IdentifierIdentityManager) Authorize(ctx context.Context, rw http.ResponseWriter, req *http.Request, ...) (identity.AuthRecord, error)
- func (im *IdentifierIdentityManager) ClaimsSupported(claims []string) []string
- func (im *IdentifierIdentityManager) EndSession(ctx context.Context, rw http.ResponseWriter, req *http.Request, ...) error
- func (im *IdentifierIdentityManager) Fetch(ctx context.Context, userID string, sessionRef *string, scopes map[string]bool, ...) (identity.AuthRecord, bool, error)
- func (im *IdentifierIdentityManager) Name() string
- func (im *IdentifierIdentityManager) OnSetLogon(cb func(ctx context.Context, rw http.ResponseWriter, user identity.User) error) error
- func (im *IdentifierIdentityManager) OnUnsetLogon(cb func(ctx context.Context, rw http.ResponseWriter) error) error
- func (im *IdentifierIdentityManager) RegisterManagers(mgrs *managers.Managers) error
- func (im *IdentifierIdentityManager) ScopesSupported(scopes map[string]bool) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CookieIdentityManager ¶
type CookieIdentityManager struct {
// contains filtered or unexported fields
}
CookieIdentityManager implements an identity manager which passes through received HTTP cookies to a HTTP backend..
func NewCookieIdentityManager ¶
func NewCookieIdentityManager(c *identity.Config, backendURI *url.URL, cookieNames []string, timeout time.Duration, transport http.RoundTripper) *CookieIdentityManager
NewCookieIdentityManager creates a new CookieIdentityManager from the provided parameters.
func (*CookieIdentityManager) AddRoutes ¶
func (im *CookieIdentityManager) AddRoutes(ctx context.Context, router *mux.Router)
AddRoutes implements the identity.Manager interface.
func (*CookieIdentityManager) ApproveScopes ¶
func (im *CookieIdentityManager) ApproveScopes(ctx context.Context, sub string, audience string, approvedScopes map[string]bool) (string, error)
ApproveScopes implements the Backend interface.
func (*CookieIdentityManager) ApprovedScopes ¶
func (im *CookieIdentityManager) ApprovedScopes(ctx context.Context, sub string, audience string, ref string) (map[string]bool, error)
ApprovedScopes implements the Backend interface.
func (*CookieIdentityManager) Authenticate ¶
func (im *CookieIdentityManager) Authenticate(ctx context.Context, rw http.ResponseWriter, req *http.Request, ar *payload.AuthenticationRequest, next identity.Manager) (identity.AuthRecord, error)
Authenticate implements the identity.Manager interface.
func (*CookieIdentityManager) Authorize ¶
func (im *CookieIdentityManager) Authorize(ctx context.Context, rw http.ResponseWriter, req *http.Request, ar *payload.AuthenticationRequest, auth identity.AuthRecord) (identity.AuthRecord, error)
Authorize implements the identity.Manager interface.
func (*CookieIdentityManager) ClaimsSupported ¶
func (im *CookieIdentityManager) ClaimsSupported(claims []string) []string
ClaimsSupported implements the identity.Manager interface.
func (*CookieIdentityManager) EndSession ¶
func (im *CookieIdentityManager) EndSession(ctx context.Context, rw http.ResponseWriter, req *http.Request, ar *payload.EndSessionRequest) error
EndSession implements the identity.Manager interface.
func (*CookieIdentityManager) Fetch ¶
func (im *CookieIdentityManager) Fetch(ctx context.Context, userID string, sessionRef *string, scopes map[string]bool, requestedClaimsMaps []*payload.ClaimsRequestMap, requestedScopes map[string]bool) (identity.AuthRecord, bool, error)
Fetch implements the identity.Manager interface.
func (*CookieIdentityManager) Name ¶
func (im *CookieIdentityManager) Name() string
Name implements the identity.Manager interface.
func (*CookieIdentityManager) OnSetLogon ¶
func (im *CookieIdentityManager) OnSetLogon(func(ctx context.Context, rw http.ResponseWriter, user identity.User) error) error
OnSetLogon implements the identity.Manager interface.
func (*CookieIdentityManager) OnUnsetLogon ¶
func (im *CookieIdentityManager) OnUnsetLogon(func(ctx context.Context, rw http.ResponseWriter) error) error
OnUnsetLogon implements the identity.Manager interface.
func (*CookieIdentityManager) RegisterManagers ¶
func (im *CookieIdentityManager) RegisterManagers(mgrs *managers.Managers) error
RegisterManagers registers the provided managers,
func (*CookieIdentityManager) ScopesSupported ¶
func (im *CookieIdentityManager) ScopesSupported(scopes map[string]bool) []string
ScopesSupported implements the identity.Manager interface.
type DummyIdentityManager ¶
type DummyIdentityManager struct {
// contains filtered or unexported fields
}
DummyIdentityManager implements an identity manager which always grants access to a fixed user id.
func NewDummyIdentityManager ¶
func NewDummyIdentityManager(c *identity.Config, sub string) *DummyIdentityManager
NewDummyIdentityManager creates a new DummyIdentityManager from the provided parameters.
func (*DummyIdentityManager) AddRoutes ¶
func (im *DummyIdentityManager) AddRoutes(ctx context.Context, router *mux.Router)
AddRoutes implements the identity.Manager interface.
func (*DummyIdentityManager) ApproveScopes ¶
func (im *DummyIdentityManager) ApproveScopes(ctx context.Context, sub string, audience string, approvedScopes map[string]bool) (string, error)
ApproveScopes implements the Backend interface.
func (*DummyIdentityManager) ApprovedScopes ¶
func (im *DummyIdentityManager) ApprovedScopes(ctx context.Context, sub string, audience string, ref string) (map[string]bool, error)
ApprovedScopes implements the Backend interface.
func (*DummyIdentityManager) Authenticate ¶
func (im *DummyIdentityManager) Authenticate(ctx context.Context, rw http.ResponseWriter, req *http.Request, ar *payload.AuthenticationRequest, next identity.Manager) (identity.AuthRecord, error)
Authenticate implements the identity.Manager interface.
func (*DummyIdentityManager) Authorize ¶
func (im *DummyIdentityManager) Authorize(ctx context.Context, rw http.ResponseWriter, req *http.Request, ar *payload.AuthenticationRequest, auth identity.AuthRecord) (identity.AuthRecord, error)
Authorize implements the identity.Manager interface.
func (*DummyIdentityManager) ClaimsSupported ¶
func (im *DummyIdentityManager) ClaimsSupported(claims []string) []string
ClaimsSupported implements the identity.Manager interface.
func (*DummyIdentityManager) EndSession ¶
func (im *DummyIdentityManager) EndSession(ctx context.Context, rw http.ResponseWriter, req *http.Request, esr *payload.EndSessionRequest) error
EndSession implements the identity.Manager interface.
func (*DummyIdentityManager) Fetch ¶
func (im *DummyIdentityManager) Fetch(ctx context.Context, userID string, sessionRef *string, scopes map[string]bool, requestedClaimsMaps []*payload.ClaimsRequestMap, requestedScopes map[string]bool) (identity.AuthRecord, bool, error)
Fetch implements the identity.Manager interface.
func (*DummyIdentityManager) Name ¶
func (im *DummyIdentityManager) Name() string
Name implements the identity.Manager interface.
func (*DummyIdentityManager) OnSetLogon ¶
func (im *DummyIdentityManager) OnSetLogon(func(ctx context.Context, rw http.ResponseWriter, user identity.User) error) error
OnSetLogon implements the identity.Manager interface.
func (*DummyIdentityManager) OnUnsetLogon ¶
func (im *DummyIdentityManager) OnUnsetLogon(func(ctx context.Context, rw http.ResponseWriter) error) error
OnUnsetLogon implements the identity.Manager interface.
func (*DummyIdentityManager) ScopesSupported ¶
func (im *DummyIdentityManager) ScopesSupported(scopes map[string]bool) []string
ScopesSupported implements the identity.Manager interface.
type EncryptionManager ¶
type EncryptionManager struct {
// contains filtered or unexported fields
}
EncryptionManager implements string encryption functions with a key.
func NewEncryptionManager ¶
func NewEncryptionManager(key *[encryption.KeySize]byte) (*EncryptionManager, error)
NewEncryptionManager creates a new EncryptionManager with the provided key.
func (*EncryptionManager) Decrypt ¶
func (em *EncryptionManager) Decrypt(ciphertext []byte) ([]byte, error)
Decrypt decrypts ciphertext []byte with the accociated key and returns plaintext []byte.
func (*EncryptionManager) DecryptHexToString ¶
func (em *EncryptionManager) DecryptHexToString(ciphertextHex string) (string, error)
DecryptHexToString decrypts a hex encoded string with the accociated key and returns the plain text as string.
func (*EncryptionManager) Encrypt ¶
func (em *EncryptionManager) Encrypt(plaintext []byte) ([]byte, error)
Encrypt encrypts plaintext []byte with the accociated key and returns ciphertext []byte.
func (*EncryptionManager) EncryptStringToHexString ¶
func (em *EncryptionManager) EncryptStringToHexString(plaintext string) (string, error)
EncryptStringToHexString encrypts a plaintext string with the accociated key and returns the hex encoded ciphertext as string.
func (*EncryptionManager) GetKeySize ¶
func (em *EncryptionManager) GetKeySize() int
GetKeySize returns the size of the accociated manager's key.
func (*EncryptionManager) SetKey ¶
func (em *EncryptionManager) SetKey(key []byte) error
SetKey sets the provided key for the accociated manager.
type GuestIdentityManager ¶
type GuestIdentityManager struct {
// contains filtered or unexported fields
}
GuestIdentityManager implements an identity manager for guest users.
func NewGuestIdentityManager ¶
func NewGuestIdentityManager(c *identity.Config) *GuestIdentityManager
NewGuestIdentityManager creates a new GuestIdentityManager from the provided parameters.
func (*GuestIdentityManager) AddRoutes ¶
func (im *GuestIdentityManager) AddRoutes(ctx context.Context, router *mux.Router)
AddRoutes implements the identity.Manager interface.
func (*GuestIdentityManager) ApproveScopes ¶
func (im *GuestIdentityManager) ApproveScopes(ctx context.Context, sub string, audience string, approvedScopes map[string]bool) (string, error)
ApproveScopes implements the Backend interface.
func (*GuestIdentityManager) ApprovedScopes ¶
func (im *GuestIdentityManager) ApprovedScopes(ctx context.Context, sub string, audience string, ref string) (map[string]bool, error)
ApprovedScopes implements the Backend interface.
func (*GuestIdentityManager) Authenticate ¶
func (im *GuestIdentityManager) Authenticate(ctx context.Context, rw http.ResponseWriter, req *http.Request, ar *payload.AuthenticationRequest, next identity.Manager) (identity.AuthRecord, error)
Authenticate implements the identity.Manager interface.
func (*GuestIdentityManager) Authorize ¶
func (im *GuestIdentityManager) Authorize(ctx context.Context, rw http.ResponseWriter, req *http.Request, ar *payload.AuthenticationRequest, auth identity.AuthRecord) (identity.AuthRecord, error)
Authorize implements the identity.Manager interface.
func (*GuestIdentityManager) ClaimsSupported ¶
func (im *GuestIdentityManager) ClaimsSupported(claims []string) []string
ClaimsSupported implements the identity.Manager interface.
func (*GuestIdentityManager) EndSession ¶
func (im *GuestIdentityManager) EndSession(ctx context.Context, rw http.ResponseWriter, req *http.Request, esr *payload.EndSessionRequest) error
EndSession implements the identity.Manager interface.
func (*GuestIdentityManager) Fetch ¶
func (im *GuestIdentityManager) Fetch(ctx context.Context, userID string, sessionRef *string, scopes map[string]bool, requestedClaimsMaps []*payload.ClaimsRequestMap, requestedScopes map[string]bool) (identity.AuthRecord, bool, error)
Fetch implements the identity.Manager interface.
func (*GuestIdentityManager) Name ¶
func (im *GuestIdentityManager) Name() string
Name implements the identity.Manager interface.
func (*GuestIdentityManager) OnSetLogon ¶
func (im *GuestIdentityManager) OnSetLogon(cb func(ctx context.Context, rw http.ResponseWriter, user identity.User) error) error
OnSetLogon implements the identity.Manager interface.
func (*GuestIdentityManager) OnUnsetLogon ¶
func (im *GuestIdentityManager) OnUnsetLogon(cb func(ctx context.Context, rw http.ResponseWriter) error) error
OnUnsetLogon implements the identity.Manager interface.
func (*GuestIdentityManager) RegisterManagers ¶
func (im *GuestIdentityManager) RegisterManagers(mgrs *managers.Managers) error
RegisterManagers registers the provided managers,
func (*GuestIdentityManager) ScopesSupported ¶
func (im *GuestIdentityManager) ScopesSupported(scopes map[string]bool) []string
ScopesSupported implements the identity.Manager interface.
type IdentifierIdentityManager ¶
type IdentifierIdentityManager struct {
// contains filtered or unexported fields
}
IdentifierIdentityManager implements an identity manager which relies on Konnect its identifier to provide identity.
func NewIdentifierIdentityManager ¶
func NewIdentifierIdentityManager(c *identity.Config, i *identifier.Identifier) *IdentifierIdentityManager
NewIdentifierIdentityManager creates a new IdentifierIdentityManager from the provided parameters.
func (*IdentifierIdentityManager) AddRoutes ¶
func (im *IdentifierIdentityManager) AddRoutes(ctx context.Context, router *mux.Router)
AddRoutes implements the identity.Manager interface.
func (*IdentifierIdentityManager) ApproveScopes ¶
func (im *IdentifierIdentityManager) ApproveScopes(ctx context.Context, sub string, audience string, approvedScopes map[string]bool) (string, error)
ApproveScopes implements the Backend interface.
func (*IdentifierIdentityManager) ApprovedScopes ¶
func (im *IdentifierIdentityManager) ApprovedScopes(ctx context.Context, sub string, audience string, ref string) (map[string]bool, error)
ApprovedScopes implements the Backend interface.
func (*IdentifierIdentityManager) Authenticate ¶
func (im *IdentifierIdentityManager) Authenticate(ctx context.Context, rw http.ResponseWriter, req *http.Request, ar *payload.AuthenticationRequest, next identity.Manager) (identity.AuthRecord, error)
Authenticate implements the identity.Manager interface.
func (*IdentifierIdentityManager) Authorize ¶
func (im *IdentifierIdentityManager) Authorize(ctx context.Context, rw http.ResponseWriter, req *http.Request, ar *payload.AuthenticationRequest, auth identity.AuthRecord) (identity.AuthRecord, error)
Authorize implements the identity.Manager interface.
func (*IdentifierIdentityManager) ClaimsSupported ¶
func (im *IdentifierIdentityManager) ClaimsSupported(claims []string) []string
ClaimsSupported implements the identity.Manager interface.
func (*IdentifierIdentityManager) EndSession ¶
func (im *IdentifierIdentityManager) EndSession(ctx context.Context, rw http.ResponseWriter, req *http.Request, esr *payload.EndSessionRequest) error
EndSession implements the identity.Manager interface.
func (*IdentifierIdentityManager) Fetch ¶
func (im *IdentifierIdentityManager) Fetch(ctx context.Context, userID string, sessionRef *string, scopes map[string]bool, requestedClaimsMaps []*payload.ClaimsRequestMap, requestedScopes map[string]bool) (identity.AuthRecord, bool, error)
Fetch implements the identity.Manager interface.
func (*IdentifierIdentityManager) Name ¶
func (im *IdentifierIdentityManager) Name() string
Name implements the identity.Manager interface.
func (*IdentifierIdentityManager) OnSetLogon ¶
func (im *IdentifierIdentityManager) OnSetLogon(cb func(ctx context.Context, rw http.ResponseWriter, user identity.User) error) error
OnSetLogon implements the identity.Manager interface.
func (*IdentifierIdentityManager) OnUnsetLogon ¶
func (im *IdentifierIdentityManager) OnUnsetLogon(cb func(ctx context.Context, rw http.ResponseWriter) error) error
OnUnsetLogon implements the identity.Manager interface.
func (*IdentifierIdentityManager) RegisterManagers ¶
func (im *IdentifierIdentityManager) RegisterManagers(mgrs *managers.Managers) error
RegisterManagers registers the provided managers,
func (*IdentifierIdentityManager) ScopesSupported ¶
func (im *IdentifierIdentityManager) ScopesSupported(scopes map[string]bool) []string
ScopesSupported implements the identity.Manager interface.