Commit 78fc0c7
Fix 3-level reference resolution: resolve imported policy's references before importing
When importing a policy whose entries use references (e.g. fleet-west's
driver references fleet-roles's driver for resources), the references
must be resolved BEFORE the entries are imported and references stripped.
Previously, resolveImport would merge transitive entries then immediately
rewrite labels (stripping references via the 6-arg factory), losing the
resource/subject inheritance that references provided. Now, resolveReferences
is called on the loaded policy's entries after transitive merge but before
label rewriting, materializing the inherited values.
This fixes the 3-level hierarchy scenario (template → intermediate → leaf)
where Alice (subject on intermediate) could not access resources defined
on the template.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 02aa727 commit 78fc0c7
1 file changed
Lines changed: 7 additions & 1 deletion
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
143 | 149 | | |
144 | 150 | | |
145 | 151 | | |
146 | | - | |
| 152 | + | |
147 | 153 | | |
148 | 154 | | |
149 | 155 | | |
| |||
0 commit comments