Skip to content

Commit

Permalink
ARSN-362: change new function name for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
benzekrimaha committed Oct 30, 2023
1 parent 39988e5 commit 7777831
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions lib/policyEvaluator/evaluator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ export function evaluatePolicy(
}

/**
* @deprecated Upgrade to evaluateAllPoliciesNew
* @deprecated Upgrade to standardEvaluateAllPolicies
* Evaluate whether a request is permitted under a policy.
* @param requestContext - Info necessary to
* evaluate permission
Expand All @@ -326,9 +326,9 @@ export function evaluateAllPolicies(
allPolicies: any[],
log: Logger,
): string {
return evaluateAllPoliciesNew(requestContext, allPolicies, log).verdict;
return standardEvaluateAllPolicies(requestContext, allPolicies, log).verdict;
}
export function evaluateAllPoliciesNew(
export function standardEvaluateAllPolicies(
requestContext: RequestContext,
allPolicies: any[],
log: Logger,
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/policyEvaluator.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const fakeTimers = require('@sinonjs/fake-timers');
const evaluator = require('../../lib/policyEvaluator/evaluator');
const evaluatePolicy = evaluator.evaluatePolicy;
const evaluateAllPolicies = evaluator.evaluateAllPolicies;
const evaluateAllPoliciesNew = evaluator.evaluateAllPoliciesNew;
const standardEvaluateAllPolicies = evaluator.standardEvaluateAllPolicies;
const handleWildcards =
require('../../lib/policyEvaluator/utils/wildcards').handleWildcards;
const substituteVariables =
Expand Down Expand Up @@ -1457,7 +1457,7 @@ describe('policyEvaluator', () => {
'my_favorite_bucket', undefined,
undefined, undefined, 'bucketDelete', 's3');
requestContext.setRequesterInfo({});
const result = evaluateAllPoliciesNew(requestContext,
const result = standardEvaluateAllPolicies(requestContext,
[samples['arn:aws:iam::aws:policy/AmazonS3FullAccess'],
samples['Deny Bucket Policy']], log);
assert.deepStrictEqual(result, {
Expand All @@ -1471,7 +1471,7 @@ describe('policyEvaluator', () => {
'notVeryPrivate', undefined,
undefined, undefined, 'bucketDelete', 's3');
requestContext.setRequesterInfo({});
const result = evaluateAllPoliciesNew(requestContext,
const result = standardEvaluateAllPolicies(requestContext,
[samples['Multi-Statement Policy'],
samples['Variable Bucket Policy']], log);
assert.deepStrictEqual(result, {
Expand All @@ -1485,7 +1485,7 @@ describe('policyEvaluator', () => {
'notbucket', undefined,
undefined, undefined, 'objectGet', 's3');
requestContext.setRequesterInfo({});
const result = evaluateAllPoliciesNew(requestContext, [
const result = standardEvaluateAllPolicies(requestContext, [
samples['Multi-Statement Policy'],
samples['Variable Bucket Policy'],
], log);
Expand Down Expand Up @@ -1670,7 +1670,7 @@ describe('policyEvaluator', () => {
'my_favorite_bucket', undefined,
undefined, undefined, 'objectGet', 's3');
requestContext.setRequesterInfo({});
const result = evaluateAllPoliciesNew(
const result = standardEvaluateAllPolicies(
requestContext,
testCase.policiesToEvaluate.map(policyName => TestMatrixPolicies[policyName]),
log);
Expand Down

0 comments on commit 7777831

Please sign in to comment.