Documentation ¶
Index ¶
- Variables
- func AppAndUserPatternFromBlessings(blessings ...string) (app, user security.BlessingPattern, err error)
- func Decode(s string) (string, error)
- func DecodeId(s string) (wire.Id, error)
- func Encode(s string) string
- func EncodeId(id wire.Id) string
- func FilterTags(perms access.Permissions, allowTags ...access.Tag) (filtered access.Permissions)
- func IsPrefix(start, limit string) bool
- func ListChildIds(ctx *context.T, parentFullName string) ([]wire.Id, error)
- func NewErrFoundMultipleAppUserBlessings(ctx *context.T, au1 string, au2 string) error
- func NewErrFoundMultipleUserBlessings(ctx *context.T, u1 string, u2 string) error
- func NewErrFoundNoConventionalBlessings(ctx *context.T) error
- func ParseCollectionRowPair(ctx *context.T, pattern string) (wire.Id, string, error)
- func PrefixRangeLimit(p string) string
- func PrefixRangeStart(p string) string
- func RowPrefixPattern(cxId wire.Id, keyPrefix string) wire.CollectionRowPattern
- func ValidateId(id wire.Id) error
- func ValidateRowKey(s string) error
- type AccessController
Constants ¶
This section is empty.
Variables ¶
var ( ErrFoundMultipleAppUserBlessings = verror.Register("v.io/v23/syncbase/util.FoundMultipleAppUserBlessings", verror.NoRetry, "{1:}{2:} found multiple app:user blessings for different apps or users: {3} and {4}") ErrFoundMultipleUserBlessings = verror.Register("v.io/v23/syncbase/util.FoundMultipleUserBlessings", verror.NoRetry, "{1:}{2:} found multiple user blessings for different users: {3} and {4}") ErrFoundNoConventionalBlessings = verror.Register("v.io/v23/syncbase/util.FoundNoConventionalBlessings", verror.NoRetry, "{1:}{2:} found no blessings matching app:user or user conventions") )
Functions ¶
func AppAndUserPatternFromBlessings ¶
func AppAndUserPatternFromBlessings(blessings ...string) (app, user security.BlessingPattern, err error)
AppAndUserPatternFromBlessings infers the app and user blessing pattern from the given set of blessing names. <idp>:o:<app>:<user> blessings are preferred, with a fallback to <idp>:u:<user> and unrestricted app. Returns an error and no-match patterns if the inferred pattern is ambiguous (multiple blessings for different apps or users are found), or if no blessings matching conventions are found. TODO(ivanpi): Allow caller to restrict format to app:user or user instead of automatic fallback?
func Encode ¶
Encode escapes a component name for use in a Syncbase object name. In particular, it replaces bytes "%" and "/" with the "%" character followed by the byte's two-digit hex code. Clients using the client library need not escape names themselves; the client library does so on their behalf.
func FilterTags ¶
func FilterTags(perms access.Permissions, allowTags ...access.Tag) (filtered access.Permissions)
FilterTags returns a copy of the provided perms, filtered to include only entries for tags allowed by the allowTags whitelist.
func IsPrefix ¶
IsPrefix returns true if start and limit together represent a prefix range. If true, start is the represented prefix.
func ListChildIds ¶
ListChildIds returns a list of ids of all children of parentFullName. Glob is assumed to return the child ids sorted by blessing, then by name.
func NewErrFoundMultipleAppUserBlessings ¶
NewErrFoundMultipleAppUserBlessings returns an error with the ErrFoundMultipleAppUserBlessings ID.
func NewErrFoundMultipleUserBlessings ¶
NewErrFoundMultipleUserBlessings returns an error with the ErrFoundMultipleUserBlessings ID.
func NewErrFoundNoConventionalBlessings ¶
NewErrFoundNoConventionalBlessings returns an error with the ErrFoundNoConventionalBlessings ID.
func ParseCollectionRowPair ¶
ParseCollectionRowPair splits the "<encCxId>/<rowKey>" part of a Syncbase object name into the collection id and the row key or prefix.
func PrefixRangeLimit ¶
PrefixRangeLimit returns the limit of the row range for the given prefix.
func PrefixRangeStart ¶
PrefixRangeStart returns the start of the row range for the given prefix.
func RowPrefixPattern ¶
func RowPrefixPattern(cxId wire.Id, keyPrefix string) wire.CollectionRowPattern
RowPrefixPattern returns a CollectionRowPattern matching a single key prefix in a single collection.
func ValidateId ¶
ValidateId returns nil iff the given Id is a valid database, collection, or syncgroup Id. TODO(ivanpi): Use verror.New instead of fmt.Errorf everywhere.
func ValidateRowKey ¶
ValidateRowKey returns nil iff the given string is a valid row key.
Types ¶
type AccessController ¶
type AccessController interface { // SetPermissions replaces the current Permissions for an object. // For detailed documentation, see Object.SetPermissions. SetPermissions(ctx *context.T, perms access.Permissions, version string) error // GetPermissions returns the current Permissions for an object. // For detailed documentation, see Object.GetPermissions. GetPermissions(ctx *context.T) (perms access.Permissions, version string, err error) }
AccessController provides access control for various syncbase objects.