pub struct AuthContext { /* private fields */ }Implementations§
Source§impl AuthContext
impl AuthContext
pub fn new(cfg: ResolvedConfig, cache_path: PathBuf) -> Self
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).
When SHAREPOINT_REFRESH_TOKEN is set in the environment (propagated
via ResolvedConfig::refresh_token_seed) and no valid cached token
exists, the refresh token is used to bootstrap an access token via the
OAuth refresh exchange. This supports headless/CI usage where a
long-lived refresh token is injected at runtime rather than stored in a
persistent cache. If the bootstrap refresh exchange fails (e.g. the
token has been revoked), the error is surfaced immediately with auth
exit code 3 — there is no silent fallback to interactive device-code
flow, because the caller explicitly provided a token.
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 (const: unstable) · 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 !RefUnwindSafe for AuthContext
impl !UnwindSafe for AuthContext
impl Freeze for AuthContext
impl Send for AuthContext
impl Sync for AuthContext
impl Unpin for AuthContext
impl UnsafeUnpin 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