#[non_exhaustive]pub enum TokenRotation {
Manual,
WithPassword(Secret),
}Expand description
How the bot token is rotated — an explicit choice, because Forgejo only
mints and deletes access tokens under basic authentication (the
/users/{name}/tokens endpoints refuse token auth), so rotation without a
human means the bridge holds the bot’s password too.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Manual
The bridge holds only the token. Rotating is an operator’s job: mint a
new token for the bot with crate::BOT_TOKEN_SCOPES and hand it to
crate::ForgejoForge::replace_token, which verifies it before use.
WithPassword(Secret)
The bridge also holds the bot’s password (sealed like the App key on
GitHub) and rotates on its own with
crate::ForgejoForge::mint_token and
crate::ForgejoForge::retire_token. The bot must not have 2FA
enabled, which Forgejo requires for basic auth.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TokenRotation
impl RefUnwindSafe for TokenRotation
impl Send for TokenRotation
impl Sync for TokenRotation
impl Unpin for TokenRotation
impl UnsafeUnpin for TokenRotation
impl UnwindSafe for TokenRotation
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