Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthLookupMethod ¶
type AuthLookupMethod interface {
// Directive indicates AuthLookupMethod is a directive.
directive.Directive
// AuthLookupMethodID is the auth method identifier.
// Cannot be empty.
AuthLookupMethodID() string
}
AuthLookupMethod is a directive to search for a auth method by ID. At least one of the search fields should be set.
func NewAuthLookupMethod ¶
func NewAuthLookupMethod( id string, ) AuthLookupMethod
NewAuthLookupMethod constructs a new lookupMethod directive.
type AuthLookupMethodValue ¶
type AuthLookupMethodValue = Method
AuthLookupMethodValue is the result of the AuthLookupMethod directive.
func ExAuthLookupMethod ¶
func ExAuthLookupMethod( ctx context.Context, b bus.Bus, methodID string, returnIfIdle bool, ) (AuthLookupMethodValue, error)
ExAuthLookupMethod looks up a single instance of the auth method. if !returnIfIdle: waits for the auth method to exist.
func ExAuthLookupMethods ¶
func ExAuthLookupMethods( ctx context.Context, b bus.Bus, methodID string, waitOne bool, valDisposeCb func(), ) ([]AuthLookupMethodValue, directive.Instance, directive.Reference, error)
ExAuthLookupMethods executes the LookupMethod directive. Returns all available implementations of method id. If method id is empty, returns all. If waitOne is set, waits for at least one value before returning.
type Constructor ¶
Constructor constructs a method with common parameters.
type Handler ¶
type Handler any
Handler is the method handler. Manages "ambient-ly discovered" authentication keys.
type Method ¶
type Method interface {
// GetMethodID returns the auth method id.
// This is a unique identifier for this code / method.
GetMethodID() string
// Execute executes the auth method, yielding private keys to the handler.
// If returns nil, will not be retried.
Execute(ctx context.Context) error
// UnmarshalParameters unmarshals+validates parameters from binary.
UnmarshalParameters(data []byte) (Parameters, error)
// Authenticate authenticates with existing auth parameters.
// Parameters are generated with either UnmarshalParameters or Register.
// Generates the private key.
Authenticate(params Parameters, authSecretData []byte) (crypto.PrivKey, error)
// Close closes all resources related to the auth method.
Close()
}
Method is an authentication method.
The method likely produces Parameters to register.
type Parameters ¶
type Parameters interface {
// MarshalBlock marshals the block to binary.
MarshalBlock() ([]byte, error)
// Validate validates the parameters (cursory).
Validate() error
}
Parameters are authentication method params.
Parameters are stored in a user record.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package auth_method_password implements password-based entity key derivation using scrypt with a blake3-derived deterministic salt from the username.
|
Package auth_method_password implements password-based entity key derivation using scrypt with a blake3-derived deterministic salt from the username. |
|
Package auth_method_pem implements a PEM backup key auth method.
|
Package auth_method_pem implements a PEM backup key auth method. |