Skip to content

fix(authorization): serve delete by organization, type and external id - #209

Open
etiennecoutaud wants to merge 1 commit into
workos:mainfrom
etiennecoutaud:fix/authorization-delete-resource-by-external-id
Open

etiennecoutaud wants to merge 1 commit into
workos:mainfrom
etiennecoutaud:fix/authorization-delete-resource-by-external-id

Conversation

@etiennecoutaud

Copy link
Copy Markdown

Summary

DELETE /authorization/organizations/:organization_id/resources/:resource_type_slug/:external_id had no route, so deleting a resource by external id (DeleteResourceByExternalID in workos-go, with or without cascade_delete) got 404 Not Found. The emulator already served GET and PATCH on that path, and DELETE by resource id.

Fixes #207

Behavior

Checked against a WorkOS staging environment, on a resource holding one role assignment:

Call WorkOS Emulator before
delete by external id, no cascade_delete 409 resource_has_dependents 404 Not Found
delete by external id, cascade_delete=true 204, resource gone 404 Not Found

The emulator now matches both rows.

What changed

  • The delete-by-id handler becomes deleteResource(c, resource, ref), shared by both routes, the way updateResource is shared by the PATCH routes.
  • docs/behavior.md: the FGA / Authorization section notes that deletes are served by id and by external id, with the same rules.
  • SUPPORTED.md regenerated: FGA / Authorization write coverage goes from 24/27 to 25/27.

No other endpoint changes behavior.

Tests

  • New case in authorization-resources.spec.ts: the 409 without cascade_delete, the 204 with it (the child resource is deleted too), and the 404 for an unknown resource. It fails on main.
  • bun test (2091 pass), bun run typecheck, bun run lint, bun run fmt:check, bun run build, node scripts/check-package.mjs, node scripts/smoke-node.mjs, and the codegen and SUPPORTED.md drift checks all pass.

@greptile-apps

greptile-apps Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Adds resource deletion by organization, resource type, and external ID using the existing delete rules.

  • Authorization resources can now be deleted by organization, type, and external ID.

No actionable issues found.

Reviews (1) · Last reviewed commit: "fix(authorization): serve delete by orga..." · Reviewed by Greptile

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.

DELETE /authorization/organizations/:org/resources/:type/:external_id is not served

1 participant