SWATCH-5457: fix(authentication): swatch-5457 overlay inventory for v2 orgs - #1972
SWATCH-5457: fix(authentication): swatch-5457 overlay inventory for v2 orgs#1972diegomaranhao wants to merge 1 commit into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1972 +/- ##
=======================================
Coverage 91.24% 91.24%
=======================================
Files 127 127
Lines 5230 5234 +4
Branches 2419 2420 +1
=======================================
+ Hits 4772 4776 +4
Misses 421 421
Partials 37 37
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
Deploy Failed -- Last 100 lines of deploy output |
What's included
Two related authentication fixes for Kessel/v2 org environments.
authentication.js — overlay inventory in session authorized
Instance table instance links read session.authorized.inventory to decide whether to render. In v2
orgs (Kessel enabled or not), the RBAC v1 inventory permission is always empty, so those links were
silently hidden even for authorized users. When isAuthorized is true, inventory: true (and appName:
true) are now overlaid onto the context value. The constructed object is wrapped in useMemo to avoid
recreating the context reference on every render. A helpers.browserExpose({ authDebug }) block is
included for in-browser debugging.
useHasRelation.js — add enabled to useEffect deps
The Kessel feature flag (swatch.common-security.use-kessel-rbac) is read from Chrome after the first
paint. With an empty [] dep array the check ran once on mount — before the flag had resolved — so
enabled was always false and checkSelf was never called. Adding enabled to the dep array lets the
effect re-run when the flag arrives.
How to test
To make
$npm run start:proxywork, you need the following fix #1965Coverage and basic unit test check
Local run check (mock API, dev mode — Kessel path skipped, legacy RBAC exercised)
Proxy run check (exercises Kessel path end-to-end)
authorized.inventory: true
Example
N/A — auth/session context fix; no visual diff on the component itself.
Updates issue/story