Public declaration syntax from forge-rs/crates/forge-agent402/src/server.rs Original source SHA-256: 667d0ff36cf1134a0f6c01de83530e4e7697745232b6e19260d1eafe56e07fca Function bodies and constant values are omitted. This is not the complete implementation. Source line 31 #[derive(Debug, Clone)] pub struct ServeConfig { /// Server origin (e.g., "https://api.example.com"). pub origin: String, /// Optional realm for the OpenAgent challenge. pub realm: Option, /// HMAC secret for session JWTs. Must be at least 32 bytes. pub session_secret: Vec, /// Session TTL in seconds (default: 900 = 15 minutes). pub session_ttl_secs: i64, /// Minimum trust tier (default: 0 = Anonymous). pub min_trust_tier: u8, /// Priced routes (empty = identity-only, no payment required). pub priced_routes: Vec, /// Wallet address for receiving payments. pub recipient_address: Option, /// Facilitator URL for x402 settlement. pub facilitator_url: Option, /// Capability requirements per route (Arsenal scopes). pub capabilities: Vec } Source line 62 #[derive(Debug, Clone)] pub struct RouteConfig { /// Route path pattern (prefix match). pub path: String, /// HTTP method (None = all methods). pub method: Option, /// Price per request as decimal string (e.g., "0.002"). pub price: String, /// Currency (default: "USDC"). pub currency: String } Source line 77 pub fn new(origin: impl Into, session_secret: impl AsRef<[u8]>) -> Self; Source line 92 pub fn with_priced_route( mut self, path: impl Into, method: impl Into, price: impl Into, ) -> Self; Source line 108 pub fn with_recipient(mut self, address: impl Into) -> Self; Source line 114 pub fn with_facilitator(mut self, url: impl Into) -> Self; Source line 120 pub fn with_min_trust_tier(mut self, tier: u8) -> Self; Source line 126 pub fn with_realm(mut self, realm: impl Into) -> Self; Source line 136 pub fn with_capability( mut self, path: impl Into, method: impl Into, scopes: &[&str], condition: GrantCondition, ) -> Self; Source line 175 #[derive(Debug, Clone)] pub struct CapabilityConfig { /// Route path pattern (prefix match). pub path: String, /// HTTP method (None = all methods). pub method: Option, /// Required Arsenal scopes (format: `service:resource:action`). pub scopes: Vec, /// Grant condition: "verified" or "verified_and_paid". pub condition: GrantCondition } Source line 188 #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum GrantCondition { /// Grant after identity verification succeeds (any trust tier). Verified, /// Grant after identity verification AND x402 payment succeeds. VerifiedAndPaid, /// Grant only if trust tier meets minimum. TrustMinimum(u8), } Source line 228 #[derive(Clone)] pub struct ServeLayer { } Source line 235 pub fn new(config: ServeConfig) -> Self; Source line 246 pub fn config(&self) -> &ServeConfig; Source line 275 pub fn serve(config: ServeConfig) -> ServeLayer;