Skip to content

Fix integration API site resource lookup - #3510

Open
shubhamsinnh wants to merge 1 commit into
fosrl:mainfrom
shubhamsinnh:codex/fix-integration-site-resource
Open

Fix integration API site resource lookup#3510
shubhamsinnh wants to merge 1 commit into
fosrl:mainfrom
shubhamsinnh:codex/fix-integration-site-resource

Conversation

@shubhamsinnh

@shubhamsinnh shubhamsinnh commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.

Description

Fixes #2743.

The integration API route GET /site-resource/{siteResourceId} only provides a resource ID, but the shared request schema required an orgId. As a result, valid requests failed validation before the resource lookup ran.

This makes orgId optional for ID-based lookups while keeping it as an additional constraint for org-scoped routes. It also updates the OpenAPI definitions so they only advertise parameters that are actually present in the route.

A regression test covers the ID-only route, the existing org-scoped form, and invalid resource IDs.

For API-key and user routes, the existing access middleware still authorizes the requested resource before this handler runs. Root API keys continue through the existing root-key check and receive the normal not-found response when the resource does not exist.

How to test?

npx tsx server/routers/siteResource/getSiteResource.test.ts
npx eslint server/routers/siteResource/getSiteResource.ts server/routers/siteResource/getSiteResource.test.ts
npx prettier --check server/routers/siteResource/getSiteResource.ts server/routers/siteResource/getSiteResource.test.ts
npx tsc --noEmit

All four checks pass locally.

@shubhamsinnh
shubhamsinnh marked this pull request as ready for review July 30, 2026 10:05
@shubhamsinnh

shubhamsinnh commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Hi @oschwartz10612, @miloschwartz, and @AstralDestiny
This addresses the integration API lookup failure reported in #2743.

I'd appreciate your review when you get a chance
Thanks !!

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.

[Integration API] GET /site-resource/{siteResourceId} not working

1 participant