PtcRunner.Kernel.MCPOAuth.LocalFences (PtcRunner v0.14.0)

Copy Markdown View Source

Runtime-shared fail-closed fences for OAuth response transitions.

Durable store transitions remain authoritative. Each secret-free transition has its own :persistent_term key, so publishing it is atomic and does not depend on a process that can restart between a server response and durable persistence. Admission reads one runtime snapshot and conservatively erases only fences satisfied by a strictly newer grant. Identities are opaque digests; token, principal, and endpoint values are never retained.

Summary

Types

fence()

@type fence() ::
  {:rejected_generation, non_neg_integer()}
  | {:scope_requirement, non_neg_integer(), MapSet.t(binary())}

identity()

@type identity() :: binary()

Functions

admit(identity, generation, granted_scopes)

@spec admit(identity(), non_neg_integer(), MapSet.t(binary())) ::
  :ok | {:error, :authorization_required}

block(identity, operation_ref, fence)

@spec block(identity(), reference(), fence()) :: :ok

identity(store, key)

resolve(identity, operation_ref)

@spec resolve(identity(), reference()) :: :ok