Skip to content

Commit 46d4d66

Browse files
author
awstools
committed
feat(client-verifiedpermissions): Adds Cedar JSON format support for entities and context data in authorization requests
1 parent 0f29c7b commit 46d4d66

File tree

7 files changed

+207
-110
lines changed

7 files changed

+207
-110
lines changed

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

+3
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export interface BatchIsAuthorizedCommandOutput extends BatchIsAuthorizedOutput,
110110
* ],
111111
* },
112112
* ],
113+
* cedarJson: "STRING_VALUE",
113114
* },
114115
* requests: [ // BatchIsAuthorizedInputList // required
115116
* { // BatchIsAuthorizedInputItem
@@ -123,6 +124,7 @@ export interface BatchIsAuthorizedCommandOutput extends BatchIsAuthorizedOutput,
123124
* contextMap: { // ContextMap
124125
* "<keys>": "<AttributeValue>",
125126
* },
127+
* cedarJson: "STRING_VALUE",
126128
* },
127129
* },
128130
* ],
@@ -178,6 +180,7 @@ export interface BatchIsAuthorizedCommandOutput extends BatchIsAuthorizedOutput,
178180
* // decimal: "STRING_VALUE",
179181
* // },
180182
* // },
183+
* // cedarJson: "STRING_VALUE",
181184
* // },
182185
* // },
183186
* // decision: "ALLOW" || "DENY", // required

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

+3
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export interface BatchIsAuthorizedWithTokenCommandOutput extends BatchIsAuthoriz
110110
* ],
111111
* },
112112
* ],
113+
* cedarJson: "STRING_VALUE",
113114
* },
114115
* requests: [ // BatchIsAuthorizedWithTokenInputList // required
115116
* { // BatchIsAuthorizedWithTokenInputItem
@@ -122,6 +123,7 @@ export interface BatchIsAuthorizedWithTokenCommandOutput extends BatchIsAuthoriz
122123
* contextMap: { // ContextMap
123124
* "<keys>": "<AttributeValue>",
124125
* },
126+
* cedarJson: "STRING_VALUE",
125127
* },
126128
* },
127129
* ],
@@ -174,6 +176,7 @@ export interface BatchIsAuthorizedWithTokenCommandOutput extends BatchIsAuthoriz
174176
* // decimal: "STRING_VALUE",
175177
* // },
176178
* // },
179+
* // cedarJson: "STRING_VALUE",
177180
* // },
178181
* // },
179182
* // decision: "ALLOW" || "DENY", // required

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

+2
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export interface IsAuthorizedCommandOutput extends IsAuthorizedOutput, __Metadat
9696
* decimal: "STRING_VALUE",
9797
* },
9898
* },
99+
* cedarJson: "STRING_VALUE",
99100
* },
100101
* entities: { // EntitiesDefinition Union: only one key present
101102
* entityList: [ // EntityList
@@ -109,6 +110,7 @@ export interface IsAuthorizedCommandOutput extends IsAuthorizedOutput, __Metadat
109110
* ],
110111
* },
111112
* ],
113+
* cedarJson: "STRING_VALUE",
112114
* },
113115
* };
114116
* const command = new IsAuthorizedCommand(input);

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

+2
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ export interface IsAuthorizedWithTokenCommandOutput extends IsAuthorizedWithToke
102102
* decimal: "STRING_VALUE",
103103
* },
104104
* },
105+
* cedarJson: "STRING_VALUE",
105106
* },
106107
* entities: { // EntitiesDefinition Union: only one key present
107108
* entityList: [ // EntityList
@@ -115,6 +116,7 @@ export interface IsAuthorizedWithTokenCommandOutput extends IsAuthorizedWithToke
115116
* ],
116117
* },
117118
* ],
119+
* cedarJson: "STRING_VALUE",
118120
* },
119121
* };
120122
* const command = new IsAuthorizedWithTokenCommand(input);

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

+133-69
Large diffs are not rendered by default.

clients/client-verifiedpermissions/src/protocols/Aws_json1_0.ts

+5
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,7 @@ const se_BatchIsAuthorizedWithTokenInputList = (
13341334
*/
13351335
const se_ContextDefinition = (input: ContextDefinition, context: __SerdeContext): any => {
13361336
return ContextDefinition.visit(input, {
1337+
cedarJson: (value) => ({ cedarJson: value }),
13371338
contextMap: (value) => ({ contextMap: se_ContextMap(value, context) }),
13381339
_: (name, value) => ({ name: value } as any),
13391340
});
@@ -1411,6 +1412,7 @@ const se_CreatePolicyTemplateInput = (input: CreatePolicyTemplateInput, context:
14111412
*/
14121413
const se_EntitiesDefinition = (input: EntitiesDefinition, context: __SerdeContext): any => {
14131414
return EntitiesDefinition.visit(input, {
1415+
cedarJson: (value) => ({ cedarJson: value }),
14141416
entityList: (value) => ({ entityList: se_EntityList(value, context) }),
14151417
_: (name, value) => ({ name: value } as any),
14161418
});
@@ -1791,6 +1793,9 @@ const de_BatchIsAuthorizedWithTokenOutputList = (
17911793
* deserializeAws_json1_0ContextDefinition
17921794
*/
17931795
const de_ContextDefinition = (output: any, context: __SerdeContext): ContextDefinition => {
1796+
if (__expectString(output.cedarJson) !== undefined) {
1797+
return { cedarJson: __expectString(output.cedarJson) as any };
1798+
}
17941799
if (output.contextMap != null) {
17951800
return {
17961801
contextMap: de_ContextMap(output.contextMap, context),

0 commit comments

Comments
 (0)