An easy-to-host PDS on the ATProtocol, MacOS. Grandma-approved.

style: cargo fmt after review fix commit

+22 -28
+4 -16
crates/relay/src/db/oauth.rs
··· 628 628 let second = consume_authorization_code(&pool, "hash-abc123") 629 629 .await 630 630 .unwrap(); 631 - assert!( 632 - second.is_none(), 633 - "consumed code must not be found again" 634 - ); 631 + assert!(second.is_none(), "consumed code must not be found again"); 635 632 } 636 633 637 634 #[tokio::test] ··· 674 671 let result = consume_authorization_code(&pool, "expired-code-hash") 675 672 .await 676 673 .unwrap(); 677 - assert!( 678 - result.is_none(), 679 - "expired auth code must return None" 680 - ); 674 + assert!(result.is_none(), "expired auth code must return None"); 681 675 } 682 676 683 677 #[tokio::test] ··· 757 751 let second = consume_oauth_refresh_token(&pool, "consume-test-token-hash") 758 752 .await 759 753 .unwrap(); 760 - assert!( 761 - second.is_none(), 762 - "consumed token must not be found again" 763 - ); 754 + assert!(second.is_none(), "consumed token must not be found again"); 764 755 } 765 756 766 757 #[tokio::test] ··· 791 782 let result = consume_oauth_refresh_token(&pool, "expired-hash") 792 783 .await 793 784 .unwrap(); 794 - assert!( 795 - result.is_none(), 796 - "expired refresh token must return None" 797 - ); 785 + assert!(result.is_none(), "expired refresh token must return None"); 798 786 } 799 787 800 788 #[tokio::test]
+18 -12
crates/relay/src/routes/oauth_token.rs
··· 993 993 let header_b64 = at.split('.').next().unwrap(); 994 994 let header_json = String::from_utf8(URL_SAFE_NO_PAD.decode(header_b64).unwrap()).unwrap(); 995 995 let header: serde_json::Value = serde_json::from_str(&header_json).unwrap(); 996 - assert_eq!( 997 - header["typ"], "at+jwt", 998 - "access token typ must be at+jwt" 999 - ); 1000 - assert_eq!( 1001 - header["alg"], "ES256", 1002 - "access token alg must be ES256" 1003 - ); 996 + assert_eq!(header["typ"], "at+jwt", "access token typ must be at+jwt"); 997 + assert_eq!(header["alg"], "ES256", "access token alg must be ES256"); 1004 998 1005 999 let payload_b64 = at.split('.').nth(1).unwrap(); 1006 1000 let payload_json = String::from_utf8(URL_SAFE_NO_PAD.decode(payload_b64).unwrap()).unwrap(); ··· 1011 1005 cnf_jkt, expected_jkt, 1012 1006 "cnf.jkt must match DPoP key thumbprint" 1013 1007 ); 1014 - assert_eq!(payload["iss"], "https://test.example.com", "iss must be public_url"); 1015 - assert_eq!(payload["aud"], "https://test.example.com", "aud must be public_url"); 1008 + assert_eq!( 1009 + payload["iss"], "https://test.example.com", 1010 + "iss must be public_url" 1011 + ); 1012 + assert_eq!( 1013 + payload["aud"], "https://test.example.com", 1014 + "aud must be public_url" 1015 + ); 1016 1016 } 1017 1017 1018 1018 #[tokio::test] ··· 1327 1327 let payload_b64 = at.split('.').nth(1).unwrap(); 1328 1328 let payload_json = String::from_utf8(URL_SAFE_NO_PAD.decode(payload_b64).unwrap()).unwrap(); 1329 1329 let payload: serde_json::Value = serde_json::from_str(&payload_json).unwrap(); 1330 - assert_eq!(payload["iss"], "https://test.example.com", "iss must be public_url"); 1331 - assert_eq!(payload["aud"], "https://test.example.com", "aud must be public_url"); 1330 + assert_eq!( 1331 + payload["iss"], "https://test.example.com", 1332 + "iss must be public_url" 1333 + ); 1334 + assert_eq!( 1335 + payload["aud"], "https://test.example.com", 1336 + "aud must be public_url" 1337 + ); 1332 1338 } 1333 1339 1334 1340 #[tokio::test]