Skip to content

Commit 1282be9

Browse files
authored
Fix permission set schema validation bugs (#70)
* Fix permission set schema validation bugs * Version upgrades * Update env.yaml version no
1 parent 6dce2af commit 1282be9

File tree

11 files changed

+3609
-3380
lines changed

11 files changed

+3609
-3380
lines changed

config/env.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
App: "aws-sso-extensions-for-enterprise"
33
Environment: "env"
4-
Version: "3.1.3"
4+
Version: "3.1.4"
55

66
PipelineSettings:
77
BootstrapQualifier: "<your-bootstrap-qualifier>" # For example: 'ssoutility'

lib/lambda-functions/application-handlers/src/permissionSetTopicProcessor.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ export const handler = async (event: SNSEvent) => {
129129
let currentSessionDuration = "";
130130
let sortedManagedPoliciesArnList: Array<string> = [];
131131
let currentRelayState = "";
132+
let currentPermissionSetDescription = permissionSetName;
132133

133134
logger({
134135
handler: "permissionSetTopicProcessor",
@@ -154,7 +155,9 @@ export const handler = async (event: SNSEvent) => {
154155
new CreatePermissionSetCommand({
155156
InstanceArn: instanceArn,
156157
Name: permissionSetName,
157-
Description: permissionSetName,
158+
Description: currentItem.description
159+
? currentItem.description
160+
: permissionSetName,
158161
RelayState: currentItem.relayState + "",
159162
SessionDuration: serializeDurationToISOFormat({
160163
minutes: parseInt(currentItem.sessionDurationInMinutes + ""),
@@ -327,6 +330,12 @@ export const handler = async (event: SNSEvent) => {
327330
sortedManagedPoliciesArnList =
328331
currentItem.sortedManagedPoliciesArnList;
329332
}
333+
if (
334+
currentItem.description &&
335+
currentItem.description.length !== 0
336+
) {
337+
currentPermissionSetDescription = currentItem.description;
338+
}
330339
permissionSetArn = fetchArn.Item.permissionSetArn;
331340

332341
let k: keyof typeof diffCalculated;
@@ -506,10 +515,14 @@ export const handler = async (event: SNSEvent) => {
506515
case "sessionDurationInMinutes-add":
507516
case "sessionDurationInMinutes-remove":
508517
case "sessionDurationInMinutes-update":
518+
case "description-add":
519+
case "description-remove":
520+
case "description-update":
509521
case "relayState-add":
510522
case "relayState-remove":
511523
case "relayState-update": {
512524
updatePermissionSetAttributes = true;
525+
reProvision = true;
513526
logger({
514527
handler: "permissionSetTopicProcessor",
515528
logMode: "info",
@@ -603,6 +616,7 @@ export const handler = async (event: SNSEvent) => {
603616
new UpdatePermissionSetCommand({
604617
PermissionSetArn: permissionSetArn,
605618
InstanceArn: instanceArn,
619+
Description: currentPermissionSetDescription,
606620
SessionDuration: serializeDurationToISOFormat({
607621
minutes: parseInt(currentSessionDuration),
608622
}),

lib/lambda-functions/helpers/src/interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface Tag {
1212
}
1313
export interface CreateUpdatePermissionSetDataProps {
1414
readonly permissionSetName: string;
15+
readonly description?: string;
1516
readonly sessionDurationInMinutes: string;
1617
readonly relayState: string;
1718
readonly tags: Array<Tag>;

lib/lambda-functions/package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@
77
},
88
"keywords": [],
99
"dependencies": {
10-
"@aws-sdk/client-dynamodb": "3.52.0",
11-
"@aws-sdk/client-identitystore": "3.52.0",
12-
"@aws-sdk/client-s3": "3.52.0",
13-
"@aws-sdk/client-sfn": "3.52.0",
14-
"@aws-sdk/client-sns": "3.52.0",
15-
"@aws-sdk/client-sqs": "3.52.0",
16-
"@aws-sdk/client-ssm": "3.52.0",
17-
"@aws-sdk/client-sso-admin": "3.52.0",
18-
"@aws-sdk/credential-providers": "3.52.0",
19-
"@aws-sdk/lib-dynamodb": "3.52.0",
20-
"@aws-sdk/util-dynamodb": "3.52.0",
21-
"@aws-sdk/util-waiter": "3.52.0",
22-
"ajv": "8.10.0",
23-
"json-diff": "0.7.1",
24-
"uuid": "8.3.2"
10+
"@aws-sdk/client-dynamodb": "^3.92.0",
11+
"@aws-sdk/client-identitystore": "^3.92.0",
12+
"@aws-sdk/client-s3": "^3.92.0",
13+
"@aws-sdk/client-sfn": "^3.92.0",
14+
"@aws-sdk/client-sns": "^3.92.0",
15+
"@aws-sdk/client-sqs": "^3.92.0",
16+
"@aws-sdk/client-ssm": "^3.92.0",
17+
"@aws-sdk/client-sso-admin": "^3.92.0",
18+
"@aws-sdk/credential-providers": "^3.92.0",
19+
"@aws-sdk/lib-dynamodb": "^3.92.0",
20+
"@aws-sdk/util-dynamodb": "^3.92.0",
21+
"@aws-sdk/util-waiter": "^3.78.0",
22+
"ajv": "^8.11.0",
23+
"json-diff": "^0.7.4",
24+
"uuid": "^8.3.2"
2525
},
2626
"devDependencies": {
27-
"@types/json-diff": "0.7.0",
28-
"@types/uuid": "8.3.4"
27+
"@types/json-diff": "^0.7.0",
28+
"@types/uuid": "^8.3.4"
2929
}
3030
}

0 commit comments

Comments
 (0)