pub enum AuthScheme {
Auto,
PrivateToken,
Bearer,
}Expand description
How to send the token to GitLab.
GitLab self-hosted accepts two distinct auth headers depending on token type:
- PRIVATE-TOKEN — Personal Access Tokens (
glpat-*), OAuth Application Secrets used as PAT (gloas-*), Deploy Tokens (gldt-*), Runner Authentication Tokens (glrt-*). - Authorization: Bearer — OAuth access_tokens issued by the
/oauth/tokenDoorkeeper endpoint (no documented prefix).
Sending an OAuth access_token via PRIVATE-TOKEN returns 401 Unauthorized; sending a PAT via Authorization: Bearer works
against gitlab.com but is rejected by some self-hosted setups.
AuthScheme::Auto keeps the historical behaviour of detecting
the scheme by the well-known prefix; PrivateToken / Bearer
let the caller force the choice when they already know the
token’s origin.
Variants§
Auto
Detect by token prefix (default — backward compatible).
PrivateToken
Force PRIVATE-TOKEN: <token>.
Bearer
Force Authorization: Bearer <token>.
Trait Implementations§
Source§impl Clone for AuthScheme
impl Clone for AuthScheme
Source§fn clone(&self) -> AuthScheme
fn clone(&self) -> AuthScheme
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 moreSource§impl Debug for AuthScheme
impl Debug for AuthScheme
Source§impl Default for AuthScheme
impl Default for AuthScheme
Source§fn default() -> AuthScheme
fn default() -> AuthScheme
Returns the “default value” for a type. Read more
Source§impl PartialEq for AuthScheme
impl PartialEq for AuthScheme
Source§fn eq(&self, other: &AuthScheme) -> bool
fn eq(&self, other: &AuthScheme) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for AuthScheme
impl Eq for AuthScheme
impl StructuralPartialEq for AuthScheme
Auto Trait Implementations§
impl Freeze for AuthScheme
impl RefUnwindSafe for AuthScheme
impl Send for AuthScheme
impl Sync for AuthScheme
impl Unpin for AuthScheme
impl UnsafeUnpin for AuthScheme
impl UnwindSafe for AuthScheme
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.