-
Notifications
You must be signed in to change notification settings - Fork 0
Auth: add magic-link/session migrations and runtime datasource #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
RandyJDean
wants to merge
1
commit into
main
Choose a base branch
from
07-09-auth_add_magic-link_session_migrations_and_runtime_datasource
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| -- Single-use sign-in tokens emailed to users. Keyed by email (not member id) | ||
| -- because the member row is only created once the link is verified. | ||
| CREATE TABLE IF NOT EXISTS "magic_link_tokens" ( | ||
| id UUID PRIMARY KEY, | ||
|
RandyJDean marked this conversation as resolved.
|
||
| email TEXT NOT NULL, | ||
| token_hash TEXT UNIQUE NOT NULL, | ||
| expires_at TIMESTAMPTZ NOT NULL, | ||
| consumed_at TIMESTAMPTZ, | ||
| created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() | ||
| ); | ||
|
|
||
| CREATE INDEX idx_magic_link_tokens_email ON "magic_link_tokens" (email); | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| -- Spring Session JDBC schema, copied verbatim from spring-session-jdbc's | ||
| -- org/springframework/session/jdbc/schema-postgresql.sql so Flyway owns it | ||
| -- (spring.session.jdbc.initialize-schema is set to "never" in application.yml). | ||
| CREATE TABLE SPRING_SESSION ( | ||
| PRIMARY_ID CHAR(36) NOT NULL, | ||
| SESSION_ID CHAR(36) NOT NULL, | ||
| CREATION_TIME BIGINT NOT NULL, | ||
| LAST_ACCESS_TIME BIGINT NOT NULL, | ||
| MAX_INACTIVE_INTERVAL INT NOT NULL, | ||
| EXPIRY_TIME BIGINT NOT NULL, | ||
| PRINCIPAL_NAME VARCHAR(100), | ||
| CONSTRAINT SPRING_SESSION_PK PRIMARY KEY (PRIMARY_ID) | ||
| ); | ||
|
|
||
| CREATE UNIQUE INDEX SPRING_SESSION_IX1 ON SPRING_SESSION (SESSION_ID); | ||
| CREATE INDEX SPRING_SESSION_IX2 ON SPRING_SESSION (EXPIRY_TIME); | ||
| CREATE INDEX SPRING_SESSION_IX3 ON SPRING_SESSION (PRINCIPAL_NAME); | ||
|
|
||
| CREATE TABLE SPRING_SESSION_ATTRIBUTES ( | ||
| SESSION_PRIMARY_ID CHAR(36) NOT NULL, | ||
| ATTRIBUTE_NAME VARCHAR(200) NOT NULL, | ||
| ATTRIBUTE_BYTES BYTEA NOT NULL, | ||
| CONSTRAINT SPRING_SESSION_ATTRIBUTES_PK PRIMARY KEY (SESSION_PRIMARY_ID, ATTRIBUTE_NAME), | ||
| CONSTRAINT SPRING_SESSION_ATTRIBUTES_FK FOREIGN KEY (SESSION_PRIMARY_ID) | ||
| REFERENCES SPRING_SESSION (PRIMARY_ID) ON DELETE CASCADE | ||
| ); |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| app: | ||
| auth: | ||
| # Dev runs plain HTTP through the Vite proxy; a Secure cookie would be silently dropped. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this need to be the case? Should we be logging in on dev too? |
||
| cookie-secure: false | ||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.