Documentation
¶
Overview ¶
Package authorization resolves product permissions from stable Role identities.
Index ¶
- Constants
- func CanReceiveAgentShare(workspaceID string, workspaceGrants []gatewaydb.PermissionAction, ...) (bool, error)
- type Agent
- type AgentCapabilities
- type DelegationClaims
- type Effective
- func (e Effective) Active() bool
- func (e Effective) AgentCapabilities(scope Scope, agent Agent) (AgentCapabilities, error)
- func (e Effective) Allows(scope Scope, operation Operation) bool
- func (e Effective) CanAdminister(scope Scope) bool
- func (e Effective) CanDelegate(scope Scope, resource gatewaydb.PermissionResource) bool
- func (e Effective) CanReceiveAgentShare(scope Scope, grants []gatewaydb.AgentShareCapability) (bool, error)
- func (e Effective) HasAccess(scope Scope) bool
- type Operation
- type Queries
- type Resolver
- type Scope
- type Subject
Constants ¶
const DelegationLabel = "agentz.accuknox.com/delegation"
DelegationLabel identifies controller-owned OAuth resource routes.
Variables ¶
This section is empty.
Functions ¶
func CanReceiveAgentShare ¶
func CanReceiveAgentShare(workspaceID string, workspaceGrants []gatewaydb.PermissionAction, administrator bool, grants []gatewaydb.AgentShareCapability) (bool, error)
CanReceiveAgentShare reports whether the supplied Workspace grants support every effective capability in the proposed Agent Share.
Types ¶
type AgentCapabilities ¶
type AgentCapabilities struct {
Use bool
Modify bool
Delete bool
ManageOwnership bool
ReadSecrets bool
WriteSecrets bool
DeleteSecrets bool
}
AgentCapabilities is the complete action projection for one Agent.
func (AgentCapabilities) CoversShare ¶
func (c AgentCapabilities) CoversShare(grants []gatewaydb.AgentShareCapability) bool
CoversShare reports whether these effective capabilities contain every action represented by the proposed Agent Share grants.
type DelegationClaims ¶ added in v0.29.0
type DelegationClaims struct {
jwt.RegisteredClaims
ClientID string `json:"azp"`
GrantID string `json:"agentz_grant_id"`
Scope string `json:"scope"`
SessionID string `json:"sid"`
}
DelegationClaims binds an OAuth access token to its immutable AgentZ grant.
func VerifyDelegationToken ¶ added in v0.29.0
func VerifyDelegationToken(bearer, issuer, audience string, key jwt.Keyfunc) (DelegationClaims, error)
VerifyDelegationToken checks the access-token contract before live authorization.
type Effective ¶
type Effective struct {
// contains filtered or unexported fields
}
Effective is an immutable snapshot of one Subject's effective permissions.
func (Effective) Active ¶
Active reports whether the subject has an enabled Membership in the Organisation. A grant-free active Membership remains active.
func (Effective) AgentCapabilities ¶
func (e Effective) AgentCapabilities(scope Scope, agent Agent) (AgentCapabilities, error)
AgentCapabilities evaluates Workspace grants, ownership, and Agent Shares through the Cedar policy set.
func (Effective) Allows ¶
Allows reports whether an explicitly mapped operation is allowed in the exact scope.
func (Effective) CanAdminister ¶
CanAdminister reports whether a built-in role bypass applies to the exact scope.
func (Effective) CanDelegate ¶ added in v0.29.0
func (e Effective) CanDelegate(scope Scope, resource gatewaydb.PermissionResource) bool
CanDelegate reports whether external apps may use a resource in the selected workspace.
func (Effective) CanReceiveAgentShare ¶
func (e Effective) CanReceiveAgentShare(scope Scope, grants []gatewaydb.AgentShareCapability) (bool, error)
CanReceiveAgentShare reports whether the subject's Workspace grants support every effective capability in the proposed Agent Share.
type Operation ¶
type Operation string
Operation identifies a generated gateway operation.
const ( // OperationListGuardrailConnections manages scoped prompt safeguards. OperationListGuardrailConnections Operation = "listGuardrailConnections" // OperationGetGuardrailConnection manages scoped prompt safeguards. OperationGetGuardrailConnection Operation = "getGuardrailConnection" // OperationDiscoverGuardrailConnectionResources browses resources using a saved connection. OperationDiscoverGuardrailConnectionResources Operation = "discoverGuardrailConnectionResources" // OperationCreateGuardrailConnection manages scoped prompt safeguards. OperationCreateGuardrailConnection Operation = "createGuardrailConnection" // OperationUpdateGuardrailConnection manages scoped prompt safeguards. OperationUpdateGuardrailConnection Operation = "updateGuardrailConnection" // OperationDeleteGuardrailConnection manages scoped prompt safeguards. OperationDeleteGuardrailConnection Operation = "deleteGuardrailConnection" // OperationListGuardrailPolicies manages scoped prompt safeguards. OperationListGuardrailPolicies Operation = "listGuardrailPolicies" // OperationGetGuardrailPolicy manages scoped prompt safeguards. OperationGetGuardrailPolicy Operation = "getGuardrailPolicy" // OperationCreateGuardrailPolicy manages scoped prompt safeguards. OperationCreateGuardrailPolicy Operation = "createGuardrailPolicy" // OperationUpdateGuardrailPolicy manages scoped prompt safeguards. OperationUpdateGuardrailPolicy Operation = "updateGuardrailPolicy" // OperationDeleteGuardrailPolicy manages scoped prompt safeguards. OperationDeleteGuardrailPolicy Operation = "deleteGuardrailPolicy" // OperationGetGuardrailSettings reads organization guardrail settings. OperationGetGuardrailSettings Operation = "getGuardrailSettings" // OperationGetEffectiveGuardrails resolves mandatory and optional guardrail checks. OperationGetEffectiveGuardrails Operation = "getEffectiveGuardrails" // OperationUpdateGuardrailSettings changes the organization baseline. OperationUpdateGuardrailSettings Operation = "updateGuardrailSettings" // OperationListGuardrailEvents reads scoped guardrail audit history. OperationListGuardrailEvents Operation = "listGuardrailEvents" // OperationGetGuardrailEvent reads a retained evaluation and captured content. OperationGetGuardrailEvent Operation = "getGuardrailEvent" // OperationListSkills lists immutable Skill resources. OperationListSkills Operation = "listSkills" // OperationCreateSkill creates an immutable Skill resource. OperationCreateSkill Operation = "createSkill" // OperationUpdateSkill modifies an immutable Skill resource. OperationUpdateSkill Operation = "updateSkill" // OperationDeleteSkill deletes an immutable Skill resource. OperationDeleteSkill Operation = "deleteSkill" // OperationListSandboxes lists Sandbox resources. OperationListSandboxes Operation = "listSandboxes" // OperationCreateSandbox creates a Sandbox resource. OperationCreateSandbox Operation = "createSandbox" // OperationUpdateSandbox modifies a Sandbox resource. OperationUpdateSandbox Operation = "updateSandbox" // OperationDeleteSandbox deletes a Sandbox resource. OperationDeleteSandbox Operation = "deleteSandbox" // OperationListMCPConnections lists MCP Connection resources. OperationListMCPConnections Operation = "listMCPConnections" // OperationWatchMCPConnections watches MCP Connection resources. OperationWatchMCPConnections Operation = "watchMCPConnections" // OperationGetMCPConnection reads one MCP Connection resource. OperationGetMCPConnection Operation = "getMCPConnection" // OperationCreateMCPConnection creates an MCP Connection resource. OperationCreateMCPConnection Operation = "createMCPConnection" // OperationReauthenticateMCPConnection replaces MCP credentials. OperationReauthenticateMCPConnection Operation = "reauthenticateMCPConnection" // OperationDeleteMCPConnection deletes an MCP Connection resource. OperationDeleteMCPConnection Operation = "deleteMCPConnection" // OperationListInferenceProviders lists Inference Provider resources. OperationListInferenceProviders Operation = "listInferenceProviders" // OperationWatchInferenceProviders watches Inference Provider resources. OperationWatchInferenceProviders Operation = "watchInferenceProviders" // OperationGetInferenceProvider reads one Inference Provider resource. OperationGetInferenceProvider Operation = "getInferenceProvider" // OperationGetInferenceProviderUsage reads Inference Provider usage. OperationGetInferenceProviderUsage Operation = "getInferenceProviderUsage" // OperationRefreshInferenceProviderModels reads current Provider models. OperationRefreshInferenceProviderModels Operation = "refreshInferenceProviderModels" // OperationListInferenceProviderCatalog reads the Provider catalog. OperationListInferenceProviderCatalog Operation = "listInferenceProviderCatalog" // OperationListInferenceModelSuggestions reads catalog model suggestions. OperationListInferenceModelSuggestions Operation = "listInferenceModelSuggestions" // OperationCreateInferenceProvider creates an Inference Provider resource. OperationCreateInferenceProvider Operation = "createInferenceProvider" // OperationCreateInferenceProviderOAuthTicket creates Provider credentials. OperationCreateInferenceProviderOAuthTicket Operation = "createInferenceProviderOAuthTicket" // OperationReauthenticateInferenceProviderOAuthTicket authorizes // subscription replacement sign-in. OperationReauthenticateInferenceProviderOAuthTicket Operation = "reauthenticateInferenceProviderOAuthTicket" // OperationUpdateInferenceProvider modifies an Inference Provider resource. OperationUpdateInferenceProvider Operation = "updateInferenceProvider" // OperationDeleteInferenceProvider deletes an Inference Provider resource. OperationDeleteInferenceProvider Operation = "deleteInferenceProvider" // OperationListInferencePools lists Inference Pool resources. OperationListInferencePools Operation = "listInferencePools" // OperationWatchInferencePools watches Inference Pool resources. OperationWatchInferencePools Operation = "watchInferencePools" // OperationGetInferencePool reads one Inference Pool resource. OperationGetInferencePool Operation = "getInferencePool" // OperationGetInferencePoolUsage reads Inference Pool usage. OperationGetInferencePoolUsage Operation = "getInferencePoolUsage" // OperationCreateInferencePool creates an Inference Pool resource. OperationCreateInferencePool Operation = "createInferencePool" // OperationUpdateInferencePool modifies an Inference Pool resource. OperationUpdateInferencePool Operation = "updateInferencePool" // OperationDeleteInferencePool deletes an Inference Pool resource. OperationDeleteInferencePool Operation = "deleteInferencePool" // OperationListAgents lists Agent resources. OperationListAgents Operation = "listAgents" // OperationWatchAgents watches Agent resources. OperationWatchAgents Operation = "watchAgents" // OperationCreateAgent creates an Agent resource. OperationCreateAgent Operation = "createAgent" // OperationUpdateAgent modifies an Agent resource. OperationUpdateAgent Operation = "updateAgent" // OperationDeleteAgent deletes an Agent resource. OperationDeleteAgent Operation = "deleteAgent" OperationShareAuthoredAgent Operation = "shareAuthoredAgent" OperationShareNonAuthoredAgent Operation = "shareNonAuthoredAgent" OperationUseSharedAgent Operation = "useSharedAgent" OperationReadSharedSecret Operation = "readSharedSecret" OperationWriteSharedSecret Operation = "writeSharedSecret" OperationDeleteSharedSecret Operation = "deleteSharedSecret" // OperationListAPIKeys lists Workspace API key metadata. OperationListAPIKeys Operation = "listAPIKeys" // OperationCreateAPIKey creates a Workspace API key. OperationCreateAPIKey Operation = "createAPIKey" // OperationDeleteAPIKey deletes a Workspace API key. OperationDeleteAPIKey Operation = "deleteAPIKey" // OperationReadObservability reads Workspace observability. OperationReadObservability Operation = "readObservability" )
func (Operation) BearerScope ¶
BearerScope returns the generated bearer scope for the operation.
type Queries ¶
type Queries interface {
GatewayResolvePermissions(ctx context.Context, arg gatewaydb.GatewayResolvePermissionsParams) ([]gatewaydb.GatewayResolvePermissionsRow, error)
}
Queries is the generated persistence used to resolve assigned Role grants.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver resolves direct and Team Role grants for one active Organisation Membership.