shrike 0.1.1

AT Protocol library for Rust
Documentation
// Code generated by lexgen. DO NOT EDIT.

#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ServerGetServiceAuthParams {
    /// The DID of the service that the token will be used to authenticate with
    pub aud: String,
    /// The time in Unix Epoch seconds that the JWT expires. Defaults to 60 seconds in the future. The service may enforce certain time bounds on tokens depending on the requested scope.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub exp: Option<i64>,
    /// Lexicon (XRPC) method to bind the requested token to
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub lxm: Option<String>,
}

#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ServerGetServiceAuthOutput {
    pub token: String,
    /// Extra fields not defined in the schema.
    #[serde(flatten)]
    pub extra: std::collections::HashMap<String, serde_json::Value>,
}

/// ServerGetServiceAuth — Get a signed token on behalf of the requesting DID for the requested service.
pub async fn server_get_service_auth(
    client: &crate::xrpc::Client,
    params: &ServerGetServiceAuthParams,
) -> Result<ServerGetServiceAuthOutput, crate::xrpc::Error> {
    client
        .query("com.atproto.server.getServiceAuth", params)
        .await
}