Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAuthFailed = errors.New("no realm could authenticate these credentials") ErrNilRealm = errors.New("registering a nil realm is not allowed") )
Functions ¶
func Init ¶
func Init(authConfig *config.AuthConfiguration, apiKeyRepo datastore.APIKeyRepository, userRepo datastore.UserRepository, cache cache.Cache) error
Types ¶
type RealmChain ¶
type RealmChain struct {
// contains filtered or unexported fields
}
RealmChain represents a group of realms to be called for authentication. When RealmChain.Authenticate is called, the Authenticate method of all registered realms is called. If at least one realm can authenticate the given auth.Credential, RealmChain.Authenticate will not return an error
func Get ¶
func Get() (*RealmChain, error)
func (*RealmChain) Authenticate ¶
func (rc *RealmChain) Authenticate(ctx context.Context, cred *auth.Credential) (*auth.AuthenticatedUser, error)
Authenticate calls the Authenticate method of all registered realms. If at least one realm can authenticate the given auth.Credential, Authenticate will not return an error
func (*RealmChain) RegisterRealm ¶
func (rc *RealmChain) RegisterRealm(r auth.Realm) error
Click to show internal directories.
Click to hide internal directories.