Documentation ¶
Overview ¶
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 ¶
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.
Variables ¶
This section is empty.
Functions ¶
func GetClientUserIds ¶
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 ¶
Parse the userId components from a blessing name or a userId string. Returns nil on failure.
Types ¶
type Blessing ¶
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 ¶
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 ¶
func (b *Blessing) AppPattern() security.BlessingPattern
AppPattern returns a BlessingPattern that would be matched by all users of the same application.
func (*Blessing) AppUserPattern ¶
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 ¶
Home returns the "Home directory" in the global namespace for this Blessing.
func (*Blessing) UserPattern ¶
func (b *Blessing) UserPattern() security.BlessingPattern
UserPattern returns a BlessingPattern that would be matched by a blessing obtainable by the user (irrespective of application).