pub struct SessionAuth {
pub session_key: String,
/* private fields */
}Expand description
Session-scoped signing material used for Trellis auth and RPC proofs.
Fields§
§session_key: StringPublic session key in base64url form.
Implementations§
Source§impl SessionAuth
impl SessionAuth
Sourcepub fn from_seed_base64url(
seed_b64url: &str,
) -> Result<Self, TrellisClientError>
pub fn from_seed_base64url( seed_b64url: &str, ) -> Result<Self, TrellisClientError>
Construct a session authenticator from a base64url-encoded Ed25519 seed.
Sourcepub fn sign_sha256_domain(&self, prefix: &str, value: &str) -> String
pub fn sign_sha256_domain(&self, prefix: &str, value: &str) -> String
Sign a domain-separated string value with SHA-256(prefix:value).
Sourcepub fn nats_connect_token(&self, iat: u64) -> String
pub fn nats_connect_token(&self, iat: u64) -> String
Create a service auth-callout token using an iat timestamp.
Sourcepub fn nats_connect_binding_token(&self, binding_token: &str) -> String
pub fn nats_connect_binding_token(&self, binding_token: &str) -> String
Create a user auth-callout token using a binding token.
Sourcepub fn inbox_prefix(&self) -> String
pub fn inbox_prefix(&self) -> String
Return the inbox prefix derived from the session key.
Sourcepub fn create_proof(&self, subject: &str, payload: &[u8]) -> String
pub fn create_proof(&self, subject: &str, payload: &[u8]) -> String
Create the proof header for a signed RPC request payload.
Auto Trait Implementations§
impl Freeze for SessionAuth
impl RefUnwindSafe for SessionAuth
impl Send for SessionAuth
impl Sync for SessionAuth
impl Unpin for SessionAuth
impl UnsafeUnpin for SessionAuth
impl UnwindSafe for SessionAuth
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more