MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / is_token68

Function is_token68

crates/openshell-supervisor-network/src/token_grant.rs:418–432  ·  view source on GitHub ↗
(token: &str)

Source from the content-addressed store, hash-verified

416}
417
418fn is_token68(token: &str) -> bool {
419 let mut padding_started = false;
420 let mut saw_value = false;
421 for byte in token.bytes() {
422 if byte == b'=' {
423 padding_started = true;
424 continue;
425 }
426 if padding_started || !is_token68_value_byte(byte) {
427 return false;
428 }
429 saw_value = true;
430 }
431 saw_value
432}
433
434fn is_token68_value_byte(byte: u8) -> bool {
435 byte.is_ascii_alphanumeric() || matches!(byte, b'-' | b'.' | b'_' | b'~' | b'+' | b'/')

Callers 1

validate_access_tokenFunction · 0.85

Calls 1

is_token68_value_byteFunction · 0.85

Tested by

no test coverage detected