Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/cloud/src/edge/marketing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ describe("marketingProxyRequest", () => {
describe("isV2Path", () => {
const forwarded = [
"/.well-known/oauth-authorization-server/api/auth",
"/oauth/client-metadata.json",
"/api/auth/callback/google",
"/api/auth/callback/github",
"/git/acme/tools/info/refs",
Expand All @@ -117,10 +118,9 @@ describe("isV2Path", () => {
"/.well-known/oauth-authorization-server/api/auth/extra",
"/.well-known/oauth-protected-resource/mcp",
"/oauth/client-id-metadata.json",
// v2 does not serve OpenID configuration on executor.sh, and its client
// metadata document's move to executor.sh is pending.
// v2 does not serve OpenID configuration on executor.sh.
"/api/auth/.well-known/openid-configuration",
"/oauth/client-metadata.json",
"/oauth/client-metadata.json/extra",
// Git remotes need a path under /git/.
"/git",
"/gitlab/acme/tools/info/refs",
Expand Down
6 changes: 4 additions & 2 deletions apps/cloud/src/edge/marketing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ const matchesPathPattern = (pathname: string, pattern: string): boolean =>
pattern.endsWith("/*") ? pathname.startsWith(pattern.slice(0, -1)) : pathname === pattern;

/** Path patterns v2 answers on `executor.sh`. `/git/*` never matches
* `/gitlab/...`. v2's outbound OAuth client metadata document stays off this
* list: its move to `executor.sh` is pending, and v1's own document
* `/gitlab/...`. v1's own client metadata document
* (`/oauth/client-id-metadata.json`) stays with v1. */
const V2_PATHS: ReadonlyArray<string> = [
// Sign-in issuer metadata for the issuer `https://executor.sh/api/auth`.
"/.well-known/oauth-authorization-server/api/auth",
// v2's outbound OAuth client metadata document: its connected-account
// sign-ins name it as their client ID, beside their callback on this origin.
"/oauth/client-metadata.json",
"/git/*",
"/.well-known/agent-skills/*",
];
Expand Down
11 changes: 6 additions & 5 deletions apps/cloud/src/edge/v2-edge-contract.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"/.well-known/oauth-authorization-server/api/auth",
"/api/auth/callback/<provider>",
"/api/oauth/callback, when state starts with x2.",
"/oauth/client-metadata.json",
"/git/*",
"/ (without a v1 session)",
"/home",
Expand Down Expand Up @@ -56,6 +57,11 @@
"target": "/api/oauth/callback?code=c&state=x2.abc",
"forwards": true
},
{
"method": "GET",
"target": "/oauth/client-metadata.json",
"forwards": true
},
{
"method": "GET",
"target": "/git/acme/site.git/info/refs?service=git-upload-pack",
Expand Down Expand Up @@ -241,11 +247,6 @@
"target": "/api/oauth/callback?code=c",
"forwards": false
},
{
"method": "GET",
"target": "/oauth/client-metadata.json",
"forwards": false
},
{
"method": "GET",
"target": "/oauth/client-id-metadata.json",
Expand Down
Loading