pub struct ScopedAccessToken {
pub scope: String,
pub derived_key: ContentKey,
pub created_at: u64,
pub expires_at: Option<u64>,
}Expand description
A token granting scoped read access to specific paths or branches.
Fields§
§scope: StringScope pattern (e.g., “refs/heads/main” or “path:src/”).
derived_key: ContentKeyDerived key for this scope.
created_at: u64When the token was created (Unix timestamp in seconds).
expires_at: Option<u64>Optional expiration time (Unix timestamp in seconds).
Implementations§
Source§impl ScopedAccessToken
impl ScopedAccessToken
Sourcepub fn new(
scope: String,
derived_key: ContentKey,
expires_at: Option<u64>,
) -> Self
pub fn new( scope: String, derived_key: ContentKey, expires_at: Option<u64>, ) -> Self
Create a new scoped access token.
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if this token has expired.
Sourcepub fn can_access(&self, path: &str) -> bool
pub fn can_access(&self, path: &str) -> bool
Check if this token grants access to the given path.
Trait Implementations§
Source§impl Clone for ScopedAccessToken
impl Clone for ScopedAccessToken
Source§fn clone(&self) -> ScopedAccessToken
fn clone(&self) -> ScopedAccessToken
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ScopedAccessToken
impl RefUnwindSafe for ScopedAccessToken
impl Send for ScopedAccessToken
impl Sync for ScopedAccessToken
impl Unpin for ScopedAccessToken
impl UnsafeUnpin for ScopedAccessToken
impl UnwindSafe for ScopedAccessToken
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