Skip to content

Commit 585a47c

Browse files
daviddanialyclaude
andcommitted
mig: add session-enrichment capability and discovery-tracking columns to remote_session_issuers
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C555wgLmfbVWf4oxK7FvwB
1 parent eda3ac0 commit 585a47c

7 files changed

Lines changed: 423 additions & 89 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"server": patch
3+
---
4+
5+
Add nullable columns to `remote_session_issuers` for the OpenID Connect and OAuth capabilities that drive session enrichment (`userinfo_endpoint`, `introspection_endpoint`, `introspection_endpoint_auth_methods_supported`, `id_token_signing_alg_values_supported`, `claims_supported`, `backchannel_logout_supported`, `authorization_response_iss_parameter_supported`) and for tracking discovery itself (`metadata_fetched_at`, `metadata_last_error`, `metadata_last_error_at`). Schema only; discovery does not populate them yet.

server/database/schema.sql

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2365,6 +2365,20 @@ CREATE TABLE IF NOT EXISTS remote_session_issuers (
23652365
-- client_id, which Gram uses to pre-flight whether outbound CIMD is viable.
23662366
client_id_metadata_document_supported BOOLEAN NOT NULL DEFAULT FALSE,
23672367

2368+
-- OpenID Connect Discovery, RFC 7662, RFC 9207, and OpenID Back-Channel
2369+
-- Logout fields that tell Gram which session-enrichment interfaces an
2370+
-- issuer offers. All nullable with no default, following
2371+
-- code_challenge_methods_supported: NULL means discovery has not captured
2372+
-- the field for this row yet, which stays distinct from an empty array or
2373+
-- FALSE written by a refresh ("captured; the upstream advertises nothing").
2374+
userinfo_endpoint TEXT,
2375+
introspection_endpoint TEXT,
2376+
introspection_endpoint_auth_methods_supported TEXT[],
2377+
id_token_signing_alg_values_supported TEXT[],
2378+
claims_supported TEXT[],
2379+
backchannel_logout_supported BOOLEAN,
2380+
authorization_response_iss_parameter_supported BOOLEAN,
2381+
23682382
oidc BOOLEAN NOT NULL DEFAULT FALSE,
23692383
passthrough BOOLEAN NOT NULL DEFAULT FALSE,
23702384

@@ -2385,6 +2399,18 @@ CREATE TABLE IF NOT EXISTS remote_session_issuers (
23852399
-- drop the OIDC fields they omit.
23862400
metadata JSONB,
23872401

2402+
-- When discovery last wrote the discovered endpoint, capability, and
2403+
-- metadata columns. updated_at also moves on operator edits, so this is
2404+
-- the only way to tell a stale capability set from a fresh one and the
2405+
-- only thing a scheduled refresh can order by. NULL for rows created from
2406+
-- the form or predating capture.
2407+
metadata_fetched_at timestamptz,
2408+
-- The public-safe reason the most recent metadata refresh failed, and when.
2409+
-- NULL when the row has never failed a refresh; cleared by the next
2410+
-- successful one.
2411+
metadata_last_error TEXT,
2412+
metadata_last_error_at timestamptz,
2413+
23882414
created_at timestamptz NOT NULL DEFAULT clock_timestamp(),
23892415
updated_at timestamptz NOT NULL DEFAULT clock_timestamp(),
23902416
deleted_at timestamptz,

server/internal/database/models.go

Lines changed: 40 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/internal/remotesessions/repo/models.go

Lines changed: 40 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)