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

Knife upload user doesn't work properly #75

Closed
alekc opened this issue Jul 23, 2020 · 3 comments
Closed

Knife upload user doesn't work properly #75

alekc opened this issue Jul 23, 2020 · 3 comments

Comments

@alekc
Copy link
Contributor

alekc commented Jul 23, 2020

Describe the bug
When doing knife upload user, goiardi wont permit the operation because knife adds several fields which are not recognised by goiardi.

I.e. given this user.json file

{
"name": "user",
"email": "user@example.com",
"public_key": "-----BEGIN PUBLIC KEY-----xxx-----END PUBLIC KEY-----\n\n"
}

knife upload user will attempt following upload

{
   "name":"user",
   "username":"user",
   "display_name":"user",
   "admin":false,
   "json_class":"Chef::WebUIUser",
   "chef_type":"webui_user",
   "salt":null,
   "password":null,
   "openid":null,
   "email":"user@example.com",
   "public_key":"-----BEGIN PUBLIC KEY-----xxxxxx-----END PUBLIC KEY-----\n\n"
}

which will trigger at least 2 different failures:

  1. password cannot be null (validation fails, it would not fail with "")
  2. following fields are not recognised: "chef_type", "display_name", "json_class", "openid" (goiardi has a very strict validation rules, if there are any extra fields in request, it would be refused.

Expected behavior
standard operation such as knife upload working

Additional context
This was observed on both cinc (15) and chefdk (3.9) knife versions

@ctdk
Copy link
Owner

ctdk commented Jul 23, 2020

Thanks for the PR for this. This issue is a little interesting, because the Chef 11 behavior the goiardi master branch still emulates is beginning to break more and more often. The chef pedant tests would flip out if you tried uploading extra fields, I remember, so this may be a bit delicate.

There's also a possibility that the 1.0.0-dev and related branches may already work better. Obviously things are a bit fluid there though.

@alekc
Copy link
Contributor Author

alekc commented Jul 23, 2020 via email

@alekc
Copy link
Contributor Author

alekc commented Aug 4, 2020

Closed via #76

@alekc alekc closed this as completed Aug 4, 2020
@alekc alekc mentioned this issue Aug 14, 2020
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

No branches or pull requests

2 participants