Skip to content

test: cover routing for a provider literally named "oauth"#119

Open
heskew wants to merge 1 commit into
mainfrom
test/oauth-named-provider-routing
Open

test: cover routing for a provider literally named "oauth"#119
heskew wants to merge 1 commit into
mainfrom
test/oauth-named-provider-routing

Conversation

@heskew

@heskew heskew commented Jun 9, 2026

Copy link
Copy Markdown
Member

What

Adds an integration test to integrationTests/path-segment-routing.test.ts covering a routing case the existing suite missed: a provider whose configured name is literally oauth must be reachable at /oauth/oauth/login.

Why

Harper strips the resource mount segment before the OAuth resource runs, so parseRoute receives target.id = "oauth/login" and must resolve providerName = "oauth". The existing suite only asserts oac-oauth-tenant (whose first path segment isn't oauth), so it does not exercise this case.

This came out of reviewing #101 ("detect and omit oauth prefix from path parts"), which strips a leading oauth segment in parseRoute. Verified empirically against real Harper:

So the prefix-strip isn't a harmless no-op — it breaks any provider legitimately named oauth. This test is the regression guard for that invariant: green on main, red under such a change.

Test

Reuses the existing path-segment-routing-app fixture (which already configures an oauth-named decoy provider) — no fixture changes. Boots real Harper and asserts the 302 + authorizationUrl origin/path + client_id.


🤖 Generated with Claude Code

Add an integration test asserting /oauth/oauth/login dispatches to a provider
whose configured name is literally "oauth" (302 to its authorizationUrl with
its client_id). Harper strips the mount segment, so parseRoute sees
target.id = "oauth/login" and must resolve providerName "oauth"; any change
that detects-and-omits a leading "oauth" path segment would instead resolve
"login" and make the provider unreachable.

The existing oac-oauth-tenant case doesn't exercise this (its first path
segment isn't "oauth"), so this new assertion is the one that fails under
such a change. Reuses the existing path-segment-routing-app fixture; no
fixture changes needed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@claude

claude Bot commented Jun 9, 2026

Copy link
Copy Markdown

Reviewed; no blockers found.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Reviewed; no blockers found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant