pub trait AshAdapter {
// Provided methods
fn canonicalize_json(&self, input: &str) -> AdapterResult { ... }
fn canonicalize_query(&self, input: &str) -> AdapterResult { ... }
fn canonicalize_urlencoded(&self, input: &str) -> AdapterResult { ... }
fn normalize_binding(
&self,
method: &str,
path: &str,
query: &str,
) -> AdapterResult { ... }
fn hash_body(&self, body: &str) -> AdapterResult { ... }
fn derive_client_secret(
&self,
nonce: &str,
context_id: &str,
binding: &str,
) -> AdapterResult { ... }
fn build_proof(
&self,
secret: &str,
ts: &str,
binding: &str,
body_hash: &str,
) -> AdapterResult { ... }
fn timing_safe_equal(&self, a: &str, b: &str) -> AdapterResult { ... }
fn validate_timestamp(&self, ts: &str) -> AdapterResult { ... }
fn trigger_error(&self, input: &Value) -> AdapterResult { ... }
fn extract_scoped_fields(
&self,
payload: &str,
fields: &[String],
strict: bool,
) -> AdapterResult { ... }
fn build_unified_proof(&self, input: &Value) -> AdapterResult { ... }
}Expand description
Trait that SDK implementations must implement for conformance testing.
Each method corresponds to a vector category. Return AdapterResult::skip()
for categories your SDK doesn’t implement yet.
Provided Methods§
Sourcefn canonicalize_json(&self, input: &str) -> AdapterResult
fn canonicalize_json(&self, input: &str) -> AdapterResult
JSON canonicalization: input JSON text → canonical JSON text
Sourcefn canonicalize_query(&self, input: &str) -> AdapterResult
fn canonicalize_query(&self, input: &str) -> AdapterResult
Query canonicalization: raw query → canonical query
Sourcefn canonicalize_urlencoded(&self, input: &str) -> AdapterResult
fn canonicalize_urlencoded(&self, input: &str) -> AdapterResult
URL-encoded canonicalization: raw → canonical
Sourcefn normalize_binding(
&self,
method: &str,
path: &str,
query: &str,
) -> AdapterResult
fn normalize_binding( &self, method: &str, path: &str, query: &str, ) -> AdapterResult
Binding normalization: (method, path, query) → binding string
Sourcefn hash_body(&self, body: &str) -> AdapterResult
fn hash_body(&self, body: &str) -> AdapterResult
Body hashing: canonical body → hex hash
Sourcefn derive_client_secret(
&self,
nonce: &str,
context_id: &str,
binding: &str,
) -> AdapterResult
fn derive_client_secret( &self, nonce: &str, context_id: &str, binding: &str, ) -> AdapterResult
Client secret derivation: (nonce, context_id, binding) → hex secret
Sourcefn build_proof(
&self,
secret: &str,
ts: &str,
binding: &str,
body_hash: &str,
) -> AdapterResult
fn build_proof( &self, secret: &str, ts: &str, binding: &str, body_hash: &str, ) -> AdapterResult
Proof generation: full inputs → hex proof
Sourcefn timing_safe_equal(&self, a: &str, b: &str) -> AdapterResult
fn timing_safe_equal(&self, a: &str, b: &str) -> AdapterResult
Timing-safe comparison: (a, b) → bool
Sourcefn validate_timestamp(&self, ts: &str) -> AdapterResult
fn validate_timestamp(&self, ts: &str) -> AdapterResult
Timestamp validation: ts → ok or error
Sourcefn trigger_error(&self, input: &Value) -> AdapterResult
fn trigger_error(&self, input: &Value) -> AdapterResult
Error behavior: trigger → error code + status
Sourcefn extract_scoped_fields(
&self,
payload: &str,
fields: &[String],
strict: bool,
) -> AdapterResult
fn extract_scoped_fields( &self, payload: &str, fields: &[String], strict: bool, ) -> AdapterResult
Scoped field extraction: (payload, fields, mode) → extracted/hash
Sourcefn build_unified_proof(&self, input: &Value) -> AdapterResult
fn build_unified_proof(&self, input: &Value) -> AdapterResult
Unified proof: full inputs → proof + scope_hash + chain_hash