@cloud-copilot/iam-data 0.9.202508241 → 0.11.202508241

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/cjs/conditionKeys.d.ts +1 -0
  2. package/dist/cjs/conditionKeys.d.ts.map +1 -1
  3. package/dist/cjs/conditionKeys.js +7 -0
  4. package/dist/cjs/conditionKeys.js.map +1 -1
  5. package/dist/cjs/data.d.ts +12 -0
  6. package/dist/cjs/data.d.ts.map +1 -1
  7. package/dist/cjs/data.js +18 -0
  8. package/dist/cjs/data.js.map +1 -1
  9. package/dist/cjs/findConditionKey.d.ts +12 -0
  10. package/dist/cjs/findConditionKey.d.ts.map +1 -0
  11. package/dist/cjs/findConditionKey.js +95 -0
  12. package/dist/cjs/findConditionKey.js.map +1 -0
  13. package/dist/cjs/globalConditionKeys.d.ts +9 -0
  14. package/dist/cjs/globalConditionKeys.d.ts.map +1 -0
  15. package/dist/cjs/globalConditionKeys.js +328 -0
  16. package/dist/cjs/globalConditionKeys.js.map +1 -0
  17. package/dist/cjs/index.d.ts +1 -0
  18. package/dist/cjs/index.d.ts.map +1 -1
  19. package/dist/cjs/index.js +3 -0
  20. package/dist/cjs/index.js.map +1 -1
  21. package/dist/esm/conditionKeys.d.ts +1 -0
  22. package/dist/esm/conditionKeys.d.ts.map +1 -1
  23. package/dist/esm/conditionKeys.js +6 -0
  24. package/dist/esm/conditionKeys.js.map +1 -1
  25. package/dist/esm/data.d.ts +12 -0
  26. package/dist/esm/data.d.ts.map +1 -1
  27. package/dist/esm/data.js +16 -0
  28. package/dist/esm/data.js.map +1 -1
  29. package/dist/esm/findConditionKey.d.ts +12 -0
  30. package/dist/esm/findConditionKey.d.ts.map +1 -0
  31. package/dist/esm/findConditionKey.js +92 -0
  32. package/dist/esm/findConditionKey.js.map +1 -0
  33. package/dist/esm/globalConditionKeys.d.ts +9 -0
  34. package/dist/esm/globalConditionKeys.d.ts.map +1 -0
  35. package/dist/esm/globalConditionKeys.js +325 -0
  36. package/dist/esm/globalConditionKeys.js.map +1 -0
  37. package/dist/esm/index.d.ts +1 -0
  38. package/dist/esm/index.d.ts.map +1 -1
  39. package/dist/esm/index.js +1 -0
  40. package/dist/esm/index.js.map +1 -1
  41. package/package.json +1 -1
@@ -27,4 +27,5 @@ export declare function iamConditionKeyExists(serviceKey: string, conditionKey:
27
27
  * @returns the details for the condition key
28
28
  */
29
29
  export declare function iamConditionKeyDetails(serviceKey: string, conditionKey: string): Promise<ConditionKey>;
30
+ export declare function getConditionKeysWithVariables(serviceKey: string): Promise<string[]>;
30
31
  //# sourceMappingURL=conditionKeys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"conditionKeys.d.ts","sourceRoot":"","sources":["../../src/conditionKeys.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAGtF;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,OAAO,CAAC,CAGlB;AAED;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,YAAY,CAAC,CAMvB"}
1
+ {"version":3,"file":"conditionKeys.d.ts","sourceRoot":"","sources":["../../src/conditionKeys.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAGtF;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,OAAO,CAAC,CAGlB;AAED;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,YAAY,CAAC,CAMvB;AAED,wBAAsB,6BAA6B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAKzF"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.iamConditionKeysForService = iamConditionKeysForService;
4
4
  exports.iamConditionKeyExists = iamConditionKeyExists;
5
5
  exports.iamConditionKeyDetails = iamConditionKeyDetails;
6
+ exports.getConditionKeysWithVariables = getConditionKeysWithVariables;
6
7
  const data_js_1 = require("./data.js");
7
8
  /**
8
9
  * Reads the condition keys for a service
@@ -40,4 +41,10 @@ async function iamConditionKeyDetails(serviceKey, conditionKey) {
40
41
  }
41
42
  return data[conditionKey.toLowerCase()];
42
43
  }
44
+ async function getConditionKeysWithVariables(serviceKey) {
45
+ const data = await (0, data_js_1.readConditionKeys)(serviceKey.toLowerCase());
46
+ return Object.values(data)
47
+ .filter((conditionKey) => conditionKey.key.includes('${'))
48
+ .map((conditionKey) => conditionKey.key);
49
+ }
43
50
  //# sourceMappingURL=conditionKeys.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"conditionKeys.js","sourceRoot":"","sources":["../../src/conditionKeys.ts"],"names":[],"mappings":";;AAcA,gEAGC;AASD,sDAMC;AAUD,wDASC;AAnDD,uCAA6C;AAQ7C;;;;;GAKG;AACI,KAAK,UAAU,0BAA0B,CAAC,UAAkB;IACjE,MAAM,IAAI,GAAG,MAAM,IAAA,2BAAiB,EAA+B,UAAU,CAAC,WAAW,EAAE,CA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;AACI,KAAK,UAAU,qBAAqB,CACzC,UAAkB,EAClB,YAAoB;IAEpB,MAAM,IAAI,GAAG,MAAM,IAAA,2BAAiB,EAA+B,UAAU,CAAC,WAAW,EAAE,CAAC,CAAA;IAC5F,OAAO,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,CAAA;AAC3C,CAAC;AAED;;;;;;;GAOG;AACI,KAAK,UAAU,sBAAsB,CAC1C,UAAkB,EAClB,YAAoB;IAEpB,MAAM,IAAI,GAAG,MAAM,IAAA,2BAAiB,EAA+B,UAAU,CAAC,WAAW,EAAE,CAAC,CAAA;IAC5F,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,iBAAiB,YAAY,+BAA+B,UAAU,EAAE,CAAC,CAAA;IAC3F,CAAC;IACD,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,CAAA;AACzC,CAAC;AAEM,KAAK,UAAU,6BAA6B,CAAC,UAAkB;IACpE,MAAM,IAAI,GAAG,MAAM,IAAA,2BAAiB,EAA+B,UAAU,CAAC,WAAW,EAAE,CAAC,CAAA;IAC5F,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;SACvB,MAAM,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;SACzD,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;AAC5C,CAAC"}
@@ -20,4 +20,16 @@ export declare function readConditionKeys<T>(serviceKey: string): Promise<T>;
20
20
  * @returns the resource type data
21
21
  */
22
22
  export declare function readResourceTypes<T>(serviceKey: string): Promise<T>;
23
+ /**
24
+ * Read the condition patterns data
25
+ *
26
+ * @returns the condition patterns data
27
+ */
28
+ export declare function readConditionPatterns(): Promise<Record<string, Record<string, string>>>;
29
+ /**
30
+ * Read the unassociated conditions data
31
+ *
32
+ * @returns the unassociated conditions data
33
+ */
34
+ export declare function readUnassociatedConditions(): Promise<Record<string, string[]>>;
23
35
  //# sourceMappingURL=data.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/data.ts"],"names":[],"mappings":"AAKA,wBAAsB,YAAY,CAAC,CAAC,EAAE,GAAG,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CA0BxE;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAEtE;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAEzE;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAEzE"}
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/data.ts"],"names":[],"mappings":"AAKA,wBAAsB,YAAY,CAAC,CAAC,EAAE,GAAG,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CA0BxE;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAEtE;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAEzE;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAEzE;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAE7F;AAED;;;;GAIG;AACH,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAEpF"}
package/dist/cjs/data.js CHANGED
@@ -4,6 +4,8 @@ exports.readDataFile = readDataFile;
4
4
  exports.readActionData = readActionData;
5
5
  exports.readConditionKeys = readConditionKeys;
6
6
  exports.readResourceTypes = readResourceTypes;
7
+ exports.readConditionPatterns = readConditionPatterns;
8
+ exports.readUnassociatedConditions = readUnassociatedConditions;
7
9
  const readRelativeFile_js_1 = require("./readRelativeFile.js");
8
10
  const dataCache = {};
9
11
  const requestCache = {};
@@ -58,4 +60,20 @@ async function readConditionKeys(serviceKey) {
58
60
  async function readResourceTypes(serviceKey) {
59
61
  return readDataFile('resourceTypes', `${serviceKey}.json`);
60
62
  }
63
+ /**
64
+ * Read the condition patterns data
65
+ *
66
+ * @returns the condition patterns data
67
+ */
68
+ async function readConditionPatterns() {
69
+ return readDataFile('conditionPatterns.json');
70
+ }
71
+ /**
72
+ * Read the unassociated conditions data
73
+ *
74
+ * @returns the unassociated conditions data
75
+ */
76
+ async function readUnassociatedConditions() {
77
+ return readDataFile('unassociatedConditions.json');
78
+ }
61
79
  //# sourceMappingURL=data.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"data.js","sourceRoot":"","sources":["../../src/data.ts"],"names":[],"mappings":";;AAKA,oCA0BC;AAQD,wCAEC;AAQD,8CAEC;AAQD,8CAEC;AA7DD,+DAAwD;AAExD,MAAM,SAAS,GAAwB,EAAE,CAAA;AACzC,MAAM,YAAY,GAAiC,EAAE,CAAA;AAE9C,KAAK,UAAU,YAAY,CAAI,GAAG,SAAmB;IAC1D,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IACzB,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAEhC,wDAAwD;I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AAI,eAAe,EAAE,GAAG,UAAU,OAAO,CAAC,CAAA;AAC/D,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,qBAAqB;IACzC,OAAO,YAAY,CAAyC,wBAAwB,CAAC,CAAA;AACvF,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,0BAA0B;IAC9C,OAAO,YAAY,CAA2B,6BAA6B,CAAC,CAAA;AAC9E,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { ConditionKey } from './conditionKeys.js';
2
+ /**
3
+ * Find the details for a condition key if it exists. This will check both global condition
4
+ * keys and service specific condition keys. If @param conditionKey matches a condition key that
5
+ * contains a variable it will return the matching condition key.
6
+ *
7
+ * If no match can be found, it will return undefined.
8
+ *
9
+ * @param conditionKey the condition key to find, is case insensitive
10
+ */
11
+ export declare function findConditionKey(conditionKey: string): Promise<ConditionKey | undefined>;
12
+ //# sourceMappingURL=findConditionKey.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findConditionKey.d.ts","sourceRoot":"","sources":["../../src/findConditionKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAiD,MAAM,oBAAoB,CAAA;AAwBhG;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CA0E9F"}
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findConditionKey = findConditionKey;
4
+ const conditionKeys_js_1 = require("./conditionKeys.js");
5
+ const data_js_1 = require("./data.js");
6
+ const globalConditionKeys_js_1 = require("./globalConditionKeys.js");
7
+ const services_js_1 = require("./services.js");
8
+ /**
9
+ * Get the service prefixes to search for a condition key
10
+ *
11
+ * @param servicePrefix the original service prefix from the condition key
12
+ * @returns an array of service prefixes to search
13
+ */
14
+ async function getServicePrefixes(servicePrefix) {
15
+ // Check if the service exists
16
+ const serviceExists = await (0, services_js_1.iamServiceExists)(servicePrefix);
17
+ if (serviceExists) {
18
+ return [servicePrefix];
19
+ }
20
+ // Service doesn't exist, check unassociated conditions
21
+ const unassociatedConditions = await (0, data_js_1.readUnassociatedConditions)();
22
+ return unassociatedConditions[servicePrefix] || [];
23
+ }
24
+ /**
25
+ * Find the details for a condition key if it exists. This will check both global condition
26
+ * keys and service specific condition keys. If @param conditionKey matches a condition key that
27
+ * contains a variable it will return the matching condition key.
28
+ *
29
+ * If no match can be found, it will return undefined.
30
+ *
31
+ * @param conditionKey the condition key to find, is case insensitive
32
+ */
33
+ async function findConditionKey(conditionKey) {
34
+ const normalizedConditionKey = conditionKey.toLowerCase();
35
+ // If it starts with 'aws', check global condition keys
36
+ if (normalizedConditionKey.startsWith('aws:')) {
37
+ // First check for exact match in global condition keys
38
+ const exactGlobalMatch = globalConditionKeys_js_1.globalConditionKeys.find((gck) => gck.key.toLowerCase() === normalizedConditionKey);
39
+ if (exactGlobalMatch) {
40
+ return exactGlobalMatch;
41
+ }
42
+ // Then check global condition keys with variables (like aws:PrincipalTag/tag-key)
43
+ const variableGlobalMatch = globalConditionKeys_js_1.globalConditionKeys.find((gck) => {
44
+ const pattern = gck.key.toLowerCase();
45
+ if (pattern.includes('/')) {
46
+ // Handle patterns like 'aws:principaltag/tag-key' where 'tag-key' is a variable
47
+ const [prefix, suffix] = pattern.split('/');
48
+ return normalizedConditionKey.startsWith(prefix + '/') && suffix === 'tag-key';
49
+ }
50
+ return false;
51
+ });
52
+ if (variableGlobalMatch) {
53
+ return variableGlobalMatch;
54
+ }
55
+ return undefined;
56
+ }
57
+ // If it doesn't start with 'aws', extract the service prefix
58
+ const colonIndex = normalizedConditionKey.indexOf(':');
59
+ if (colonIndex === -1) {
60
+ return undefined; // No service prefix found
61
+ }
62
+ const servicePrefix = normalizedConditionKey.substring(0, colonIndex);
63
+ // Get all service prefixes to search
64
+ const servicesToSearch = await getServicePrefixes(servicePrefix);
65
+ if (servicesToSearch.length === 0) {
66
+ return undefined; // No services found for this condition prefix
67
+ }
68
+ // Check each service for the condition key
69
+ for (const service of servicesToSearch) {
70
+ // Check for exact match in service condition keys
71
+ const hasConditionKey = await (0, conditionKeys_js_1.iamConditionKeyExists)(service, normalizedConditionKey);
72
+ if (hasConditionKey) {
73
+ return await (0, conditionKeys_js_1.iamConditionKeyDetails)(service, normalizedConditionKey);
74
+ }
75
+ }
76
+ // Last resort: check condition patterns
77
+ const conditionPatterns = await (0, data_js_1.readConditionPatterns)();
78
+ const servicePatterns = conditionPatterns[servicePrefix];
79
+ if (servicePatterns) {
80
+ for (const [patternStr, templateKey] of Object.entries(servicePatterns)) {
81
+ const regex = new RegExp(`^${patternStr}$`, 'i');
82
+ console.log(patternStr);
83
+ console.log(normalizedConditionKey);
84
+ if (regex.test(normalizedConditionKey)) {
85
+ // Found a pattern match, try to get the template condition key
86
+ const hasTemplateKey = await (0, conditionKeys_js_1.iamConditionKeyExists)(servicePrefix, templateKey);
87
+ if (hasTemplateKey) {
88
+ return await (0, conditionKeys_js_1.iamConditionKeyDetails)(servicePrefix, templateKey);
89
+ }
90
+ }
91
+ }
92
+ }
93
+ return undefined;
94
+ }
95
+ //# sourceMappingURL=findConditionKey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findConditionKey.js","sourceRoot":"","sources":["../../src/findConditionKey.ts"],"names":[],"mappings":";;AAiCA,4CA0EC;AA3GD,yDAAgG;AAChG,uCAA6E;AAC7E,qEAA8D;AAC9D,+CAAgD;AAEhD;;;;;GAKG;AACH,KAAK,UAAU,kBAAkB,CAAC,aAAqB;IACrD,8BAA8B;IAC9B,MAAM,aAAa,GAAG,MAAM,IAAA,8BAAgB,EAAC,aAAa,CAAC,CAAA;IAE3D,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,CAAC,aAAa,CAAC,CAAA;IACxB,CAAC;IAED,uDAAuD;IACvD,MAAM,sBAAsB,GAAG,MAAM,IAAA,oCAA0B,GAAE,CAAA;IACjE,OAAO,sBAAsB,CAAC,aA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,aAAa,EAAE,WAAW,CAAC,CAAA;gBACjE,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { ConditionKey } from './conditionKeys.js';
2
+ interface GlobalConditionKey extends ConditionKey {
3
+ category: string;
4
+ }
5
+ export declare const globalConditionKeys: GlobalConditionKey[];
6
+ export declare const globalConditionKeysByName: Record<string, GlobalConditionKey>;
7
+ export declare const globalVariableConditionKeysByPrefix: Record<string, GlobalConditionKey>;
8
+ export {};
9
+ //# sourceMappingURL=globalConditionKeys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globalConditionKeys.d.ts","sourceRoot":"","sources":["../../src/globalConditionKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,UAAU,kBAAmB,SAAQ,YAAY;IAC/C,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,eAAO,MAAM,mBAAmB,EAAE,kBAAkB,EAyTnD,CAAA;AAED,eAAO,MAAM,yBAAyB,oCAMrC,CAAA;AAED,eAAO,MAAM,mCAAmC,oCAQ/C,CAAA"}
@@ -0,0 +1,328 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.globalVariableConditionKeysByPrefix = exports.globalConditionKeysByName = exports.globalConditionKeys = void 0;
4
+ exports.globalConditionKeys = [
5
+ {
6
+ key: 'aws:PrincipalArn',
7
+ category: 'principal',
8
+ type: 'ARN',
9
+ description: ''
10
+ },
11
+ {
12
+ key: 'aws:PrincipalAccount',
13
+ category: 'principal',
14
+ type: 'String',
15
+ description: ''
16
+ },
17
+ {
18
+ key: 'aws:PrincipalOrgPaths',
19
+ category: 'principal',
20
+ type: 'ArrayOfString',
21
+ description: ''
22
+ },
23
+ {
24
+ key: 'aws:PrincipalOrgID',
25
+ category: 'principal',
26
+ type: 'String',
27
+ description: ''
28
+ },
29
+ {
30
+ key: 'aws:PrincipalTag/tag-key',
31
+ category: 'principal',
32
+ type: 'String',
33
+ description: ''
34
+ },
35
+ {
36
+ key: 'aws:PrincipalIsAWSService',
37
+ category: 'principal',
38
+ type: 'Bool',
39
+ description: ''
40
+ },
41
+ {
42
+ key: 'aws:PrincipalServiceName',
43
+ category: 'principal',
44
+ type: 'String',
45
+ description: ''
46
+ },
47
+ {
48
+ key: 'aws:PrincipalServiceNamesList',
49
+ category: 'principal',
50
+ type: 'ArrayOfString',
51
+ description: ''
52
+ },
53
+ {
54
+ key: 'aws:PrincipalType',
55
+ category: 'principal',
56
+ type: 'String',
57
+ description: ''
58
+ },
59
+ {
60
+ key: 'aws:userid',
61
+ category: 'principal',
62
+ type: 'String',
63
+ description: ''
64
+ },
65
+ {
66
+ key: 'aws:username',
67
+ category: 'principal',
68
+ type: 'String',
69
+ description: ''
70
+ },
71
+ {
72
+ key: 'aws:AssumedRoot',
73
+ category: 'session',
74
+ type: 'String',
75
+ description: ''
76
+ },
77
+ {
78
+ key: 'aws:FederatedProvider',
79
+ category: 'session',
80
+ type: 'String',
81
+ description: ''
82
+ },
83
+ {
84
+ key: 'aws:TokenIssueTime',
85
+ category: 'session',
86
+ type: 'Date',
87
+ description: ''
88
+ },
89
+ {
90
+ key: 'aws:MultiFactorAuthAge',
91
+ category: 'session',
92
+ type: 'Numeric',
93
+ description: ''
94
+ },
95
+ {
96
+ key: 'aws:MultiFactorAuthPresent',
97
+ category: 'session',
98
+ type: 'Bool',
99
+ description: ''
100
+ },
101
+ {
102
+ key: 'aws:ChatbotSourceArn',
103
+ category: 'session',
104
+ type: 'ARN',
105
+ description: ''
106
+ },
107
+ {
108
+ key: 'aws:Ec2InstanceSourceVpc',
109
+ category: 'session',
110
+ type: 'String',
111
+ description: ''
112
+ },
113
+ {
114
+ key: 'aws:Ec2InstanceSourcePrivateIPv4',
115
+ category: 'session',
116
+ type: 'IPAddress',
117
+ description: ''
118
+ },
119
+ {
120
+ key: 'aws:SourceIdentity',
121
+ category: 'session',
122
+ type: 'String',
123
+ description: ''
124
+ },
125
+ {
126
+ key: 'ec2:RoleDelivery',
127
+ category: 'session',
128
+ type: 'Numeric',
129
+ description: ''
130
+ },
131
+ {
132
+ key: 'ec2:SourceInstanceArn',
133
+ category: 'session',
134
+ type: 'ARN',
135
+ description: ''
136
+ },
137
+ {
138
+ key: 'glue:RoleAssumedBy',
139
+ category: 'session',
140
+ type: 'String',
141
+ description: ''
142
+ },
143
+ {
144
+ key: 'glue:CredentialIssuingService',
145
+ category: 'session',
146
+ type: 'String',
147
+ description: ''
148
+ },
149
+ {
150
+ key: 'lambda:SourceFunctionArn',
151
+ category: 'session',
152
+ type: 'ARN',
153
+ description: ''
154
+ },
155
+ {
156
+ key: 'ssm:SourceInstanceArn',
157
+ category: 'session',
158
+ type: 'ARN',
159
+ description: ''
160
+ },
161
+ {
162
+ key: 'identitystore:UserId',
163
+ category: 'session',
164
+ type: 'String',
165
+ description: ''
166
+ },
167
+ {
168
+ key: 'aws:SourceIp',
169
+ category: 'network',
170
+ type: 'IPAddress',
171
+ description: ''
172
+ },
173
+ {
174
+ key: 'aws:SourceVpc',
175
+ category: 'network',
176
+ type: 'String',
177
+ description: ''
178
+ },
179
+ {
180
+ key: 'aws:SourceVpce',
181
+ category: 'network',
182
+ type: 'String',
183
+ description: ''
184
+ },
185
+ {
186
+ key: 'aws:VpcSourceIp',
187
+ category: 'network',
188
+ type: 'IPAddress',
189
+ description: ''
190
+ },
191
+ {
192
+ key: 'aws:ResourceAccount',
193
+ category: 'resource',
194
+ type: 'String',
195
+ description: ''
196
+ },
197
+ {
198
+ key: 'aws:ResourceOrgID',
199
+ category: 'resource',
200
+ type: 'String',
201
+ description: ''
202
+ },
203
+ {
204
+ key: 'aws:ResourceOrgPaths',
205
+ category: 'resource',
206
+ type: 'ArrayOfString',
207
+ description: ''
208
+ },
209
+ {
210
+ key: 'aws:ResourceTag/tag-key',
211
+ category: 'resource',
212
+ type: 'String',
213
+ description: ''
214
+ },
215
+ {
216
+ key: 'aws:CalledVia',
217
+ category: 'request',
218
+ type: 'ArrayOfString',
219
+ description: ''
220
+ },
221
+ {
222
+ key: 'aws:CalledViaFirst',
223
+ category: 'request',
224
+ type: 'String',
225
+ description: ''
226
+ },
227
+ {
228
+ key: 'aws:CalledViaLast',
229
+ category: 'request',
230
+ type: 'String',
231
+ description: ''
232
+ },
233
+ {
234
+ key: 'aws:ViaAWSService',
235
+ category: 'request',
236
+ type: 'Bool',
237
+ description: ''
238
+ },
239
+ {
240
+ key: 'aws:CurrentTime',
241
+ category: 'request',
242
+ type: 'Date',
243
+ description: ''
244
+ },
245
+ {
246
+ key: 'aws:EpochTime',
247
+ category: 'request',
248
+ type: 'Date', //Can Also be Numeric...
249
+ description: ''
250
+ },
251
+ {
252
+ key: 'aws:referer',
253
+ category: 'request',
254
+ type: 'String',
255
+ description: ''
256
+ },
257
+ {
258
+ key: 'aws:RequestedRegion',
259
+ category: 'request',
260
+ type: 'String',
261
+ description: ''
262
+ },
263
+ {
264
+ key: 'aws:RequestTag/tag-key',
265
+ category: 'request',
266
+ type: 'String',
267
+ description: ''
268
+ },
269
+ {
270
+ key: 'aws:TagKeys',
271
+ category: 'request',
272
+ type: 'ArrayOfString',
273
+ description: ''
274
+ },
275
+ {
276
+ key: 'aws:SecureTransport',
277
+ category: 'request',
278
+ type: 'Bool',
279
+ description: ''
280
+ },
281
+ {
282
+ key: 'aws:SourceArn',
283
+ category: 'request',
284
+ type: 'ARN',
285
+ description: ''
286
+ },
287
+ {
288
+ key: 'aws:SourceAccount',
289
+ category: 'request',
290
+ type: 'String',
291
+ description: ''
292
+ },
293
+ {
294
+ key: 'aws:SourceOwner',
295
+ category: 'request',
296
+ type: 'String',
297
+ description: ''
298
+ },
299
+ {
300
+ key: 'aws:SourceOrgPaths',
301
+ category: 'request',
302
+ type: 'ArrayOfString',
303
+ description: ''
304
+ },
305
+ {
306
+ key: 'aws:SourceOrgID',
307
+ category: 'request',
308
+ type: 'String',
309
+ description: ''
310
+ },
311
+ {
312
+ key: 'aws:UserAgent',
313
+ category: 'request',
314
+ type: 'String',
315
+ description: ''
316
+ }
317
+ ];
318
+ exports.globalConditionKeysByName = exports.globalConditionKeys.reduce((acc, key) => {
319
+ acc[key.key.toLowerCase()] = key;
320
+ return acc;
321
+ }, {});
322
+ exports.globalVariableConditionKeysByPrefix = exports.globalConditionKeys.reduce((acc, key) => {
323
+ if (key.key.includes('/')) {
324
+ acc[key.key.split('/')[0].toLowerCase()] = key;
325
+ }
326
+ return acc;
327
+ }, {});
328
+ //# sourceMappingURL=globalConditionKeys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globalConditionKeys.js","sourceRoot":"","sources":["../../src/globalConditionKeys.ts"],"names":[],"mappings":";;;AAMa,QAAA,mBAAmB,GAAyB;IACvD;QACE,GAAG,EAAE,kBAAkB;QACvB,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,EAAE;KAChB;IACD;QACE,GAAG,EAAE,sBAAsB;QAC3B,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,EAAE;KAChB;IACD;QACE,GAAG,EAAE,uBAAuB;QAC5B,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,EAAE;KAChB;IACD;QACE,GAAG,EAAE,oBAAoB;QACzB,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,EAAE;KAChB;IACD;QACE,GAAG,EAAE,0BAA0B;QAC/B,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,EAAE;KAChB;IACD;QACE,GAAG,EAAE,2BAA2B;QAChC,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,EAAE;KAChB;IACD;QACE,GAAG,EAAE,0BAA0B;QAC/B,QAAQ,EAAE,WAAW;QACrB,I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I,EAAE,QAAQ;QACd,WAAW,EAAE,EAAE;KAChB;CACF,CAAA;AAEY,QAAA,yBAAyB,GAAG,2BAAmB,CAAC,MAAM,CACjE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACX,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,GAAG,GAAG,CAAA;IAChC,OAAO,GAAG,CAAA;AACZ,CAAC,EACD,EAAwC,CACzC,CAAA;AAEY,QAAA,mCAAmC,GAAG,2BAAmB,CAAC,MAAM,CAC3E,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACX,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1B,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,GAAG,GAAG,CAAA;IAChD,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC,EACD,EAAwC,CACzC,CAAA"}
@@ -1,5 +1,6 @@
1
1
  export * from './actions.js';
2
2
  export * from './conditionKeys.js';
3
+ export { findConditionKey } from './findConditionKey.js';
3
4
  export * from './resourceTypes.js';
4
5
  export * from './services.js';
5
6
  export * from './version.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA"}
package/dist/cjs/index.js CHANGED
@@ -14,8 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.findConditionKey = void 0;
17
18
  __exportStar(require("./actions.js"), exports);
18
19
  __exportStar(require("./conditionKeys.js"), exports);
20
+ var findConditionKey_js_1 = require("./findConditionKey.js");
21
+ Object.defineProperty(exports, "findConditionKey", { enumerable: true, get: function () { return findConditionKey_js_1.findConditionKey; } });
19
22
  __exportStar(require("./resourceTypes.js"), exports);
20
23
  __exportStar(require("./services.js"), exports);
21
24
  __exportStar(require("./version.js"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,qDAAkC;AAClC,qDAAkC;AAClC,gDAA6B;AAC7B,+CAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,qDAAkC;AAClC,6DAAwD;AAA/C,uHAAA,gBAAgB,OAAA;AACzB,qDAAkC;AAClC,gDAA6B;AAC7B,+CAA4B"}
@@ -27,4 +27,5 @@ export declare function iamConditionKeyExists(serviceKey: string, conditionKey:
27
27
  * @returns the details for the condition key
28
28
  */
29
29
  export declare function iamConditionKeyDetails(serviceKey: string, conditionKey: string): Promise<ConditionKey>;
30
+ export declare function getConditionKeysWithVariables(serviceKey: string): Promise<string[]>;
30
31
  //# sourceMappingURL=conditionKeys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"conditionKeys.d.ts","sourceRoot":"","sources":["../../src/conditionKeys.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAGtF;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,OAAO,CAAC,CAGlB;AAED;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,YAAY,CAAC,CAMvB"}
1
+ {"version":3,"file":"conditionKeys.d.ts","sourceRoot":"","sources":["../../src/conditionKeys.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAGtF;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,OAAO,CAAC,CAGlB;AAED;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,YAAY,CAAC,CAMvB;AAED,wBAAsB,6BAA6B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAKzF"}
@@ -35,4 +35,10 @@ export async function iamConditionKeyDetails(serviceKey, conditionKey) {
35
35
  }
36
36
  return data[conditionKey.toLowerCase()];
37
37
  }
38
+ export async function getConditionKeysWithVariables(serviceKey) {
39
+ const data = await readConditionKeys(serviceKey.toLowerCase());
40
+ return Object.values(data)
41
+ .filter((conditionKey) => conditionKey.key.includes('${'))
42
+ .map((conditionKey) => conditionKey.key);
43
+ }
38
44
  //# sourceMappingURL=conditionKeys.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"conditionKeys.js","sourceRoot":"","sources":["../../src/conditionKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAQ7C;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,UAAkB;IACjE,MAAM,IAAI,GAAG,MAAM,iBAAiB,CAA+B,UAAU,CAAC,WAAW,EAAE,CAAC,CAAA;IAC5F,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;AACpE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,UAAkB,EAClB,YAAoB;IAEpB,MAAM,IAAI,GAAG,MAAM,iBAAiB,CAA+B,UAAU,CAAC,WAAW,EAAE,CAAC,CAAA;IAC5F,OAAO,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,CAAA;AAC3C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,UAAkB,EAClB,YAAoB;IAEpB,MAAM,IAAI,GAAG,MAAM,iBAAiB,CAA+B,UAAU,CAAC,WAAW,EAAE,CAAC,CAAA;IAC5F,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,iBAAiB,YAAY,+BAA+B,UAAU,EAAE,CAAC,CAAA;IAC3F,CAAC;IACD,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,CAAA;AACzC,CAAC"}
1
+ {"version":3,"file":"conditionKeys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AAM,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;SACzD,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;AAC5C,CAAC"}
@@ -20,4 +20,16 @@ export declare function readConditionKeys<T>(serviceKey: string): Promise<T>;
20
20
  * @returns the resource type data
21
21
  */
22
22
  export declare function readResourceTypes<T>(serviceKey: string): Promise<T>;
23
+ /**
24
+ * Read the condition patterns data
25
+ *
26
+ * @returns the condition patterns data
27
+ */
28
+ export declare function readConditionPatterns(): Promise<Record<string, Record<string, string>>>;
29
+ /**
30
+ * Read the unassociated conditions data
31
+ *
32
+ * @returns the unassociated conditions data
33
+ */
34
+ export declare function readUnassociatedConditions(): Promise<Record<string, string[]>>;
23
35
  //# sourceMappingURL=data.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/data.ts"],"names":[],"mappings":"AAKA,wBAAsB,YAAY,CAAC,CAAC,EAAE,GAAG,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CA0BxE;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAEtE;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAEzE;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAEzE"}
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/data.ts"],"names":[],"mappings":"AAKA,wBAAsB,YAAY,CAAC,CAAC,EAAE,GAAG,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CA0BxE;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAEtE;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAEzE;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAEzE;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAE7F;AAED;;;;GAIG;AACH,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAEpF"}
package/dist/esm/data.js CHANGED
@@ -52,4 +52,20 @@ export async function readConditionKeys(serviceKey) {
52
52
  export async function readResourceTypes(serviceKey) {
53
53
  return readDataFile('resourceTypes', `${serviceKey}.json`);
54
54
  }
55
+ /**
56
+ * Read the condition patterns data
57
+ *
58
+ * @returns the condition patterns data
59
+ */
60
+ export async function readConditionPatterns() {
61
+ return readDataFile('conditionPatterns.json');
62
+ }
63
+ /**
64
+ * Read the unassociated conditions data
65
+ *
66
+ * @returns the unassociated conditions data
67
+ */
68
+ export async function readUnassociatedConditions() {
69
+ return readDataFile('unassociatedConditions.json');
70
+ }
55
71
  //# sourceMappingURL=data.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"data.js","sourceRoot":"","sources":["../../src/data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,MAAM,SAAS,GAAwB,EAAE,CAAA;AACzC,MAAM,YAAY,GAAiC,EAAE,CAAA;AAErD,MAAM,CAAC,KAAK,UAAU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AiB,CAAI,UAAkB;IAC3D,OAAO,YAAY,CAAI,eAAe,EAAE,GAAG,UAAU,OAAO,CAAC,CAAA;AAC/D,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAI,UAAkB;IAC3D,OAAO,YAAY,CAAI,eAAe,EAAE,GAAG,UAAU,OAAO,CAAC,CAAA;AAC/D,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB;IACzC,OAAO,YAAY,CAAyC,wBAAwB,CAAC,CAAA;AACvF,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B;IAC9C,OAAO,YAAY,CAA2B,6BAA6B,CAAC,CAAA;AAC9E,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { ConditionKey } from './conditionKeys.js';
2
+ /**
3
+ * Find the details for a condition key if it exists. This will check both global condition
4
+ * keys and service specific condition keys. If @param conditionKey matches a condition key that
5
+ * contains a variable it will return the matching condition key.
6
+ *
7
+ * If no match can be found, it will return undefined.
8
+ *
9
+ * @param conditionKey the condition key to find, is case insensitive
10
+ */
11
+ export declare function findConditionKey(conditionKey: string): Promise<ConditionKey | undefined>;
12
+ //# sourceMappingURL=findConditionKey.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findConditionKey.d.ts","sourceRoot":"","sources":["../../src/findConditionKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAiD,MAAM,oBAAoB,CAAA;AAwBhG;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CA0E9F"}
@@ -0,0 +1,92 @@
1
+ import { iamConditionKeyDetails, iamConditionKeyExists } from './conditionKeys.js';
2
+ import { readConditionPatterns, readUnassociatedConditions } from './data.js';
3
+ import { globalConditionKeys } from './globalConditionKeys.js';
4
+ import { iamServiceExists } from './services.js';
5
+ /**
6
+ * Get the service prefixes to search for a condition key
7
+ *
8
+ * @param servicePrefix the original service prefix from the condition key
9
+ * @returns an array of service prefixes to search
10
+ */
11
+ async function getServicePrefixes(servicePrefix) {
12
+ // Check if the service exists
13
+ const serviceExists = await iamServiceExists(servicePrefix);
14
+ if (serviceExists) {
15
+ return [servicePrefix];
16
+ }
17
+ // Service doesn't exist, check unassociated conditions
18
+ const unassociatedConditions = await readUnassociatedConditions();
19
+ return unassociatedConditions[servicePrefix] || [];
20
+ }
21
+ /**
22
+ * Find the details for a condition key if it exists. This will check both global condition
23
+ * keys and service specific condition keys. If @param conditionKey matches a condition key that
24
+ * contains a variable it will return the matching condition key.
25
+ *
26
+ * If no match can be found, it will return undefined.
27
+ *
28
+ * @param conditionKey the condition key to find, is case insensitive
29
+ */
30
+ export async function findConditionKey(conditionKey) {
31
+ const normalizedConditionKey = conditionKey.toLowerCase();
32
+ // If it starts with 'aws', check global condition keys
33
+ if (normalizedConditionKey.startsWith('aws:')) {
34
+ // First check for exact match in global condition keys
35
+ const exactGlobalMatch = globalConditionKeys.find((gck) => gck.key.toLowerCase() === normalizedConditionKey);
36
+ if (exactGlobalMatch) {
37
+ return exactGlobalMatch;
38
+ }
39
+ // Then check global condition keys with variables (like aws:PrincipalTag/tag-key)
40
+ const variableGlobalMatch = globalConditionKeys.find((gck) => {
41
+ const pattern = gck.key.toLowerCase();
42
+ if (pattern.includes('/')) {
43
+ // Handle patterns like 'aws:principaltag/tag-key' where 'tag-key' is a variable
44
+ const [prefix, suffix] = pattern.split('/');
45
+ return normalizedConditionKey.startsWith(prefix + '/') && suffix === 'tag-key';
46
+ }
47
+ return false;
48
+ });
49
+ if (variableGlobalMatch) {
50
+ return variableGlobalMatch;
51
+ }
52
+ return undefined;
53
+ }
54
+ // If it doesn't start with 'aws', extract the service prefix
55
+ const colonIndex = normalizedConditionKey.indexOf(':');
56
+ if (colonIndex === -1) {
57
+ return undefined; // No service prefix found
58
+ }
59
+ const servicePrefix = normalizedConditionKey.substring(0, colonIndex);
60
+ // Get all service prefixes to search
61
+ const servicesToSearch = await getServicePrefixes(servicePrefix);
62
+ if (servicesToSearch.length === 0) {
63
+ return undefined; // No services found for this condition prefix
64
+ }
65
+ // Check each service for the condition key
66
+ for (const service of servicesToSearch) {
67
+ // Check for exact match in service condition keys
68
+ const hasConditionKey = await iamConditionKeyExists(service, normalizedConditionKey);
69
+ if (hasConditionKey) {
70
+ return await iamConditionKeyDetails(service, normalizedConditionKey);
71
+ }
72
+ }
73
+ // Last resort: check condition patterns
74
+ const conditionPatterns = await readConditionPatterns();
75
+ const servicePatterns = conditionPatterns[servicePrefix];
76
+ if (servicePatterns) {
77
+ for (const [patternStr, templateKey] of Object.entries(servicePatterns)) {
78
+ const regex = new RegExp(`^${patternStr}$`, 'i');
79
+ console.log(patternStr);
80
+ console.log(normalizedConditionKey);
81
+ if (regex.test(normalizedConditionKey)) {
82
+ // Found a pattern match, try to get the template condition key
83
+ const hasTemplateKey = await iamConditionKeyExists(servicePrefix, templateKey);
84
+ if (hasTemplateKey) {
85
+ return await iamConditionKeyDetails(servicePrefix, templateKey);
86
+ }
87
+ }
88
+ }
89
+ }
90
+ return undefined;
91
+ }
92
+ //# sourceMappingURL=findConditionKey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findConditionKey.js","sourceRoot":"","sources":["../../src/findConditionKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAChG,OAAO,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAA;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAEhD;;;;;GAKG;AACH,KAAK,UAAU,kBAAkB,CAAC,aAAqB;IACrD,8BAA8B;IAC9B,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAC,aAAa,CAAC,CAAA;IA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vC,+DAA+D;gBAC/D,MAAM,cAAc,GAAG,MAAM,qBAAqB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAA;gBAC9E,IAAI,cAAc,EAAE,CAAC;oBACnB,OAAO,MAAM,sBAAsB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAA;gBACjE,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { ConditionKey } from './conditionKeys.js';
2
+ interface GlobalConditionKey extends ConditionKey {
3
+ category: string;
4
+ }
5
+ export declare const globalConditionKeys: GlobalConditionKey[];
6
+ export declare const globalConditionKeysByName: Record<string, GlobalConditionKey>;
7
+ export declare const globalVariableConditionKeysByPrefix: Record<string, GlobalConditionKey>;
8
+ export {};
9
+ //# sourceMappingURL=globalConditionKeys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globalConditionKeys.d.ts","sourceRoot":"","sources":["../../src/globalConditionKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,UAAU,kBAAmB,SAAQ,YAAY;IAC/C,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,eAAO,MAAM,mBAAmB,EAAE,kBAAkB,EAyTnD,CAAA;AAED,eAAO,MAAM,yBAAyB,oCAMrC,CAAA;AAED,eAAO,MAAM,mCAAmC,oCAQ/C,CAAA"}
@@ -0,0 +1,325 @@
1
+ export const globalConditionKeys = [
2
+ {
3
+ key: 'aws:PrincipalArn',
4
+ category: 'principal',
5
+ type: 'ARN',
6
+ description: ''
7
+ },
8
+ {
9
+ key: 'aws:PrincipalAccount',
10
+ category: 'principal',
11
+ type: 'String',
12
+ description: ''
13
+ },
14
+ {
15
+ key: 'aws:PrincipalOrgPaths',
16
+ category: 'principal',
17
+ type: 'ArrayOfString',
18
+ description: ''
19
+ },
20
+ {
21
+ key: 'aws:PrincipalOrgID',
22
+ category: 'principal',
23
+ type: 'String',
24
+ description: ''
25
+ },
26
+ {
27
+ key: 'aws:PrincipalTag/tag-key',
28
+ category: 'principal',
29
+ type: 'String',
30
+ description: ''
31
+ },
32
+ {
33
+ key: 'aws:PrincipalIsAWSService',
34
+ category: 'principal',
35
+ type: 'Bool',
36
+ description: ''
37
+ },
38
+ {
39
+ key: 'aws:PrincipalServiceName',
40
+ category: 'principal',
41
+ type: 'String',
42
+ description: ''
43
+ },
44
+ {
45
+ key: 'aws:PrincipalServiceNamesList',
46
+ category: 'principal',
47
+ type: 'ArrayOfString',
48
+ description: ''
49
+ },
50
+ {
51
+ key: 'aws:PrincipalType',
52
+ category: 'principal',
53
+ type: 'String',
54
+ description: ''
55
+ },
56
+ {
57
+ key: 'aws:userid',
58
+ category: 'principal',
59
+ type: 'String',
60
+ description: ''
61
+ },
62
+ {
63
+ key: 'aws:username',
64
+ category: 'principal',
65
+ type: 'String',
66
+ description: ''
67
+ },
68
+ {
69
+ key: 'aws:AssumedRoot',
70
+ category: 'session',
71
+ type: 'String',
72
+ description: ''
73
+ },
74
+ {
75
+ key: 'aws:FederatedProvider',
76
+ category: 'session',
77
+ type: 'String',
78
+ description: ''
79
+ },
80
+ {
81
+ key: 'aws:TokenIssueTime',
82
+ category: 'session',
83
+ type: 'Date',
84
+ description: ''
85
+ },
86
+ {
87
+ key: 'aws:MultiFactorAuthAge',
88
+ category: 'session',
89
+ type: 'Numeric',
90
+ description: ''
91
+ },
92
+ {
93
+ key: 'aws:MultiFactorAuthPresent',
94
+ category: 'session',
95
+ type: 'Bool',
96
+ description: ''
97
+ },
98
+ {
99
+ key: 'aws:ChatbotSourceArn',
100
+ category: 'session',
101
+ type: 'ARN',
102
+ description: ''
103
+ },
104
+ {
105
+ key: 'aws:Ec2InstanceSourceVpc',
106
+ category: 'session',
107
+ type: 'String',
108
+ description: ''
109
+ },
110
+ {
111
+ key: 'aws:Ec2InstanceSourcePrivateIPv4',
112
+ category: 'session',
113
+ type: 'IPAddress',
114
+ description: ''
115
+ },
116
+ {
117
+ key: 'aws:SourceIdentity',
118
+ category: 'session',
119
+ type: 'String',
120
+ description: ''
121
+ },
122
+ {
123
+ key: 'ec2:RoleDelivery',
124
+ category: 'session',
125
+ type: 'Numeric',
126
+ description: ''
127
+ },
128
+ {
129
+ key: 'ec2:SourceInstanceArn',
130
+ category: 'session',
131
+ type: 'ARN',
132
+ description: ''
133
+ },
134
+ {
135
+ key: 'glue:RoleAssumedBy',
136
+ category: 'session',
137
+ type: 'String',
138
+ description: ''
139
+ },
140
+ {
141
+ key: 'glue:CredentialIssuingService',
142
+ category: 'session',
143
+ type: 'String',
144
+ description: ''
145
+ },
146
+ {
147
+ key: 'lambda:SourceFunctionArn',
148
+ category: 'session',
149
+ type: 'ARN',
150
+ description: ''
151
+ },
152
+ {
153
+ key: 'ssm:SourceInstanceArn',
154
+ category: 'session',
155
+ type: 'ARN',
156
+ description: ''
157
+ },
158
+ {
159
+ key: 'identitystore:UserId',
160
+ category: 'session',
161
+ type: 'String',
162
+ description: ''
163
+ },
164
+ {
165
+ key: 'aws:SourceIp',
166
+ category: 'network',
167
+ type: 'IPAddress',
168
+ description: ''
169
+ },
170
+ {
171
+ key: 'aws:SourceVpc',
172
+ category: 'network',
173
+ type: 'String',
174
+ description: ''
175
+ },
176
+ {
177
+ key: 'aws:SourceVpce',
178
+ category: 'network',
179
+ type: 'String',
180
+ description: ''
181
+ },
182
+ {
183
+ key: 'aws:VpcSourceIp',
184
+ category: 'network',
185
+ type: 'IPAddress',
186
+ description: ''
187
+ },
188
+ {
189
+ key: 'aws:ResourceAccount',
190
+ category: 'resource',
191
+ type: 'String',
192
+ description: ''
193
+ },
194
+ {
195
+ key: 'aws:ResourceOrgID',
196
+ category: 'resource',
197
+ type: 'String',
198
+ description: ''
199
+ },
200
+ {
201
+ key: 'aws:ResourceOrgPaths',
202
+ category: 'resource',
203
+ type: 'ArrayOfString',
204
+ description: ''
205
+ },
206
+ {
207
+ key: 'aws:ResourceTag/tag-key',
208
+ category: 'resource',
209
+ type: 'String',
210
+ description: ''
211
+ },
212
+ {
213
+ key: 'aws:CalledVia',
214
+ category: 'request',
215
+ type: 'ArrayOfString',
216
+ description: ''
217
+ },
218
+ {
219
+ key: 'aws:CalledViaFirst',
220
+ category: 'request',
221
+ type: 'String',
222
+ description: ''
223
+ },
224
+ {
225
+ key: 'aws:CalledViaLast',
226
+ category: 'request',
227
+ type: 'String',
228
+ description: ''
229
+ },
230
+ {
231
+ key: 'aws:ViaAWSService',
232
+ category: 'request',
233
+ type: 'Bool',
234
+ description: ''
235
+ },
236
+ {
237
+ key: 'aws:CurrentTime',
238
+ category: 'request',
239
+ type: 'Date',
240
+ description: ''
241
+ },
242
+ {
243
+ key: 'aws:EpochTime',
244
+ category: 'request',
245
+ type: 'Date', //Can Also be Numeric...
246
+ description: ''
247
+ },
248
+ {
249
+ key: 'aws:referer',
250
+ category: 'request',
251
+ type: 'String',
252
+ description: ''
253
+ },
254
+ {
255
+ key: 'aws:RequestedRegion',
256
+ category: 'request',
257
+ type: 'String',
258
+ description: ''
259
+ },
260
+ {
261
+ key: 'aws:RequestTag/tag-key',
262
+ category: 'request',
263
+ type: 'String',
264
+ description: ''
265
+ },
266
+ {
267
+ key: 'aws:TagKeys',
268
+ category: 'request',
269
+ type: 'ArrayOfString',
270
+ description: ''
271
+ },
272
+ {
273
+ key: 'aws:SecureTransport',
274
+ category: 'request',
275
+ type: 'Bool',
276
+ description: ''
277
+ },
278
+ {
279
+ key: 'aws:SourceArn',
280
+ category: 'request',
281
+ type: 'ARN',
282
+ description: ''
283
+ },
284
+ {
285
+ key: 'aws:SourceAccount',
286
+ category: 'request',
287
+ type: 'String',
288
+ description: ''
289
+ },
290
+ {
291
+ key: 'aws:SourceOwner',
292
+ category: 'request',
293
+ type: 'String',
294
+ description: ''
295
+ },
296
+ {
297
+ key: 'aws:SourceOrgPaths',
298
+ category: 'request',
299
+ type: 'ArrayOfString',
300
+ description: ''
301
+ },
302
+ {
303
+ key: 'aws:SourceOrgID',
304
+ category: 'request',
305
+ type: 'String',
306
+ description: ''
307
+ },
308
+ {
309
+ key: 'aws:UserAgent',
310
+ category: 'request',
311
+ type: 'String',
312
+ description: ''
313
+ }
314
+ ];
315
+ export const globalConditionKeysByName = globalConditionKeys.reduce((acc, key) => {
316
+ acc[key.key.toLowerCase()] = key;
317
+ return acc;
318
+ }, {});
319
+ export const globalVariableConditionKeysByPrefix = globalConditionKeys.reduce((acc, key) => {
320
+ if (key.key.includes('/')) {
321
+ acc[key.key.split('/')[0].toLowerCase()] = key;
322
+ }
323
+ return acc;
324
+ }, {});
325
+ //# sourceMappingURL=globalConditionKeys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globalConditionKeys.js","sourceRoot":"","sources":["../../src/globalConditionKeys.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,mBAAmB,GAAyB;IACvD;QACE,GAAG,EAAE,kBAAkB;QACvB,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,EAAE;KAChB;IACD;QACE,GAAG,EAAE,sBAAsB;QAC3B,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,EAAE;KAChB;IACD;QACE,GAAG,EAAE,uBAAuB;QAC5B,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,EAAE;KAChB;IACD;QACE,GAAG,EAAE,oBAAoB;QACzB,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,EAAE;KAChB;IACD;QACE,GAAG,EAAE,0BAA0B;QAC/B,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,EAAE;KAChB;IACD;QACE,GAAG,EAAE,2BAA2B;QAChC,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,EAAE;KAChB;IACD;QACE,GAAG,EAAE,0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eAAe;QACpB,QAAQ,EAAE,SAAS;QACnB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,EAAE;KAChB;CACF,CAAA;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG,mBAAmB,CAAC,MAAM,CACjE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACX,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,GAAG,GAAG,CAAA;IAChC,OAAO,GAAG,CAAA;AACZ,CAAC,EACD,EAAwC,CACzC,CAAA;AAED,MAAM,CAAC,MAAM,mCAAmC,GAAG,mBAAmB,CAAC,MAAM,CAC3E,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACX,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1B,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,GAAG,GAAG,CAAA;IAChD,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC,EACD,EAAwC,CACzC,CAAA"}
@@ -1,5 +1,6 @@
1
1
  export * from './actions.js';
2
2
  export * from './conditionKeys.js';
3
+ export { findConditionKey } from './findConditionKey.js';
3
4
  export * from './resourceTypes.js';
4
5
  export * from './services.js';
5
6
  export * from './version.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA"}
package/dist/esm/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './actions.js';
2
2
  export * from './conditionKeys.js';
3
+ export { findConditionKey } from './findConditionKey.js';
3
4
  export * from './resourceTypes.js';
4
5
  export * from './services.js';
5
6
  export * from './version.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud-copilot/iam-data",
3
- "version": "0.9.202508241",
3
+ "version": "0.11.202508241",
4
4
  "description": "AWS IAM Data",
5
5
  "repository": "github:cloud-copilot/iam-data",
6
6
  "updatedAt": "2025-08-24T23:10:39.906Z",