Documentation
¶
Overview ¶
Package `auth` contains basic types for authentication and authorization.
Rules for scope-based path authorization:
- Normalized resource paths have no trailing slash, e.g. a root is named `/foo` not `/foo/`; like a directory realpath or an AWS S3 bucket; but unlike Vault's listing policy.
- The only normalized path that ends with slash is the root path `/`.
- Paths can be normalized in Go by `path.Clean()` aka `slashpath.Clean()`, not `filepath.Clean()`.
- Callers should call authorize with normalized resource paths.
- Authorizers should normalize paths before checking access.
- A token that wants to grant access to a path `/foo` and all paths below must include two path patterns: `/foo` and `/foo/*`; i.e. `/foo/*` does not match `/foo`.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionDetails ¶
type ActionDetails map[string]interface{}
type AnyAuthorizer ¶
type AnyAuthorizer interface {
AuthorizeAny(Identity, ...ScopedAction) error
}
type Authenticator ¶
type Authorizer ¶
type Authorizer interface {
Authorize(Identity, Action, ActionDetails) error
}
type ScopedAction ¶
type ScopedAction struct { Action Details ActionDetails }
func (ScopedAction) String ¶
func (sa ScopedAction) String() string
type SimpleScope ¶
type UnixIdentities ¶
type UnixIdentities []UnixIdentity
func (UnixIdentities) FindDomain ¶
func (ids UnixIdentities) FindDomain(dom string) (UnixIdentity, bool)
type UnixIdentity ¶
Click to show internal directories.
Click to hide internal directories.