fix: default atproto client_id to deployer-hosted metadata
Authorization servers reject the Gitea-raw copy's text/plain Content-Type when fetching client metadata at PAR time (verified against a live PDS). The deployer serves the same document as application/json.
This commit is contained in:
1 parent
5772bedb88
commit
9ebb35860c
3 files changed
+8
-6
No files matched your search
@@ -198,7 +198,7 @@ func TestOAuthFlowResolvePARExchangeSaveRefresh(t *testing.T) {
|
||||
authURL := BuildAuthorizeURL(resolved.AuthServer, client.ClientID, par.RequestURI)
|
||||
if !strings.HasPrefix(authURL, pds.URL+"/oauth/authorize?") ||
|
||||
!strings.Contains(authURL, "request_uri=urn%3Aietf%3Aparams%3Aoauth%3Arequest_uri%3Areq-1") ||
|
||||
!strings.Contains(authURL, "client_id=https%3A%2F%2Fgit.site.latha.org") {
|
||||
!strings.Contains(authURL, "client_id=https%3A%2F%2Fdeploy.site.latha.org") {
|
||||
t.Fatalf("authorize URL = %s", authURL)
|
||||
}
|
||||
|
||||
|
||||
@@ -12,13 +12,15 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
// DefaultClientID serves the client metadata JSON from this repo
|
||||
// (oauth/atproto-client-metadata.json) via Gitea raw, so it is
|
||||
// versioned with the client. Regenerate with
|
||||
// DefaultClientID is served by gitea-k3s-deployer next to the OAuth
|
||||
// relay (it needs a real application/json response; Gitea raw
|
||||
// serves text/plain, which authorization servers reject — the copy
|
||||
// in this repo at oauth/atproto-client-metadata.json is kept only
|
||||
// as a versioned source). Regenerate with
|
||||
// `latha-auth atproto --print-client-metadata` after changing
|
||||
// scope or redirect URIs, or pass --client-id /
|
||||
// LATHA_ATPROTO_CLIENT_ID to use a different hosted copy.
|
||||
DefaultClientID = "https://git.site.latha.org/experiments/latha-auth/raw/branch/main/oauth/atproto-client-metadata.json"
|
||||
DefaultClientID = "https://deploy.site.latha.org/oauth/atproto-client-metadata.json"
|
||||
// DefaultScope covers full repo writes and blob uploads (the old
|
||||
// app-password capability level), which publishing tiles needs.
|
||||
DefaultScope = "atproto transition:generic"
|
||||
|
||||
Reference in new issue
Block a user