An easy-to-host PDS on the ATProtocol, iPhone and MacOS. Maintain control of your keys and data, always.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: address Phase 4 code review findings

- Remove ticket reference from PAR integration test doc comment
- Apply cargo fmt formatting fixes to oauth.rs and http.rs

authored by

Malpercio and committed by
Tangled
428ce5ca d7c5bd08

+19 -7
+19 -7
apps/identity-wallet/src-tauri/src/oauth.rs
··· 480 480 assert_eq!(verifier.len(), 43, "base64url of 32 bytes must be 43 chars"); 481 481 // RFC 7636 §4.1: ALPHA / DIGIT / "-" / "." / "_" / "~" 482 482 assert!( 483 - verifier.chars().all(|c| c.is_alphanumeric() || "-._~".contains(c)), 483 + verifier 484 + .chars() 485 + .all(|c| c.is_alphanumeric() || "-._~".contains(c)), 484 486 "verifier must consist only of unreserved chars: got {verifier}" 485 487 ); 486 488 } ··· 490 492 use sha2::{Digest, Sha256}; 491 493 let (verifier, challenge) = pkce::generate(); 492 494 let expected = URL_SAFE_NO_PAD.encode(Sha256::digest(verifier.as_bytes())); 493 - assert_eq!(challenge, expected, "challenge must be base64url(sha256(verifier))"); 495 + assert_eq!( 496 + challenge, expected, 497 + "challenge must be base64url(sha256(verifier))" 498 + ); 494 499 } 495 500 496 501 #[test] ··· 503 508 fn pkce_verifiers_are_unique() { 504 509 let (v1, _) = pkce::generate(); 505 510 let (v2, _) = pkce::generate(); 506 - assert_ne!(v1, v2, "each generate() call must produce a different verifier"); 511 + assert_ne!( 512 + v1, v2, 513 + "each generate() call must produce a different verifier" 514 + ); 507 515 } 508 516 509 517 /// Integration test: PAR call against a running relay. ··· 533 541 .expect("PAR must succeed"); 534 542 535 543 assert!( 536 - resp.request_uri.starts_with("urn:ietf:params:oauth:request_uri:"), 544 + resp.request_uri 545 + .starts_with("urn:ietf:params:oauth:request_uri:"), 537 546 "request_uri must use OAuth PAR URN scheme, got: {}", 538 547 resp.request_uri 539 548 ); ··· 542 551 543 552 /// Integration test: PAR call missing code_challenge is rejected by relay. 544 553 /// 545 - /// Verifies MM-149.AC1.4: the relay returns a client error (400) when 546 - /// code_challenge is absent from the PAR request. 554 + /// The relay returns a client error (400) when code_challenge is absent 555 + /// from the PAR request. 547 556 /// 548 557 /// Run with: cargo test -p identity-wallet par_missing_challenge -- --include-ignored --nocapture 549 558 #[tokio::test] ··· 563 572 .header("DPoP", dpop_proof) 564 573 .form(&[ 565 574 ("client_id", "dev.malpercio.identitywallet"), 566 - ("redirect_uri", "dev.malpercio.identitywallet:/oauth/callback"), 575 + ( 576 + "redirect_uri", 577 + "dev.malpercio.identitywallet:/oauth/callback", 578 + ), 567 579 ("code_challenge_method", "S256"), 568 580 ("state", "somestate"), 569 581 ("response_type", "code"),