Repository navigation
feat(config): write the OpenID Provider config keys - #336
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes the four OpenID Provider system config keys writable:
oidc_provider_enabled,oidc_issuer,allow_client_secrets, andthird_party_clients_enabledmove fromNOT_YET_WRITABLEtoWRITABLE_KEYS, soseamless config setandconfig applysend them.NOT_YET_WRITABLEstays (now empty) with its test, so the next types bump that adds a key still fails until it is placed.Why
The instance's patch schema is strict, so these keys stayed unsent until an auth API accepted them. The API that does is merged on main and ships in auth API 0.21.0, so this PR needs auth API 0.21.0; against an older instance
config seton one of these keys is refused by the instance.Values
oidc_provider_enabled,allow_client_secrets,third_party_clients_enabledparse as JSON booleans;oidc_issuertakes a URL, ornullto clear it. These matchSystemConfigPatchSchema(z.boolean().optional()andz.url().nullable().optional()).config setchecks the four values against the shared patch schema fields before sending, soconfig set oidc_provider_enabled yesfails with "oidc_provider_enabled must be true or false." rather than the instance's 400.config applyleaves validation to the instance, as it does for every other key.oidc_issuer,rpid, and signing keys, which only the instance knows, so that rule stays on the instance and is documented rather than checked.Docs
seamless config --helpand the README document the keys: the instance refuses to enable the provider untiloidc_issueris set,allow_client_secretsenables the weaker shared-secret client authentication andseamless clientsrefuses shared-secret clients until it is on, and third-party clients needthird_party_clients_enabled.Bumps
@seamless-auth/typesto 0.34.0-next.3. Minor changeset.Closes #332
Checks
npm run build: passesnpm run coverage: 76 files passed, 1 skipped; 1698 tests passed, 4 skipped; thresholds met (all files 99.04% statements, 96.68% branches, 98.68% functions, 99.31% lines)npm run check:types-current:@seamless-auth/types "0.34.0-next.3" is currentnpm run check:pins: passes