Documentation
¶
Index ¶
- Variables
- type BatchCheckRequest
- func (*BatchCheckRequest) Descriptor() ([]byte, []int)deprecated
- func (x *BatchCheckRequest) GetItems() []*CheckItem
- func (x *BatchCheckRequest) GetRelationships() []*Relationship
- func (x *BatchCheckRequest) GetSubject() *Principal
- func (*BatchCheckRequest) ProtoMessage()
- func (x *BatchCheckRequest) ProtoReflect() protoreflect.Message
- func (x *BatchCheckRequest) Reset()
- func (x *BatchCheckRequest) String() string
- type BatchCheckResponse
- func (*BatchCheckResponse) Descriptor() ([]byte, []int)deprecated
- func (x *BatchCheckResponse) GetResults() []*CheckResult
- func (*BatchCheckResponse) ProtoMessage()
- func (x *BatchCheckResponse) ProtoReflect() protoreflect.Message
- func (x *BatchCheckResponse) Reset()
- func (x *BatchCheckResponse) String() string
- type CheckItem
- func (*CheckItem) Descriptor() ([]byte, []int)deprecated
- func (x *CheckItem) GetActions() []string
- func (x *CheckItem) GetAncestorIds() []string
- func (x *CheckItem) GetContext() string
- func (x *CheckItem) GetObject() *Object
- func (*CheckItem) ProtoMessage()
- func (x *CheckItem) ProtoReflect() protoreflect.Message
- func (x *CheckItem) Reset()
- func (x *CheckItem) String() string
- type CheckRequest
- func (*CheckRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CheckRequest) GetAction() string
- func (x *CheckRequest) GetContext() string
- func (x *CheckRequest) GetObject() *Object
- func (x *CheckRequest) GetRelationships() []*Relationship
- func (x *CheckRequest) GetSubject() *Principal
- func (*CheckRequest) ProtoMessage()
- func (x *CheckRequest) ProtoReflect() protoreflect.Message
- func (x *CheckRequest) Reset()
- func (x *CheckRequest) String() string
- type CheckResponse
- func (*CheckResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CheckResponse) GetAllowed() bool
- func (x *CheckResponse) GetReason() string
- func (*CheckResponse) ProtoMessage()
- func (x *CheckResponse) ProtoReflect() protoreflect.Message
- func (x *CheckResponse) Reset()
- func (x *CheckResponse) String() string
- type CheckResult
- func (*CheckResult) Descriptor() ([]byte, []int)deprecated
- func (x *CheckResult) GetAction() string
- func (x *CheckResult) GetAllowed() bool
- func (x *CheckResult) GetItemIndex() int32
- func (x *CheckResult) GetObject() *Object
- func (x *CheckResult) GetReason() string
- func (*CheckResult) ProtoMessage()
- func (x *CheckResult) ProtoReflect() protoreflect.Message
- func (x *CheckResult) Reset()
- func (x *CheckResult) String() string
- type Object
- type Principal
- type Relationship
- func (*Relationship) Descriptor() ([]byte, []int)deprecated
- func (x *Relationship) GetObject() *Object
- func (x *Relationship) GetRole() *Role
- func (*Relationship) ProtoMessage()
- func (x *Relationship) ProtoReflect() protoreflect.Message
- func (x *Relationship) Reset()
- func (x *Relationship) String() string
- type Role
Constants ¶
This section is empty.
Variables ¶
var File_gitlab_glaz_v1_check_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type BatchCheckRequest ¶
type BatchCheckRequest struct {
// Required.
Subject *Principal `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"`
// Capped at 10,000 items. GLAZ rejects a larger batch outright rather
// than evaluating an unbounded number of Cedar decisions in one call.
Items []*CheckItem `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"`
// Every tuple relevant to any item in this batch, deduped by the caller.
// Not pre-filtered per item — see CheckItem.ancestor_ids. Capped at
// 10,000, the same as items: GLAZ indexes the whole list by object id
// once per call, so an unbounded list would make that indexing cost
// unbounded too.
Relationships []*Relationship `protobuf:"bytes,3,rep,name=relationships,proto3" json:"relationships,omitempty"`
// contains filtered or unexported fields
}
One subject, many (object, actions) pairs, one shared relationship-tuple list (proposal 016). Generalizes CheckRequest: the host no longer pre-filters tuples per resource. GLAZ itself scopes which tuples count toward which item, using CheckItem.ancestor_ids, since one call now spans several objects that may sit at different points in the same hierarchy.
func (*BatchCheckRequest) Descriptor
deprecated
func (*BatchCheckRequest) Descriptor() ([]byte, []int)
Deprecated: Use BatchCheckRequest.ProtoReflect.Descriptor instead.
func (*BatchCheckRequest) GetItems ¶
func (x *BatchCheckRequest) GetItems() []*CheckItem
func (*BatchCheckRequest) GetRelationships ¶
func (x *BatchCheckRequest) GetRelationships() []*Relationship
func (*BatchCheckRequest) GetSubject ¶
func (x *BatchCheckRequest) GetSubject() *Principal
func (*BatchCheckRequest) ProtoMessage ¶
func (*BatchCheckRequest) ProtoMessage()
func (*BatchCheckRequest) ProtoReflect ¶
func (x *BatchCheckRequest) ProtoReflect() protoreflect.Message
func (*BatchCheckRequest) Reset ¶
func (x *BatchCheckRequest) Reset()
func (*BatchCheckRequest) String ¶
func (x *BatchCheckRequest) String() string
type BatchCheckResponse ¶
type BatchCheckResponse struct {
Results []*CheckResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
// contains filtered or unexported fields
}
func (*BatchCheckResponse) Descriptor
deprecated
func (*BatchCheckResponse) Descriptor() ([]byte, []int)
Deprecated: Use BatchCheckResponse.ProtoReflect.Descriptor instead.
func (*BatchCheckResponse) GetResults ¶
func (x *BatchCheckResponse) GetResults() []*CheckResult
func (*BatchCheckResponse) ProtoMessage ¶
func (*BatchCheckResponse) ProtoMessage()
func (*BatchCheckResponse) ProtoReflect ¶
func (x *BatchCheckResponse) ProtoReflect() protoreflect.Message
func (*BatchCheckResponse) Reset ¶
func (x *BatchCheckResponse) Reset()
func (*BatchCheckResponse) String ¶
func (x *BatchCheckResponse) String() string
type CheckItem ¶
type CheckItem struct {
Object *Object `protobuf:"bytes,1,opt,name=object,proto3" json:"object,omitempty"`
// The actions being checked, e.g. "read_repository". Capped at 20 per
// item; must not be empty.
Actions []string `protobuf:"bytes,2,rep,name=actions,proto3" json:"actions,omitempty"`
// Context for ABAC (e.g. visibility, type), as a JSON object string.
Context string `protobuf:"bytes,3,opt,name=context,proto3" json:"context,omitempty"`
// IDs of this object's ancestors (e.g. namespace_id and org_id, for a
// repository). GLAZ counts a tuple from BatchCheckRequest.relationships
// toward this item only if the tuple's object matches this item's own
// object or one of these ancestor_ids. GLAZ trusts these ids as given; it
// does not verify that they are actually ancestors of `object`. Capped at
// 20 per item, the same as actions: real hierarchies are a handful of
// levels deep, and scoping does one lookup per ancestor id per item.
//
// This is the only ancestor input GLAZ reads.
AncestorIds []string `protobuf:"bytes,4,rep,name=ancestor_ids,json=ancestorIds,proto3" json:"ancestor_ids,omitempty"`
// contains filtered or unexported fields
}
One object and the actions to check the subject against it, evaluated against a scoped view of BatchCheckRequest.relationships.
func (*CheckItem) Descriptor
deprecated
func (*CheckItem) GetActions ¶
func (*CheckItem) GetAncestorIds ¶
func (*CheckItem) GetContext ¶
func (*CheckItem) ProtoMessage ¶
func (*CheckItem) ProtoMessage()
func (*CheckItem) ProtoReflect ¶
func (x *CheckItem) ProtoReflect() protoreflect.Message
type CheckRequest ¶
type CheckRequest struct {
// Always a principal UUID.
Subject *Principal `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"`
// The action being checked, e.g. "read_repository". Named "action", not
// "permission".
Action string `protobuf:"bytes,2,opt,name=action,proto3" json:"action,omitempty"`
// The object the action is checked against.
Object *Object `protobuf:"bytes,3,opt,name=object,proto3" json:"object,omitempty"`
// The subject's role grants, filtered by the host to the object and its
// ancestors. GLAZ does not scope this list itself: a grant on any object
// listed here counts toward the decision.
Relationships []*Relationship `protobuf:"bytes,4,rep,name=relationships,proto3" json:"relationships,omitempty"`
// Context for ABAC (e.g. visibility, type), as a JSON object string.
Context string `protobuf:"bytes,5,opt,name=context,proto3" json:"context,omitempty"`
// contains filtered or unexported fields
}
One subject, one action, one resource. The host pre-assembles everything GLAZ needs to decide (proposal 014): the role grants filtered to the resource and its ancestors, and resource attributes.
func (*CheckRequest) Descriptor
deprecated
func (*CheckRequest) Descriptor() ([]byte, []int)
Deprecated: Use CheckRequest.ProtoReflect.Descriptor instead.
func (*CheckRequest) GetAction ¶
func (x *CheckRequest) GetAction() string
func (*CheckRequest) GetContext ¶
func (x *CheckRequest) GetContext() string
func (*CheckRequest) GetObject ¶
func (x *CheckRequest) GetObject() *Object
func (*CheckRequest) GetRelationships ¶
func (x *CheckRequest) GetRelationships() []*Relationship
func (*CheckRequest) GetSubject ¶
func (x *CheckRequest) GetSubject() *Principal
func (*CheckRequest) ProtoMessage ¶
func (*CheckRequest) ProtoMessage()
func (*CheckRequest) ProtoReflect ¶
func (x *CheckRequest) ProtoReflect() protoreflect.Message
func (*CheckRequest) Reset ¶
func (x *CheckRequest) Reset()
func (*CheckRequest) String ¶
func (x *CheckRequest) String() string
type CheckResponse ¶
type CheckResponse struct {
Allowed bool `protobuf:"varint,1,opt,name=allowed,proto3" json:"allowed,omitempty"`
Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"`
// contains filtered or unexported fields
}
func (*CheckResponse) Descriptor
deprecated
func (*CheckResponse) Descriptor() ([]byte, []int)
Deprecated: Use CheckResponse.ProtoReflect.Descriptor instead.
func (*CheckResponse) GetAllowed ¶
func (x *CheckResponse) GetAllowed() bool
func (*CheckResponse) GetReason ¶
func (x *CheckResponse) GetReason() string
func (*CheckResponse) ProtoMessage ¶
func (*CheckResponse) ProtoMessage()
func (*CheckResponse) ProtoReflect ¶
func (x *CheckResponse) ProtoReflect() protoreflect.Message
func (*CheckResponse) Reset ¶
func (x *CheckResponse) Reset()
func (*CheckResponse) String ¶
func (x *CheckResponse) String() string
type CheckResult ¶
type CheckResult struct {
Object *Object `protobuf:"bytes,1,opt,name=object,proto3" json:"object,omitempty"`
Action string `protobuf:"bytes,2,opt,name=action,proto3" json:"action,omitempty"`
Allowed bool `protobuf:"varint,3,opt,name=allowed,proto3" json:"allowed,omitempty"`
Reason string `protobuf:"bytes,4,opt,name=reason,proto3" json:"reason,omitempty"`
// The index of the CheckItem in BatchCheckRequest.items that produced this
// result. Disambiguates two items that share the same object.
ItemIndex int32 `protobuf:"varint,5,opt,name=item_index,json=itemIndex,proto3" json:"item_index,omitempty"`
// contains filtered or unexported fields
}
One (item, action) verdict. Carries the object it was evaluated against. Also carries the source item's index in BatchCheckRequest.items, so a caller can match a result back to a specific item even when two items share an object.
func (*CheckResult) Descriptor
deprecated
func (*CheckResult) Descriptor() ([]byte, []int)
Deprecated: Use CheckResult.ProtoReflect.Descriptor instead.
func (*CheckResult) GetAction ¶
func (x *CheckResult) GetAction() string
func (*CheckResult) GetAllowed ¶
func (x *CheckResult) GetAllowed() bool
func (*CheckResult) GetItemIndex ¶
func (x *CheckResult) GetItemIndex() int32
func (*CheckResult) GetObject ¶
func (x *CheckResult) GetObject() *Object
func (*CheckResult) GetReason ¶
func (x *CheckResult) GetReason() string
func (*CheckResult) ProtoMessage ¶
func (*CheckResult) ProtoMessage()
func (*CheckResult) ProtoReflect ¶
func (x *CheckResult) ProtoReflect() protoreflect.Message
func (*CheckResult) Reset ¶
func (x *CheckResult) Reset()
func (*CheckResult) String ¶
func (x *CheckResult) String() string
type Object ¶
type Object struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// contains filtered or unexported fields
}
An object (resource), by UUID.
func (*Object) Descriptor
deprecated
func (*Object) ProtoMessage ¶
func (*Object) ProtoMessage()
func (*Object) ProtoReflect ¶
func (x *Object) ProtoReflect() protoreflect.Message
type Principal ¶
type Principal struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// contains filtered or unexported fields
}
A principal, by UUID. Identities are resolved upstream by the host; identity resolution is out of scope here.
func (*Principal) Descriptor
deprecated
func (*Principal) ProtoMessage ¶
func (*Principal) ProtoMessage()
func (*Principal) ProtoReflect ¶
func (x *Principal) ProtoReflect() protoreflect.Message
type Relationship ¶
type Relationship struct {
Object *Object `protobuf:"bytes,2,opt,name=object,proto3" json:"object,omitempty"`
Role *Role `protobuf:"bytes,4,opt,name=role,proto3" json:"role,omitempty"`
// contains filtered or unexported fields
}
A role granted on an object: the two fields of a relationship tuple GLAZ reads. The subject is the request's, so the tuple carries none.
func (*Relationship) Descriptor
deprecated
func (*Relationship) Descriptor() ([]byte, []int)
Deprecated: Use Relationship.ProtoReflect.Descriptor instead.
func (*Relationship) GetObject ¶
func (x *Relationship) GetObject() *Object
func (*Relationship) GetRole ¶
func (x *Relationship) GetRole() *Role
func (*Relationship) ProtoMessage ¶
func (*Relationship) ProtoMessage()
func (*Relationship) ProtoReflect ¶
func (x *Relationship) ProtoReflect() protoreflect.Message
func (*Relationship) Reset ¶
func (x *Relationship) Reset()
func (*Relationship) String ¶
func (x *Relationship) String() string
type Role ¶
type Role struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// contains filtered or unexported fields
}
A role, by UUID; the ids are the ones in crates/glaz-roles/roles/**.
func (*Role) Descriptor
deprecated
func (*Role) ProtoMessage ¶
func (*Role) ProtoMessage()
func (*Role) ProtoReflect ¶
func (x *Role) ProtoReflect() protoreflect.Message