OpenAgentID documentation
Source referencesRust module referenceopenagent-http

openagent-http · session

Declared module signatures, types, configuration, and source documentation.

Source: openagent-sdk/adapters/http/rust/src/session.rs. SHA-256: ba53a721c939d4b67d6e8d1a17c097716926a28910a8ec424fba9bf88d35586b.

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.

session::AuthenticatedSession

An authenticated HTTP session obtained after a successful OAAP handshake.

Wraps a reqwest::Client and attaches the Authorization: OAS <token>, X-OpenAgent-DID, and X-OpenAgent-Session headers to every request.

#[derive(Debug, Clone)]
pub struct AuthenticatedSession {

}

Source line: 17.

session::AuthenticatedSession::new

Creates a new authenticated session.

pub fn new(
        client: reqwest::Client,
        base_url: String,
        session_id: String,
        peer_did: String,
        session_token: String,
        expires_at: i64,
    ) -> Self;

Source line: 30.

session::AuthenticatedSession::is_expired

Returns true if the session has expired.

pub fn is_expired(&self) -> bool;

Source line: 49.

session::AuthenticatedSession::session_id

Returns the session ID.

pub fn session_id(&self) -> &str;

Source line: 54.

session::AuthenticatedSession::peer_did

Returns the peer DID.

pub fn peer_did(&self) -> &str;

Source line: 59.

session::AuthenticatedSession::base_url

Returns the base URL of the authenticated server.

pub fn base_url(&self) -> &str;

Source line: 64.

session::AuthenticatedSession::get

Sends an authenticated GET request.

pub async fn get(&self, path: &str) -> Result<reqwest::Response, AuthProtocolError>;

Source line: 69.

session::AuthenticatedSession::post

Sends an authenticated POST request with a JSON body.

pub async fn post(
        &self,
        path: &str,
        body: &impl serde::Serialize,
    ) -> Result<reqwest::Response, AuthProtocolError>;

Source line: 84.

session::AuthenticatedSession::put

Sends an authenticated PUT request with a JSON body.

pub async fn put(
        &self,
        path: &str,
        body: &impl serde::Serialize,
    ) -> Result<reqwest::Response, AuthProtocolError>;

Source line: 104.

session::AuthenticatedSession::delete

Sends an authenticated DELETE request.

pub async fn delete(&self, path: &str) -> Result<reqwest::Response, AuthProtocolError>;

Source line: 124.

On this page