Skip to content

Conversation

gaoxingliang
Copy link

improve the error message when requesting to wolf failed and if the username or password is wrong, give a more readable message.

Description

improve the plugin wolf-rbac

Which issue(s) this PR fixes:

Fixes #12231
The main changes:
1, add a optional property error_message to customize the error message if request wolf failed. because the user may don't need to know what wolf is.
2, if the username / password is wrong or user not found, return a more readable message. and http code to 401 instead of 200.
3, test and doc is changed too.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

…and if password is wrong, return a more readable error
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request plugin labels May 21, 2025
@moonming
Copy link
Member

@gaoxingliang thanks for this PR. I have a question, is it necessary to let the client know about the existence of the Wolf plugin? Of course, this was not introduced by this PR. Is just log local error ok?

@gaoxingliang
Copy link
Author

Hi @moonming, this pr provides the ability to hide the wolf existence for user. previous version doesn't provide this ability. that's to say: if a user provides a wrong username or password, or any other error encountered, the user will receive a message:
request to wolf failed.
This pr provides a setting to customize this message eg, you can set it to : 'auth fail encountered.'

Or do you mean I need to set the default error message to some other error instead of previous request to wolf...? I set it as default to keep compabalility.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels May 22, 2025
@Baoyuantop
Copy link
Contributor

Hi @gaoxingliang, can you get CI to pass?

@Baoyuantop Baoyuantop marked this pull request as draft July 21, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request plugin size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: wolf-rbac plugin if password error, no useful messages returned
3 participants