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

incorrect error message for active_roles.add[][a]=b #1173

Open
ElectricNroff opened this issue Jan 16, 2024 · 0 comments
Open

incorrect error message for active_roles.add[][a]=b #1173

ElectricNroff opened this issue Jan 16, 2024 · 0 comments

Comments

@ElectricNroff
Copy link
Contributor

https://cveawg.mitre.org/api-docs/#/Users/userUpdateSingle says

PUT /org/{shortname}/user/{username}
...
active_roles.add
string
(query)

However, a user can try to specify an array of objects instead of a string, i.e.,

curl -g -X PUT \
-H "CVE-API-ORG: ..." \
-H "CVE-API-USER: ..." \
-H "CVE-API-KEY: ..." \
'https://cveawg-test.mitre.org/api/org/Mickey%20Mouse/user/minnie?active_roles.add[][a]=b'

This results in:

{"error":"BAD_INPUT","message":"Parameters were invalid","details":[{"msg":"Parameter must be a one-dimensional array of strings","param":"active_roles.add","location":"query"}]}

The must in the above error message is incorrect because the API specification states that active_roles.add is supposed to have a string value, and the implementation does support a string. (The implementation happens to support either the string "ADMIN" or an array in which each array element is the string "ADMIN" - for small numbers of array elements.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Triage
Development

No branches or pull requests

1 participant