Paul Campbell
341dc97a51
Repository is now behind an enum to allow selection of a mock Repsitory for use in tests.
16 lines
561 B
Rust
16 lines
561 B
Rust
/// The API Token for the [user]
|
|
/// ForgeJo: https://{hostname}/user/settings/applications
|
|
/// Github: https://github.com/settings/tokens
|
|
#[derive(Clone, Debug, derive_more::Constructor)]
|
|
pub struct ApiToken(secrecy::Secret<String>);
|
|
/// 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()
|
|
}
|
|
}
|
|
impl Default for ApiToken {
|
|
fn default() -> Self {
|
|
Self("".to_string().into())
|
|
}
|
|
}
|