pub struct GitlabTokenValidator;Expand description
Validates GitLab token structure.
GitLab PATs: classic tokens are glpat- + 20 base64url chars, but the
routable tokens GitLab ships since 16.x (glpat-, glrt-, glcbt-, …)
are LONGER and embed their own CRC32 in a base64-encoded trailer. This
validator does structural checks only — it does not recompute the routable
CRC — so it must not claim a token is fabricated merely because its length
is not the classic 20: that false Invalid verdict makes the engine DROP
every modern GitLab token (the atlantis-credentials /
gitlab-personal-access-token contract regressions). The rule is:
- body contains a char a GitLab token cannot →
Invalid - body is base64url-shaped and within the real-world length →
Valid - anything else (too short / absurdly long to model) →
NotApplicableso we only ever DROP on a positively-malformed body, never on an unrecognised-but-plausible length.
Trait Implementations§
Source§impl ChecksumValidator for GitlabTokenValidator
impl ChecksumValidator for GitlabTokenValidator
Source§fn validator_id(&self) -> &str
fn validator_id(&self) -> &str
Identifier for this validator (used for diagnostics and registry lookups).
Auto Trait Implementations§
impl Freeze for GitlabTokenValidator
impl RefUnwindSafe for GitlabTokenValidator
impl Send for GitlabTokenValidator
impl Sync for GitlabTokenValidator
impl Unpin for GitlabTokenValidator
impl UnsafeUnpin for GitlabTokenValidator
impl UnwindSafe for GitlabTokenValidator
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more