Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotFound = errors.New("secret not found") ErrAccessDenied = errors.New("access denied") // nuh, uh, uh! ErrIDMismatch = errors.New("id mismatch") )
var ErrInvalidPattern = errors.New("invalid pattern")
Functions ¶
This section is empty.
Types ¶
type ID ¶
type ID string
ID contains a secret identifier. Valid secret identifiers must match the format [A-Za-z0-9.-]+(/[A-Za-z0-9.-]+)+?.
For storage, we don't really differentiate much about the ID format but by convention we do simple, slash-separated management, providing a groupable access control system for management across plugins.
type Pattern ¶
type Pattern string
Pattern can be used to match secret identifiers. Valid patterns must follow the same validation rules as secret identifiers, with the exception that '*' can be used to match a single component, and '**' can be used to match zero or more components.
func ParsePattern ¶
type Restricted ¶
type Restricted struct {
// contains filtered or unexported fields
}
Restricted controls access to a set of secrets.
By default, it allows access to no secrets but can be modified safely from other threads.
func NewRestricted ¶
func NewRestricted(resolver Resolver, allowed ...ID) *Restricted
func (*Restricted) Allow ¶
func (r *Restricted) Allow(allowed ...ID)