Skip to content

Declare clientId a string, not a foreign key - #13

Merged
mastacontrola merged 1 commit into
mainfrom
oidc-clientid-string
Aug 17, 2026
Merged

Declare clientId a string, not a foreign key#13
mastacontrola merged 1 commit into
mainfrom
oidc-clientid-string

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

An OpenID Connect client id is a string the provider chooses — fog-web, or a GUID on Entra. It also ends in "id", and FOGController::save() read any key ending in "id" as an integer foreign key.

Because clientId is required, that did not make provider rows slightly worse — it made creating one impossible:

[2026-08-17 14:49:30] OIDC ID:  Name: Test IdP has failed to save.
                      Error: Required database field is empty: clientId

…about a field the admin had filled in, surfacing in the UI as the generic "Add provider failed!". And since no provider could exist, no provider group could exist either — so the Role and User Group provider-group tabs from #10 had nothing to associate. That is how it was found.

FOGProject/fogproject#1153 stops the base class inferring a column's type from its name and lets the model declare it instead. This is the declaration.

Verified against a live 1.6 database from a shadow tree carrying both changes: clientId => 'fog-web' saves and reads back intact (opClientID = fog-web). Before the pair, the same call returned false.

The gate goes in the existing oidc-provider-safety.test.php rather than a new file, because it belongs with the other silent ways a provider row can be wrong — dropping the declaration switches provider creation off entirely. Mutation-verified: removing the property fails the test with a message naming the cause.

Requires FOGProject/fogproject#1153 — inert without it, and harmless: on an older core the property is simply an unread declaration.

🤖 Generated with Claude Code

https://claude.ai/code/session_017aBSWrDArXHTpKWkkN27LR

An OpenID Connect client id is a string the provider chooses -- "fog-web",
or a GUID on Entra -- but it ends in "id", and FOGController::save() read
any key ending in "id" as an integer foreign key. clientId is required, so
the mismatch did not degrade anything: it made creating a provider
impossible, reported as

    Required database field is empty: clientId

about a field the admin had filled in, surfacing in the UI as the generic
"Add provider failed!". No OIDC provider could be created at all, which
also means no provider group, and so the Role and User Group provider-group
tabs from #10 had nothing to associate.

fogproject#1153 stops the base class inferring a column's type from its
name and lets the model say so instead. This declares it.

The gate lives in the existing provider-safety test because this belongs
with the other silent ways a provider row can be wrong: dropping the
declaration does not make providers slightly worse, it switches provider
creation off entirely.

Requires fogproject#1153; inert without it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017aBSWrDArXHTpKWkkN27LR
@mastacontrola
mastacontrola merged commit 6d7ee5b into main Aug 17, 2026
2 checks passed
@mastacontrola
mastacontrola deleted the oidc-clientid-string branch August 17, 2026 19:58
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