Documentation
¶
Overview ¶
Package securityflag implements utilities for creating security objects based on flags.
Index ¶
- func NewAuthorizer(ctx *context.T, name string) (security.Authorizer, error)
- func NewAuthorizerOrDie(ctx *context.T) security.Authorizer
- func PermissionsFromFlag(ctx *context.T) (access.Permissions, error)
- func PermissionsFromSpec(spec access.PermissionsSpec, name string) (access.Permissions, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAuthorizer ¶
NewAuthorizer constructs an Authorizer based on the PermissionsSpec stored in the context for the specified 'name' (which defaults to "runtime" for an empty string value). It will preferentially use literal permissions over file stored ones.
func NewAuthorizerOrDie ¶
func NewAuthorizerOrDie(ctx *context.T) security.Authorizer
NewAuthorizerOrDie is provided for backward compatibility except that it must be called with a context.T. Use access.NewAuthorizer or access.RuntimeAuthorizer in future.
func PermissionsFromFlag ¶
func PermissionsFromFlag(ctx *context.T) (access.Permissions, error)
PermissionsFromFlag is provided for backward compatibility except that it must be called with a context.T. Use PermissionsFromSpec in future.
func PermissionsFromSpec ¶
func PermissionsFromSpec(spec access.PermissionsSpec, name string) (access.Permissions, error)
PermissionsFromSpec returns the permissions specified by the supplied PermissionsSpec for 'runtime' (ie. as derived) from command line flags specified by flags.PermissionsFlags originally. It is intended for callers that need more control of how Permissions are managed. TODO(rjkroege): Refactor these two functions into one by making an Authorizer use a Permissions accessor interface.
Types ¶
This section is empty.