fix: return after context.Fail() in StorageAccessHandler#1024
fix: return after context.Fail() in StorageAccessHandler#1024LindqvistMartin wants to merge 1 commit into
Conversation
On a PDP deny the handler calls context.Fail() then falls through to context.Succeed(requirement). Fail() already forces the denial, so this changes nothing today, but the trailing Succeed() is dead code. Add the early return so it stops on deny, like the missing-instanceGuid branch above.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughModifies StorageAccessHandler to return immediately after calling context.Fail() when a PDP decision is invalid, preventing fall-through to the success path. Adds a corresponding unit test verifying the requirement remains pending when PDP denies access. ChangesStorageAccessHandler PDP Deny Fix
Estimated code review effort: 1 (Trivial) | ~5 minutes Related Issues: None specified. Suggested labels: bug, tests Suggested reviewers: None specified. PoemA rabbit hopped through code so tight, 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
On a PDP deny
HandleRequirementAsynccallscontext.Fail()and then fallsthrough to
context.Succeed(requirement).Fail()already forces the denial, sothis changes nothing today, but the trailing
Succeed()is dead code. Add areturnafterFail()so it stops on deny, like the missing-instanceGuidbranchabove already does.
Added a unit test asserting the requirement stays in
context.PendingRequirementson deny — the one thing the stray
Succeed()changes.Related Issue(s)
Verification
Documentation
Summary by CodeRabbit
Bug Fixes
Tests