MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / unsupported_algorithm_rejected

Function unsupported_algorithm_rejected

nodedb/src/control/security/jwt.rs:434–445  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

432
433 #[test]
434 fn unsupported_algorithm_rejected() {
435 let header = base64_url_encode(br#"{"alg":"ES256"}"#);
436 let payload = base64_url_encode(br#"{"sub":"x","exp":9999999999}"#);
437 let sig = base64_url_encode(b"fakesig");
438 let token = format!("{header}.{payload}.{sig}");
439
440 let validator = JwtValidator::new(JwtConfig::default());
441 assert_eq!(
442 validator.validate(&token).err(),
443 Some(JwtError::UnsupportedAlgorithm)
444 );
445 }
446}

Callers

nothing calls this directly

Calls 1

base64_url_encodeFunction · 0.85

Tested by

no test coverage detected