capabilities

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Direction_name = map[int32]string{
		0: "INVALID_DIRECTION",
		1: "REQUEST",
		2: "RESPONSE",
	}
	Direction_value = map[string]int32{
		"INVALID_DIRECTION": 0,
		"REQUEST":           1,
		"RESPONSE":          2,
	}
)

Enum value maps for Direction.

View Source
var (
	ContextReference_name = map[int32]string{
		0: "INVALID_CONTEXT",
		1: "SESSION_PRINCIPAL",
		2: "SCOPE_TENANT",
		3: "SCOPE_PRINCIPAL",
		4: "UNAUTHENTICATED_PRINCIPAL",
		5: "VHOST_TENANT",
	}
	ContextReference_value = map[string]int32{
		"INVALID_CONTEXT":           0,
		"SESSION_PRINCIPAL":         1,
		"SCOPE_TENANT":              2,
		"SCOPE_PRINCIPAL":           3,
		"UNAUTHENTICATED_PRINCIPAL": 4,
		"VHOST_TENANT":              5,
	}
)

Enum value maps for ContextReference.

View Source
var (
	Rule_AuthStatus_name = map[int32]string{
		0: "LOGGED_IN",
		1: "PUBLIC",
		2: "SUPER",
	}
	Rule_AuthStatus_value = map[string]int32{
		"LOGGED_IN": 0,
		"PUBLIC":    1,
		"SUPER":     2,
	}
)

Enum value maps for Rule_AuthStatus.

View Source
var (
	// Applies the given requirements if the field is set.
	//
	// optional cacheroach.capabilities.Rule field_rule = 55123;
	E_FieldRule = &file_capabilities_proto_extTypes[1]
)

Extension fields to descriptorpb.FieldOptions.

View Source
var (
	// optional cacheroach.capabilities.Rule method_rule = 55123;
	E_MethodRule = &file_capabilities_proto_extTypes[2]
)

Extension fields to descriptorpb.MethodOptions.

View Source
var (
	// optional cacheroach.capabilities.Rule msg_rule = 55123;
	E_MsgRule = &file_capabilities_proto_extTypes[0]
)

Extension fields to descriptorpb.MessageOptions.

View Source
var File_capabilities_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Capabilities

type Capabilities struct {

	// General model property access.
	Read bool `protobuf:"varint,1,opt,name=read,proto3" json:"read,omitempty"`
	// General model property access.
	Write bool `protobuf:"varint,2,opt,name=write,proto3" json:"write,omitempty"`
	// Grants the ability to create additional access tokens.
	Delegate bool `protobuf:"varint,3,opt,name=delegate,proto3" json:"delegate,omitempty"`
	// Grants access to personally-identifying information.
	Pii bool `protobuf:"varint,4,opt,name=pii,proto3" json:"pii,omitempty"`
	// Grants access to the server-side fetch API.
	Fetch bool `protobuf:"varint,5,opt,name=fetch,proto3" json:"fetch,omitempty"`
	// contains filtered or unexported fields
}

func All

func All() *Capabilities

All returns a Capabilities wil all bits set.

func Parse

func Parse(x []string) (*Capabilities, error)

Parse will return a capabilities with the request field names set. The value "all" will return All().

func (*Capabilities) AsBits

func (x *Capabilities) AsBits() int64

AsBits expresses the bool fields of the message as a bit-field, using the message field numbers as the bit.

func (*Capabilities) Descriptor deprecated

func (*Capabilities) Descriptor() ([]byte, []int)

Deprecated: Use Capabilities.ProtoReflect.Descriptor instead.

func (*Capabilities) GetDelegate

func (x *Capabilities) GetDelegate() bool

func (*Capabilities) GetFetch

func (x *Capabilities) GetFetch() bool

func (*Capabilities) GetPii

func (x *Capabilities) GetPii() bool

func (*Capabilities) GetRead

func (x *Capabilities) GetRead() bool

func (*Capabilities) GetWrite

func (x *Capabilities) GetWrite() bool

func (*Capabilities) IsSubsetOf

func (x *Capabilities) IsSubsetOf(other *Capabilities) bool

IsSubsetOf returns true if the target Capabilities are a subset of or equal to another Capabilities.

func (*Capabilities) Pretty

func (x *Capabilities) Pretty() string

Pretty returns a pretty-printable value that Parse will understand.

func (*Capabilities) ProtoMessage

func (*Capabilities) ProtoMessage()

func (*Capabilities) ProtoReflect

func (x *Capabilities) ProtoReflect() protoreflect.Message

func (*Capabilities) Reset

func (x *Capabilities) Reset()

func (*Capabilities) Scan

func (x *Capabilities) Scan(v interface{}) error

Scan implements sql.Scanner.

func (*Capabilities) String

func (x *Capabilities) String() string

func (*Capabilities) Value

func (x *Capabilities) Value() (driver.Value, error)

Value implements driver.Valuer.

func (*Capabilities) Zero

func (x *Capabilities) Zero() bool

Zero returns true if no capabilities are set.

type ContextReference

type ContextReference int32
const (
	ContextReference_INVALID_CONTEXT           ContextReference = 0
	ContextReference_SESSION_PRINCIPAL         ContextReference = 1 // The principal that is making the request.
	ContextReference_SCOPE_TENANT              ContextReference = 2 // The tenant that is embedded in the session's scope.
	ContextReference_SCOPE_PRINCIPAL           ContextReference = 3 // The principal embedded in the session's scope.
	ContextReference_UNAUTHENTICATED_PRINCIPAL ContextReference = 4 // A well-known ID for an unauthorized request.
	ContextReference_VHOST_TENANT              ContextReference = 5 // The tenant associated with a virtual-host.
)

func (ContextReference) Descriptor

func (ContextReference) Enum

func (ContextReference) EnumDescriptor deprecated

func (ContextReference) EnumDescriptor() ([]byte, []int)

Deprecated: Use ContextReference.Descriptor instead.

func (ContextReference) Number

func (ContextReference) String

func (x ContextReference) String() string

func (ContextReference) Type

type Direction

type Direction int32
const (
	Direction_INVALID_DIRECTION Direction = 0
	Direction_REQUEST           Direction = 1
	Direction_RESPONSE          Direction = 2
)

func (Direction) Descriptor

func (Direction) Descriptor() protoreflect.EnumDescriptor

func (Direction) Enum

func (x Direction) Enum() *Direction

func (Direction) EnumDescriptor deprecated

func (Direction) EnumDescriptor() ([]byte, []int)

Deprecated: Use Direction.Descriptor instead.

func (Direction) Number

func (x Direction) Number() protoreflect.EnumNumber

func (Direction) String

func (x Direction) String() string

func (Direction) Type

type LocationReference

type LocationReference struct {
	TenantId *Reference `protobuf:"bytes,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"`
	Path     *Reference `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	// contains filtered or unexported fields
}

Analog of session.Location.

func (*LocationReference) Descriptor deprecated

func (*LocationReference) Descriptor() ([]byte, []int)

Deprecated: Use LocationReference.ProtoReflect.Descriptor instead.

func (*LocationReference) GetPath

func (x *LocationReference) GetPath() *Reference

func (*LocationReference) GetTenantId

func (x *LocationReference) GetTenantId() *Reference

func (*LocationReference) ProtoMessage

func (*LocationReference) ProtoMessage()

func (*LocationReference) ProtoReflect

func (x *LocationReference) ProtoReflect() protoreflect.Message

func (*LocationReference) Reset

func (x *LocationReference) Reset()

func (*LocationReference) String

func (x *LocationReference) String() string

type Reference

type Reference struct {

	// Types that are assignable to Kind:
	//	*Reference_Context
	//	*Reference_Field
	//	*Reference_StringValue
	Kind isReference_Kind `protobuf_oneof:"Kind"`
	// contains filtered or unexported fields
}

Reference to an ID.

func (*Reference) Descriptor deprecated

func (*Reference) Descriptor() ([]byte, []int)

Deprecated: Use Reference.ProtoReflect.Descriptor instead.

func (*Reference) GetContext

func (x *Reference) GetContext() ContextReference

func (*Reference) GetField

func (x *Reference) GetField() int32

func (*Reference) GetKind

func (m *Reference) GetKind() isReference_Kind

func (*Reference) GetStringValue

func (x *Reference) GetStringValue() string

func (*Reference) ProtoMessage

func (*Reference) ProtoMessage()

func (*Reference) ProtoReflect

func (x *Reference) ProtoReflect() protoreflect.Message

func (*Reference) Reset

func (x *Reference) Reset()

func (*Reference) String

func (x *Reference) String() string

type Reference_Context

type Reference_Context struct {
	Context ContextReference `protobuf:"varint,1,opt,name=context,proto3,enum=cacheroach.capabilities.ContextReference,oneof"`
}

type Reference_Field

type Reference_Field struct {
	Field int32 `protobuf:"varint,2,opt,name=field,proto3,oneof"`
}

type Reference_StringValue

type Reference_StringValue struct {
	// A literal string value.
	StringValue string `protobuf:"bytes,3,opt,name=string_value,json=stringValue,proto3,oneof"`
}

type Rule

type Rule struct {

	// Types that are assignable to Kind:
	//	*Rule_Eq_
	//	*Rule_Not
	//	*Rule_Never
	//	*Rule_And_
	//	*Rule_Or_
	//	*Rule_AuthStatus_
	//	*Rule_May
	//	*Rule_Direction
	//	*Rule_IsSubset
	Kind isRule_Kind `protobuf_oneof:"Kind"`
	// A message to be returned to the user explaining the rule.
	Message string `protobuf:"bytes,15,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*Rule) Descriptor deprecated

func (*Rule) Descriptor() ([]byte, []int)

Deprecated: Use Rule.ProtoReflect.Descriptor instead.

func (*Rule) GetAnd

func (x *Rule) GetAnd() *Rule_And

func (*Rule) GetAuthStatus

func (x *Rule) GetAuthStatus() Rule_AuthStatus

func (*Rule) GetDirection

func (x *Rule) GetDirection() Direction

func (*Rule) GetEq

func (x *Rule) GetEq() *Rule_Eq

func (*Rule) GetIsSubset

func (x *Rule) GetIsSubset() bool

func (*Rule) GetKind

func (m *Rule) GetKind() isRule_Kind

func (*Rule) GetMay

func (x *Rule) GetMay() *SessionReference

func (*Rule) GetMessage

func (x *Rule) GetMessage() string

func (*Rule) GetNever

func (x *Rule) GetNever() bool

func (*Rule) GetNot

func (x *Rule) GetNot() *Rule

func (*Rule) GetOr

func (x *Rule) GetOr() *Rule_Or

func (*Rule) ProtoMessage

func (*Rule) ProtoMessage()

func (*Rule) ProtoReflect

func (x *Rule) ProtoReflect() protoreflect.Message

func (*Rule) Reset

func (x *Rule) Reset()

func (*Rule) String

func (x *Rule) String() string

type Rule_And

type Rule_And struct {
	Rule []*Rule `protobuf:"bytes,1,rep,name=rule,proto3" json:"rule,omitempty"`
	// contains filtered or unexported fields
}

func (*Rule_And) Descriptor deprecated

func (*Rule_And) Descriptor() ([]byte, []int)

Deprecated: Use Rule_And.ProtoReflect.Descriptor instead.

func (*Rule_And) GetRule

func (x *Rule_And) GetRule() []*Rule

func (*Rule_And) ProtoMessage

func (*Rule_And) ProtoMessage()

func (*Rule_And) ProtoReflect

func (x *Rule_And) ProtoReflect() protoreflect.Message

func (*Rule_And) Reset

func (x *Rule_And) Reset()

func (*Rule_And) String

func (x *Rule_And) String() string

type Rule_And_

type Rule_And_ struct {
	// Conjunction.
	And *Rule_And `protobuf:"bytes,4,opt,name=and,proto3,oneof"`
}

type Rule_AuthStatus

type Rule_AuthStatus int32
const (
	// Require credentials.
	Rule_LOGGED_IN Rule_AuthStatus = 0
	// Always allow access, even to unauthenticated callers.
	Rule_PUBLIC Rule_AuthStatus = 1
	// Require super-token access. This is the default.
	Rule_SUPER Rule_AuthStatus = 2
)

func (Rule_AuthStatus) Descriptor

func (Rule_AuthStatus) Enum

func (x Rule_AuthStatus) Enum() *Rule_AuthStatus

func (Rule_AuthStatus) EnumDescriptor deprecated

func (Rule_AuthStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use Rule_AuthStatus.Descriptor instead.

func (Rule_AuthStatus) Number

func (Rule_AuthStatus) String

func (x Rule_AuthStatus) String() string

func (Rule_AuthStatus) Type

type Rule_AuthStatus_

type Rule_AuthStatus_ struct {
	// General authentication status.
	AuthStatus Rule_AuthStatus `protobuf:"varint,6,opt,name=auth_status,json=authStatus,proto3,enum=cacheroach.capabilities.Rule_AuthStatus,oneof"`
}

type Rule_Direction

type Rule_Direction struct {
	// The request direction.
	Direction Direction `protobuf:"varint,8,opt,name=direction,proto3,enum=cacheroach.capabilities.Direction,oneof"`
}

type Rule_Eq

type Rule_Eq struct {
	A *Reference `protobuf:"bytes,1,opt,name=a,proto3" json:"a,omitempty"`
	B *Reference `protobuf:"bytes,2,opt,name=b,proto3" json:"b,omitempty"`
	// contains filtered or unexported fields
}

func (*Rule_Eq) Descriptor deprecated

func (*Rule_Eq) Descriptor() ([]byte, []int)

Deprecated: Use Rule_Eq.ProtoReflect.Descriptor instead.

func (*Rule_Eq) GetA

func (x *Rule_Eq) GetA() *Reference

func (*Rule_Eq) GetB

func (x *Rule_Eq) GetB() *Reference

func (*Rule_Eq) ProtoMessage

func (*Rule_Eq) ProtoMessage()

func (*Rule_Eq) ProtoReflect

func (x *Rule_Eq) ProtoReflect() protoreflect.Message

func (*Rule_Eq) Reset

func (x *Rule_Eq) Reset()

func (*Rule_Eq) String

func (x *Rule_Eq) String() string

type Rule_Eq_

type Rule_Eq_ struct {
	// Requires equality.
	Eq *Rule_Eq `protobuf:"bytes,1,opt,name=eq,proto3,oneof"`
}

type Rule_IsSubset

type Rule_IsSubset struct {
	// Applies to session.Session; indicates that the session must be a
	// subset of the principal's scopes.
	IsSubset bool `protobuf:"varint,9,opt,name=is_subset,json=isSubset,proto3,oneof"`
}

type Rule_May

type Rule_May struct {
	May *SessionReference `protobuf:"bytes,7,opt,name=may,proto3,oneof"`
}

type Rule_Never

type Rule_Never struct {
	// A rule that never matches.
	Never bool `protobuf:"varint,3,opt,name=never,proto3,oneof"`
}

type Rule_Not

type Rule_Not struct {
	// Inverts the enclosed rule.
	Not *Rule `protobuf:"bytes,2,opt,name=not,proto3,oneof"`
}

type Rule_Or

type Rule_Or struct {
	Rule []*Rule `protobuf:"bytes,1,rep,name=rule,proto3" json:"rule,omitempty"`
	// contains filtered or unexported fields
}

func (*Rule_Or) Descriptor deprecated

func (*Rule_Or) Descriptor() ([]byte, []int)

Deprecated: Use Rule_Or.ProtoReflect.Descriptor instead.

func (*Rule_Or) GetRule

func (x *Rule_Or) GetRule() []*Rule

func (*Rule_Or) ProtoMessage

func (*Rule_Or) ProtoMessage()

func (*Rule_Or) ProtoReflect

func (x *Rule_Or) ProtoReflect() protoreflect.Message

func (*Rule_Or) Reset

func (x *Rule_Or) Reset()

func (*Rule_Or) String

func (x *Rule_Or) String() string

type Rule_Or_

type Rule_Or_ struct {
	// Disjunction.
	Or *Rule_Or `protobuf:"bytes,5,opt,name=or,proto3,oneof"`
}

type ScopeReference

type ScopeReference struct {

	// Types that are assignable to Kind:
	//	*ScopeReference_SuperToken
	//	*ScopeReference_OnPrincipal
	//	*ScopeReference_OnLocation
	Kind isScopeReference_Kind `protobuf_oneof:"Kind"`
	// contains filtered or unexported fields
}

Analog of session.Scope.

func (*ScopeReference) Descriptor deprecated

func (*ScopeReference) Descriptor() ([]byte, []int)

Deprecated: Use ScopeReference.ProtoReflect.Descriptor instead.

func (*ScopeReference) GetKind

func (m *ScopeReference) GetKind() isScopeReference_Kind

func (*ScopeReference) GetOnLocation

func (x *ScopeReference) GetOnLocation() *LocationReference

func (*ScopeReference) GetOnPrincipal

func (x *ScopeReference) GetOnPrincipal() *Reference

func (*ScopeReference) GetSuperToken

func (x *ScopeReference) GetSuperToken() bool

func (*ScopeReference) ProtoMessage

func (*ScopeReference) ProtoMessage()

func (*ScopeReference) ProtoReflect

func (x *ScopeReference) ProtoReflect() protoreflect.Message

func (*ScopeReference) Reset

func (x *ScopeReference) Reset()

func (*ScopeReference) String

func (x *ScopeReference) String() string

type ScopeReference_OnLocation

type ScopeReference_OnLocation struct {
	OnLocation *LocationReference `protobuf:"bytes,3,opt,name=on_location,json=onLocation,proto3,oneof"`
}

type ScopeReference_OnPrincipal

type ScopeReference_OnPrincipal struct {
	OnPrincipal *Reference `protobuf:"bytes,2,opt,name=on_principal,json=onPrincipal,proto3,oneof"`
}

type ScopeReference_SuperToken

type ScopeReference_SuperToken struct {
	SuperToken bool `protobuf:"varint,1,opt,name=super_token,json=superToken,proto3,oneof"`
}

type SessionReference

type SessionReference struct {
	Capabilities *Capabilities   `protobuf:"bytes,2,opt,name=capabilities,proto3" json:"capabilities,omitempty"`
	Scope        *ScopeReference `protobuf:"bytes,4,opt,name=scope,proto3" json:"scope,omitempty"`
	// contains filtered or unexported fields
}

Analog of session.Session.

func (*SessionReference) Descriptor deprecated

func (*SessionReference) Descriptor() ([]byte, []int)

Deprecated: Use SessionReference.ProtoReflect.Descriptor instead.

func (*SessionReference) GetCapabilities

func (x *SessionReference) GetCapabilities() *Capabilities

func (*SessionReference) GetScope

func (x *SessionReference) GetScope() *ScopeReference

func (*SessionReference) ProtoMessage

func (*SessionReference) ProtoMessage()

func (*SessionReference) ProtoReflect

func (x *SessionReference) ProtoReflect() protoreflect.Message

func (*SessionReference) Reset

func (x *SessionReference) Reset()

func (*SessionReference) String

func (x *SessionReference) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL