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

Improve Error Handling for Missing Credentials in AppRole and UserPass #28441

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ltcarbonell
Copy link
Contributor

@ltcarbonell ltcarbonell commented Sep 19, 2024

Description

This PR updates the error handling for AppRole and UserPass when login credentials are missing. Currently, a 500 error is returned, but a 400 error is more accurate and aligns with the behavior of other auth engines (e.g., LDAP).

Original output:

> curl --request POST -v \
       http://127.0.0.1:8200/v1/auth/userpass/login/mitchellh | jq -r ".auth"
...
< HTTP/1.1 500 Internal Server Error
...

New output:

> curl --request POST -v \
       http://127.0.0.1:8200/v1/auth/userpass/login/mitchellh | jq -r ".auth"
...
< HTTP/1.1 400 Bad Request
...

TODO only if you're a HashiCorp employee

@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Sep 19, 2024
Copy link

github-actions bot commented Sep 19, 2024

CI Results:
All Go tests succeeded! ✅

Copy link

github-actions bot commented Sep 19, 2024

Build Results:
All builds succeeded! ✅

@ltcarbonell ltcarbonell added this to the 1.19.0-rc milestone Sep 19, 2024
@ltcarbonell ltcarbonell requested review from hc-github-team-secure-vault-core and a team and removed request for hc-github-team-secure-vault-core and a team September 19, 2024 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant