UNPKG

@cloud-copilot/iam-lens

Version:

Visibility in IAM in and across AWS accounts

67 lines 2.74 kB
import { IamCollectClient } from '../collect/client.js'; import { type SimulationRequest } from './simulate.js'; /** * Context keys for IAM simulation requests. * * These keys are used to provide additional context for the simulation, such as * the principal making the request, the resource being accessed, and any additional * context keys that may be required for the simulation. */ export type ContextKeys = Record<string, string | string[]>; export declare const knownContextKeys: readonly string[]; export declare const CONTEXT_KEYS: { assumedRoot: string; userId: string; vpc: string; vpcEndpointId: string; vpcEndpointAccount: string; vpcEndpointOrgId: string; vpcEndpointOrgPaths: string; vpcArn: string; }; /** * Checks if a context has a specific key (case-insensitive). * * @param context - The context to check. * @param key - The key to check for. * @returns True if the context has the key, false otherwise. */ export declare function contextHasKey(context: ContextKeys, key: string): boolean; /** * Get the value of a context key (case-insensitive). * * @param context - The context to check. * @param key - The key to get the value for. * @returns The value of the context key, or undefined if it doesn't exist. */ export declare function contextValue(context: ContextKeys, key: string): string | string[] | undefined; /** * Get the context keys for a simulation request. * * @param collectClient the collect client to use for fetching data * @param simulationRequest the simulation request to create context keys for * @param service the service the request is for * @param contextKeyOverrides the context key overrides to apply * @returns a promise that resolves to the context keys for the simulation request */ export declare function createContextKeys(collectClient: IamCollectClient, simulationRequest: SimulationRequest, service: string, contextKeyOverrides: ContextKeys): Promise<{ resourceTagsAreKnown: boolean; contextKeys: ContextKeys; }>; /** * Get the VPC keys that should be added to the context for a simulation. * * @param context the existing context * @param service the service the request is for * @param collectClient the IAM collect client * @returns a record of VPC context keys */ export declare function getVpcKeys(context: ContextKeys, service: string, collectClient: IamCollectClient): Promise<ContextKeys>; /** * Check if a service supports extra VPC endpoint data. * * @param service the service to check * @returns true if the service supports extra VPC endpoint data, false otherwise */ export declare function serviceSupportsExtraVpcEndpointData(service: string): boolean; //# sourceMappingURL=contextKeys.d.ts.map