Documentation
¶
Overview ¶
Package security contains logic for setting SM security
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthenticationDecision ¶
type AuthenticationDecision int
AuthenticationDecision represents a Authenticator decision to allow or deny authentication or to abstain from taking a decision
const ( // Allow represents an authentication decision to allow to proceed Allow AuthenticationDecision = iota // Deny represents an authentication decision to deny proceeding Deny // Abstain represents an authentication decision to abstain from deciding - let another component to decide Abstain )
func (AuthenticationDecision) String ¶
func (a AuthenticationDecision) String() string
String implements Stringer and converts the decision to human-readable value
type Authenticator ¶
type Authenticator interface {
// Authenticate returns information about the user if security is successful, a bool specifying
// whether the authenticator ran or not and an error if one occurs
Authenticate(req *http.Request) (*web.User, AuthenticationDecision, error)
}
Authenticator extracts the authenticator information from the request and returns information about the current user or an error if security was not successful
type Encrypter ¶
type Encrypter interface {
Encrypt(ctx context.Context, plaintext []byte) ([]byte, error)
Decrypt(ctx context.Context, ciphertext []byte) ([]byte, error)
}
Encrypter provides functionality to encrypt and decrypt data
type KeyFetcher ¶
KeyFetcher provides functionality to get encryption key from a remote location
type TokenVerifier ¶
type TokenVerifier interface {
// Verify verifies that the token is valid and returns a token if so, otherwise returns an error
Verify(ctx context.Context, token string) (web.TokenData, error)
}
TokenVerifier attempts to verify a token and returns it or an error if the verification was not successful
type TwoLayerEncrypter ¶
type TwoLayerEncrypter struct {
Fetcher KeyFetcher
}
TwoLayerEncrypter is an encrypter that fetches the encryption key from a remote location
Directories
¶
| Path | Synopsis |
|---|---|
|
Package basic contains logic for setting up a basic authenticator
|
Package basic contains logic for setting up a basic authenticator |
|
Package oidc contains logic for setting up an Open ID Connect authenticator
|
Package oidc contains logic for setting up an Open ID Connect authenticator |
|
Code generated by counterfeiter.
|
Code generated by counterfeiter. |