-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor login flow #114
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
Merged
Merged
Refactor login flow #114
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2d27b11
chore: add PyRight configuration
jbriones1 f99648b
wip: add CORS
jbriones1 2c0c854
wip: changed login model
jbriones1 06ac4aa
fix: CORS header and made cookie cache the samesite and domain value
jbriones1 bff7df6
fix: address code review comments
jbriones1 3e29603
fix: linter caught an error
jbriones1 0f403f3
fix: flipped the IS_PROD logic
jbriones1 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
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,7 @@ | ||
| from pydantic import BaseModel, Field | ||
|
|
||
|
|
||
| class LoginBodyModel(BaseModel): | ||
| service: str = Field(description="Service URL used for SFU's CAS system") | ||
| ticket: str = Field(description="Ticket return from SFU's CAS system") | ||
| redirect_url: str | None = Field(None, description="Optional redirect URL") |
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 |
|---|---|---|
|
|
@@ -2,12 +2,13 @@ | |
|
|
||
| # TODO(future): replace new.sfucsss.org with sfucsss.org during migration | ||
| # TODO(far-future): branch-specific root IP addresses (e.g., devbranch.sfucsss.org) | ||
| FRONTEND_ROOT_URL = "http://localhost:8080" if os.environ.get("LOCAL") == "true" else "https://new.sfucsss.org" | ||
| GITHUB_ORG_NAME = "CSSS-Test-Organization" if os.environ.get("LOCAL") == "true" else "CSSS" | ||
| ENV_LOCAL = os.environ.get("LOCAL") | ||
| IS_PROD = True if not ENV_LOCAL or ENV_LOCAL.lower() != "true" else False | ||
| GITHUB_ORG_NAME = "CSSS-Test-Organization" if not IS_PROD else "CSSS" | ||
|
|
||
| W3_GUILD_ID = "1260652618875797504" | ||
| CSSS_GUILD_ID = "228761314644852736" | ||
| ACTIVE_GUILD_ID = W3_GUILD_ID if os.environ.get("LOCAL") == "true" else CSSS_GUILD_ID | ||
| ACTIVE_GUILD_ID = W3_GUILD_ID if not IS_PROD else CSSS_GUILD_ID | ||
|
|
||
| SESSION_ID_LEN = 512 | ||
| # technically a max of 8 digits https://www.sfu.ca/computing/about/support/tips/sfu-userid.html | ||
|
|
@@ -25,3 +26,7 @@ | |
|
|
||
| # https://docs.github.com/en/[email protected]/admin/identity-and-access-management/iam-configuration-reference/username-considerations-for-external-authentication | ||
| GITHUB_USERNAME_LEN = 39 | ||
|
|
||
| # COOKIE | ||
| SAMESITE="none" if IS_PROD else "lax" | ||
| DOMAIN=".sfucsss.org" if IS_PROD else None | ||
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 |
|---|---|---|
|
|
@@ -3,3 +3,6 @@ | |
|
|
||
| class SuccessFailModel(BaseModel): | ||
| success: bool | ||
|
|
||
| class DetailModel(BaseModel): | ||
| detail: str | ||
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.