-
Notifications
You must be signed in to change notification settings - Fork 84
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
Feature/cognito webpage redirect #149
Merged
Merged
Changes from 52 commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
db4e3bc
Added code assets for display_credentials_web_page lambda
joshmarsh 41d6091
Expire time now shows up in encoded auth creds
joshmarsh 77c11c0
Added copy to clipboard button
joshmarsh ba35d3f
Added auth endpoint to terraform
joshmarsh 4023cea
Rewrote static web server lambda in golang
joshmarsh 8853769
Added unit test for status code 404
joshmarsh 5cf9b2e
Setting content-type for static assets
joshmarsh 2a3a673
WIP: Solved cognito cyclical dependency issues using ssm
joshmarsh a5d8997
Merging master
joshmarsh 0ed320c
Setting env vars from parameter store
joshmarsh 25a82e6
Removed some unnecessary code
joshmarsh b35e29d
Add /auth to end of callback url
joshmarsh f6cd88f
build script bug
joshmarsh f3ecacf
build script bug
joshmarsh 2552c87
/auth x-amazon-apigateway-integration GET -> POST
joshmarsh 17f17ee
Merge branch 'master' into feature/cognito-webpage-redirect
joshmarsh 023baad
Moved repeated response writing code to api/response pkg
joshmarsh c07f5c9
Added functionality to config to make ssm env vars work
joshmarsh d97a9fc
linting
joshmarsh 12e3ea7
TF Formatting
joshmarsh 126c6a2
Go Formatting
joshmarsh 8362038
Added .idea to gitignore
joshmarsh c3b7149
Untracked .idea
joshmarsh 728cb41
Removed print statements
joshmarsh 3a2b154
Removed unused mock
joshmarsh abffb62
Updated config.Dump docs
joshmarsh d36b156
Minor doc changes
joshmarsh dc7f575
Functional test bug
joshmarsh f664ee4
Moved SSM param retrieval to AWSServiceBuilder.Build()
joshmarsh 9dee3f9
Go formatting
joshmarsh fb1d84a
functional test bug
joshmarsh dd239b9
Debugging functional test error
joshmarsh 25bd098
Removed print statement
joshmarsh 0c57c01
Removed unnecessary error check
joshmarsh 3a2827e
Updated CHANGELOG
joshmarsh c9343bd
Mapping admin groups/claims to admin role
joshmarsh 6d50df4
Merge branch 'master' into feature/cognito-webpage-redirect
joshmarsh 75060b3
UserDetailer nil pointer bug
joshmarsh d019e8b
Removed lease_auth binary
joshmarsh d560445
formatting
joshmarsh c506a38
Merge branch 'master' into feature/cognito-webpage-redirect
joshmarsh 2501d5e
fixed test failure
joshmarsh 6717d5a
Added UserDetails to controller_test
joshmarsh ef189f3
Giving users permission to post to leases/*
joshmarsh aa5733e
Added sign out button to creds page
joshmarsh b8fd367
Refresh bug fix
joshmarsh 1938f55
Added minified vuejs
joshmarsh 620bc8b
Fix missing hyphen in Cognito user pool name
eschwartz fabc35b
Merge branch 'feature/cognito-webpage-redirect' of github.com:Optum/d…
joshmarsh 84fb508
Removed JQuery
joshmarsh d9b886e
Added newline after creds string
joshmarsh 60efcbb
Merge branch 'master' into feature/cognito-webpage-redirect
joshmarsh e8c8cec
Removed profile from scopes
joshmarsh 91fb6fe
Merge branch 'master' into feature/cognito-webpage-redirect
joshmarsh 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
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
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"github.com/Optum/dce/pkg/api/response" | ||
"html/template" | ||
"log" | ||
"net/http" | ||
"path/filepath" | ||
"strings" | ||
) | ||
|
||
func GetAuthPage(w http.ResponseWriter, r *http.Request) { | ||
lp := filepath.Join("views", "index.html") | ||
|
||
tmpl, err := template.ParseFiles(lp) | ||
if err != nil { | ||
errorMessage := fmt.Sprintf("Failed to load web page: %s", err) | ||
log.Print(errorMessage) | ||
response.WriteServerErrorWithResponse(w, errorMessage) | ||
} | ||
if err := tmpl.Execute(w, Config); err != nil { | ||
errorMessage := fmt.Sprintf("Failed to load web page: %s", err) | ||
log.Print(errorMessage) | ||
response.WriteServerErrorWithResponse(w, errorMessage) | ||
} | ||
w.Header().Set("Content-Type", "text/html") | ||
w.WriteHeader(http.StatusOK) | ||
} | ||
|
||
func GetAuthPageAssets(w http.ResponseWriter, r *http.Request) { | ||
fs := http.FileServer(http.Dir("./public")) | ||
sp := http.StripPrefix("/auth/public", fs) | ||
|
||
splitStr := strings.Split(r.URL.Path, ".") | ||
ext := splitStr[len(splitStr)-1] | ||
var contentType string | ||
switch ext { | ||
case "css": | ||
contentType = "text/css" | ||
case "js": | ||
contentType = "text/javascript" | ||
default: | ||
contentType = "application/json" | ||
} | ||
|
||
w.Header().Set("Content-Type", contentType) | ||
sp.ServeHTTP(w, r) | ||
} |
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.
These are used by accounts, usage, and credentials_web_page, so I moved them here to be more DRY.