chef / chef/chef-server

PUT /policy_groups/GROUP/policies/NAME does not check if policy is the same

Open
#653 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

If you do the following:

PUT /policy_groups/a/policies/p
{
  "name": "p",
  "revision_id": "1.0.0",
  "cookbook_locks": {},
  "run_list": []
}

And then do this:

PUT /policy_groups/b/policies/p
{
  "name": "p",
  "revision_id": "1.0.0",
  "cookbook_locks": {},
  "run_list": [ "mycookbook" ]
}

The policy endpoint silently ignores the input to the second PUT. It should 409 and let me know that the policy will not be exactly what I thought it would.

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 tracing the PUT /policy_groups/GROUP/policies/NAME endpoint and reproduce the two requests from the issue. Confirm that changing the policy group with conflicting policy content returns HTTP 409 and explains that the policy cannot match the requested input.

Written by the indexing model from the issue text.

Assessment

Tech stack
erlang
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.