perlsky is a Perl 5 implementation of an AT Protocol Personal Data Server.
13
fork

Configure Feed

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

Split temp endpoint coverage from catch-all suite

alice 7ab4f54b 748d5b8c

+115 -62
+3 -2
docs/TEST_AUDIT.md
··· 116 116 Current suite counts by bucket: 117 117 118 118 - `direct reference differential`: `5` 119 - - `audited local regression`: `31` 119 + - `audited local regression`: `32` 120 120 - `local correctness/infrastructure`: `13` 121 121 122 122 | Test file | Bucket | Current note | ··· 168 168 | `t/service-proxy.t` | audited local regression | upstream proxy behavior plus conservative local appview fallback and preference semantics | 169 169 | `t/sqlite-binary.t` | local correctness/infrastructure | SQLite binary round-trip correctness | 170 170 | `t/store-sqlite.t` | audited local regression | store-level session, invite, label, and repo persistence behavior | 171 + | `t/temp-endpoints.t` | audited local regression | isolated local coverage for `com.atproto.temp.*` semantics and admin credential revocation behavior | 171 172 | `t/tid-repair.t` | local correctness/infrastructure | TID repair and recovery helpers | 172 173 | `t/uncovered-endpoints.t` | audited local regression | intentionally mixed catch-all for admin/temp/sync/local-policy edges that are easy to miss elsewhere; useful coverage, but one of the least reference-pure suites in the tree | 173 174 ··· 182 183 - `t/import-repo.t` 183 184 Is close to a clean conformance suite, but still includes the local `accepting_imports` gate in the same file. 184 185 - `t/uncovered-endpoints.t` 185 - Exists specifically to stop lesser-used local endpoints from falling out of coverage; it should be read as a pragmatic safety net, not as a pure reference-alignment suite. 186 + Exists specifically to stop lesser-used local endpoints from falling out of coverage; it is a little narrower after moving the self-contained `com.atproto.temp.*` checks into `t/temp-endpoints.t`, but it should still be read as a pragmatic safety net, not as a pure reference-alignment suite. 186 187 187 188 ## What This Audit Does Not Yet Claim 188 189
+112
t/temp-endpoints.t
··· 1 + use v5.34; 2 + use warnings; 3 + 4 + use Config (); 5 + use File::Spec; 6 + use File::Temp qw(tempdir); 7 + use FindBin qw($Bin); 8 + use MIME::Base64 qw(encode_base64); 9 + use Test::More; 10 + 11 + BEGIN { 12 + require lib; 13 + my $root = File::Spec->rel2abs(File::Spec->catdir($Bin, '..')); 14 + lib->import( 15 + File::Spec->catdir($root, 'lib'), 16 + File::Spec->catdir($root, 'local', 'lib', 'perl5'), 17 + File::Spec->catdir($root, 'local', 'lib', 'perl5', $Config::Config{archname}), 18 + ); 19 + } 20 + 21 + use Test::Mojo; 22 + use ATProto::PDS; 23 + 24 + my $root = File::Spec->rel2abs(File::Spec->catdir($Bin, '..')); 25 + my $tmp = tempdir(CLEANUP => 1); 26 + 27 + my $app = ATProto::PDS->new( 28 + project_root => $root, 29 + settings => { 30 + base_url => 'http://127.0.0.1:7755', 31 + service_handle_domain => 'example.test', 32 + service_did_method => 'did:web', 33 + jwt_secret => 'temp-endpoints-secret', 34 + admin_password => 'admin-secret', 35 + testing_auto_confirm_email => 1, 36 + data_dir => $tmp, 37 + db_path => File::Spec->catfile($tmp, 'perlsky.sqlite'), 38 + }, 39 + ); 40 + 41 + my $t = Test::Mojo->new($app); 42 + my $admin_auth = 'Basic ' . encode_base64('admin:admin-secret', q()); 43 + 44 + $t->post_ok('/xrpc/com.atproto.server.createAccount' => json => { 45 + handle => 'alice.example.test', 46 + email => 'alice@example.test', 47 + password => 'hunter22', 48 + })->status_is(200); 49 + 50 + my $created = $t->tx->res->json; 51 + my $did = $created->{did}; 52 + my $access = $created->{accessJwt}; 53 + 54 + $t->post_ok('/xrpc/com.atproto.server.createAppPassword' => { 55 + Authorization => "Bearer $access", 56 + } => json => { 57 + name => 'revoke-me', 58 + })->status_is(200) 59 + ->json_like('/password' => qr/\w/); 60 + 61 + my $app_password = $t->tx->res->json->{password}; 62 + 63 + $t->get_ok('/xrpc/com.atproto.temp.checkSignupQueue') 64 + ->status_is(200) 65 + ->json_is('/activated' => JSON::PP::true); 66 + 67 + $t->get_ok('/xrpc/com.atproto.temp.dereferenceScope?scope=ref:app.bsky.feed.post') 68 + ->status_is(200) 69 + ->json_is('/scope' => 'app.bsky.feed.post'); 70 + 71 + $t->get_ok('/xrpc/com.atproto.temp.dereferenceScope?scope=app.bsky.feed.post') 72 + ->status_is(400) 73 + ->json_is('/error' => 'InvalidScopeReference'); 74 + 75 + $t->get_ok('/xrpc/com.atproto.temp.dereferenceScope?scope=ref:') 76 + ->status_is(400) 77 + ->json_is('/error' => 'InvalidScopeReference'); 78 + 79 + $t->post_ok('/xrpc/com.atproto.temp.requestPhoneVerification' => json => { 80 + phoneNumber => '+441234567890', 81 + })->status_is(200) 82 + ->content_is(q()); 83 + 84 + $t->post_ok('/xrpc/com.atproto.temp.revokeAccountCredentials' => json => { 85 + account => $did, 86 + })->status_is(401) 87 + ->json_is('/error' => 'AuthRequired'); 88 + 89 + $t->post_ok('/xrpc/com.atproto.temp.revokeAccountCredentials' => { 90 + Authorization => $admin_auth, 91 + } => json => { 92 + account => $did, 93 + })->status_is(200) 94 + ->content_is(q()); 95 + 96 + $t->get_ok('/xrpc/com.atproto.server.getSession' => { 97 + Authorization => "Bearer $access", 98 + })->status_is(401); 99 + 100 + $t->post_ok('/xrpc/com.atproto.server.createSession' => json => { 101 + identifier => 'alice.example.test', 102 + password => $app_password, 103 + })->status_is(401) 104 + ->json_is('/error' => 'AuthenticationRequired'); 105 + 106 + $t->post_ok('/xrpc/com.atproto.server.createSession' => json => { 107 + identifier => 'alice.example.test', 108 + password => 'hunter22', 109 + })->status_is(401) 110 + ->json_is('/error' => 'AuthenticationRequired'); 111 + 112 + done_testing;
-60
t/uncovered-endpoints.t
··· 534 534 })->status_is(200) 535 535 ->json_has('/accessJwt'); 536 536 537 - $access = $t->tx->res->json->{accessJwt}; 538 - 539 - $t->post_ok('/xrpc/com.atproto.server.createAppPassword' => { 540 - Authorization => "Bearer $access", 541 - } => json => { 542 - name => 'revoke-me', 543 - })->status_is(200) 544 - ->json_like('/password' => qr/\w/); 545 - 546 - my $app_password = $t->tx->res->json->{password}; 547 - 548 - $t->get_ok('/xrpc/com.atproto.temp.checkSignupQueue') 549 - ->status_is(200) 550 - ->json_is('/activated' => JSON::PP::true); 551 - 552 - $t->get_ok('/xrpc/com.atproto.temp.dereferenceScope?scope=ref:app.bsky.feed.post') 553 - ->status_is(200) 554 - ->json_is('/scope' => 'app.bsky.feed.post'); 555 - 556 - $t->get_ok('/xrpc/com.atproto.temp.dereferenceScope?scope=app.bsky.feed.post') 557 - ->status_is(400) 558 - ->json_is('/error' => 'InvalidScopeReference'); 559 - 560 - $t->get_ok('/xrpc/com.atproto.temp.dereferenceScope?scope=ref:') 561 - ->status_is(400) 562 - ->json_is('/error' => 'InvalidScopeReference'); 563 - 564 - $t->post_ok('/xrpc/com.atproto.temp.requestPhoneVerification' => json => { 565 - phoneNumber => '+441234567890', 566 - })->status_is(200) 567 - ->content_is(q()); 568 - 569 - $t->post_ok('/xrpc/com.atproto.temp.revokeAccountCredentials' => json => { 570 - account => $did, 571 - })->status_is(401) 572 - ->json_is('/error' => 'AuthRequired'); 573 - 574 - $t->post_ok('/xrpc/com.atproto.temp.revokeAccountCredentials' => { 575 - Authorization => $admin_auth, 576 - } => json => { 577 - account => $did, 578 - })->status_is(200) 579 - ->content_is(q()); 580 - 581 - $t->get_ok('/xrpc/com.atproto.server.getSession' => { 582 - Authorization => "Bearer $access", 583 - })->status_is(401); 584 - 585 - $t->post_ok('/xrpc/com.atproto.server.createSession' => json => { 586 - identifier => 'alice.example.test', 587 - password => $app_password, 588 - })->status_is(401) 589 - ->json_is('/error' => 'AuthenticationRequired'); 590 - 591 - $t->post_ok('/xrpc/com.atproto.server.createSession' => json => { 592 - identifier => 'alice.example.test', 593 - password => 'new-hunter22', 594 - })->status_is(401) 595 - ->json_is('/error' => 'AuthenticationRequired'); 596 - 597 537 done_testing;