pub struct Session {
pub token: String,
pub email: String,
pub expires_at: DateTime<Utc>,
}Expand description
Persisted CLI session record (lives at ~/.zlayer/session.json,
mode 0600 on Unix).
Stores the JWT returned by POST /auth/token (or /auth/login) so
subsequent CLI invocations don’t need to re-authenticate. The daemon
client attaches Authorization: Bearer <token> from this record when
present.
Fields§
§token: StringJWT access token.
email: StringEmail of the authenticated user (for whoami display).
expires_at: DateTime<Utc>Token expiry. Used to warn the user before the token actually expires.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Session
impl<'de> Deserialize<'de> for Session
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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