oas-lineage · config
Declared module signatures, types, configuration, and source documentation.
Source: oas/oas/oas-lineage/src/config.rs. SHA-256: 0e27fd221acf46d7e641769308ca22fc9b2863914e9bfc81b9f6010168eb6044.
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.
config::TrustAnchor
A verifier-controlled trust anchor for an OAS root document.
Trust anchors are local policy inputs. They are never inferred from the document or proof being verified.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
pub struct TrustAnchor {
/// Root DID authorized by this anchor.
pub did: String,
/// Authorized verification method on the root document.
pub verification_method: String,
/// Authorized Ed25519 public key in multibase format.
pub public_key_multibase: String,
/// Optional commitment to the exact trusted root document state.
pub document_digest: Option<String>
}Source line: 17.
config::TrustAnchor::new
Creates a key-pinned trust anchor.
pub fn new(
did: impl Into<String>,
verification_method: impl Into<String>,
public_key_multibase: impl Into<String>,
) -> Self;Source line: 30.
config::TrustAnchor::with_document_digest
Pins this anchor to an exact canonical root document digest.
#[must_use]
pub fn with_document_digest(mut self, digest: impl Into<String>) -> Self;Source line: 45.
config::VerifyConfig
Configuration for the lineage verification algorithm.
All values have sensible defaults from the OAS Specification §8.3.
Examples
use oas_lineage::config::VerifyConfig;
// Use defaults from the specification
let config = VerifyConfig::default();
assert_eq!(config.max_generation, 16);
// Or customize
let config = VerifyConfig::new()
.with_max_generation(8)
.with_total_timeout(std::time::Duration::from_secs(15));
assert_eq!(config.max_generation, 8);#[derive(Debug, Clone)]
pub struct VerifyConfig {
/// Maximum generation depth allowed.
///
/// Per OAS Spec §8.3 rule 6: RECOMMENDED default is 16.
/// Entities exceeding this depth MAY be rejected.
pub max_generation: u32,
/// Per-hop resolution timeout.
///
/// Per OAS Spec §8.3 rule 7: RECOMMENDED 5 seconds.
/// Applied to each parent document resolution individually.
pub per_hop_timeout: Duration,
/// Total timeout for the entire chain verification.
///
/// Per OAS Spec §8.3 rule 7: RECOMMENDED 30 seconds.
/// If the total elapsed time exceeds this, verification
/// reports `unverifiable` (not `invalid`).
pub total_timeout: Duration,
/// Whether to verify document signatures for each parent.
///
/// Defaults to `true`. Set to `false` only when parent documents
/// have already been verified by the resolver.
pub verify_document_signatures: bool,
/// Verifier-controlled root trust anchors.
pub trust_anchors: Vec<TrustAnchor>
}Source line: 71.
config::VerifyConfig::new
Creates a new VerifyConfig with default values.
Equivalent to [VerifyConfig::default()].
pub fn new() -> Self;Source line: 123.
config::VerifyConfig::with_max_generation
Sets the maximum generation depth.
Arguments
depth- Maximum number of derivation steps from human root.
pub fn with_max_generation(mut self, depth: u32) -> Self;Source line: 132.
config::VerifyConfig::with_per_hop_timeout
Sets the per-hop resolution timeout.
Arguments
timeout- Duration to wait for each parent resolution.
pub fn with_per_hop_timeout(mut self, timeout: Duration) -> Self;Source line: 142.
config::VerifyConfig::with_total_timeout
Sets the total verification timeout.
Arguments
timeout- Maximum duration for the entire chain verification.
pub fn with_total_timeout(mut self, timeout: Duration) -> Self;Source line: 152.
config::VerifyConfig::with_verify_signatures
Sets whether to verify document signatures at each hop.
Arguments
verify-trueto verify signatures (default),falseto skip.
pub fn with_verify_signatures(mut self, verify: bool) -> Self;Source line: 162.
config::VerifyConfig::with_trust_anchor
Adds a verifier-controlled root trust anchor.
#[must_use]
pub fn with_trust_anchor(mut self, anchor: TrustAnchor) -> Self;Source line: 169.