pub struct AuthContext { /* private fields */ }Implementations§
Source§impl AuthContext
impl AuthContext
pub fn new(cfg: ResolvedConfig, cache_path: PathBuf) -> Self
pub async fn client_id(&self) -> String
Sourcepub async fn access_token(&self) -> Result<String>
pub async fn access_token(&self) -> Result<String>
Get a non-expired access token, refreshing if necessary.
Honors SHAREPOINT_ACCESS_TOKEN as a CI escape hatch (no refresh).
pub async fn http(&self) -> Client
pub async fn config(&self) -> ResolvedConfig
pub async fn cache_path(&self) -> PathBuf
Sourcepub async fn seed_from_env_refresh_token(
&self,
refresh_token: &str,
) -> Result<()>
pub async fn seed_from_env_refresh_token( &self, refresh_token: &str, ) -> Result<()>
Seed the cache from SHAREPOINT_REFRESH_TOKEN (CI use case). The next
access_token() call will refresh and persist the rotated token.
oid_for_seed is a synthetic identifier — the real one comes back on first refresh.
Trait Implementations§
Source§impl Clone for AuthContext
impl Clone for AuthContext
Source§fn clone(&self) -> AuthContext
fn clone(&self) -> AuthContext
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 AuthContext
impl !RefUnwindSafe for AuthContext
impl Send for AuthContext
impl Sync for AuthContext
impl Unpin for AuthContext
impl UnsafeUnpin for AuthContext
impl !UnwindSafe for AuthContext
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