OpenAgentID documentation
Source referencesRust module referencearsenal-broker

arsenal-broker · consent_service

Declared module signatures, types, configuration, and source documentation.

Source: arsenal/crates/arsenal-broker/src/consent_service.rs. SHA-256: d5bc3cfdbde82b3e2544445f990fce58684a28f34883bbf99c3b2e6ff7950a06.

This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.

Service for managing consent records.

pub struct ConsentService {

}

Source line: 32.

Create a new consent service without signature verification.

#[must_use]
pub fn new(
        consent_store: Arc<dyn ConsentStore>,
        audit_sink: Arc<dyn AuditSink>,
        config: ConsentConfig,
    ) -> Self;

Source line: 46.

Create a consent service with signature verification enabled.

#[must_use]
pub fn with_key_resolver(
        consent_store: Arc<dyn ConsentStore>,
        audit_sink: Arc<dyn AuditSink>,
        key_resolver: Arc<dyn PublicKeyResolver>,
        config: ConsentConfig,
    ) -> Self;

Source line: 61.

Check if valid consent exists for an agent, variable, and tenant.

Consent records are scoped to a tenant to prevent cross-tenant consent leakage in multi-tenant deployments.

Errors

Returns an error if the consent store lookup fails.

pub async fn check_consent(
        &self,
        agent_did: &str,
        variable: &str,
        tenant_id: &TenantId,
    ) -> ArsenalResult<ConsentStatus>;

Source line: 83.

Store an approved consent record.

Errors

Returns an error if the record is invalid or storage fails.

pub async fn approve_consent(
        &self,
        record: ConsentRecord,
        tenant_id: &TenantId,
        ctx: &RequestContext,
    ) -> ArsenalResult<ConsentRecord>;

Source line: 114.

Deny a consent request.

This is a no-store operation — denied requests are only audited, not persisted as records.

pub async fn deny_consent(
        &self,
        request: &ConsentRequest,
        tenant_id: &TenantId,
        ctx: &RequestContext,
    );

Source line: 175.

Revoke an existing consent record.

Errors

Returns an error if the consent ID is not found or storage fails.

pub async fn revoke_consent(
        &self,
        consent_id: &ConsentId,
        tenant_id: &TenantId,
        ctx: &RequestContext,
    ) -> ArsenalResult<()>;

Source line: 200.

List consent records for an agent.

Errors

Returns an error if the consent store lookup fails.

pub async fn list_consents(&self, agent_did: &str) -> ArsenalResult<Vec<ConsentRecord>>;

Source line: 233.

Get a consent record by ID.

Errors

Returns an error if the consent store lookup fails.

pub async fn get_consent(
        &self,
        consent_id: &ConsentId,
    ) -> ArsenalResult<Option<ConsentRecord>>;

Source line: 245.

Run cleanup of expired consent records.

Returns the number of records cleaned up.

pub async fn cleanup_expired(&self) -> u64;

Source line: 258.

On this page