Documentation ¶
Overview ¶
Package authentication implements authentication mechanisms.
The Transparent Key Server is designed to be used by identity providers - IdP in OAuth parlance. OAuth2 Access Tokens may be provided as authentication information, which can be resolved to user information and associated scopes on the backend.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrMissingAuth occurs when authentication information is missing. ErrMissingAuth = errors.New("auth: missing authentication header") )
Functions ¶
func GetFakeCredential ¶
func GetFakeCredential(userID string) credentials.PerRPCCredentials
GetFakeCredential returns fake PerRPCCredentials
Types ¶
type Authenticator ¶
type Authenticator interface { // ValidateCreds authenticate the information present in ctx. ValidateCreds(ctx context.Context) (*SecurityContext, error) }
Authenticator provides services to authenticate users.
type FakeAuth ¶
type FakeAuth struct{}
FakeAuth provides a fake authenticator for testing.
func (*FakeAuth) ValidateCreds ¶
func (a *FakeAuth) ValidateCreds(ctx context.Context) (*SecurityContext, error)
ValidateCreds authenticate the information present in ctx.
type SecurityContext ¶
type SecurityContext struct {
// contains filtered or unexported fields
}
SecurityContext contains information generated by the authentication module.
func NewSecurityContext ¶
func NewSecurityContext(identity string) *SecurityContext
NewSecurityContext creates a new SecurityContext given an identity.
func (*SecurityContext) Identity ¶
func (c *SecurityContext) Identity() string
Identity returns the identity of the current security context.