Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::inspect::ControlGrantStore Class Reference

Stores only the client_granted term of the permission equation. More...

#include <control_grants.hpp>

Public Types

using Clock = std::function<std::chrono::steady_clock::time_point()>

Public Member Functions

 ControlGrantStore (ControlIdentityRegistry &identities, std::shared_ptr< ControlSecurityAuditLog > audit_log, ControlGrantStoreConfig config={}, Clock clock=[] { return std::chrono::steady_clock::now();})
 ~ControlGrantStore ()
 ControlGrantStore (const ControlGrantStore &)=delete
ControlGrantStore & operator= (const ControlGrantStore &)=delete
ControlGrantResult issue (ControlGrantRequest request, ControlConsentDecision consent)
 Internal broker call.
ControlGrantStatus revoke (const ControlGrantId &grant_id, std::string_view decision_id)
std::size_t revoke_client (const ControlClientId &client_id, std::string_view decision_id)
std::size_t revoke_registration (const ControlRegistrationId &registration_id, std::string_view decision_id)
bool is_granted (const ControlGrantId &grant_id, const ControlClientId &client_id, const ControlRegistrationId &registration_id, InspectorCapability capability)
std::optional< ControlOperationAuthorization > authorize_operation (const ControlGrantId &grant_id, const ControlClientId &client_id, const ControlRegistrationId &registration_id, InspectorCapability capability, std::string_view operation_identity)
 Atomically reserves the GPU-health capability of an interactive-consent grant for its first durable idempotency identity.
bool commit_operation_authorization (const ControlGrantId &grant_id, std::string_view operation_identity, std::uint64_t reservation_token)
 Commits a provisional one-shot reservation after the durable operation receipt exists.
bool release_operation_authorization (const ControlGrantId &grant_id, std::string_view operation_identity, std::uint64_t reservation_token)
 Releases only the caller's still-provisional reservation.
std::optional< ControlGrant > grant (const ControlGrantId &grant_id)
std::vector< ControlGrant > sweep_expired ()

Detailed Description

Stores only the client_granted term of the permission equation.

A true result does not activate or route an operation; every other term remains independently required at dispatch.

Member Typedef Documentation

◆ Clock

using pulp::inspect::ControlGrantStore::Clock = std::function<std::chrono::steady_clock::time_point()>

Constructor & Destructor Documentation

◆ ControlGrantStore() [1/2]

pulp::inspect::ControlGrantStore::ControlGrantStore ( ControlIdentityRegistry & identities,
std::shared_ptr< ControlSecurityAuditLog > audit_log,
ControlGrantStoreConfig config = {},
Clock clock = [] { return std::chrono::steady_clock::now();} )

◆ ~ControlGrantStore()

pulp::inspect::ControlGrantStore::~ControlGrantStore ( )

◆ ControlGrantStore() [2/2]

pulp::inspect::ControlGrantStore::ControlGrantStore ( const ControlGrantStore & )
delete

Member Function Documentation

◆ authorize_operation()

std::optional< ControlOperationAuthorization > pulp::inspect::ControlGrantStore::authorize_operation ( const ControlGrantId & grant_id,
const ControlClientId & client_id,
const ControlRegistrationId & registration_id,
InspectorCapability capability,
std::string_view operation_identity )

Atomically reserves the GPU-health capability of an interactive-consent grant for its first durable idempotency identity.

Other capabilities on the same grant remain reusable. Once selected, a failed provisional admission may retry only that identity; once committed, only operation-store replay is eligible. The durable store remains the replay authority.

◆ commit_operation_authorization()

bool pulp::inspect::ControlGrantStore::commit_operation_authorization ( const ControlGrantId & grant_id,
std::string_view operation_identity,
std::uint64_t reservation_token )

Commits a provisional one-shot reservation after the durable operation receipt exists.

Once committed, no release can reopen the grant.

◆ grant()

std::optional< ControlGrant > pulp::inspect::ControlGrantStore::grant ( const ControlGrantId & grant_id)

◆ is_granted()

bool pulp::inspect::ControlGrantStore::is_granted ( const ControlGrantId & grant_id,
const ControlClientId & client_id,
const ControlRegistrationId & registration_id,
InspectorCapability capability )

◆ issue()

ControlGrantResult pulp::inspect::ControlGrantStore::issue ( ControlGrantRequest request,
ControlConsentDecision consent )

Internal broker call.

consent.authority is trusted composition-root input and must never be populated from request payload fields.

◆ operator=()

ControlGrantStore & pulp::inspect::ControlGrantStore::operator= ( const ControlGrantStore & )
delete

◆ release_operation_authorization()

bool pulp::inspect::ControlGrantStore::release_operation_authorization ( const ControlGrantId & grant_id,
std::string_view operation_identity,
std::uint64_t reservation_token )

Releases only the caller's still-provisional reservation.

Concurrent reservations, the selected operation identity, and committed grants are preserved.

◆ revoke()

ControlGrantStatus pulp::inspect::ControlGrantStore::revoke ( const ControlGrantId & grant_id,
std::string_view decision_id )

◆ revoke_client()

std::size_t pulp::inspect::ControlGrantStore::revoke_client ( const ControlClientId & client_id,
std::string_view decision_id )

◆ revoke_registration()

std::size_t pulp::inspect::ControlGrantStore::revoke_registration ( const ControlRegistrationId & registration_id,
std::string_view decision_id )

◆ sweep_expired()

std::vector< ControlGrant > pulp::inspect::ControlGrantStore::sweep_expired ( )

The documentation for this class was generated from the following file: