Documentation
¶
Index ¶
- Constants
- func CanCapturedCompletionAuthority(ctx context.Context, snapshot model.CompletionAuthoritySnapshot) (bool, error)
- func CanWithResolvedFacts(ctx context.Context, action model.Action, resource model.Resource, ...) (bool, error)
- func DelegatedOperationInScope(ctx context.Context, operation string) bool
- func DelegationScopeDescriptions(keys []string) []string
- func DelegationScopeKeys(source Source) []string
- func IsGrantableRolePermission(permission model.RolePermission) bool
- func OperationForRoute(method, path string) string
- func ReadOnlyUserDelegationScopeKeys() []string
- func RecentSessionAuthentication(authenticatedAt time.Time) bool
- func WithDecisionScope(ctx context.Context) context.Context
- func WithDelegatedPrincipal(ctx context.Context, principal DelegatedPrincipal, scopeKeys []string, ...) context.Context
- type DelegatedPrincipal
- type Input
- type ResolveFacts
- type RolePermissionOption
- type Service
- type ServiceWithLogging
- type Source
Constants ¶
const ( OperationRegisterMCPMachineClient = "registerMCPMachineClient" OperationDisconnectMCPMachineClient = "disconnectMCPMachineClient" )
Variables ¶
This section is empty.
Functions ¶
func CanCapturedCompletionAuthority ¶
func CanCapturedCompletionAuthority(ctx context.Context, snapshot model.CompletionAuthoritySnapshot) (bool, error)
CanCapturedCompletionAuthority evaluates only permission facts read from the scoped completion record.
func CanWithResolvedFacts ¶
func CanWithResolvedFacts(ctx context.Context, action model.Action, resource model.Resource, facts model.AuthorizationFacts) (bool, error)
CanWithResolvedFacts evaluates tenant facts captured by a trusted persistence reader.
func DelegatedOperationInScope ¶
DelegatedOperationInScope checks the verified grant before dispatching to an operation. Callers still need Can for each action and target used by the operation.
func DelegationScopeDescriptions ¶
DelegationScopeDescriptions describes the operation mappings offered during consent.
func DelegationScopeKeys ¶
DelegationScopeKeys captures the current operation mappings for a newly authorized grant.
func IsGrantableRolePermission ¶
func IsGrantableRolePermission(permission model.RolePermission) bool
func OperationForRoute ¶
func ReadOnlyUserDelegationScopeKeys ¶
func ReadOnlyUserDelegationScopeKeys() []string
ReadOnlyUserDelegationScopeKeys returns reviewed reads at their current mapping revision.
func RecentSessionAuthentication ¶
RecentSessionAuthentication is required to change a profile's MFA settings.
func WithDecisionScope ¶
WithDecisionScope carries allowed object identities into subsequent database units of work.
func WithDelegatedPrincipal ¶
func WithDelegatedPrincipal(ctx context.Context, principal DelegatedPrincipal, scopeKeys []string, revalidate func(context.Context, postgres.DBTX) error) context.Context
WithDelegatedPrincipal carries verified authentication and checks it again inside the protected database snapshot. Only the issuer's token verifier should bind a principal.
Types ¶
type DelegatedPrincipal ¶
DelegatedPrincipal identifies the membership or key verified by the OAuth issuer.
func (DelegatedPrincipal) Source ¶
func (p DelegatedPrincipal) Source() Source
type Input ¶
type Input struct {
SessionAuthenticatedAt time.Time // Trusted session authentication time for sensitive self-service changes.
Operation string // Registered action chosen by the server or trusted adapter.
CheckPurpose string // Named secondary check when the same permission protects multiple targets.
Source Source // Authenticated credential type.
UserSlug slug.Slug // The user performing the action
APIKeySlug slug.Slug // Optional API key service principal
APIKeyRoleSlug slug.Slug // Authenticated role used by key management. The resolver verifies it against the current role.
OrgSlug *slug.Slug // Optional: for organization-scoped authorization
Action model.Action // The action being performed
Resource model.Resource // The Core permission family for this check.
ResourceOwnerSlug *slug.Slug // Global profile subject.
Target model.AuthorizationTarget
ProjectDataSourceBindings bool // The operation acts on project-owned references or bindings.
}
type ResolveFacts ¶
type RolePermissionOption ¶
type RolePermissionOption struct {
model.RolePermission
ResourceLabel string
ActionLabel string
}
RolePermissionOption describes a grantable permission and its display labels.
func RolePermissionCatalog ¶
func RolePermissionCatalog() []RolePermissionOption
RolePermissionCatalog returns the permissions supported on organization roles.
type Service ¶
type Service interface {
Can(ctx context.Context, input Input) (bool, error)
EffectivePermissions(ctx context.Context, input Input) ([]model.RolePermission, error)
}
func New ¶
func New(usersService userssvc.UsersService, resolve ResolveFacts) (Service, error)
type ServiceWithLogging ¶
type ServiceWithLogging struct {
// contains filtered or unexported fields
}
ServiceWithLogging implements Service with method completion logging.
func (ServiceWithLogging) EffectivePermissions ¶
func (_d ServiceWithLogging) EffectivePermissions(ctx context.Context, input Input) (ra1 []model.RolePermission, err error)
EffectivePermissions implements Service.
type Source ¶
type Source string
Source is established by authentication, before constructing an authorization input.