-
Notifications
You must be signed in to change notification settings - Fork 42
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
Add Email-Id and Access-Token Headers for authentication #15
Merged
Conversation
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
olttwa
requested changes
Oct 1, 2018
olttwa
requested changes
Oct 3, 2018
cmd/procs/description/descriptor.go
Outdated
@@ -18,7 +20,12 @@ func NewCmd(printer io.Printer, proctorEngineClient daemon.Client) *cobra.Comman | |||
Run: func(cmd *cobra.Command, args []string) { | |||
procList, err := proctorEngineClient.ListProcs() | |||
if err != nil { | |||
printer.Println("Error fetching list of procs. Please check configuration and network connectivity", color.FgRed) | |||
if err.Error() == http.StatusText(http.StatusUnauthorized) { | |||
printer.Println(http.StatusText(http.StatusUnauthorized), color.FgRed) |
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.
Please display descriptive unauthorized error to user.
daemon/client_test.go
Outdated
|
||
executeProcResponse, err := proctorClient.ExecuteProc(procName, procArgs) | ||
|
||
assert.Nil(t, err) |
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.
Error shouldn't be nil on sad-case scenarios.
olttwa
approved these changes
Oct 3, 2018
Resolves #18 1. Constantized all the common error messages printed out to user 2. Refactored tests to use constants 3. Fixes in travis.yml to use updated package names, verbose output for debugging 4. Introduces Email and Access token, checking for same in http headers Email-Id and Access-Token 5. Fixes in error output via websocket, printing new line at end of output so that follow up messages to console don't have to do it 6. Introduces environment config ENVIRONMENT to enable testing of configs 7. HTTP testing library httpmock
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.