-
Notifications
You must be signed in to change notification settings - Fork 1
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
[56] Implement shared session between Rails <=> Phoenix #128
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
19f81ff
56 WIP shared session storage configuration
cpreisinger 8313a18
Merge branch 'dev' of github.com:GSA/Challenge_platform into 56/share…
cpreisinger de4525b
Merge branch 'dev' of github.com:GSA/Challenge_platform into 56/share…
cpreisinger 5897b88
Revert "56 WIP shared session storage configuration"
cpreisinger 7d6bfff
Merge branch 'dev' of github.com:GSA/Challenge_platform into 56/share…
cpreisinger 2fb142c
56 Shared session API with phoenix app
cpreisinger 795484d
Merge branch 'dev' of github.com:GSA/Challenge_platform into 56/share…
cpreisinger 1fb76c8
Merge branch 'dev' of github.com:GSA/Challenge_platform into 56/share…
cpreisinger 686a726
56 Update spec helper with shared session
cpreisinger 3bfd4af
56 Test and rubocop fixes
cpreisinger 272ccf6
56 Skip some hard to test functions in simplecov
cpreisinger a3db99c
Merge branch 'dev' into 56/shared-rails-phoenix-session
cpreisinger 5fd750f
56 Possible fix for logout bug
cpreisinger eaabd59
Merge branch 'dev' into 56/shared-rails-phoenix-session
stepchud 28da720
add dynamic links to phx app
stepchud 55acd12
linter fixes
stepchud 0aea978
linter code format
stepchud 3c990e0
refactor mock_login_gov
stepchud 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 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,8 @@ | ||
# local dev env vars for login.gov | ||
export LOGIN_CLIENT_ID=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:challenge_gov_portal_eval_dev | ||
export LOGIN_REDIRECT_EVAL_URL=http://localhost:3000/auth/result | ||
export LOGOUT_REDIRECT_EVAL_URL=http://localhost:3000/ | ||
export LOGOUT_REDIRECT_EVAL_URL=http://localhost:3000/ | ||
|
||
export PHOENIX_URI="http://localhost:4000" | ||
export LOGIN_SECRET="f4d3c40a00a8e6ed72fae5204d9ddacd40f087865d40803a6fcfb935591a271838533f06081067dac24c0085c74123e7e1c8b3e0ab562c6645b17eb769854d0d" | ||
export JWT_SECRET="fc28c5738ca45162f61126e770a8fbdbd938d0fedcfe8fbb9f851b855b0264866364a9130e96aca8b1977e9f58edf064f1aa435ceccf415ff22fd3c24adba320" |
This file contains 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 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 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 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 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 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 |
---|---|---|
|
@@ -30,12 +30,10 @@ | |
end | ||
|
||
it "get /auth/result successful" do | ||
user = User.new(email: "[email protected]", token: SecureRandom.uuid) | ||
code = "ABC123" | ||
login_gov = instance_double(LoginGov) | ||
allow(LoginGov).to receive(:new).and_return(login_gov) | ||
allow(login_gov).to receive(:exchange_token_from_auth_result).with(code).and_return( | ||
[{ email: "[email protected]", sub: "sub" }] | ||
) | ||
mock_login_gov(user, code) | ||
|
||
get "/auth/result", params: { code: } | ||
expect(response).to have_http_status(:redirect) | ||
expect(response).to redirect_to("/dashboard") | ||
|
@@ -47,14 +45,11 @@ | |
email = "[email protected]" | ||
token = SecureRandom.uuid | ||
|
||
User.create!({ email:, token: }) | ||
user = User.create!({ email:, token: }) | ||
|
||
code = "ABC123" | ||
login_gov = instance_double(LoginGov) | ||
allow(LoginGov).to receive(:new).and_return(login_gov) | ||
allow(login_gov).to receive(:exchange_token_from_auth_result).with(code).and_return( | ||
[{ email:, sub: token }] | ||
) | ||
mock_login_gov(user, code) | ||
|
||
get "/auth/result", params: { code: } | ||
|
||
expect(session[:userinfo]).not_to be_nil | ||
|
This file contains 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯