Expand description
§aep-core
Transport-independent models, validation, identity, assertion, and HTTP-binding primitives for the Agent Enrollment Protocol.
§Install
[dependencies]
aep-core = "0.1"§Parse protocol documents
Parsing applies AEP’s bounded native validation and preserves well-formed additive members and advertisements:
use aep_core::{Command, command_path_from_inspect, parse_inspect_document};
let document = parse_inspect_document(br#"{
"aep_version": "1.0",
"bindings": {"supported": ["http"]},
"commands": {"supported": ["inspect", "enroll"]},
"core": {"signing_algorithms": ["EdDSA", "ES256"]},
"http": {},
"identity": {"methods": ["did:web"]},
"service": {"did": "did:web:service.example"}
}"#)?;
assert_eq!(
command_path_from_inspect(&document, &Command::Enroll)?,
"/aep/enroll"
);The crate provides equivalent parse and validation functions for claims, enrollment, status, grant, revoke, Problem Details, idempotency metadata, credential responses, client assertions, and OpenAPI AEP security metadata.
§Assertions and identity
sign_client_assertion and verify_client_assertion support the required EdDSA and ES256
algorithms. decode_jwt_unverified exposes the JOSE header before verification so a Service can
select the advertised algorithm and resolve the kid. did_web_document_url and
resolve_did_web_public_key implement the did:web resolution rules, including the HTTPS default,
the one-mebibyte document limit, exact verification-method selection, and redirect rejection.
Keys use AEP-owned types rather than exposing the underlying JSON Web Token library. Ed25519 seeds, PKCS #8 PEM private keys, raw Ed25519 public keys, ES256 private scalars, PKCS #8 PEM private keys, and SEC1 ES256 public keys are supported:
use aep_core::{ClientAssertionSigningKey, SigningAlgorithm};
let key = ClientAssertionSigningKey::ed25519_from_seed([7; 32]);
assert_eq!(key.algorithm(), SigningAlgorithm::EdDsa);
let public_key = key.verifying_key();Both algorithms use pure-Rust cryptographic implementations. A signing key selects the JOSE algorithm, which prevents an algorithm option from disagreeing with the supplied key.
HTTP access remains injectable through HttpTransport; the Core crate does not select an async
runtime or networking client. The Agent, Service, and Platform crates provide the role-level
composition.
§HTTP and OpenAPI
The Core helpers normalize command paths, parse and render protected-resource authorization, resolve OpenAPI references, and deterministically select the most specific matching OpenAPI path template. Plaintext HTTP is rejected except when a caller explicitly enables the loopback-only development option.
See the workspace guide and the AEP specifications.
Structs§
- ApiKey
Grant Response - Authentication
- Authorization
Carrier Error - Basic
Grant Response - Bindings
- Claim
Support Evaluation - Claim
Values - Client
Assertion Claims - Client
Assertion Signing Key - Client
Assertion Validation Options - Client
Assertion Verifying Key - Commands
- Contact
Address Primary - Core
Configuration - Decoded
Jwt - DidWeb
Document UrlOptions - Enroll
Request - Enroll
Response - Extensions
- Grant
Request - Grant
Type Config - Http
Configuration - Http
Request - Http
Response - Idempotency
Metadata - Identity
- Inspect
Claims - Inspect
Document - JwtHeader
- OAuth
Bearer Grant Response - Open
ApiAep Security Scheme - Open
ApiPath Match - Open
ApiPath Match Options - Open
ApiPath Matching - Open
ApiReference - Problem
Details - Protected
Resource Authorization - Resolve
DidWeb Public KeyOptions - Revoke
Request - Revoke
Response - Service
Identity - Sign
Client Assertion Options - Status
Response - Transport
Error - Validation
Error - Validation
Issue - Verify
Client Assertion Options
Enums§
- Agent
Status - Assertion
Operation - Authentication
Method - Authorization
Carrier - Binding
- Built
InGrant Response - Claim
Name - Command
- Core
Error - Credential
Scheme - Enrollment
Decision Status - Error
Code - Grant
Type - Identity
Method - Open
ApiTrailing Slash - Parse
Error - Signing
Algorithm - String
Boolean
Constants§
- AUTHORIZATION_
HEADER - AUTHORIZATION_
SCHEME - DEFAULT_
HTTP_ ENDPOINT_ BASE - DEFAULT_
INSPECT_ FRESHNESS - MAX_
ASSERTION_ LIFETIME - MAX_
AUTHENTICATION_ METHODS - MEDIA_
TYPE - MINIMUM_
IDEMPOTENCY_ TTL - PROBLEM_
MEDIA_ TYPE - RECOMMENDED_
CLOCK_ SKEW - VERSION
- WELL_
KNOWN_ PATH
Traits§
Functions§
- command_
path - command_
path_ from_ inspect - decode_
jwt_ unverified - did_
web_ document_ url - did_
web_ document_ url_ with_ options - evaluate_
claim_ support - is_
http_ field_ name - is_
version_ compatible - match_
openapi_ path - missing_
required_ claim_ names - new_
problem_ details - normalize_
endpoint_ base - parse_
api_ key_ grant_ response - parse_
basic_ grant_ response - parse_
built_ in_ grant_ response - parse_
claim_ values - parse_
client_ assertion_ claims - parse_
client_ assertion_ claims_ with_ options - parse_
enroll_ request - parse_
enroll_ response - parse_
grant_ request - parse_
idempotency_ metadata - parse_
inspect_ document - parse_
oauth_ bearer_ grant_ response - parse_
openapi_ aep_ security_ scheme - parse_
problem_ details - parse_
protected_ resource_ authorization - parse_
revoke_ request - parse_
revoke_ response - parse_
status_ response - protected_
resource_ authorization_ header - registered_
claims - render_
protected_ resource_ authorization - resolve_
did_ web_ public_ key - resolve_
openapi_ url - sign_
client_ assertion - validate_
api_ key_ grant_ response - validate_
basic_ grant_ response - validate_
built_ in_ grant_ response - validate_
claim_ values - validate_
client_ assertion_ claims - validate_
client_ assertion_ claims_ with_ options - validate_
enroll_ request - validate_
enroll_ response - validate_
grant_ request - validate_
idempotency_ metadata - validate_
inspect_ document - validate_
oauth_ bearer_ grant_ response - validate_
openapi_ aep_ security_ scheme - validate_
problem_ details - validate_
protected_ resource_ authorization - validate_
revoke_ request - validate_
revoke_ response - validate_
status_ response - verify_
client_ assertion