1 | import { IConstruct } from '@aws-cdk/core';
|
2 | import { PolicyStatement } from '../policy-statement';
|
3 | /**
|
4 | * Merge as many statements as possible to shrink the total policy doc, modifying the input array in place
|
5 | *
|
6 | * We compare and merge all pairs of statements (O(N^2) complexity), opportunistically
|
7 | * merging them. This is not guaranteed to produce the optimal output, but it's probably
|
8 | * Good Enough(tm). If it merges anything, it's at least going to produce a smaller output
|
9 | * than the input.
|
10 | */
|
11 | export declare function mergeStatements(scope: IConstruct, statements: PolicyStatement[], limitSize: boolean): MergeStatementResult;
|
12 | export interface MergeStatementResult {
|
13 | /**
|
14 | * The list of maximally merged statements
|
15 | */
|
16 | readonly mergedStatements: PolicyStatement[];
|
17 | /**
|
18 | * Mapping of old to new statements
|
19 | */
|
20 | readonly originsMap: Map<PolicyStatement, PolicyStatement[]>;
|
21 | }
|