-
Notifications
You must be signed in to change notification settings - Fork 4
Cognito auth #33
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
Draft
drekdrek
wants to merge
14
commits into
cs399f24:main
Choose a base branch
from
drekdrek:cognito
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.
Draft
Cognito auth #33
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
8bd5285
add cognito dependency
8ff0970
implement barebones auth flow
b9c7fe2
linting fix
29ab2c7
add deploy and destroy scripts
dda8294
remove property decorators
bb00301
mangle cognito config
673efb2
add more cognito parameters
106d0f7
move cognito params to base class
b137cf1
Add app factory for aws config
jpappel a39c0cb
add aws create app
867781d
Fix config classes
jpappel 106414d
Change lazy evaluation of CloudAWSConfig
jpappel 0311e63
Fix linter error
jpappel 5021afa
removed deploy scripts
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
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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| from .app import create_app | ||
| from .app import aws_create_app, create_app # noqa: F401 | ||
|
|
||
| if __name__ == "__main__": | ||
| create_app().run(port=8080) |
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,43 @@ | ||
| from flask import Blueprint, Flask, redirect | ||
| from flask_cognito_lib import CognitoAuth | ||
| from flask_cognito_lib.decorators import ( | ||
| cognito_login, | ||
| cognito_login_callback, | ||
| cognito_logout, | ||
| cognito_refresh_callback, | ||
| ) | ||
|
|
||
| bp = Blueprint("auth", __name__) | ||
|
|
||
|
|
||
| def cognito_app(app: Flask): | ||
| return CognitoAuth(app) | ||
|
|
||
|
|
||
| @bp.get("/login") | ||
| @cognito_login | ||
| def login(): | ||
| pass | ||
|
|
||
|
|
||
| @bp.get("/postlogin") | ||
| @cognito_login_callback | ||
| def post_login(): | ||
| return redirect("/") | ||
|
|
||
|
|
||
| @bp.get("/logout") | ||
| @cognito_logout | ||
| def logout(): | ||
| return "Logged out" | ||
|
|
||
|
|
||
| @bp.get("/postlogout") | ||
| def post_logout(): | ||
| return "Logged out" | ||
|
|
||
|
|
||
| @bp.get("/refresh") | ||
| @cognito_refresh_callback | ||
| def refresh(): | ||
| return "Refreshed" |
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
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.