Skip to main content

validate_capabilities

Function validate_capabilities 

Source
pub fn validate_capabilities(
    caps: &CapabilitiesDocument,
) -> Result<(), AcdpError>
Expand description

Validate a acdp_types::CapabilitiesDocument against the runtime constraints listed in RFC-ACDP-0007 §3.

The JSON schema enforces types; this validator enforces the constraints the schema cannot express:

  1. acdp_version matches ^\d+\.\d+\.\d+$.
  2. registry_did is a v0.1.0 did:web DID.
  3. supported_signature_algorithms MUST contain "ed25519".
  4. supported_did_methods MUST contain "did:web".
  5. profiles MUST contain "acdp-registry-core".
  6. limits.max_embedded_bytes MUST equal exactly 65536.
  7. If supports_idempotency_key is true, limits.idempotency_key_ttl_seconds MUST be present and in 86400..=604800.
  8. limits.max_payload_bytes MUST be at least 1024 bytes.

Wired into acdp::client::RegistryClient::capabilities and acdp::client::CrossRegistryResolver::resolve.