Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterAuthzServiceServer(s grpc.ServiceRegistrar, srv AuthzServiceServer)
- type AuditList
- type AuditRecord
- func (*AuditRecord) Descriptor() ([]byte, []int)deprecated
- func (x *AuditRecord) GetAction() string
- func (x *AuditRecord) GetContext() map[string]string
- func (x *AuditRecord) GetDupCount() int32
- func (x *AuditRecord) GetDurationUs() int64
- func (x *AuditRecord) GetId() int64
- func (x *AuditRecord) GetLastOccurredAt() *timestamppb.Timestamp
- func (x *AuditRecord) GetOccurredAt() *timestamppb.Timestamp
- func (x *AuditRecord) GetPackage() string
- func (x *AuditRecord) GetPatPreview() string
- func (x *AuditRecord) GetReqId() string
- func (x *AuditRecord) GetResource() *Resource
- func (x *AuditRecord) GetResult() *AuditResult
- func (x *AuditRecord) GetScope() string
- func (x *AuditRecord) GetSubject() *AuditSubject
- func (*AuditRecord) ProtoMessage()
- func (x *AuditRecord) ProtoReflect() protoreflect.Message
- func (x *AuditRecord) Reset()
- func (x *AuditRecord) String() string
- type AuditResult
- func (*AuditResult) Descriptor() ([]byte, []int)deprecated
- func (x *AuditResult) GetAllowed() bool
- func (x *AuditResult) GetError() string
- func (x *AuditResult) GetObligations() map[string]string
- func (x *AuditResult) GetReason() string
- func (*AuditResult) ProtoMessage()
- func (x *AuditResult) ProtoReflect() protoreflect.Message
- func (x *AuditResult) Reset()
- func (x *AuditResult) String() string
- type AuditSubject
- func (*AuditSubject) Descriptor() ([]byte, []int)deprecated
- func (x *AuditSubject) GetOrg() string
- func (x *AuditSubject) GetRoles() []string
- func (x *AuditSubject) GetUsername() string
- func (*AuditSubject) ProtoMessage()
- func (x *AuditSubject) ProtoReflect() protoreflect.Message
- func (x *AuditSubject) Reset()
- func (x *AuditSubject) String() string
- type AuthzServiceClient
- type AuthzServiceServer
- type BatchEvaluateRequest
- func (*BatchEvaluateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *BatchEvaluateRequest) GetCapabilityCheck() bool
- func (x *BatchEvaluateRequest) GetRequests() []*EvaluateRequest
- func (*BatchEvaluateRequest) ProtoMessage()
- func (x *BatchEvaluateRequest) ProtoReflect() protoreflect.Message
- func (x *BatchEvaluateRequest) Reset()
- func (x *BatchEvaluateRequest) String() string
- type BatchEvaluateResponse
- func (*BatchEvaluateResponse) Descriptor() ([]byte, []int)deprecated
- func (x *BatchEvaluateResponse) GetResponses() []*EvaluateResponse
- func (*BatchEvaluateResponse) ProtoMessage()
- func (x *BatchEvaluateResponse) ProtoReflect() protoreflect.Message
- func (x *BatchEvaluateResponse) Reset()
- func (x *BatchEvaluateResponse) String() string
- type EvaluateRequest
- func (*EvaluateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *EvaluateRequest) GetAction() string
- func (x *EvaluateRequest) GetContext() map[string]string
- func (x *EvaluateRequest) GetPackage() string
- func (x *EvaluateRequest) GetPatPreview() string
- func (x *EvaluateRequest) GetResource() *Resource
- func (x *EvaluateRequest) GetToken() string
- func (*EvaluateRequest) ProtoMessage()
- func (x *EvaluateRequest) ProtoReflect() protoreflect.Message
- func (x *EvaluateRequest) Reset()
- func (x *EvaluateRequest) String() string
- type EvaluateResponse
- func (*EvaluateResponse) Descriptor() ([]byte, []int)deprecated
- func (x *EvaluateResponse) GetAllowed() bool
- func (x *EvaluateResponse) GetObligations() map[string]string
- func (x *EvaluateResponse) GetReason() string
- func (*EvaluateResponse) ProtoMessage()
- func (x *EvaluateResponse) ProtoReflect() protoreflect.Message
- func (x *EvaluateResponse) Reset()
- func (x *EvaluateResponse) String() string
- type GetAuditQuerySchemaRequest
- type QueryAuditRequest
- func (*QueryAuditRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryAuditRequest) GetQuery() *v1.Payload
- func (*QueryAuditRequest) ProtoMessage()
- func (x *QueryAuditRequest) ProtoReflect() protoreflect.Message
- func (x *QueryAuditRequest) Reset()
- func (x *QueryAuditRequest) String() string
- type Resource
- func (*Resource) Descriptor() ([]byte, []int)deprecated
- func (x *Resource) GetAttributes() map[string]string
- func (x *Resource) GetId() string
- func (x *Resource) GetType() string
- func (*Resource) ProtoMessage()
- func (x *Resource) ProtoReflect() protoreflect.Message
- func (x *Resource) Reset()
- func (x *Resource) String() string
- type UnimplementedAuthzServiceServer
- func (UnimplementedAuthzServiceServer) BatchEvaluate(context.Context, *BatchEvaluateRequest) (*BatchEvaluateResponse, error)
- func (UnimplementedAuthzServiceServer) Evaluate(context.Context, *EvaluateRequest) (*EvaluateResponse, error)
- func (UnimplementedAuthzServiceServer) GetAuditQuerySchema(context.Context, *GetAuditQuerySchemaRequest) (*v1.Descriptor, error)
- func (UnimplementedAuthzServiceServer) GetVersionInfo(context.Context, *v11.GetVersionInfoRequest) (*v11.GetVersionInfoResponse, error)
- func (UnimplementedAuthzServiceServer) QueryAudit(context.Context, *QueryAuditRequest) (*AuditList, error)
- type UnsafeAuthzServiceServer
Constants ¶
const ( AuthzService_Evaluate_FullMethodName = "/authz.v1.AuthzService/Evaluate" AuthzService_BatchEvaluate_FullMethodName = "/authz.v1.AuthzService/BatchEvaluate" AuthzService_GetAuditQuerySchema_FullMethodName = "/authz.v1.AuthzService/GetAuditQuerySchema" AuthzService_QueryAudit_FullMethodName = "/authz.v1.AuthzService/QueryAudit" AuthzService_GetVersionInfo_FullMethodName = "/authz.v1.AuthzService/GetVersionInfo" )
Variables ¶
var AuthzService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "authz.v1.AuthzService", HandlerType: (*AuthzServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Evaluate", Handler: _AuthzService_Evaluate_Handler, }, { MethodName: "BatchEvaluate", Handler: _AuthzService_BatchEvaluate_Handler, }, { MethodName: "GetAuditQuerySchema", Handler: _AuthzService_GetAuditQuerySchema_Handler, }, { MethodName: "QueryAudit", Handler: _AuthzService_QueryAudit_Handler, }, { MethodName: "GetVersionInfo", Handler: _AuthzService_GetVersionInfo_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "authz/v1/authz.proto", }
AuthzService_ServiceDesc is the grpc.ServiceDesc for AuthzService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_authz_v1_authz_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAuthzServiceServer ¶
func RegisterAuthzServiceServer(s grpc.ServiceRegistrar, srv AuthzServiceServer)
Types ¶
type AuditList ¶ added in v0.39.0
type AuditList struct {
Records []*AuditRecord `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"`
// contains filtered or unexported fields
}
AuditList holds a paginated list of audit records.
func (*AuditList) Descriptor
deprecated
added in
v0.39.0
func (*AuditList) GetRecords ¶ added in v0.39.0
func (x *AuditList) GetRecords() []*AuditRecord
func (*AuditList) ProtoMessage ¶ added in v0.39.0
func (*AuditList) ProtoMessage()
func (*AuditList) ProtoReflect ¶ added in v0.39.0
func (x *AuditList) ProtoReflect() protoreflect.Message
type AuditRecord ¶ added in v0.39.0
type AuditRecord struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
ReqId string `protobuf:"bytes,2,opt,name=req_id,json=reqId,proto3" json:"req_id,omitempty"`
OccurredAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=occurred_at,json=occurredAt,proto3" json:"occurred_at,omitempty"`
// package and action are the EvaluateRequest fields of the same name.
Package string `protobuf:"bytes,4,opt,name=package,proto3" json:"package,omitempty"`
Action string `protobuf:"bytes,5,opt,name=action,proto3" json:"action,omitempty"`
// scope is the compound "domain:action[:qualifier]" display form of
// action — e.g. "user:auth:ssh", "user:read:credentials:git" — the same
// convention CapabilityCheck.Action uses (see capability.go). Equal to
// action for actions with no such qualifier. Display/audit convenience
// only; never used for policy routing or PAT scope matching, both of
// which stay keyed on action.
Scope string `protobuf:"bytes,20,opt,name=scope,proto3" json:"scope,omitempty"`
// subject is the caller, taken from the verified JWT claims.
Subject *AuditSubject `protobuf:"bytes,22,opt,name=subject,proto3" json:"subject,omitempty"`
// pat_preview mirrors EvaluateRequest.pat_preview: the display prefix of
// the Personal Access Token exchanged for the caller's JWT, when the
// request came in that way. Caller-asserted; audit-only.
PatPreview string `protobuf:"bytes,9,opt,name=pat_preview,json=patPreview,proto3" json:"pat_preview,omitempty"`
// resource mirrors EvaluateRequest.resource (type, id, attributes; the
// resource owner is attributes["owner"]).
Resource *Resource `protobuf:"bytes,23,opt,name=resource,proto3" json:"resource,omitempty"`
// context mirrors EvaluateRequest.context — ambient attributes not
// present in the JWT or resource (auth surface, credential type, connect
// type, ...). scope (above) is derived from a subset of these keys for
// display. Values longer than the server's audit.maxContextValueBytes are
// replaced by a "<truncated: N bytes, sha256:...>" marker.
Context map[string]string `` /* 142-byte string literal not displayed */
// result mirrors EvaluateResponse (allowed, reason, obligations), plus
// error for evaluations that failed outright.
Result *AuditResult `protobuf:"bytes,24,opt,name=result,proto3" json:"result,omitempty"`
// duration_us is how long the OPA evaluation itself took, in microseconds.
DurationUs int64 `protobuf:"varint,17,opt,name=duration_us,json=durationUs,proto3" json:"duration_us,omitempty"`
// dup_count is how many identical decisions were folded into this row
// within its dedup window, including the one that created it.
DupCount int32 `protobuf:"varint,18,opt,name=dup_count,json=dupCount,proto3" json:"dup_count,omitempty"`
// last_occurred_at is the most recent occurrence folded into this row.
// occurred_at remains the first occurrence.
LastOccurredAt *timestamppb.Timestamp `protobuf:"bytes,19,opt,name=last_occurred_at,json=lastOccurredAt,proto3" json:"last_occurred_at,omitempty"`
// contains filtered or unexported fields
}
AuditRecord is a single recorded policy-evaluation decision. Repeated calls that resolved to the identical decision within a short window are folded server-side into one AuditRecord rather than returned as separate entries — see dup_count/last_occurred_at.
func (*AuditRecord) Descriptor
deprecated
added in
v0.39.0
func (*AuditRecord) Descriptor() ([]byte, []int)
Deprecated: Use AuditRecord.ProtoReflect.Descriptor instead.
func (*AuditRecord) GetAction ¶ added in v0.39.0
func (x *AuditRecord) GetAction() string
func (*AuditRecord) GetContext ¶ added in v0.39.0
func (x *AuditRecord) GetContext() map[string]string
func (*AuditRecord) GetDupCount ¶ added in v0.39.0
func (x *AuditRecord) GetDupCount() int32
func (*AuditRecord) GetDurationUs ¶ added in v0.39.0
func (x *AuditRecord) GetDurationUs() int64
func (*AuditRecord) GetId ¶ added in v0.39.0
func (x *AuditRecord) GetId() int64
func (*AuditRecord) GetLastOccurredAt ¶ added in v0.39.0
func (x *AuditRecord) GetLastOccurredAt() *timestamppb.Timestamp
func (*AuditRecord) GetOccurredAt ¶ added in v0.39.0
func (x *AuditRecord) GetOccurredAt() *timestamppb.Timestamp
func (*AuditRecord) GetPackage ¶ added in v0.39.0
func (x *AuditRecord) GetPackage() string
func (*AuditRecord) GetPatPreview ¶ added in v0.39.0
func (x *AuditRecord) GetPatPreview() string
func (*AuditRecord) GetReqId ¶ added in v0.39.0
func (x *AuditRecord) GetReqId() string
func (*AuditRecord) GetResource ¶ added in v0.63.5
func (x *AuditRecord) GetResource() *Resource
func (*AuditRecord) GetResult ¶ added in v0.63.5
func (x *AuditRecord) GetResult() *AuditResult
func (*AuditRecord) GetScope ¶ added in v0.39.0
func (x *AuditRecord) GetScope() string
func (*AuditRecord) GetSubject ¶ added in v0.63.5
func (x *AuditRecord) GetSubject() *AuditSubject
func (*AuditRecord) ProtoMessage ¶ added in v0.39.0
func (*AuditRecord) ProtoMessage()
func (*AuditRecord) ProtoReflect ¶ added in v0.39.0
func (x *AuditRecord) ProtoReflect() protoreflect.Message
func (*AuditRecord) Reset ¶ added in v0.39.0
func (x *AuditRecord) Reset()
func (*AuditRecord) String ¶ added in v0.39.0
func (x *AuditRecord) String() string
type AuditResult ¶ added in v0.63.5
type AuditResult struct {
Allowed bool `protobuf:"varint,1,opt,name=allowed,proto3" json:"allowed,omitempty"`
// reason is the policy's human-readable explanation, as returned in
// EvaluateResponse.reason. Empty when evaluation failed.
Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"`
Obligations map[string]string `` /* 149-byte string literal not displayed */
// error is populated when policy evaluation itself failed (compile/eval
// error, no result returned), rather than reflecting a normal deny.
Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"`
// contains filtered or unexported fields
}
AuditResult is the recorded outcome of an evaluation: the EvaluateResponse fields, plus error.
func (*AuditResult) Descriptor
deprecated
added in
v0.63.5
func (*AuditResult) Descriptor() ([]byte, []int)
Deprecated: Use AuditResult.ProtoReflect.Descriptor instead.
func (*AuditResult) GetAllowed ¶ added in v0.63.5
func (x *AuditResult) GetAllowed() bool
func (*AuditResult) GetError ¶ added in v0.63.5
func (x *AuditResult) GetError() string
func (*AuditResult) GetObligations ¶ added in v0.63.5
func (x *AuditResult) GetObligations() map[string]string
func (*AuditResult) GetReason ¶ added in v0.63.5
func (x *AuditResult) GetReason() string
func (*AuditResult) ProtoMessage ¶ added in v0.63.5
func (*AuditResult) ProtoMessage()
func (*AuditResult) ProtoReflect ¶ added in v0.63.5
func (x *AuditResult) ProtoReflect() protoreflect.Message
func (*AuditResult) Reset ¶ added in v0.63.5
func (x *AuditResult) Reset()
func (*AuditResult) String ¶ added in v0.63.5
func (x *AuditResult) String() string
type AuditSubject ¶ added in v0.63.5
type AuditSubject struct {
Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
Roles []string `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles,omitempty"`
Org string `protobuf:"bytes,3,opt,name=org,proto3" json:"org,omitempty"`
// contains filtered or unexported fields
}
AuditSubject is the caller of an audited evaluation, from the JWT claims.
func (*AuditSubject) Descriptor
deprecated
added in
v0.63.5
func (*AuditSubject) Descriptor() ([]byte, []int)
Deprecated: Use AuditSubject.ProtoReflect.Descriptor instead.
func (*AuditSubject) GetOrg ¶ added in v0.63.5
func (x *AuditSubject) GetOrg() string
func (*AuditSubject) GetRoles ¶ added in v0.63.5
func (x *AuditSubject) GetRoles() []string
func (*AuditSubject) GetUsername ¶ added in v0.63.5
func (x *AuditSubject) GetUsername() string
func (*AuditSubject) ProtoMessage ¶ added in v0.63.5
func (*AuditSubject) ProtoMessage()
func (*AuditSubject) ProtoReflect ¶ added in v0.63.5
func (x *AuditSubject) ProtoReflect() protoreflect.Message
func (*AuditSubject) Reset ¶ added in v0.63.5
func (x *AuditSubject) Reset()
func (*AuditSubject) String ¶ added in v0.63.5
func (x *AuditSubject) String() string
type AuthzServiceClient ¶
type AuthzServiceClient interface {
// Evaluate checks whether the subject encoded in token is permitted to
// perform action on resource, given the supplied context attributes.
Evaluate(ctx context.Context, in *EvaluateRequest, opts ...grpc.CallOption) (*EvaluateResponse, error)
// BatchEvaluate runs multiple independent Evaluate checks in a single
// round-trip. Responses are returned in the same order as the requests.
// Useful for filtering a list (e.g. which blueprints the user may launch).
BatchEvaluate(ctx context.Context, in *BatchEvaluateRequest, opts ...grpc.CallOption) (*BatchEvaluateResponse, error)
// GetAuditQuerySchema returns the query.v1.Descriptor advertising which
// recorded audit fields are queryable/sortable via QueryAudit, and which
// operators are valid on each.
GetAuditQuerySchema(ctx context.Context, in *GetAuditQuerySchemaRequest, opts ...grpc.CallOption) (*v1.Descriptor, error)
// QueryAudit retrieves recorded policy-evaluation audit entries matching a
// generic query.v1.Payload, as advertised by GetAuditQuerySchema. Callers
// are responsible for authorizing who may query the audit trail before
// calling this RPC — like the identity service's admin-only mutations,
// there is no per-call authz check here.
QueryAudit(ctx context.Context, in *QueryAuditRequest, opts ...grpc.CallOption) (*AuditList, error)
// GetVersionInfo returns build and version metadata for this service: its
// released semantic version, the git commit it was built from, and a short
// description of what the service does.
GetVersionInfo(ctx context.Context, in *v11.GetVersionInfoRequest, opts ...grpc.CallOption) (*v11.GetVersionInfoResponse, error)
}
AuthzServiceClient is the client API for AuthzService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
AuthzService evaluates authorization requests against an OPA Rego policy stored on the server. The caller must supply a signed JWT; the service verifies the token and extracts subject claims before policy evaluation.
func NewAuthzServiceClient ¶
func NewAuthzServiceClient(cc grpc.ClientConnInterface) AuthzServiceClient
type AuthzServiceServer ¶
type AuthzServiceServer interface {
// Evaluate checks whether the subject encoded in token is permitted to
// perform action on resource, given the supplied context attributes.
Evaluate(context.Context, *EvaluateRequest) (*EvaluateResponse, error)
// BatchEvaluate runs multiple independent Evaluate checks in a single
// round-trip. Responses are returned in the same order as the requests.
// Useful for filtering a list (e.g. which blueprints the user may launch).
BatchEvaluate(context.Context, *BatchEvaluateRequest) (*BatchEvaluateResponse, error)
// GetAuditQuerySchema returns the query.v1.Descriptor advertising which
// recorded audit fields are queryable/sortable via QueryAudit, and which
// operators are valid on each.
GetAuditQuerySchema(context.Context, *GetAuditQuerySchemaRequest) (*v1.Descriptor, error)
// QueryAudit retrieves recorded policy-evaluation audit entries matching a
// generic query.v1.Payload, as advertised by GetAuditQuerySchema. Callers
// are responsible for authorizing who may query the audit trail before
// calling this RPC — like the identity service's admin-only mutations,
// there is no per-call authz check here.
QueryAudit(context.Context, *QueryAuditRequest) (*AuditList, error)
// GetVersionInfo returns build and version metadata for this service: its
// released semantic version, the git commit it was built from, and a short
// description of what the service does.
GetVersionInfo(context.Context, *v11.GetVersionInfoRequest) (*v11.GetVersionInfoResponse, error)
// contains filtered or unexported methods
}
AuthzServiceServer is the server API for AuthzService service. All implementations must embed UnimplementedAuthzServiceServer for forward compatibility.
AuthzService evaluates authorization requests against an OPA Rego policy stored on the server. The caller must supply a signed JWT; the service verifies the token and extracts subject claims before policy evaluation.
type BatchEvaluateRequest ¶
type BatchEvaluateRequest struct {
Requests []*EvaluateRequest `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"`
// capability_check marks every request in this batch as a synthetic
// "what can I do" probe (e.g. built from authz.CapabilityChecks()) rather
// than a real access attempt. Policy-decision auditing should record and
// classify these separately from genuine authorization decisions.
CapabilityCheck bool `protobuf:"varint,2,opt,name=capability_check,json=capabilityCheck,proto3" json:"capability_check,omitempty"`
// contains filtered or unexported fields
}
BatchEvaluateRequest carries one or more independent checks.
func (*BatchEvaluateRequest) Descriptor
deprecated
func (*BatchEvaluateRequest) Descriptor() ([]byte, []int)
Deprecated: Use BatchEvaluateRequest.ProtoReflect.Descriptor instead.
func (*BatchEvaluateRequest) GetCapabilityCheck ¶ added in v0.32.1
func (x *BatchEvaluateRequest) GetCapabilityCheck() bool
func (*BatchEvaluateRequest) GetRequests ¶
func (x *BatchEvaluateRequest) GetRequests() []*EvaluateRequest
func (*BatchEvaluateRequest) ProtoMessage ¶
func (*BatchEvaluateRequest) ProtoMessage()
func (*BatchEvaluateRequest) ProtoReflect ¶
func (x *BatchEvaluateRequest) ProtoReflect() protoreflect.Message
func (*BatchEvaluateRequest) Reset ¶
func (x *BatchEvaluateRequest) Reset()
func (*BatchEvaluateRequest) String ¶
func (x *BatchEvaluateRequest) String() string
type BatchEvaluateResponse ¶
type BatchEvaluateResponse struct {
Responses []*EvaluateResponse `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"`
// contains filtered or unexported fields
}
BatchEvaluateResponse carries one response per request, in the same order.
func (*BatchEvaluateResponse) Descriptor
deprecated
func (*BatchEvaluateResponse) Descriptor() ([]byte, []int)
Deprecated: Use BatchEvaluateResponse.ProtoReflect.Descriptor instead.
func (*BatchEvaluateResponse) GetResponses ¶
func (x *BatchEvaluateResponse) GetResponses() []*EvaluateResponse
func (*BatchEvaluateResponse) ProtoMessage ¶
func (*BatchEvaluateResponse) ProtoMessage()
func (*BatchEvaluateResponse) ProtoReflect ¶
func (x *BatchEvaluateResponse) ProtoReflect() protoreflect.Message
func (*BatchEvaluateResponse) Reset ¶
func (x *BatchEvaluateResponse) Reset()
func (*BatchEvaluateResponse) String ¶
func (x *BatchEvaluateResponse) String() string
type EvaluateRequest ¶
type EvaluateRequest struct {
// token is the signed JWT for the already-authenticated user.
// The service verifies the signature and extracts claims as the OPA subject.
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
// action is the operation being attempted, in "resource_type:verb" form.
// Examples: "blueprint:launch", "workspace:delete", "app:access".
Action string `protobuf:"bytes,2,opt,name=action,proto3" json:"action,omitempty"`
// resource is the object the action is being performed on.
Resource *Resource `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"`
// context carries ambient attributes not present in the JWT or resource,
// e.g. "namespace", "environment", "team".
Context map[string]string `` /* 141-byte string literal not displayed */
// package is the OPA policy package to evaluate the request against
Package string `protobuf:"bytes,5,opt,name=package,proto3" json:"package,omitempty"`
// pat_preview is the display prefix (identity.access_tokens.token_preview)
// of the Personal Access Token that was exchanged for this request's JWT,
// set by the caller that performed the exchange (e.g. an API gateway).
// Empty when the request was not authenticated via a PAT. This is
// caller-asserted, not cryptographically verified — it must only be used
// for audit/observability, never as an input to the authorization
// decision itself.
PatPreview string `protobuf:"bytes,6,opt,name=pat_preview,json=patPreview,proto3" json:"pat_preview,omitempty"`
// contains filtered or unexported fields
}
EvaluateRequest is the input to a single authorization check.
func (*EvaluateRequest) Descriptor
deprecated
func (*EvaluateRequest) Descriptor() ([]byte, []int)
Deprecated: Use EvaluateRequest.ProtoReflect.Descriptor instead.
func (*EvaluateRequest) GetAction ¶
func (x *EvaluateRequest) GetAction() string
func (*EvaluateRequest) GetContext ¶
func (x *EvaluateRequest) GetContext() map[string]string
func (*EvaluateRequest) GetPackage ¶
func (x *EvaluateRequest) GetPackage() string
func (*EvaluateRequest) GetPatPreview ¶ added in v0.38.0
func (x *EvaluateRequest) GetPatPreview() string
func (*EvaluateRequest) GetResource ¶
func (x *EvaluateRequest) GetResource() *Resource
func (*EvaluateRequest) GetToken ¶
func (x *EvaluateRequest) GetToken() string
func (*EvaluateRequest) ProtoMessage ¶
func (*EvaluateRequest) ProtoMessage()
func (*EvaluateRequest) ProtoReflect ¶
func (x *EvaluateRequest) ProtoReflect() protoreflect.Message
func (*EvaluateRequest) Reset ¶
func (x *EvaluateRequest) Reset()
func (*EvaluateRequest) String ¶
func (x *EvaluateRequest) String() string
type EvaluateResponse ¶
type EvaluateResponse struct {
// allowed is true when the policy permits the action.
Allowed bool `protobuf:"varint,1,opt,name=allowed,proto3" json:"allowed,omitempty"`
// reason is a human-readable explanation of the decision.
// Populated on both allow and deny.
Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"`
// obligations carries effective attributes after policy enforcement.
// Callers must apply these key/value pairs to the resource or request
// before proceeding — e.g. forcing "privileged" to "false" for non-admins.
// Empty when the policy imposes no additional constraints.
Obligations map[string]string `` /* 149-byte string literal not displayed */
// contains filtered or unexported fields
}
EvaluateResponse is the result of a single authorization check.
func (*EvaluateResponse) Descriptor
deprecated
func (*EvaluateResponse) Descriptor() ([]byte, []int)
Deprecated: Use EvaluateResponse.ProtoReflect.Descriptor instead.
func (*EvaluateResponse) GetAllowed ¶
func (x *EvaluateResponse) GetAllowed() bool
func (*EvaluateResponse) GetObligations ¶
func (x *EvaluateResponse) GetObligations() map[string]string
func (*EvaluateResponse) GetReason ¶
func (x *EvaluateResponse) GetReason() string
func (*EvaluateResponse) ProtoMessage ¶
func (*EvaluateResponse) ProtoMessage()
func (*EvaluateResponse) ProtoReflect ¶
func (x *EvaluateResponse) ProtoReflect() protoreflect.Message
func (*EvaluateResponse) Reset ¶
func (x *EvaluateResponse) Reset()
func (*EvaluateResponse) String ¶
func (x *EvaluateResponse) String() string
type GetAuditQuerySchemaRequest ¶ added in v0.39.0
type GetAuditQuerySchemaRequest struct {
// contains filtered or unexported fields
}
GetAuditQuerySchemaRequest requests the query.v1.Descriptor for the audit resource. It carries no fields today; left as a message rather than google.protobuf.Empty so parameters (e.g. org-scoping) can be added later without changing the RPC signature.
func (*GetAuditQuerySchemaRequest) Descriptor
deprecated
added in
v0.39.0
func (*GetAuditQuerySchemaRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetAuditQuerySchemaRequest.ProtoReflect.Descriptor instead.
func (*GetAuditQuerySchemaRequest) ProtoMessage ¶ added in v0.39.0
func (*GetAuditQuerySchemaRequest) ProtoMessage()
func (*GetAuditQuerySchemaRequest) ProtoReflect ¶ added in v0.39.0
func (x *GetAuditQuerySchemaRequest) ProtoReflect() protoreflect.Message
func (*GetAuditQuerySchemaRequest) Reset ¶ added in v0.39.0
func (x *GetAuditQuerySchemaRequest) Reset()
func (*GetAuditQuerySchemaRequest) String ¶ added in v0.39.0
func (x *GetAuditQuerySchemaRequest) String() string
type QueryAuditRequest ¶ added in v0.39.0
type QueryAuditRequest struct {
Query *v1.Payload `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
// contains filtered or unexported fields
}
QueryAuditRequest carries a generic query against the fields advertised by GetAuditQuerySchema.
func (*QueryAuditRequest) Descriptor
deprecated
added in
v0.39.0
func (*QueryAuditRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryAuditRequest.ProtoReflect.Descriptor instead.
func (*QueryAuditRequest) GetQuery ¶ added in v0.39.0
func (x *QueryAuditRequest) GetQuery() *v1.Payload
func (*QueryAuditRequest) ProtoMessage ¶ added in v0.39.0
func (*QueryAuditRequest) ProtoMessage()
func (*QueryAuditRequest) ProtoReflect ¶ added in v0.39.0
func (x *QueryAuditRequest) ProtoReflect() protoreflect.Message
func (*QueryAuditRequest) Reset ¶ added in v0.39.0
func (x *QueryAuditRequest) Reset()
func (*QueryAuditRequest) String ¶ added in v0.39.0
func (x *QueryAuditRequest) String() string
type Resource ¶
type Resource struct {
// type is the resource kind: "blueprint", "workspace", "app", etc.
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
// id is the resource name or unique identifier.
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
// attributes carries ABAC metadata about the resource, e.g.:
// "owner" -> username
// "org" -> organization
// "visibility" -> "public" | "private"
Attributes map[string]string `` /* 147-byte string literal not displayed */
// contains filtered or unexported fields
}
Resource identifies the object being acted upon.
func (*Resource) Descriptor
deprecated
func (*Resource) GetAttributes ¶
func (*Resource) ProtoMessage ¶
func (*Resource) ProtoMessage()
func (*Resource) ProtoReflect ¶
func (x *Resource) ProtoReflect() protoreflect.Message
type UnimplementedAuthzServiceServer ¶
type UnimplementedAuthzServiceServer struct{}
UnimplementedAuthzServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedAuthzServiceServer) BatchEvaluate ¶
func (UnimplementedAuthzServiceServer) BatchEvaluate(context.Context, *BatchEvaluateRequest) (*BatchEvaluateResponse, error)
func (UnimplementedAuthzServiceServer) Evaluate ¶
func (UnimplementedAuthzServiceServer) Evaluate(context.Context, *EvaluateRequest) (*EvaluateResponse, error)
func (UnimplementedAuthzServiceServer) GetAuditQuerySchema ¶ added in v0.39.0
func (UnimplementedAuthzServiceServer) GetAuditQuerySchema(context.Context, *GetAuditQuerySchemaRequest) (*v1.Descriptor, error)
func (UnimplementedAuthzServiceServer) GetVersionInfo ¶ added in v0.49.0
func (UnimplementedAuthzServiceServer) GetVersionInfo(context.Context, *v11.GetVersionInfoRequest) (*v11.GetVersionInfoResponse, error)
func (UnimplementedAuthzServiceServer) QueryAudit ¶ added in v0.39.0
func (UnimplementedAuthzServiceServer) QueryAudit(context.Context, *QueryAuditRequest) (*AuditList, error)
type UnsafeAuthzServiceServer ¶
type UnsafeAuthzServiceServer interface {
// contains filtered or unexported methods
}
UnsafeAuthzServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AuthzServiceServer will result in compilation errors.