Skip to content

Commit

Permalink
fix(compartment-mapper): policy - allow any packages imported in the …
Browse files Browse the repository at this point in the history
…attenuators compartment
  • Loading branch information
naugtur committed Nov 2, 2023
1 parent 111eee5 commit 2cd6a72
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions packages/compartment-mapper/src/policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,7 @@ export const getPolicyForPackage = (namingKit, policy) => {
if (canonicalName === ATTENUATORS_COMPARTMENT) {
return {
defaultAttenuator: policy.defaultAttenuator,
packages: detectAttenuators(policy).reduce((packages, specifier) => {
packages[specifier] = true;
return packages;
}, {}),
packages: 'any',
};
}
if (policy.resources && policy.resources[canonicalName]) {
Expand Down
6 changes: 3 additions & 3 deletions packages/compartment-mapper/test/test-policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,10 @@ const errorAttenuatorForAllGlobals = recursiveEdit((key, obj) => {

const nestedAttenuator = recursiveEdit((key, obj) => {
if (key === 'attenuate') {
obj[key] = 'myattenuator/attenuate'
obj[key] = 'myattenuator/attenuate';
}
if (key === 'resources') {
obj[key]['myattenuator/attenuate'] = obj[key].myattenuator
obj[key]['myattenuator/attenuate'] = obj[key].myattenuator;
}
});

Expand Down Expand Up @@ -427,4 +427,4 @@ scaffold(
addGlobals: globals,
policy: nestedAttenuator(policy),
},
);
);

0 comments on commit 2cd6a72

Please sign in to comment.