Skip to content

Remove the conversion of the pre-0.4.0 SSO configuration - #415

Merged
tnkuehne merged 1 commit into
mainfrom
cleanup/legacy-sso-conversion
Nov 25, 2026
Merged

tnkuehne merged 1 commit into
mainfrom
cleanup/legacy-sso-conversion

Conversation

@tnkuehne

@tnkuehne tnkuehne commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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:

    • the legacy-sso-client-secret secret context
    • the leftover identity document location in secret re-encryption
  • Guard migration 0046_require_converted_sso. Startup refuses to continue while any organization_settings row still has an identity key, including identity: null. Its message:

    Company SSO settings still use the configuration format of earlier releases. Start the previous release once so it converts the earlier SSO configuration, then upgrade.

    0044_require_jwe_secrets still 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 check
  • tests/sso-conversion-guard.integration.test.ts (new): a row with an identity document or identity: null aborts 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.ts
  • RUN_CLOUDFLARE_TESTS=1 vitest run tests/cloudflare/initialization.test.ts
  • tests/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.RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

The PR appears safe to merge with the stated staged upgrade requirement.

Summary

Removes startup conversion of pre-0.4.0 company SSO settings.

  • Upgrades now stop until old company sign-in settings are converted.

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"]
Loading

Reviews (1) · Last reviewed commit: "Remove the conversion of the pre-0.4.0 S..." · Reviewed by Greptile

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.
@tnkuehne
tnkuehne merged commit 63cff38 into main Nov 25, 2026
18 checks passed
@tnkuehne
tnkuehne deleted the cleanup/legacy-sso-conversion branch November 25, 2026 21:53
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