Repository navigation
Remove the conversion of the pre-0.4.0 SSO configuration - #415
Merged
Merged
Conversation
Releases from 0.4.0 on convert the company SSO configuration that earlier releases stored in organization_settings.settings.identity into an SSO provider at every startup. The conversion is no longer needed. - Remove migrateSsoSettings and its calls in Node and Hosted initialization. - Remove the legacy-sso-client-secret context and the leftover identity document location from secret re-encryption. - Add migration 0046_require_converted_sso. It aborts while an organization still has an identity document and asks operators to start the previous release once, then upgrade. - Remove the tests that covered only the conversion and the identity document, and test the guard.
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.
Removes the startup conversion of the company SSO configuration that releases before 0.4.0 stored in
organization_settings.settings.identity.Changes
Conversion removed.
sso-migration.ts(migrateSsoSettings) is deleted, with its calls in Node startup (runtime-initialization.ts) and Hosted initialization (tools/cloudflare-initialization.ts).Identity document support removed:
legacy-sso-client-secretsecret contextGuard migration
0046_require_converted_sso. Startup refuses to continue while anyorganization_settingsrow still has anidentitykey, includingidentity: null. Its message:0044_require_jwe_secretsstill checks the identity document's client secret and is unchanged.Upgrade path
The conversion first shipped in 0.4.0 (#68). Every release from 0.4.0 up to this change runs it at startup, for Node and Hosted installations.
Installations upgrading from a release before 0.4.0 must first start a release with the conversion (0.4.0 or newer, before this change) once, so it converts the earlier SSO configuration. Then they can upgrade to a release with this change. Their stored secrets also fall under the requirement of
0044_require_jwe_secrets(#399).Installations already on 0.4.0 or newer have no identity document left and pass the guard.
Testing
pnpm checktests/sso-conversion-guard.integration.test.ts(new): a row with an identity document oridentity: nullaborts with the message; the converted settings pass.tests/secret-reencryption.integration.test.ts: without the identity document cases. The paging case is removed: it exercised the only location that skipped rows without a ciphertext.tests/jwe-secret-guard.integration.test.ts,tests/settings.integration.test.ts,tests/runtime-errors.integration.test.ts,tests/email-setup.integration.test.tsRUN_CLOUDFLARE_TESTS=1 vitest run tests/cloudflare/initialization.test.tstests/e2e/setup.spec.ts(Playwright): the upgrade scenario that modeled an identity document and called the conversion is removed. The rest of the test passes.

Confidence Score: 5/5 
The PR appears safe to merge with the stated staged upgrade requirement.Summary
Removes startup conversion of pre-0.4.0 company SSO settings.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A["Node startup or Hosted setup"] --> B["Run database migrations"] B --> C{"Settings contain identity?"} C -->|Yes| D["Stop: start the previous release once"] C -->|No| E["Initialize installation"]Reviews (1) · Last reviewed commit: "Remove the conversion of the pre-0.4.0 S..." · Reviewed by Greptile