|
28 | 28 | }, |
29 | 29 | "maxItems": 10 |
30 | 30 | }, |
31 | | - "entriesAdditions": { |
32 | | - "title": "Entries additions", |
33 | | - "type": "object", |
34 | | - "description": "Additional subjects and/or resources to additively merge into imported policy entries. Each key is a label of an imported policy entry. The value is an object with optional \"subjects\" and/or \"resources\" and/or \"namespaces\" fields that will be merged into the corresponding imported entry. The imported policy entry must explicitly allow these additions via its \"allowedImportAdditions\" field, otherwise the additions are rejected.", |
35 | | - "additionalProperties": { |
36 | | - "title": "EntryAddition", |
37 | | - "type": "object", |
38 | | - "description": "Defines additional subjects and/or resources to be merged into a single imported policy entry.", |
39 | | - "properties": { |
40 | | - "subjects": { |
41 | | - "title": "Subjects", |
42 | | - "type": "object", |
43 | | - "description": "Additional subjects to merge into the imported entry." |
44 | | - }, |
45 | | - "resources": { |
46 | | - "title": "Resources", |
47 | | - "type": "object", |
48 | | - "description": "Additional resources to merge into the imported entry." |
49 | | - }, |
50 | | - "namespaces": { |
51 | | - "title": "Namespaces", |
52 | | - "type": "array", |
53 | | - "description": "Additional namespaces to merge into the imported entry", |
54 | | - "items": { |
55 | | - "type": "string" |
56 | | - } |
57 | | - } |
58 | | - } |
59 | | - } |
60 | | - }, |
61 | 31 | "transitiveImports": { |
62 | 32 | "title": "Transitive imports", |
63 | 33 | "type": "array", |
64 | | - "description": "List of policy IDs from the imported policy's own imports that should be resolved transitively before extracting entries. This enables multi-level import chains where a template policy defines resources and an intermediate policy adds subjects via entriesAdditions.", |
| 34 | + "description": "List of policy IDs from the imported policy's own imports that should be resolved transitively before extracting entries. This enables multi-level import chains where an intermediate policy defines entries with references pointing to a template policy's entries.", |
65 | 35 | "items": { |
66 | 36 | "type": "string", |
67 | 37 | "description": "Policy ID of a policy that the imported policy itself imports from." |
|
71 | 41 | } |
72 | 42 | } |
73 | 43 | }, |
74 | | - "importsAliases": { |
75 | | - "title": "ImportsAliases", |
76 | | - "type": "object", |
77 | | - "description": "Imports aliases mapping a label to one or more entries additions targets. Subject operations on the alias label via /entries/{label}/subjects are transparently fanned out to all referenced targets. A label must not exist as both an imports alias and a local policy entry.", |
78 | | - "additionalProperties": { |
79 | | - "title": "ImportsAlias", |
80 | | - "type": "object", |
81 | | - "description": "A single imports alias defining the targets to fan out subject operations to.", |
82 | | - "properties": { |
83 | | - "targets": { |
84 | | - "title": "Targets", |
85 | | - "type": "array", |
86 | | - "description": "List of entries additions targets this alias fans out to.", |
87 | | - "items": { |
88 | | - "title": "ImportsAliasTarget", |
89 | | - "type": "object", |
90 | | - "description": "A target reference pointing to a specific entry addition in a policy import.", |
91 | | - "properties": { |
92 | | - "import": { |
93 | | - "type": "string", |
94 | | - "description": "The policy ID of the import this target refers to." |
95 | | - }, |
96 | | - "entry": { |
97 | | - "type": "string", |
98 | | - "description": "The label of the entry within the import's entriesAdditions." |
99 | | - } |
100 | | - }, |
101 | | - "required": ["import", "entry"] |
102 | | - } |
103 | | - } |
104 | | - }, |
105 | | - "required": ["targets"] |
106 | | - } |
107 | | - }, |
108 | 44 | "entries": { |
109 | 45 | "title": "PolicyEntries", |
110 | 46 | "type": "object", |
|
236 | 172 | "enum": ["implicit", "explicit", "never"], |
237 | 173 | "default": "implicit" |
238 | 174 | }, |
239 | | - "allowedImportAdditions": { |
| 175 | + "references": { |
| 176 | + "title": "References", |
| 177 | + "type": "array", |
| 178 | + "description": "An optional list of references to other policy entries. Each reference points to an entry either in the same policy (local reference) or in an imported policy (import reference). When set, subjects, resources, and namespaces from the referenced entries are additively merged into this entry.", |
| 179 | + "items": { |
| 180 | + "type": "object", |
| 181 | + "description": "A single reference to a policy entry.", |
| 182 | + "properties": { |
| 183 | + "entry": { |
| 184 | + "type": "string", |
| 185 | + "description": "The label of the referenced entry." |
| 186 | + }, |
| 187 | + "import": { |
| 188 | + "type": "string", |
| 189 | + "description": "The ID of the imported policy. If absent, the reference points to a local entry within the same policy." |
| 190 | + } |
| 191 | + }, |
| 192 | + "required": ["entry"] |
| 193 | + } |
| 194 | + }, |
| 195 | + "allowedAdditions": { |
240 | 196 | "title": "Allowed import additions", |
241 | 197 | "type": "array", |
242 | | - "description": "Defines which types of additions are allowed when this entry is imported by other policies via `entriesAdditions`. If omitted or empty, no additions are allowed. This default ensures that existing policies cannot be extended with additional subjects or resources unless the policy author explicitly opts in.", |
| 198 | + "description": "Defines which types of additions are allowed when this entry is referenced by other entries via `references`. Semantics: field absent (omitted) means no restriction — the referencing entry's own subjects, resources, and namespaces merge in as usual (upgrade-friendly default for pre-existing entries); field present and explicitly empty (`[]`) means no additions are allowed (only this entry's content is effective on the referencing side); field present with values means only the listed kinds of additions survive on the referencing entry. Enforced at resolution time as a runtime filter, not as a write-time contract: disallowed own additions on referencing entries are silently stripped at enforcement, not rejected at write. The same filter applies whether the reference is local or an import reference.", |
243 | 199 | "items": { |
244 | 200 | "type": "string", |
245 | 201 | "enum": ["subjects", "resources", "namespaces"] |
246 | 202 | }, |
247 | 203 | "example": ["subjects"] |
248 | 204 | } |
249 | | - }, |
250 | | - "required": [ |
251 | | - "subjects", |
252 | | - "resources" |
253 | | - ] |
| 205 | + } |
254 | 206 | } |
255 | 207 | } |
256 | 208 | }, |
|
0 commit comments