Skip to content

fix(connect): resolve applications by client ID - #92

Merged
gjtorikian merged 2 commits into
workos:mainfrom
m-mohamed:codex/connect-application-client-id-lookup
Sep 3, 2026
Merged

fix(connect): resolve applications by client ID#92
gjtorikian merged 2 commits into
workos:mainfrom
m-mohamed:codex/connect-application-client-id-lookup

Conversation

@m-mohamed

Copy link
Copy Markdown
Contributor

Summary

  • resolve Connect applications by entity ID first, then exact indexed client_id
  • match the WorkOS API contract that retrieval accepts an application ID or client ID
  • preserve unknown-reference 404 behavior and prove ID-first collision semantics

Verification

  • bun test: 976/976
  • bun run typecheck
  • bun run build
  • bun run lint
  • bun run fmt:check
  • package, Node smoke, and generated-drift checks
  • independent review: PASS

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown

Greptile Summary

The PR aligns Connect application lookup with the WorkOS contract by accepting either an application ID or an indexed client ID while preserving entity-ID precedence and unknown-reference behavior.

  • Adds a shared ID-first application resolver.
  • Uses the resolver for application retrieval and client-secret creation.
  • Adds coverage for client-ID lookup, collisions, missing references, and secret creation.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/workos/routes/connect.ts Introduces a primary-ID-first resolver and consistently applies it to application retrieval and client-secret creation.
src/workos/routes/connect.spec.ts Adds focused regression coverage for client-ID resolution, ID collision precedence, missing references, and client-secret ownership.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Application reference] --> B{Matches entity ID?}
  B -->|Yes| C[Return ID owner]
  B -->|No| D{Matches indexed client_id?}
  D -->|Yes| E[Return client-ID owner]
  D -->|No| F[Return 404]
Loading

Reviews (2): Last reviewed commit: "fix(connect): resolve client_secrets rou..." | Re-trigger Greptile

The spec documents `{id}` on every /connect/applications/{id}... route as
"the application ID or client ID", so secret creation must accept a
client_id the same way the GET now does. Hoist a single resolver so both
handlers share ID-first precedence, keep the param named `:id` to match
the spec and the sibling route, and assert the collision test actually
set up a colliding client_id before checking precedence.
@gjtorikian gjtorikian changed the title fix(workos): resolve Connect applications by client ID fix(connect): resolve applications by client ID Sep 3, 2026
@gjtorikian
gjtorikian merged commit b4afb88 into workos:main Sep 3, 2026
13 of 14 checks passed
@gjtorikian

Copy link
Copy Markdown
Collaborator

thanks!

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants