|
| 1 | +--- |
| 2 | +'@endo/compartment-mapper': major |
| 3 | +--- |
| 4 | + |
| 5 | +- **Breaking:** `CompartmentMapDescriptor` no longer has a `path` property. |
| 6 | +- **Breaking:** `CompartmentMapDescriptor`'s `label` property is now a |
| 7 | + _canonical name_ (a string of one or more npm package names separated by `>`). |
| 8 | +- **Breaking:** The `CompartmentMapDescriptor` returned by `captureFromMap()` |
| 9 | + now uses canonical names as the keys in its `compartments` property. |
| 10 | +- Breaking types: `CompartmentMapDescriptor`, `CompartmentDescriptor`, |
| 11 | + `ModuleConfiguration` (renamed from `ModuleDescriptor`) and `ModuleSource` |
| 12 | + have all been narrowed into discrete subtypes. |
| 13 | +- `captureFromMap()`, `loadLocation()` and `importLocation()` now accept a |
| 14 | + `moduleSourceHook` option. This hook is called when processing each module |
| 15 | + source, receiving the module source data (location, language, bytes, or error |
| 16 | + information) and the canonical name of the containing package. |
| 17 | +- `captureFromMap()` now accepts a `packageConnectionsHook` option. This hook is |
| 18 | + called for each retained compartment with its canonical name and the set of |
| 19 | + canonical names of compartments it links to (its connections). Useful for |
| 20 | + analyzing or visualizing the dependency graph. |
| 21 | +- `mapNodeModules()`, `loadLocation()`, `importLocation()`, `makeScript()`, |
| 22 | + `makeFunctor()`, and `writeScript()` now accept the following hook options: |
| 23 | + - `unknownCanonicalNameHook`: Called for each canonical name mentioned in |
| 24 | + policy but not found in the compartment map. Useful for detecting policy |
| 25 | + misconfigurations. |
| 26 | + - `packageDependenciesHook`: Called for each package with its set of |
| 27 | + dependencies. Can return partial updates to modify the dependencies, |
| 28 | + enabling dependency filtering or injection based on policy. |
| 29 | + - `packageDataHook`: Called once with data about all packages found while |
| 30 | + crawling `node_modules`, just prior to creation of a compartment map. |
| 31 | +- When dynamic requires are enabled via configuration, execution now takes |
| 32 | + policy into consideration when no other relationship (for example, a |
| 33 | + dependent/dependee relationship) between two Compartments exists. When policy |
| 34 | + explicitly allows access from package _A_ to _B_ and _A_ dynamically requires |
| 35 | + _B_ (via absolute path or otherwise), the operation will succeed. This can |
| 36 | + occur _if and only if_ dynamic requires are enabled _and_ a policy is |
| 37 | + provided. |
| 38 | +- Improved error messaging for policy enforcement failures. |
0 commit comments