-
Notifications
You must be signed in to change notification settings - Fork 5
chore(api-error): change unauthorized msg and add tests #2190
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
Conversation
This PR has been released (on staging) and is available for download with a embedded-cluster-smoke-test-staging-app license ID. Online Installer:
Airgap Installer (may take a few minutes before the airgap bundle is built):
Happy debugging! |
Merging into a branch. |
ec30def
to
50ef28e
Compare
The base branch was changed.
1ce3d26
to
f4060de
Compare
I don't think this has been merged @sgalsaleh. Rebased with main, so should be good to 👀 and ✅ |
@@ -57,7 +57,7 @@ func NewBadRequestError(err error) *APIError { | |||
func NewUnauthorizedError(err error) *APIError { | |||
return &APIError{ | |||
StatusCode: http.StatusUnauthorized, | |||
Message: err.Error(), | |||
Message: "Unauthorized", |
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.
When dealing with 401
's we shouldn't be exposing any context around what happened.
Test failures seem unrelated. Merging |
What this PR does / why we need it:
Story: https://app.shortcut.com/replicated/story/124146/add-tests-to-api-error-types
Adds tests to
api/types/errors_test.go
and changes the Unauthorized API error to not expose the underlyingerr.Error()
throughMessage
.Which issue(s) this PR fixes:
Does this PR require a test?
Does this PR require a release note?
Does this PR require documentation?