forked from kemitix/git-next
16 lines
545 B
Rust
16 lines
545 B
Rust
/// The API Token for the [user]
|
|
/// ForgeJo: https://{hostname}/user/settings/applications
|
|
/// Github: https://github.com/settings/tokens
|
|
#[derive(Clone, Debug)]
|
|
pub struct ApiToken(pub secrecy::Secret<String>);
|
|
impl From<String> for ApiToken {
|
|
fn from(value: String) -> Self {
|
|
Self(value.into())
|
|
}
|
|
}
|
|
/// The API Token is in effect a password, so it must be explicitly exposed to access its value
|
|
impl secrecy::ExposeSecret<String> for ApiToken {
|
|
fn expose_secret(&self) -> &String {
|
|
self.0.expose_secret()
|
|
}
|
|
}
|