pub enum Auth<'a> {
Token(&'a str),
OAuth2(&'a str),
Password {
username: &'a str,
password: &'a str,
mfa: Option<&'a str>,
},
None,
}
Expand description
Method of authentication to connect to the Forgejo host with.
Variants§
Token(&'a str)
Application Access Token. Grants access to scope enabled for the provided token, which may include full access.
To learn how to create a token, see the Codeberg docs on the subject.
To learn about token scope, see the official Forgejo docs.
OAuth2(&'a str)
OAuth2 Token. Grants full access to the user’s account, except for creating application access tokens.
To learn how to create an OAuth2 token, see the official Forgejo docs on the subject.
Password
Username, password, and 2-factor auth code (if enabled). Grants full access to the user’s account.
None
No authentication. Only grants access to access public endpoints.
Auto Trait Implementations§
impl<'a> Freeze for Auth<'a>
impl<'a> RefUnwindSafe for Auth<'a>
impl<'a> Send for Auth<'a>
impl<'a> Sync for Auth<'a>
impl<'a> Unpin for Auth<'a>
impl<'a> UnwindSafe for Auth<'a>
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