Skip to content

fix: allow non-string defaults in user_properties (#100)#129

Merged
JohnMcLear merged 1 commit intomainfrom
fix/user-properties-default-type
Apr 17, 2026
Merged

fix: allow non-string defaults in user_properties (#100)#129
JohnMcLear merged 1 commit intomainfrom
fix/user-properties-default-type

Conversation

@JohnMcLear
Copy link
Copy Markdown
Member

Fixes #100. The JTD schema rejected anything but a string in user_properties.*.default, so operators could not set is_admin/readOnly/canCreate to false/true defaults. Relax that slot to the JTD empty form ({}) so any JSON value is accepted — the default is assigned verbatim to req.session.user[propName] at authenticate time. Expose the compiled validator on exportedForTestingOnly and add specs that confirm string, boolean, and numeric defaults all validate.

The JTD schema forced \`user_properties.*.default\` to be a string, which
made it impossible to configure is_admin / readOnly / canCreate to
\`false\` / \`true\` — the obvious and documented way to set sensible
defaults from an OIDC provider. Reported since 2023.

Relax that slot to the JTD empty form \`{}\` so any JSON value is
accepted. The default is assigned verbatim to
\`req.session.user[propName]\` at authenticate time, so no downstream
code depends on it being a string.

Also expose \`validSettings\` on \`exportedForTestingOnly\` so the new spec
can exercise the validator directly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@JohnMcLear JohnMcLear merged commit 98d7658 into main Apr 17, 2026
2 of 3 checks passed
@JohnMcLear JohnMcLear deleted the fix/user-properties-default-type branch April 17, 2026 10:44
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.

default property should not be force to string

1 participant