openagent-server · l1feid_client
Declared module signatures, types, configuration, and source documentation.
Source: openagents/openagent.id/crates/openagent-server/src/l1feid_client.rs. SHA-256: d2a9626be9a57125eed115e7d03ffe2fa00f4b20d21d14ebf7b73f57f39b4578.
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.
l1feid_client::L1feIdProvisionResponse
Response returned by L1feIdClient::provision.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct L1feIdProvisionResponse {
/// The stable platform UUID for this agent.
pub l1fe_id: String,
/// Trust tier from the platform record (0-4).
pub trust_tier: u8,
/// True when a new record was created (HTTP 201), false when an existing
/// record was returned (HTTP 200).
pub is_new: bool
}Source line: 16.
l1feid_client::L1feIdError
Errors that can occur when calling L1feID.
#[derive(Debug, thiserror::Error)]
pub enum L1feIdError {
#[error("L1feID service request failed: {0}")]
Transport(String),
#[error("L1feID service returned unexpected status {status}: {body}")]
UnexpectedStatus { status: u16, body: String },
#[error("failed to deserialize L1feID response: {0}")]
Deserialize(String),
}Source line: 28.
l1feid_client::L1feIdClient
HTTP client for the L1feID provisioning endpoint.
The base URL is resolved from the first set of these env vars (see
[L1feIdClient::from_env]):
LIFEID_SERVICE_URL(canonical code-side name)L1FEID_API_URL(deployment/ops contract used by k8s secrets)L1FEID_SERVICE_URL(alternate spelling)
If none are set, the in-cluster default
(http://l1feid.l1feid.svc.cluster.local:8090) is used.
#[derive(Debug, Clone)]
pub struct L1feIdClient {
}Source line: 50.
l1feid_client::L1feIdClient::new
Creates a new client targeting base_url.
The URL should NOT include a trailing slash.
pub fn new(base_url: String) -> Self;Source line: 75.
l1feid_client::L1feIdClient::from_env
Creates a client using the L1feID base URL from the environment.
Resolution order (first non-empty wins):
LIFEID_SERVICE_URLL1FEID_API_URL— ops/k8s secret key (must match deploys)L1FEID_SERVICE_URL- in-cluster default
http://l1feid.l1feid.svc.cluster.local:8090
Accepting both LIFEID_SERVICE_URL and L1FEID_API_URL closes the
historical mismatch where manifests injected L1FEID_API_URL while
the binary only read LIFEID_SERVICE_URL.
pub fn from_env() -> Self;Source line: 94.
l1feid_client::L1feIdClient::base_url
Returns the configured base URL (no trailing slash expected).
#[must_use]
pub fn base_url(&self) -> &str;Source line: 102.
l1feid_client::L1feIdClient::provision
Auto-provisions a platform identity record for did.
This is idempotent: calling provision for a DID that already has a record
returns the existing l1fe_id without modification.
initial_trust_tier is only used during first-time creation.
pub async fn provision(
&self,
did: &str,
initial_trust_tier: u8,
) -> Result<L1feIdProvisionResponse, L1feIdError>;Source line: 112.