Skip to content

feat(jwt-claims): add jwt_private.current_api_id()#99

Merged
pyramation merged 1 commit into
mainfrom
feat/jwt-claims-api-id
Jul 12, 2026
Merged

feat(jwt-claims): add jwt_private.current_api_id()#99
pyramation merged 1 commit into
mainfrom
feat/jwt-claims-api-id

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

Track A of constructive-io/constructive-planning#1149 (API invocation provenance). Adds jwt_private.current_api_id() to the jwt-claims package, following the exact pattern of jwt_private.current_database_id():

CREATE FUNCTION jwt_private.current_api_id() RETURNS uuid
-- reads current_setting('jwt.claims.api_id', TRUE)
-- returns NULL when the claim is absent or not a valid uuid (NOTICE on bad uuid)
-- STABLE

Deploy/revert/verify triple + pgpm.plan entry; regenerated sql/pgpm-jwt-claims--0.15.5.sql at the current extension default_version (same convention as the current_role_type addition — no version bump; lerna handles npm versioning at release time).

Consumed by constructive-io/constructive-db#2129, where the function_callable_check policy's api arm requires a function_api_bindings row with api_id = jwt_private.current_api_id(). The vendored copy in constructive-db pgpm-modules/jwt-claims is updated identically in that PR.

Link to Devin session: https://app.devin.ai/sessions/c57a4982235d4b4098e9a49bbe99c355
Requested by: @pyramation

Reads the jwt.claims.api_id GUC and returns it as uuid; returns NULL
when the claim is absent or not a valid uuid. Used by constructive-db
function invocation policies to verify API request provenance.

Ref: constructive-io/constructive-planning#1149
@pyramation pyramation self-assigned this Jul 12, 2026
@devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@pyramation pyramation merged commit b646b97 into main Jul 12, 2026
23 checks passed
@pyramation pyramation deleted the feat/jwt-claims-api-id branch July 12, 2026 22:08
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