Skip to content
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

change 400 to 401 for invalid creds #240

Closed
wants to merge 1 commit into from

Conversation

denopink
Copy link
Contributor

No description provided.

@@ -91,7 +91,7 @@ func (fd *frontDoor) handleMissingCredentials(response http.ResponseWriter, err

func (fd *frontDoor) handleInvalidCredentials(response http.ResponseWriter, err *bascule.InvalidCredentialsError) {
response.Header().Set("Content-Type", "text/plain")
response.WriteHeader(http.StatusBadRequest)
response.WriteHeader(http.StatusUnauthorized)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's handling credentials that were misformatted or unparseable. That's definitely a bad request, since authentication hasn't even been done.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotcha, I thought anything invalid (like misformatted and unparseable) regarding creds would be consider a 401.

Copy link

codecov bot commented Feb 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (feature/v1@e3b7266). Click here to learn what that means.

Additional details and impacted files
@@             Coverage Diff              @@
##             feature/v1    #240   +/-   ##
============================================
  Coverage              ?   0.00%           
============================================
  Files                 ?      10           
  Lines                 ?     272           
  Branches              ?       0           
============================================
  Hits                  ?       0           
  Misses                ?     272           
  Partials              ?       0           
Flag Coverage Δ
unittests 0.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@denopink
Copy link
Contributor Author

I thought anything invalid (like misformatted and unparseable) regarding creds would be consider a 401.
we're going with 400 instead, closing

@denopink denopink closed this Feb 21, 2024
@denopink denopink deleted the deno/feedback/invaild-creds branch February 21, 2024 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants