open-policy-agent / open-policy-agent/frameworks
Wrong template parameter is being checked in e2e_tests: "expected" vs "name"
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 127
- Forks
- 61
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 13
Description
Function newConstraintTemplate() defines a template parameter named "expected":
"expected": {Type: "string"},
The Deny by Parameter test uses a parameter named "name":
cstr := newConstraint("Foo", "ph", map[string]string{"name": "deny_me"}, nil)
The tests passes because undefined template parameters are not type checked at all, which is probably a bug.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in constraint/pkg/client/e2e_tests.go, reviewing newConstraintTemplate() near line 39 and the Deny by Parameter test near line 601. Compare the declared template parameter with the parameter supplied by the test, then run the relevant e2e tests. Done means the test uses the declared parameter consistently and still verifies the intended denial behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100