refactor: migrate from tokens_module to sessions_module #39
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.
refactor: migrate from tokens_module to sessions_module
Summary
BREAKING CHANGE: This PR completely removes
tokens_moduleand replaces it withsessions_modulefor session-centric authentication.Key changes:
tokens_module(deploy/revert/verify SQL files)sessions_modulewith columns forsessions_table,session_credentials_table, andauth_settings_tablecrypto_auth_moduleto usesessions_table_idandsession_credentials_table_idinstead oftokens_table_iduser_auth_modulesimilarly - replaced tokens references with sessions referencespgpm.planto reflect new module dependenciessessions_modulestructure instead oftokens_moduleReview & Testing Checklist for Human
This is a breaking change affecting core authentication infrastructure. Please verify:
tokens_moduleortokens_table_idcolumnspgpm deployand verify the newsessions_moduletable is created correctly with all FK constraintssessions_table_fkeyandsession_credentials_table_fkeyconstraints should referencemetaschema_public.tablecorrectlypnpm testinpackages/metaschema-modulesto verify all tests pass with the new structuretokens_moduledata, plan for migration before deployingRecommended Test Plan
pnpm testin the metaschema-modules packagesessions_moduletable exists with correct columnscrypto_auth_moduleanduser_auth_moduletables have the newsessions_table_idandsession_credentials_table_idcolumnsNotes
This change is part of a larger migration from token-based auth to session-centric auth in the constructive-db ecosystem. The companion PR in constructive-db (PR #458) contains the corresponding changes to the auth functions.
Link to Devin run: https://app.devin.ai/sessions/d30b2724020f43f6b94865bbd5cf71c6
Requested by: @pyramation