git_next_core/config/
api_token.rs

1/// The API Token for the user
2/// `ForgeJo`: <https://{hostname}/user/settings/applications>
3/// `Github`:  <https://github.com/settings/tokens>
4#[derive(Clone, Debug, derive_more::Constructor)]
5pub struct ApiToken(secrecy::SecretString);
6/// The API Token is in effect a password, so it must be explicitly exposed to access its value
7impl secrecy::ExposeSecret<str> for ApiToken {
8    fn expose_secret(&self) -> &str {
9        self.0.expose_secret()
10    }
11}
12impl Default for ApiToken {
13    fn default() -> Self {
14        Self(String::new().into())
15    }
16}