Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
GamePad64 committed Feb 3, 2025
2 parents 898109a + 52a7c20 commit a699d9e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions notifico-core/src/credentials/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ impl EnvCredentialStorage {
pub fn new() -> Self {
let mut storage = HashMap::new();

let re = Regex::new("^NOTIFICO_CRED_(?:([[:xdigit:]]{8}-[[:xdigit:]]{4}-[[:xdigit:]]{4}-[[:xdigit:]]{4}-[[:xdigit:]]{12})_)?(.+)$").unwrap();
let re = Regex::new("^NOTIFICO_CRED_(?:([[:xdigit:]]{8}_[[:xdigit:]]{4}_[[:xdigit:]]{4}_[[:xdigit:]]{4}_[[:xdigit:]]{12})_)?(.+)$").unwrap();
for (name, value) in std::env::vars() {
let Some(captures) = re.captures(&name) else {
continue;
};

let project = captures
.get(1)
.map_or_else(Uuid::nil, |m| Uuid::parse_str(m.as_str()).unwrap());
let project = captures.get(1).map_or_else(Uuid::nil, |m| {
Uuid::parse_str(&m.as_str().replace("_", "-")).unwrap()
});
let name = captures.get(2).unwrap().as_str();
let credential = RawCredential::from_str(&value).unwrap();

Expand Down

0 comments on commit a699d9e

Please sign in to comment.