Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent interface { Authenticate(context.Context) (context.Context, error) Authorize(context.Context, Role) error User(context.Context) User Wrap(http.Handler) http.Handler }
Agent is the interface through which most of the auth package is utilized
type Config ¶
type Config struct { OIDC string Endpoints *oidcConfig Scope string AdminRole string EditorRole string ReaderRole string }
Config is the configuration needed to run an auth service
type NotAuthorizedError ¶
type NotAuthorizedError struct{}
NotAuthorizedError represents an erorr in the authorization process
func (NotAuthorizedError) Error ¶
func (e NotAuthorizedError) Error() string
type OIDCAgent ¶
type OIDCAgent struct {
// contains filtered or unexported fields
}
OIDCAgent is an auth agent implementation using oidc
func NewOIDCAgent ¶
NewOIDCAgent builds a new agent from the configuration
func (*OIDCAgent) Authenticate ¶
Authenticate handles validation of auth tokens stored in the context
type User ¶
type User struct { Name string `json:"name"` Email string `json:"email"` Subject string `json:"sub"` NotBefore int64 `json:"nbf"` NotOnOrAfter int64 `json:"exp"` IssuedAt int64 `json:"iat"` Scope string `json:"scp"` Roles []string `json:"roles"` // contains filtered or unexported fields }
User represents our representation of an oidc user
Click to show internal directories.
Click to hide internal directories.