chef / chef/chef-server

Hosted: POST and PUT /groups accept users, clients or groups but do nothing with them

Open
#605 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: To be prioritized Triage: Confirmed Triage: Try Reproducing
Dominant language
Erlang
Stars
303
Forks
211
Avg merge
1d 8h
Merged PRs (30d)
5

Description

POST /groups accepts "users", "clients" and "groups" as input (does not throw a 400), but does not populate them. PUT /groups/x does the same, even returning them from the request. This appears to be at least a partial cause of https://github.com/chef/cheffish/issues/90 .

When I have an org named essentials and a file x.json:

{
  "users": [
    "jkeiser"
  ],
  "clients": [
    "essentials-validator"
  ],
  "groups": [
    "admins"
  ],
  "orgname": "essentials",
  "name": "x",
  "groupname": "x"
}

I see the following:

jkeiser@Ettores-MacBook-Pro-2 ~/e/essentials> knife raw -m POST /groups -i x.json
{
  "uri": "https://api.opscode.com/organizations/essentials/groups/x"
}
jkeiser@Ettores-MacBook-Pro-2 ~/e/essentials> knife raw /groups/x
{
  "actors": [
  ],
  "users": [
  ],
  "clients": [
  ],
  "groups": [
  ],
  "orgname": "essentials",
  "name": "x",
  "groupname": "x"
}

If I follow it up with a PUT from the same file, I get:

jkeiser@Ettores-MacBook-Pro-2 ~/e/essentials> knife raw -m PUT /groups/x -i x.json
{
  "users": [
    "jkeiser"
  ],
  "clients": [
    "essentials-validator"
  ],
  "groups": [
    "admins"
  ],
  "orgname": "essentials",
  "name": "x",
  "groupname": "x"
}
jkeiser@Ettores-MacBook-Pro-2 ~/e/essentials> knife raw /groups/x
{
  "actors": [
  ],
  "users": [
  ],
  "clients": [
  ],
  "groups": [
  ],
  "orgname": "essentials",
  "name": "x",
  "groupname": "x"
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the hosted API handlers for POST /groups and PUT /groups/:name, then reproduce the issue with the provided knife raw requests and x.json payload. Trace how users, clients, and groups are handled and verify that a follow-up GET returns the submitted actors when the fix is complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
erlang
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.