Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator interface {
// TODO: update the return value so it can carry a message in the DENY case
// Authenticate examines the transport context and returns an identity and authentication decision.
Authenticate(context.Context, transport.Transporter) (*Identity, Decision)
}
Authenticator defines the interface for authentication providers. Implementations should examine the transport and return an identity and decision.
type Decision ¶
type Decision string
Decision represents the result of an authentication attempt.
const ( // Allow indicates that the authentication was successful and the request should be allowed. Allow Decision = "ALLOW" // Deny indicates that the authentication failed and the request should be denied. Deny Decision = "DENY" // Ignore indicates that the authenticator cannot make a decision and defers to the next authenticator. Ignore Decision = "IGNORE" )
type Identity ¶
type Identity struct {
// TODO: do we even need the tenant id?
Tenant string `yaml:"tenant"`
Principal string `yaml:"principal"`
Groups []string `yaml:"groups"`
// TODO: If we explicitly represent reporters in the database, do we need to distinguish them when they authenticate?
IsReporter bool `yaml:"is_reporter"`
Type string `yaml:"type"`
Href string `yaml:"href"`
IsGuest bool `yaml:"is_guest"`
}
Identity is the identity of the requester
Click to show internal directories.
Click to hide internal directories.