auth

package
v0.0.0-...-b0d25e1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CredentialUserPassword = "user_password"
	CredentialPin          = "pin"
	CredentialFederated    = "federated"

	MetaAuditID           = "audit_id"
	MetaFederationAuthURL = "federation_auth_url"
)
View Source
const (
	StatusPending int = iota
	StatusCompleted
)

Variables

This section is empty.

Functions

func MakeCertificates

func MakeCertificates(key ssh.PublicKey, actx *AuthContext, validBefore time.Time, maxPrincipalsPerCert int) []*ssh.Certificate

Types

type AuthContext

type AuthContext struct {
	Parent           *AuthContext
	Status           int
	SubjectName      string
	Principals       []string
	RemovePrincipals []string
	CriticalOptions  map[string]string
	Extensions       map[string]string
	Authenticator    string
	Authorizer       string
	AuthMeta         map[string]interface{}
}

func (*AuthContext) GetAuthMeta

func (ac *AuthContext) GetAuthMeta() map[string]interface{}

func (*AuthContext) GetAuthenticators

func (ac *AuthContext) GetAuthenticators() []string

func (*AuthContext) GetAuthorizers

func (ac *AuthContext) GetAuthorizers() []string

func (*AuthContext) GetCriticalOptions

func (ac *AuthContext) GetCriticalOptions() map[string]string

func (*AuthContext) GetExtensions

func (ac *AuthContext) GetExtensions() map[string]string

func (*AuthContext) GetMetaString

func (ac *AuthContext) GetMetaString(k string) string

func (*AuthContext) GetParent

func (ac *AuthContext) GetParent() *AuthContext

func (*AuthContext) GetPrincipals

func (ac *AuthContext) GetPrincipals() []string

func (*AuthContext) GetSubjectName

func (ac *AuthContext) GetSubjectName() string

func (*AuthContext) IsValid

func (ac *AuthContext) IsValid() bool

Verify the whole auth context chain

func (*AuthContext) Len

func (ac *AuthContext) Len() int

The length of the auth context chain

type Authenticator

type Authenticator interface {
	Authenticate(parentctx *AuthContext, creds *Credentials) (newctx *AuthContext, success bool)
	Type() string
	Name() string
	Realm() string
	CredentialType() string
}

type Authorizer

type Authorizer interface {
	Authorize(parentctx *AuthContext) (newctx *AuthContext, success bool)
	Name() string
	Description() string
}

type Credentials

type Credentials struct {
	UserIdentifier string `json:"userIdentifier"`
	Secret         []byte
	Meta           map[string]interface{}
}

type FederatedAuthenticator

type FederatedAuthenticator interface {
	Authenticator
	FederationCallback(data interface{}) error
}

For OAuth2 type authenticators

Directories

Path Synopsis
authz
all

Jump to

Keyboard shortcuts

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