OpenAgentID documentation
Source referencesRust module referenceoas-document

oas-document · reputation

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

Source: oas/oas/oas-document/src/reputation.rs. SHA-256: a4eb12f6b2a4ff47180ef92822356d9383db9b2b419c08e85b89af9bdfac8902.

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.

reputation::ReputationSection

Reputation summary section of an OAS Identity Document.

Trust Model

  • L0/L1: Self-reported — treat as claims, not facts.
  • L2: Backed by third-party attestation service, verifiable via OASAttestationService endpoint.

Examples

use oas_document::reputation::ReputationSection;

let rep = ReputationSection {
    total_interactions: Some(15_420),
    endorsement_count: Some(87),
    trust_score: Some("0.94".to_string()),
    uptime_30d: Some("99.7%".to_string()),
    uptime_90d: Some("99.5%".to_string()),
    first_active: Some("2026-01-15T00:00:00Z".to_string()),
    endorser_dids: vec![
        "did:oas:prod:hmr:alice".to_string(),
        "did:oas:prod:enr:acme".to_string(),
    ],
};
assert_eq!(rep.endorsement_count, Some(87));
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ReputationSection {
/// Total number of interactions/requests served.

#[serde(skip_serializing_if = "Option::is_none")]
pub total_interactions: Option<u64>,
/// Number of endorsements received from other DIDs.

#[serde(skip_serializing_if = "Option::is_none")]
pub endorsement_count: Option<u32>,
/// Aggregated trust score as a decimal string (0.0–1.0).

#[serde(skip_serializing_if = "Option::is_none")]
pub trust_score: Option<String>,
/// Uptime percentage over the last 30 days.

#[serde(skip_serializing_if = "Option::is_none")]
pub uptime_30d: Option<String>,
/// Uptime percentage over the last 90 days.

#[serde(skip_serializing_if = "Option::is_none")]
pub uptime_90d: Option<String>,
/// ISO 8601 timestamp of when this entity first became active.

#[serde(skip_serializing_if = "Option::is_none")]
pub first_active: Option<String>,
/// DIDs of entities that have endorsed this entity.

#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub endorser_dids: Vec<String>
}

Source line: 40.

On this page