pub struct TokenCheck {
pub valid: bool,
pub login: Option<String>,
pub scopes: Option<Vec<String>>,
pub repo: RepoAccess,
pub needs_workflow: bool,
}Expand description
The result of preflighting a GitHub token against a repo’s mirror config
(mirror check): whether it authenticates, what it can see, and whether
it can push .github/workflows/ if the repo ships any.
Fields§
§valid: bool§login: Option<String>§scopes: Option<Vec<String>>Classic PATs return their scopes in the X-OAuth-Scopes response
header; fine-grained PATs omit it entirely, which is why this is
Option rather than an empty Vec on the “can’t tell” case.
repo: RepoAccess§needs_workflow: boolWhether the repo ships .github/workflows/ — if so, pushing it needs
the workflow scope (classic) or Workflows:write (fine-grained).
Implementations§
Source§impl TokenCheck
impl TokenCheck
Sourcepub fn has_workflow_scope(&self) -> Option<bool>
pub fn has_workflow_scope(&self) -> Option<bool>
Whether the token’s scopes include workflow. None when the scopes
couldn’t be introspected at all (a fine-grained PAT) — distinct from
Some(false), which is a real, checkable absence.
Trait Implementations§
Source§impl Clone for TokenCheck
impl Clone for TokenCheck
Source§fn clone(&self) -> TokenCheck
fn clone(&self) -> TokenCheck
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 Freeze for TokenCheck
impl RefUnwindSafe for TokenCheck
impl Send for TokenCheck
impl Sync for TokenCheck
impl Unpin for TokenCheck
impl UnsafeUnpin for TokenCheck
impl UnwindSafe for TokenCheck
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