v.io: v.io/v23/conventions Index | Files

package conventions

import "v.io/v23/conventions"

Package conventions implements unenforced conventions for Vanadium.

This is still work in progress, the conventions may change. Please do not rely on these conventions till this comment is removed!

Package conventions implements unenforced conventions for Vanadium.

Index

Package Files

conventions.go uid.go

Constants

const (
    ServerUser          = "self:?:ServerUser"      // a client that has our public key
    UnauthenticatedUser = "self:?:Unauthenticated" // a client which presents no blessing we trust
)

Special case user ids. They all have the identity provider "self" meaning that the server is poviding the identity and type "?" meaning that we don't know what type of Id this is.

func GetClientUserIds Uses

func GetClientUserIds(ctx *context.T, call security.Call) []string

GetClientUserIds returns a slice of ids for the client. Each Id is one of the special ones above or the string <identity provider>:<single letter type>:<actor>. Examples of types are "u" for user and "r" for role and "?" for unknown.

func ParseUserId Uses

func ParseUserId(s string) []string

Parse the userId components from a blessing name or a userId string. Returns nil on failure. nolint:golint // API change required.

type Blessing Uses

type Blessing struct {
    IdentityProvider string // Name of the identity provider
    User             string // UserID attested to by the identity provider
    Application      string // ApplicationID attested to by the identity provider (may be empty)
    Rest             string // Remaining extensions of the blessing.
}

Blessing represents structured information encoded in a blessing name.

func ParseBlessingNames Uses

func ParseBlessingNames(blessingNames ...string) []Blessing

ParseBlessingNames extracts structured information from the provided blessing names. Blessing names that do not adhere to the conventions of this package are ignored.

Typically the set of names to provide would be obtained via a call to security.RemoteBlessingNames or security.LocalBlessingNames.

func (*Blessing) AppPattern Uses

func (b *Blessing) AppPattern() security.BlessingPattern

AppPattern returns a BlessingPattern that would be matched by all users of the same application.

func (*Blessing) AppUserPattern Uses

func (b *Blessing) AppUserPattern() security.BlessingPattern

AppUserPattern returns a BlessingPattern that would be matched by a blessing for the user using the same application.

func (*Blessing) Home Uses

func (b *Blessing) Home() string

Home returns the "Home directory" in the global namespace for this Blessing.

func (*Blessing) String Uses

func (b *Blessing) String() string

String returns the blessing name represented by this structure.

func (*Blessing) UserPattern Uses

func (b *Blessing) UserPattern() security.BlessingPattern

UserPattern returns a BlessingPattern that would be matched by a blessing obtainable by the user (irrespective of application).

Package conventions imports 5 packages (graph) and is imported by 8 packages. Updated 2020-10-29. Refresh now. Tools for package owners.