Documentation
¶
Overview ¶
Package security defines the authorization boundary for remote Dispatch operators.
Index ¶
- Constants
- Variables
- func BulkTarget(queue string, limit int, before time.Time, dryRun bool) (string, error)
- func CreationTarget(kind, name, queue string) (string, error)
- func Metadata(p Principal) durable.AuditMetadata
- func ResourceTarget(prefix id.Prefix, raw string) (string, error)
- type AuditService
- type Authenticator
- type AuthenticatorFunc
- type Authorizer
- type AuthorizerFunc
- type Boundary
- func (b Boundary) AcceptOutcome(ctx context.Context, o durable.LegacyOutcome) error
- func (b Boundary) AuthenticationDenied(ctx context.Context, op Operation) error
- func (b Boundary) BeginCommand(ctx context.Context, p Principal, op Operation) (attempt CommandAttempt, auditErr error)
- func (b Boundary) Check(ctx context.Context, p Principal, op Operation) error
- func (b Boundary) CheckNamespace(ctx context.Context, p Principal, op Operation, namespace string) error
- func (b Boundary) DurableReadsReady() bool
- func (b Boundary) FinishCommand(ctx context.Context, a CommandAttempt, success bool) error
- func (b Boundary) RecordDurableRead(ctx context.Context, p Principal, action, outcome, namespace string, ...) error
- type CommandAttempt
- type ForgeAuthenticator
- type Operation
- type OutcomeUnconfirmedError
- type Principal
- type Resource
- type WardenAuthorizer
Constants ¶
const ( OperatorRead = "dispatch.installation.read" OperatorWrite = "dispatch.installation.write" PayloadRead = "dispatch.installation.payload.read" Subscribe = "dispatch.installation.subscribe" Federation = "dispatch.installation.federation" )
const CheckTimeout = 5 * time.Second
const StreamLifetime = 5 * time.Minute
Variables ¶
var ( ErrUnauthenticated = errors.New("dispatch: authentication required") ErrForbidden = errors.New("dispatch: access denied") )
Functions ¶
func BulkTarget ¶
BulkTarget describes the effective bounded replay or purge selection.
func CreationTarget ¶
CreationTarget identifies the input selector before an output ID exists.
func Metadata ¶
func Metadata(p Principal) durable.AuditMetadata
Metadata retains the verified machine actor kind. It never copies raw claims.
Types ¶
type AuditService ¶
type AuditService struct {
// contains filtered or unexported fields
}
AuditService is a shared activation handle. Route copies keep this pointer; Activate verifies its binding after migrations. The extension enables remote admission only after the engine starts successfully. A zero or inactive handle fails closed.
func (*AuditService) AcceptanceFailures ¶
func (a *AuditService) AcceptanceFailures() uint64
AcceptanceFailures counts local audit acceptance failures, without provider text or recursive audit events. Persisted unresolved attempts survive restart.
func (*AuditService) Activate ¶
func (a *AuditService) Activate(ctx context.Context, store durable.OutboxStore, catalog durable.NamespaceStore, resource Resource, namespace string, allowNamespaceFallback bool) error
Activate verifies the persisted host binding; caller input never selects it.
func (*AuditService) Deactivate ¶
func (a *AuditService) Deactivate()
type Authenticator ¶
type AuthenticatorFunc ¶
func (AuthenticatorFunc) Authenticate ¶
type Authorizer ¶
type AuthorizerFunc ¶
type Boundary ¶
type Boundary struct {
Resource Resource
Authorizer Authorizer
Audit *AuditService
}
Boundary always denies incomplete configuration and bounds policy work.
func (Boundary) AcceptOutcome ¶
func (Boundary) AuthenticationDenied ¶
AuthenticationDenied records anonymous admission without retaining credentials or provider errors. Audit failure never changes the denial into authorization.
func (Boundary) BeginCommand ¶
func (Boundary) CheckNamespace ¶
func (b Boundary) CheckNamespace(ctx context.Context, p Principal, op Operation, namespace string) error
CheckNamespace uses an already resolved authorized namespace for successful read auditing. Unresolved and denied attempts always use the host binding.
func (Boundary) DurableReadsReady ¶
DurableReadsReady preserves the extension's post-start admission barrier.
func (Boundary) FinishCommand ¶
func (Boundary) RecordDurableRead ¶
func (b Boundary) RecordDurableRead(ctx context.Context, p Principal, action, outcome, namespace string, targets ...durable.Key) error
RecordDurableRead accepts denial and sensitive-read audit before protected data leaves the operator service. Successful scope comes from the persisted catalog.
type CommandAttempt ¶
type CommandAttempt struct{ Record durable.LegacyAttempt }
CommandAttempt identifies durable evidence accepted before legacy execution.
func (CommandAttempt) CaptureOutcome ¶
func (a CommandAttempt) CaptureOutcome(success bool) (durable.LegacyOutcome, error)
CaptureOutcome allocates one immutable outcome for safe persistence retries.
type ForgeAuthenticator ¶
ForgeAuthenticator resolves providers on every request. Only provider-attested explicit credentials are accepted, including after an upstream cookie bridge.
func NewForgeAuthenticator ¶
func NewForgeAuthenticator(registry func() (auth.Registry, error), providers ...string) *ForgeAuthenticator
func (*ForgeAuthenticator) Authenticate ¶
type Operation ¶
type Operation struct {
Action string
Payload bool
// AuditAction is the registered operation, separate from its Warden permission.
AuditAction string
Target string
}
func ContractOperation ¶
func DWPOperation ¶
func RESTOperation ¶
RESTOperation uses the registered method and template, never a request label.
type OutcomeUnconfirmedError ¶
type OutcomeUnconfirmedError struct{ AttemptID string }
OutcomeUnconfirmedError means execution may have succeeded. Retrying the command is unsafe; reconcile the retained attempt instead.
func (*OutcomeUnconfirmedError) Error ¶
func (e *OutcomeUnconfirmedError) Error() string
func (*OutcomeUnconfirmedError) Unwrap ¶
func (e *OutcomeUnconfirmedError) Unwrap() error
type Principal ¶
type Principal struct{ Subject, Kind string }
Principal is a verified server identity. Request filters never establish authority.
type WardenAuthorizer ¶
WardenAuthorizer resolves the host policy engine lazily. Unhandled obligations deny even an otherwise allowed decision.