Documentation
¶
Overview ¶
Package operation carries the transport-independent authorization contract attached by every network adapter before it invokes a service operation.
Index ¶
- Constants
- func AdmitPreauthentication(ctx context.Context) error
- func AdmitRequest(ctx context.Context, sessionID string) error
- func IsNetwork(ctx context.Context) bool
- func WithContract(ctx context.Context, contract Contract) context.Context
- func WithNetwork(ctx context.Context) context.Context
- func WithPreauthenticationAdmission(ctx context.Context, charge func() error) context.Context
- func WithRequestAdmission(ctx context.Context, charge func(sessionID string) error) context.Context
- type Contract
Constants ¶
const ( ArtifactNone = "none" ArtifactHumanSession = "human-session" ArtifactMachineCredential = "machine-credential" ArtifactDeveloperCredential = "developer-credential" ArtifactSCIMCredential = "scim-credential" ArtifactInstanceCredential = "instance-credential" ArtifactLocal = "local" )
Variables ¶
This section is empty.
Functions ¶
func AdmitPreauthentication ¶
AdmitPreauthentication bounds artifact resolution before its first datastore read. Call after cheap grammar checks, independently of credential liveness. Source identity comes from transport middleware, not tokens. Nested reads and retries reuse the admission outcome, including a refusal.
func AdmitRequest ¶
AdmitRequest charges only a transaction-authenticated human session. Invalid credentials and machine callers cannot allocate or spend human buckets.
func WithContract ¶
WithContract attaches a trusted operation contract to a network request.
func WithNetwork ¶
WithNetwork marks work entered through a network adapter, including public metadata operations that have no authorization contract.
func WithPreauthenticationAdmission ¶
WithPreauthenticationAdmission attaches trusted source admission to one request. Nested reads and transaction retries share accounting, never an authentication or authorization result.
func WithRequestAdmission ¶
WithRequestAdmission attaches accounting, not identity or authorization, to one network request. Transaction retries and nested service reads share the receipt; authentication is still resolved live before every admission.
Types ¶
type Contract ¶
type Contract struct {
ID string
AuthorizationOperation string
// contains filtered or unexported fields
}
Contract is one immutable network-operation admission row. It is built from trusted compiled registry data, never request input.
func FromContext ¶
FromContext returns the network operation contract, when one was attached.
func NewArtifactContract ¶
NewArtifactContract constructs an immutable admission row for a network operation that has an artifact policy but no domain authorization formula.
func NewContract ¶
NewContract constructs a complete immutable operation contract.
func (Contract) AdmitsArtifact ¶
AdmitsArtifact reports whether class is explicitly admitted.