@cloud-copilot/iam-simulate
Version:
Simulate evaluation of AWS IAM policies
37 lines • 1.52 kB
TypeScript
import { Resource, Statement } from '@cloud-copilot/iam-policy';
import { ResourceExplain, StatementExplain } from '../explain/statementExplain.js';
import { AwsRequest } from '../request/request.js';
/**
* Check if a request matches the Resource or NotResource elements of a statement.
*
* @param request the request to check
* @param statement the statement to check against
* @returns true if the request matches the resources in the statement, false otherwise
*/
export declare function requestMatchesStatementResources(request: AwsRequest, statement: Statement): {
matches: boolean;
details: Pick<StatementExplain, 'resources' | 'notResources'>;
};
/**
* Check if a request matches a set of resources.
*
* @param request the request to check
* @param policyResources the resources to check against
* @returns true if the request matches any of the resources, false otherwise
*/
export declare function requestMatchesResources(request: AwsRequest, policyResources: Resource[]): {
matches: boolean;
explains: ResourceExplain[];
};
/**
* Check if a request matches a NotResource element in a policy.
*
* @param request the request to check
* @param policyResources the resources to check against
* @returns true if the request does not match any of the resources, false otherwise
*/
export declare function requestMatchesNotResources(request: AwsRequest, policyResources: Resource[]): {
matches: boolean;
explains: ResourceExplain[];
};
//# sourceMappingURL=resource.d.ts.map