Skip to content

Commit 629ed6e

Browse files
author
awstools
committed
feat(client-verifiedpermissions): Adds policy effect and actions fields to Policy API's.
1 parent 1223f47 commit 629ed6e

File tree

7 files changed

+225
-34
lines changed

7 files changed

+225
-34
lines changed

clients/client-verifiedpermissions/src/commands/CreatePolicyCommand.ts

+7
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,15 @@ export interface CreatePolicyCommandOutput extends CreatePolicyOutput, __Metadat
104104
* // entityType: "STRING_VALUE", // required
105105
* // entityId: "STRING_VALUE", // required
106106
* // },
107+
* // actions: [ // ActionIdentifierList
108+
* // { // ActionIdentifier
109+
* // actionType: "STRING_VALUE", // required
110+
* // actionId: "STRING_VALUE", // required
111+
* // },
112+
* // ],
107113
* // createdDate: new Date("TIMESTAMP"), // required
108114
* // lastUpdatedDate: new Date("TIMESTAMP"), // required
115+
* // effect: "Permit" || "Forbid",
109116
* // };
110117
*
111118
* ```

clients/client-verifiedpermissions/src/commands/GetPolicyCommand.ts

+7
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ export interface GetPolicyCommandOutput extends GetPolicyOutput, __MetadataBeare
5656
* // entityType: "STRING_VALUE", // required
5757
* // entityId: "STRING_VALUE", // required
5858
* // },
59+
* // actions: [ // ActionIdentifierList
60+
* // { // ActionIdentifier
61+
* // actionType: "STRING_VALUE", // required
62+
* // actionId: "STRING_VALUE", // required
63+
* // },
64+
* // ],
5965
* // definition: { // PolicyDefinitionDetail Union: only one key present
6066
* // static: { // StaticPolicyDefinitionDetail
6167
* // description: "STRING_VALUE",
@@ -75,6 +81,7 @@ export interface GetPolicyCommandOutput extends GetPolicyOutput, __MetadataBeare
7581
* // },
7682
* // createdDate: new Date("TIMESTAMP"), // required
7783
* // lastUpdatedDate: new Date("TIMESTAMP"), // required
84+
* // effect: "Permit" || "Forbid",
7885
* // };
7986
*
8087
* ```

clients/client-verifiedpermissions/src/commands/ListPoliciesCommand.ts

+7
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ export interface ListPoliciesCommandOutput extends ListPoliciesOutput, __Metadat
8383
* // entityType: "STRING_VALUE", // required
8484
* // entityId: "STRING_VALUE", // required
8585
* // },
86+
* // actions: [ // ActionIdentifierList
87+
* // { // ActionIdentifier
88+
* // actionType: "STRING_VALUE", // required
89+
* // actionId: "STRING_VALUE", // required
90+
* // },
91+
* // ],
8692
* // definition: { // PolicyDefinitionItem Union: only one key present
8793
* // static: { // StaticPolicyDefinitionItem
8894
* // description: "STRING_VALUE",
@@ -101,6 +107,7 @@ export interface ListPoliciesCommandOutput extends ListPoliciesOutput, __Metadat
101107
* // },
102108
* // createdDate: new Date("TIMESTAMP"), // required
103109
* // lastUpdatedDate: new Date("TIMESTAMP"), // required
110+
* // effect: "Permit" || "Forbid",
104111
* // },
105112
* // ],
106113
* // };

clients/client-verifiedpermissions/src/commands/UpdatePolicyCommand.ts

+7
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,15 @@ export interface UpdatePolicyCommandOutput extends UpdatePolicyOutput, __Metadat
117117
* // entityType: "STRING_VALUE", // required
118118
* // entityId: "STRING_VALUE", // required
119119
* // },
120+
* // actions: [ // ActionIdentifierList
121+
* // { // ActionIdentifier
122+
* // actionType: "STRING_VALUE", // required
123+
* // actionId: "STRING_VALUE", // required
124+
* // },
125+
* // ],
120126
* // createdDate: new Date("TIMESTAMP"), // required
121127
* // lastUpdatedDate: new Date("TIMESTAMP"), // required
128+
* // effect: "Permit" || "Forbid",
122129
* // };
123130
*
124131
* ```

clients/client-verifiedpermissions/src/models/models_0.ts

+100-20
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,8 @@ export class ValidationException extends __BaseException {
358358
}
359359

360360
/**
361-
* <p>A list of user groups and entities from an Amazon Cognito user pool identity
362-
* source.</p>
361+
* <p>The type of entity that a policy store maps to groups from an Amazon Cognito user
362+
* pool identity source.</p>
363363
* <p>This data type is part of a <a href="https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CognitoUserPoolConfiguration.html">CognitoUserPoolConfiguration</a> structure and is a request parameter in <a href="https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreateIdentitySource.html">CreateIdentitySource</a>.</p>
364364
* @public
365365
*/
@@ -373,8 +373,8 @@ export interface CognitoGroupConfiguration {
373373
}
374374

375375
/**
376-
* <p>A list of user groups and entities from an Amazon Cognito user pool identity
377-
* source.</p>
376+
* <p>The type of entity that a policy store maps to groups from an Amazon Cognito user
377+
* pool identity source.</p>
378378
* <p>This data type is part of an <a href="https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CognitoUserPoolConfigurationItem.html">CognitoUserPoolConfigurationDetail</a> structure and is a response parameter to
379379
* <a href="https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_GetIdentitySource.html">GetIdentitySource</a>.</p>
380380
* @public
@@ -389,8 +389,8 @@ export interface CognitoGroupConfigurationDetail {
389389
}
390390

391391
/**
392-
* <p>A list of user groups and entities from an Amazon Cognito user pool identity
393-
* source.</p>
392+
* <p>The type of entity that a policy store maps to groups from an Amazon Cognito user
393+
* pool identity source.</p>
394394
* <p>This data type is part of an <a href="https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CognitoUserPoolConfigurationDetail.html">CognitoUserPoolConfigurationItem</a> structure and is a response parameter to
395395
* <a href="http://forums.aws.amazon.com/verifiedpermissions/latest/apireference/API_ListIdentitySources.html">ListIdentitySources</a>.</p>
396396
* @public
@@ -410,7 +410,7 @@ export interface CognitoGroupConfigurationItem {
410410
* <p>This data type is used as a field that is part of an <a href="https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_Configuration.html">Configuration</a> structure that is
411411
* used as a parameter to <a href="https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreateIdentitySource.html">CreateIdentitySource</a>.</p>
412412
* <p>Example:<code>"CognitoUserPoolConfiguration":\{"UserPoolArn":"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5","ClientIds":
413-
* ["a1b2c3d4e5f6g7h8i9j0kalbmc"]\}</code>
413+
* ["a1b2c3d4e5f6g7h8i9j0kalbmc"],"groupConfiguration": \{"groupEntityType": "MyCorp::Group"\}\}</code>
414414
* </p>
415415
* @public
416416
*/
@@ -435,8 +435,8 @@ export interface CognitoUserPoolConfiguration {
435435
clientIds?: string[];
436436

437437
/**
438-
* <p>The configuration of the user groups from an Amazon Cognito user pool identity
439-
* source.</p>
438+
* <p>The type of entity that a policy store maps to groups from an Amazon Cognito user
439+
* pool identity source.</p>
440440
* @public
441441
*/
442442
groupConfiguration?: CognitoGroupConfiguration;
@@ -448,7 +448,7 @@ export interface CognitoUserPoolConfiguration {
448448
* <p>This data type is used as a field that is part of an <a href="https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ConfigurationDetail.html">ConfigurationDetail</a> structure that is
449449
* part of the response to <a href="https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_GetIdentitySource.html">GetIdentitySource</a>.</p>
450450
* <p>Example:<code>"CognitoUserPoolConfiguration":\{"UserPoolArn":"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5","ClientIds":
451-
* ["a1b2c3d4e5f6g7h8i9j0kalbmc"]\}</code>
451+
* ["a1b2c3d4e5f6g7h8i9j0kalbmc"],"groupConfiguration": \{"groupEntityType": "MyCorp::Group"\}\}</code>
452452
* </p>
453453
* @public
454454
*/
@@ -483,8 +483,8 @@ export interface CognitoUserPoolConfigurationDetail {
483483
issuer: string | undefined;
484484

485485
/**
486-
* <p>The configuration of the user groups from an Amazon Cognito user pool identity
487-
* source.</p>
486+
* <p>The type of entity that a policy store maps to groups from an Amazon Cognito user
487+
* pool identity source.</p>
488488
* @public
489489
*/
490490
groupConfiguration?: CognitoGroupConfigurationDetail;
@@ -496,7 +496,7 @@ export interface CognitoUserPoolConfigurationDetail {
496496
* <p>This data type is used as a field that is part of the <a href="https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ConfigurationItem.html">ConfigurationItem</a> structure that is
497497
* part of the response to <a href="https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ListIdentitySources.html">ListIdentitySources</a>.</p>
498498
* <p>Example:<code>"CognitoUserPoolConfiguration":\{"UserPoolArn":"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5","ClientIds":
499-
* ["a1b2c3d4e5f6g7h8i9j0kalbmc"]\}</code>
499+
* ["a1b2c3d4e5f6g7h8i9j0kalbmc"],"groupConfiguration": \{"groupEntityType": "MyCorp::Group"\}\}</code>
500500
* </p>
501501
* @public
502502
*/
@@ -531,8 +531,8 @@ export interface CognitoUserPoolConfigurationItem {
531531
issuer: string | undefined;
532532

533533
/**
534-
* <p>The configuration of the user groups from an Amazon Cognito user pool identity
535-
* source.</p>
534+
* <p>The type of entity that a policy store maps to groups from an Amazon Cognito user
535+
* pool identity source.</p>
536536
* @public
537537
*/
538538
groupConfiguration?: CognitoGroupConfigurationItem;
@@ -543,7 +543,7 @@ export interface CognitoUserPoolConfigurationItem {
543543
* <note>
544544
* <p>At this time, the only valid member of this structure is a Amazon Cognito user pool
545545
* configuration.</p>
546-
* <p>You must specify a <code>userPoolArn</code>, and optionally, a
546+
* <p>Specifies a <code>userPoolArn</code>, a <code>groupConfiguration</code>, and a
547547
* <code>ClientId</code>.</p>
548548
* </note>
549549
* <p>This data type is used as a request parameter for the <a href="https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreateIdentitySource.html">CreateIdentitySource</a>
@@ -607,7 +607,8 @@ export type ConfigurationDetail =
607607
export namespace ConfigurationDetail {
608608
/**
609609
* <p>Contains configuration details of a Amazon Cognito user pool that Verified Permissions can use as a source of
610-
* authenticated identities as entities. It specifies the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of a Amazon Cognito user pool
610+
* authenticated identities as entities. It specifies the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of a Amazon Cognito user pool,
611+
* the policy store entity that you want to assign to user groups,
611612
* and one or more application client IDs.</p>
612613
* <p>Example:
613614
* <code>"configuration":\{"cognitoUserPoolConfiguration":\{"userPoolArn":"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5","clientIds":
@@ -654,7 +655,8 @@ export type ConfigurationItem = ConfigurationItem.CognitoUserPoolConfigurationMe
654655
export namespace ConfigurationItem {
655656
/**
656657
* <p>Contains configuration details of a Amazon Cognito user pool that Verified Permissions can use as a source of
657-
* authenticated identities as entities. It specifies the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of a Amazon Cognito user pool
658+
* authenticated identities as entities. It specifies the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of a Amazon Cognito user pool,
659+
* the policy store entity that you want to assign to user groups,
658660
* and one or more application client IDs.</p>
659661
* <p>Example:
660662
* <code>"configuration":\{"cognitoUserPoolConfiguration":\{"userPoolArn":"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5","clientIds":
@@ -1013,6 +1015,20 @@ export interface CreatePolicyInput {
10131015
definition: PolicyDefinition | undefined;
10141016
}
10151017

1018+
/**
1019+
* @public
1020+
* @enum
1021+
*/
1022+
export const PolicyEffect = {
1023+
FORBID: "Forbid",
1024+
PERMIT: "Permit",
1025+
} as const;
1026+
1027+
/**
1028+
* @public
1029+
*/
1030+
export type PolicyEffect = (typeof PolicyEffect)[keyof typeof PolicyEffect];
1031+
10161032
/**
10171033
* @public
10181034
* @enum
@@ -1063,6 +1079,14 @@ export interface CreatePolicyOutput {
10631079
*/
10641080
resource?: EntityIdentifier;
10651081

1082+
/**
1083+
* <p>The action that a policy permits or forbids. For example,
1084+
* <code>\{"actions": [\{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"\}, \{"entityID": "SharePhoto",
1085+
* "entityType": "PhotoFlash::Action"\}]\}</code>.</p>
1086+
* @public
1087+
*/
1088+
actions?: ActionIdentifier[];
1089+
10661090
/**
10671091
* <p>The date and time the policy was originally created.</p>
10681092
* @public
@@ -1074,6 +1098,13 @@ export interface CreatePolicyOutput {
10741098
* @public
10751099
*/
10761100
lastUpdatedDate: Date | undefined;
1101+
1102+
/**
1103+
* <p>The effect of the decision that a policy returns to an authorization
1104+
* request. For example, <code>"effect": "Permit"</code>.</p>
1105+
* @public
1106+
*/
1107+
effect?: PolicyEffect;
10771108
}
10781109

10791110
/**
@@ -1704,6 +1735,14 @@ export interface GetPolicyOutput {
17041735
*/
17051736
resource?: EntityIdentifier;
17061737

1738+
/**
1739+
* <p>The action that a policy permits or forbids. For example,
1740+
* <code>\{"actions": [\{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"\}, \{"entityID": "SharePhoto",
1741+
* "entityType": "PhotoFlash::Action"\}]\}</code>.</p>
1742+
* @public
1743+
*/
1744+
actions?: ActionIdentifier[];
1745+
17071746
/**
17081747
* <p>The definition of the requested policy.</p>
17091748
* @public
@@ -1721,6 +1760,13 @@ export interface GetPolicyOutput {
17211760
* @public
17221761
*/
17231762
lastUpdatedDate: Date | undefined;
1763+
1764+
/**
1765+
* <p>The effect of the decision that a policy returns to an authorization
1766+
* request. For example, <code>"effect": "Permit"</code>.</p>
1767+
* @public
1768+
*/
1769+
effect?: PolicyEffect;
17241770
}
17251771

17261772
/**
@@ -1927,7 +1973,7 @@ export interface ListIdentitySourcesInput {
19271973
* <code>NextToken</code> after every operation to ensure that you receive all of the
19281974
* results.</p>
19291975
* <p>If you do not specify this parameter, the operation defaults to 10 identity sources per response.
1930-
* You can specify a maximum of 200 identity sources per response.</p>
1976+
* You can specify a maximum of 50 identity sources per response.</p>
19311977
* @public
19321978
*/
19331979
maxResults?: number;
@@ -2066,7 +2112,7 @@ export interface ListIdentitySourcesOutput {
20662112
}
20672113

20682114
/**
2069-
* <p>A list of user groups and entities from an Amazon Cognito user pool identity
2115+
* <p>The user group entities from an Amazon Cognito user pool identity
20702116
* source.</p>
20712117
* @public
20722118
*/
@@ -2513,6 +2559,14 @@ export interface PolicyItem {
25132559
*/
25142560
resource?: EntityIdentifier;
25152561

2562+
/**
2563+
* <p>The action that a policy permits or forbids. For example,
2564+
* <code>\{"actions": [\{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"\}, \{"entityID": "SharePhoto",
2565+
* "entityType": "PhotoFlash::Action"\}]\}</code>.</p>
2566+
* @public
2567+
*/
2568+
actions?: ActionIdentifier[];
2569+
25162570
/**
25172571
* <p>The policy definition of an item in the list of policies returned.</p>
25182572
* @public
@@ -2530,6 +2584,13 @@ export interface PolicyItem {
25302584
* @public
25312585
*/
25322586
lastUpdatedDate: Date | undefined;
2587+
2588+
/**
2589+
* <p>The effect of the decision that a policy returns to an authorization
2590+
* request. For example, <code>"effect": "Permit"</code>.</p>
2591+
* @public
2592+
*/
2593+
effect?: PolicyEffect;
25332594
}
25342595

25352596
/**
@@ -2911,6 +2972,14 @@ export interface UpdatePolicyOutput {
29112972
*/
29122973
resource?: EntityIdentifier;
29132974

2975+
/**
2976+
* <p>The action that a policy permits or forbids. For example,
2977+
* <code>\{"actions": [\{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"\}, \{"entityID": "SharePhoto",
2978+
* "entityType": "PhotoFlash::Action"\}]\}</code>.</p>
2979+
* @public
2980+
*/
2981+
actions?: ActionIdentifier[];
2982+
29142983
/**
29152984
* <p>The date and time that the policy was originally created.</p>
29162985
* @public
@@ -2922,6 +2991,13 @@ export interface UpdatePolicyOutput {
29222991
* @public
29232992
*/
29242993
lastUpdatedDate: Date | undefined;
2994+
2995+
/**
2996+
* <p>The effect of the decision that a policy returns to an authorization
2997+
* request. For example, <code>"effect": "Permit"</code>.</p>
2998+
* @public
2999+
*/
3000+
effect?: PolicyEffect;
29253001
}
29263002

29273003
/**
@@ -3994,6 +4070,7 @@ export const CreatePolicyOutputFilterSensitiveLog = (obj: CreatePolicyOutput): a
39944070
...obj,
39954071
...(obj.principal && { principal: EntityIdentifierFilterSensitiveLog(obj.principal) }),
39964072
...(obj.resource && { resource: EntityIdentifierFilterSensitiveLog(obj.resource) }),
4073+
...(obj.actions && { actions: obj.actions.map((item) => ActionIdentifierFilterSensitiveLog(item)) }),
39974074
});
39984075

39994076
/**
@@ -4077,6 +4154,7 @@ export const GetPolicyOutputFilterSensitiveLog = (obj: GetPolicyOutput): any =>
40774154
...obj,
40784155
...(obj.principal && { principal: EntityIdentifierFilterSensitiveLog(obj.principal) }),
40794156
...(obj.resource && { resource: EntityIdentifierFilterSensitiveLog(obj.resource) }),
4157+
...(obj.actions && { actions: obj.actions.map((item) => ActionIdentifierFilterSensitiveLog(item)) }),
40804158
...(obj.definition && { definition: PolicyDefinitionDetailFilterSensitiveLog(obj.definition) }),
40814159
});
40824160

@@ -4261,6 +4339,7 @@ export const PolicyItemFilterSensitiveLog = (obj: PolicyItem): any => ({
42614339
...obj,
42624340
...(obj.principal && { principal: EntityIdentifierFilterSensitiveLog(obj.principal) }),
42634341
...(obj.resource && { resource: EntityIdentifierFilterSensitiveLog(obj.resource) }),
4342+
...(obj.actions && { actions: obj.actions.map((item) => ActionIdentifierFilterSensitiveLog(item)) }),
42644343
...(obj.definition && { definition: PolicyDefinitionItemFilterSensitiveLog(obj.definition) }),
42654344
});
42664345

@@ -4338,6 +4417,7 @@ export const UpdatePolicyOutputFilterSensitiveLog = (obj: UpdatePolicyOutput): a
43384417
...obj,
43394418
...(obj.principal && { principal: EntityIdentifierFilterSensitiveLog(obj.principal) }),
43404419
...(obj.resource && { resource: EntityIdentifierFilterSensitiveLog(obj.resource) }),
4420+
...(obj.actions && { actions: obj.actions.map((item) => ActionIdentifierFilterSensitiveLog(item)) }),
43414421
});
43424422

43434423
/**

0 commit comments

Comments
 (0)