Auto-indexing service and GraphQL API for AT Protocol Records quickslice.slices.network/
atproto gleam graphql
at main 37 lines 1.0 kB view raw
1import gleam/option.{None} 2import gleeunit/should 3import handlers/oauth/client_metadata 4 5pub fn generate_metadata_test() { 6 let metadata = 7 client_metadata.generate_metadata( 8 "https://example.com/oauth-client-metadata.json", 9 "Test Client", 10 ["https://example.com/callback"], 11 "atproto transition:generic", 12 None, 13 None, 14 ) 15 16 metadata.client_id 17 |> should.equal("https://example.com/oauth-client-metadata.json") 18 metadata.client_name |> should.equal("Test Client") 19 metadata.scope |> should.equal("atproto transition:generic") 20 metadata.dpop_bound_access_tokens |> should.be_true 21} 22 23pub fn scopes_passed_through_test() { 24 let metadata = 25 client_metadata.generate_metadata( 26 "https://example.com", 27 "Test", 28 [], 29 "atproto transition:generic transition:chat.bsky", 30 None, 31 None, 32 ) 33 34 // Scopes should be passed through as-is (validated at config save time) 35 metadata.scope 36 |> should.equal("atproto transition:generic transition:chat.bsky") 37}