Commit Graph
32 Commits
Author SHA1 Message Date
mr-pmillzandClaude Opus 5.5 4cb620f46b Fix Integration API organization delete (regression of #1376)
DELETE /v1/org/{orgId} on the Integration API always returned
500 "An error occurred..." and left the organization in place, even for a
root API key holding the deleteOrg action. The handler looked up the
caller's ownership with req.user!.userId, but Integration API requests are
authenticated by verifyApiKey, which sets req.apiKey and never req.user,
so the lookup threw "Cannot read properties of undefined (reading
'userId')".

#1376 was fixed in f37eda47 by dropping the user-only permission check;
79cf7c84 later added the owner check to the handler shared by both
routers, reintroducing the failure for API keys.

Keep the owner check for dashboard sessions. For Integration API keys the
route is already restricted by verifyApiKeyIsRoot and
verifyApiKeyHasAction(deleteOrg), so load the organization directly. Both
paths still refuse a billing organization and return the same 404 for an
unknown organization.

Verified against a local SQLite instance with a root key: before the
change, create returned 201 and delete returned 500 with the organization
still present; after it, delete returns 200 and a repeated delete or GET
returns 404. npx tsc --noEmit passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 11:09:18 -04:00
Owen c85a7f6ac5 Migrate unkown openapi response from string to {} 2026-06-09 15:35:08 -07:00
copilot-swe-agent[bot]andoschwartz10612 a0a093ed0b Document all registerPath responses and normalize OpenAPI parser schemas
Agent-Logs-Url: https://github.com/fosrl/pangolin/sessions/73990123-9c27-444b-bc6e-77e890a0d57c

Co-authored-by: oschwartz10612 <4999704+oschwartz10612@users.noreply.github.com>
2026-05-17 06:43:10 +00:00
miloschwartz 79cf7c84dc support delete org and preserve path on switch 2026-02-17 16:45:15 -08:00
miloschwartz 33f0782f3a support delete account 2026-02-14 18:01:37 -08:00
Owen ce632a25cf Consolidate the messages into the same enum 2026-01-17 11:41:10 -08:00
Owen 9114dd5992 Send terminate error messages 2026-01-16 14:57:54 -08:00
Owen 152fb47ca4 Handle unrelay and relaying better 2025-12-02 11:17:08 -05:00
Owen de83cf9d8c Handle delete org and checking org policy 2025-11-26 15:35:33 -05:00
Lokowitz 7db99a7dd5 used zod codemod 2025-11-16 14:18:17 +00:00
Owen d92b87b7c8 Chungus 2.0 2025-10-10 11:27:15 -07:00
Owen f37eda4739 Fix #1376 2025-08-30 22:28:37 -07:00
miloschwartz adc0a81592 delete org domains and resources on org delete 2025-07-28 15:34:56 -07:00
miloschwartz 494329f568 delete resources on delete org 2025-07-28 12:55:20 -07:00
Owen 98a261e38c Pull up downstream changes 2025-07-13 21:57:24 -07:00
miloschwartz 2cca561e51 support postgresql as database option 2025-06-04 12:02:07 -04:00
miloschwartz d260450a84 add openapi registers 2025-04-06 22:44:14 -04:00
miloschwartz fefb07e14c move schema.ts to module 2025-03-23 17:11:48 -04:00
Milo Schwartz 3b4a993704 refactor and reorganize 2025-01-01 21:41:31 -05:00
Owen Schwartz 2f328fc719 Add basic transactions 2024-12-24 16:00:02 -05:00
Owen Schwartz 35358cbe57 Working on delete 2024-12-24 12:08:31 -05:00
Owen Schwartz 0386d81b95 Merge branch 'main' of https://github.com/fosrl/pangolin 2024-12-22 12:04:57 -05:00
Owen Schwartz 1361b47ef7 Remove dangerous logging 2024-12-22 12:03:46 -05:00
Milo Schwartz ce5df3b0b9 fix issues from test deploy 2024-12-21 21:01:12 -05:00
Milo Schwartz 03051878ef rename super user to admin and middleware refactoring 2024-11-05 22:38:57 -05:00
Milo Schwartz 2852d62258 refactor contexts, format zod errors, and more refactoring 2024-11-03 13:57:51 -05:00
Owen Schwartz 9abb656d52 Move to string ordId 2024-10-14 15:11:18 -04:00
Owen Schwartz 364b2c26c3 Add role aware updates & endpoints 2024-10-12 21:36:30 -04:00
Owen Schwartz 8213036729 Format files and fix http response 2024-10-06 18:05:20 -04:00
Owen Schwartz 81017139c5 Add actions check to all endpoints 2024-10-06 16:43:59 -04:00
Owen Schwartz ecdf2dfd04 Fix return response and add list 2024-10-02 21:17:38 -04:00
Milo Schwartz 1a91dbb89c organized routes and routes and added rate limiter 2024-10-02 00:04:40 -04:00