Documentation ¶
Index ¶
- Variables
- func WithSession(ctx context.Context, s *Session) context.Context
- type ID
- func (x *ID) AsUUID() uuid.UUID
- func (*ID) Descriptor() ([]byte, []int)deprecated
- func (x *ID) GetData() []byte
- func (*ID) ProtoMessage()
- func (x *ID) ProtoReflect() protoreflect.Message
- func (x *ID) Reset()
- func (x *ID) Scan(v interface{}) error
- func (x *ID) String() string
- func (x *ID) Value() (driver.Value, error)
- func (x *ID) Zero() bool
- type Location
- func (*Location) Descriptor() ([]byte, []int)deprecated
- func (x *Location) GetPath() string
- func (x *Location) GetTenantId() *tenant.ID
- func (x *Location) GetVersion() int64
- func (*Location) ProtoMessage()
- func (x *Location) ProtoReflect() protoreflect.Message
- func (x *Location) Reset()
- func (x *Location) String() string
- type Scope
- func (*Scope) Descriptor() ([]byte, []int)deprecated
- func (m *Scope) GetKind() isScope_Kind
- func (x *Scope) GetOnLocation() *Location
- func (x *Scope) GetOnPrincipal() *principal.ID
- func (x *Scope) GetSuperToken() bool
- func (x *Scope) IsSubsetOf(other *Scope) bool
- func (*Scope) ProtoMessage()
- func (x *Scope) ProtoReflect() protoreflect.Message
- func (x *Scope) Reset()
- func (x *Scope) String() string
- type Scope_OnLocation
- type Scope_OnPrincipal
- type Scope_SuperToken
- type Session
- func (*Session) Descriptor() ([]byte, []int)deprecated
- func (x *Session) GetCapabilities() *capabilities.Capabilities
- func (x *Session) GetExpiresAt() *timestamppb.Timestamp
- func (x *Session) GetID() *ID
- func (x *Session) GetName() string
- func (x *Session) GetNote() string
- func (x *Session) GetPrincipalId() *principal.ID
- func (x *Session) GetScope() *Scope
- func (x *Session) IsSubsetOf(other *Session) bool
- func (x *Session) MarshalJSON() ([]byte, error)
- func (*Session) ProtoMessage()
- func (x *Session) ProtoReflect() protoreflect.Message
- func (x *Session) Reset()
- func (x *Session) String() string
- func (x *Session) UnmarshalJSON(data []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var File_session_proto protoreflect.FileDescriptor
Functions ¶
Types ¶
type ID ¶
type ID struct { Data []byte `protobuf:"bytes,1,opt,name=data,json=d,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func ParseID ¶
ParseID will parse the input as either a canonically-formatted UUID or as a base64-encoded collection of bytes.
func (*ID) Descriptor
deprecated
func (*ID) ProtoMessage ¶
func (*ID) ProtoMessage()
func (*ID) ProtoReflect ¶
func (x *ID) ProtoReflect() protoreflect.Message
type Location ¶
type Location struct { // The tenant. TenantId *tenant.ID `protobuf:"bytes,1,opt,name=tenant_id,json=t,proto3" json:"tenant_id,omitempty"` // A specific path (e.g. /foo/bar/baz) or a path prefix // (e.g. /foo/bar/*). Path string `protobuf:"bytes,2,opt,name=path,json=p,proto3" json:"path,omitempty"` // Restricts access to a specific version of the data on the path. Version int64 `protobuf:"varint,3,opt,name=version,json=v,proto3" json:"version,omitempty"` // contains filtered or unexported fields }
func (*Location) Descriptor
deprecated
func (*Location) GetTenantId ¶
func (*Location) GetVersion ¶
func (*Location) ProtoMessage ¶
func (*Location) ProtoMessage()
func (*Location) ProtoReflect ¶
func (x *Location) ProtoReflect() protoreflect.Message
type Scope ¶
type Scope struct { // Types that are assignable to Kind: // *Scope_SuperToken // *Scope_OnPrincipal // *Scope_OnLocation Kind isScope_Kind `protobuf_oneof:"Kind"` // contains filtered or unexported fields }
func (*Scope) Descriptor
deprecated
func (*Scope) GetOnLocation ¶
func (*Scope) GetOnPrincipal ¶
func (*Scope) GetSuperToken ¶
func (*Scope) IsSubsetOf ¶
IsSubsetOf returns true if the target scope is a subset of or equal to another Scope.
func (*Scope) ProtoMessage ¶
func (*Scope) ProtoMessage()
func (*Scope) ProtoReflect ¶
func (x *Scope) ProtoReflect() protoreflect.Message
type Scope_OnLocation ¶
type Scope_OnLocation struct { // Delegates operations within a tenancy. OnLocation *Location `protobuf:"bytes,3,opt,name=on_location,json=l,proto3,oneof"` }
type Scope_OnPrincipal ¶
type Scope_SuperToken ¶
type Scope_SuperToken struct { // A super-token is only used internally and allows anything. SuperToken bool `protobuf:"varint,1,opt,name=super_token,json=s,proto3,oneof"` }
type Session ¶
type Session struct { ID *ID `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` Capabilities *capabilities.Capabilities `protobuf:"bytes,2,opt,name=capabilities,json=c,proto3" json:"capabilities,omitempty"` PrincipalId *principal.ID `protobuf:"bytes,3,opt,name=principal_id,json=p,proto3" json:"principal_id,omitempty"` Scope *Scope `protobuf:"bytes,4,opt,name=scope,json=s,proto3" json:"scope,omitempty"` ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=expires_at,json=x,proto3" json:"expires_at,omitempty"` // A long-form note, to describe the session to a human. Note string `protobuf:"bytes,6,opt,name=note,proto3" json:"note,omitempty"` // A key that is unique per principal, to allow easy // programmatic access to a specific session. Name string `protobuf:"bytes,7,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func FromContext ¶
FromContext returns the Session associated with the context, or nil.
func (*Session) Descriptor
deprecated
func (*Session) GetCapabilities ¶
func (x *Session) GetCapabilities() *capabilities.Capabilities
func (*Session) GetExpiresAt ¶
func (x *Session) GetExpiresAt() *timestamppb.Timestamp
func (*Session) GetPrincipalId ¶
func (*Session) IsSubsetOf ¶
IsSubsetOf returns tue if the capabilities and scope of the the target session are a subset of or equal to those of another session. It will also return true if the other session is a super-token.
func (*Session) MarshalJSON ¶
MarshalJSON allows the Session to be correctly encoded into a JWT.
func (*Session) ProtoMessage ¶
func (*Session) ProtoMessage()
func (*Session) ProtoReflect ¶
func (x *Session) ProtoReflect() protoreflect.Message
func (*Session) UnmarshalJSON ¶
UnmarshalJSON allows the Session to be correctly decoded from a JWT.
Click to show internal directories.
Click to hide internal directories.