use sandogasa_config::secret::SecretRef;
pub const DISTGIT_BASE: &str = "https://src.fedoraproject.org";
sandogasa_config::keyring_fn!();
pub fn bugzilla(url: &str) -> SecretRef {
SecretRef::for_url(url, "sandogasa: Bugzilla API key")
}
pub fn distgit() -> SecretRef {
SecretRef::for_url(DISTGIT_BASE, "sandogasa: Pagure token")
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn entries_are_named_for_the_service() {
assert_eq!(
bugzilla("https://bugzilla.redhat.com/").lookup_command(),
"secret-tool lookup application sandogasa service bugzilla.redhat.com"
);
assert_eq!(
distgit().lookup_command(),
"secret-tool lookup application sandogasa service src.fedoraproject.org"
);
}
}