Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions crates/aether-gateway/frontdoor/src/request_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,7 @@ pub fn short_request_id(value: &str) -> String {
}

fn looks_like_uuid(value: &str) -> bool {
let bytes = value.as_bytes();
if bytes.len() != 36 {
return false;
}

for (index, byte) in bytes.iter().enumerate() {
let is_hyphen = matches!(index, 8 | 13 | 18 | 23);
if is_hyphen {
if *byte != b'-' {
return false;
}
continue;
}

if !byte.is_ascii_hexdigit() {
return false;
}
}

true
value.len() == 36 && uuid::Uuid::parse_str(value).is_ok()
}

#[cfg(test)]
Expand Down
7 changes: 1 addition & 6 deletions crates/aether-oauth/src/provider/providers/kiro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,12 +581,7 @@ pub fn normalize_kiro_machine_id(raw: &str) -> Option<String> {
if raw.len() == 64 && raw.bytes().all(|byte| byte.is_ascii_hexdigit()) {
return Some(raw.to_ascii_lowercase());
}
if raw.len() == 36
&& raw.chars().enumerate().all(|(idx, ch)| match idx {
8 | 13 | 18 | 23 => ch == '-',
_ => ch.is_ascii_hexdigit(),
})
{
if raw.len() == 36 && uuid::Uuid::parse_str(raw).is_ok() {
let normalized = raw.replace('-', "").to_ascii_lowercase();
return Some(format!("{normalized}{normalized}"));
}
Expand Down
Loading