v.io: v.io/x/ref/lib/security/securityflag Index | Files

package securityflag

import "v.io/x/ref/lib/security/securityflag"

Package securityflag implements utilities for creating security objects based on flags.


Package Files


func NewAuthorizer Uses

func NewAuthorizer(ctx *context.T, name string) (security.Authorizer, error)

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 Uses

func NewAuthorizerOrDie(ctx *context.T) security.Authorizer

NewAuthorizerOrDie returns an authorizer configured in the same way as that for 'runtime', preferring a literal (ie. on the command line) vs a file based specification, and assuming the typical set of access tags. It will panic if it fails to create an authorizer.

func PermissionsFromSpec Uses

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.

Package securityflag imports 7 packages (graph) and is imported by 20 packages. Updated 2020-06-09. Refresh now. Tools for package owners.