Skip to content

Commit 81ff312

Browse files
author
AWS
committed
Amazon Verified Permissions Update: Adding BatchGetPolicy API which supports the retrieval of multiple policies across multiple policy stores within a single request.
1 parent b72a278 commit 81ff312

File tree

2 files changed

+180
-5
lines changed

2 files changed

+180
-5
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "feature",
3+
"category": "Amazon Verified Permissions",
4+
"contributor": "",
5+
"description": "Adding BatchGetPolicy API which supports the retrieval of multiple policies across multiple policy stores within a single request."
6+
}

services/verifiedpermissions/src/main/resources/codegen-resources/service-2.json

Lines changed: 174 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,22 @@
1515
"uid":"verifiedpermissions-2021-12-01"
1616
},
1717
"operations":{
18+
"BatchGetPolicy":{
19+
"name":"BatchGetPolicy",
20+
"http":{
21+
"method":"POST",
22+
"requestUri":"/"
23+
},
24+
"input":{"shape":"BatchGetPolicyInput"},
25+
"output":{"shape":"BatchGetPolicyOutput"},
26+
"errors":[
27+
{"shape":"ValidationException"},
28+
{"shape":"AccessDeniedException"},
29+
{"shape":"ThrottlingException"},
30+
{"shape":"InternalServerException"}
31+
],
32+
"documentation":"<p>Retrieves information about a group (batch) of policies.</p> <note> <p>The <code>BatchGetPolicy</code> operation doesn't have its own IAM permission. To authorize this operation for Amazon Web Services principals, include the permission <code>verifiedpermissions:GetPolicy</code> in their IAM policies.</p> </note>"
33+
},
1834
"BatchIsAuthorized":{
1935
"name":"BatchIsAuthorized",
2036
"http":{
@@ -558,6 +574,14 @@
558574
"record":{
559575
"shape":"RecordAttribute",
560576
"documentation":"<p>An attribute value of <a href=\"https://docs.cedarpolicy.com/policies/syntax-datatypes.html#record\">Record</a> type.</p> <p>Example: <code>{\"record\": { \"keyName\": {} } }</code> </p>"
577+
},
578+
"ipaddr":{
579+
"shape":"IpAddr",
580+
"documentation":"<p>An attribute value of <a href=\"https://docs.cedarpolicy.com/policies/syntax-datatypes.html#datatype-ipaddr\">ipaddr</a> type.</p> <p>Example: <code>{\"ip\": \"192.168.1.100\"}</code> </p>"
581+
},
582+
"decimal":{
583+
"shape":"Decimal",
584+
"documentation":"<p>An attribute value of <a href=\"https://docs.cedarpolicy.com/policies/syntax-datatypes.html#datatype-decimal\">decimal</a> type.</p> <p>Example: <code>{\"decimal\": \"1.1\"}</code> </p>"
561585
}
562586
},
563587
"documentation":"<p>The value of an attribute.</p> <p>Contains information about the runtime context for a request for which an authorization decision is made. </p> <p>This data type is used as a member of the <a href=\"https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ContextDefinition.html\">ContextDefinition</a> structure which is uses as a request parameter for the <a href=\"https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorized.html\">IsAuthorized</a>, <a href=\"https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_BatchIsAuthorized.html\">BatchIsAuthorized</a>, and <a href=\"https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html\">IsAuthorizedWithToken</a> operations.</p>",
@@ -574,6 +598,138 @@
574598
"max":255,
575599
"min":1
576600
},
601+
"BatchGetPolicyErrorCode":{
602+
"type":"string",
603+
"enum":[
604+
"POLICY_STORE_NOT_FOUND",
605+
"POLICY_NOT_FOUND"
606+
]
607+
},
608+
"BatchGetPolicyErrorItem":{
609+
"type":"structure",
610+
"required":[
611+
"code",
612+
"policyStoreId",
613+
"policyId",
614+
"message"
615+
],
616+
"members":{
617+
"code":{
618+
"shape":"BatchGetPolicyErrorCode",
619+
"documentation":"<p>The error code that was returned.</p>"
620+
},
621+
"policyStoreId":{
622+
"shape":"String",
623+
"documentation":"<p>The identifier of the policy store associated with the failed request.</p>"
624+
},
625+
"policyId":{
626+
"shape":"String",
627+
"documentation":"<p>The identifier of the policy associated with the failed request.</p>"
628+
},
629+
"message":{
630+
"shape":"String",
631+
"documentation":"<p>A detailed error message.</p>"
632+
}
633+
},
634+
"documentation":"<p>Contains the information about an error resulting from a <code>BatchGetPolicy</code> API call.</p>"
635+
},
636+
"BatchGetPolicyErrorList":{
637+
"type":"list",
638+
"member":{"shape":"BatchGetPolicyErrorItem"}
639+
},
640+
"BatchGetPolicyInput":{
641+
"type":"structure",
642+
"required":["requests"],
643+
"members":{
644+
"requests":{
645+
"shape":"BatchGetPolicyInputList",
646+
"documentation":"<p>An array of up to 100 policies you want information about.</p>"
647+
}
648+
}
649+
},
650+
"BatchGetPolicyInputItem":{
651+
"type":"structure",
652+
"required":[
653+
"policyStoreId",
654+
"policyId"
655+
],
656+
"members":{
657+
"policyStoreId":{
658+
"shape":"PolicyStoreId",
659+
"documentation":"<p>The identifier of the policy store where the policy you want information about is stored.</p>"
660+
},
661+
"policyId":{
662+
"shape":"PolicyId",
663+
"documentation":"<p>The identifier of the policy you want information about.</p>"
664+
}
665+
},
666+
"documentation":"<p>Information about a policy that you include in a <code>BatchGetPolicy</code> API request.</p>"
667+
},
668+
"BatchGetPolicyInputList":{
669+
"type":"list",
670+
"member":{"shape":"BatchGetPolicyInputItem"},
671+
"max":100,
672+
"min":1
673+
},
674+
"BatchGetPolicyOutput":{
675+
"type":"structure",
676+
"required":[
677+
"results",
678+
"errors"
679+
],
680+
"members":{
681+
"results":{
682+
"shape":"BatchGetPolicyOutputList",
683+
"documentation":"<p>Information about the policies listed in the request that were successfully returned. These results are returned in the order they were requested.</p>"
684+
},
685+
"errors":{
686+
"shape":"BatchGetPolicyErrorList",
687+
"documentation":"<p>Information about the policies from the request that resulted in an error. These results are returned in the order they were requested.</p>"
688+
}
689+
}
690+
},
691+
"BatchGetPolicyOutputItem":{
692+
"type":"structure",
693+
"required":[
694+
"policyStoreId",
695+
"policyId",
696+
"policyType",
697+
"definition",
698+
"createdDate",
699+
"lastUpdatedDate"
700+
],
701+
"members":{
702+
"policyStoreId":{
703+
"shape":"PolicyStoreId",
704+
"documentation":"<p>The identifier of the policy store where the policy you want information about is stored.</p>"
705+
},
706+
"policyId":{
707+
"shape":"PolicyId",
708+
"documentation":"<p>The identifier of the policy you want information about.</p>"
709+
},
710+
"policyType":{
711+
"shape":"PolicyType",
712+
"documentation":"<p>The type of the policy. This is one of the following values:</p> <ul> <li> <p> <code>STATIC</code> </p> </li> <li> <p> <code>TEMPLATE_LINKED</code> </p> </li> </ul>"
713+
},
714+
"definition":{
715+
"shape":"PolicyDefinitionDetail",
716+
"documentation":"<p>The policy definition of an item in the list of policies returned.</p>"
717+
},
718+
"createdDate":{
719+
"shape":"TimestampFormat",
720+
"documentation":"<p>The date and time the policy was created.</p>"
721+
},
722+
"lastUpdatedDate":{
723+
"shape":"TimestampFormat",
724+
"documentation":"<p>The date and time the policy was most recently updated.</p>"
725+
}
726+
},
727+
"documentation":"<p>Contains information about a policy returned from a <code>BatchGetPolicy</code> API request.</p>"
728+
},
729+
"BatchGetPolicyOutputList":{
730+
"type":"list",
731+
"member":{"shape":"BatchGetPolicyOutputItem"}
732+
},
577733
"BatchIsAuthorizedInput":{
578734
"type":"structure",
579735
"required":[
@@ -628,7 +784,7 @@
628784
"members":{
629785
"results":{
630786
"shape":"BatchIsAuthorizedOutputList",
631-
"documentation":"<p>A series of <code>Allow</code> or <code>Deny</code> decisions for each request, and the policies that produced them.</p>"
787+
"documentation":"<p>A series of <code>Allow</code> or <code>Deny</code> decisions for each request, and the policies that produced them. These results are returned in the order they were requested.</p>"
632788
}
633789
}
634790
},
@@ -726,7 +882,7 @@
726882
},
727883
"results":{
728884
"shape":"BatchIsAuthorizedWithTokenOutputList",
729-
"documentation":"<p>A series of <code>Allow</code> or <code>Deny</code> decisions for each request, and the policies that produced them.</p>"
885+
"documentation":"<p>A series of <code>Allow</code> or <code>Deny</code> decisions for each request, and the policies that produced them. These results are returned in the order they were requested.</p>"
730886
}
731887
}
732888
},
@@ -1193,6 +1349,13 @@
11931349
}
11941350
}
11951351
},
1352+
"Decimal":{
1353+
"type":"string",
1354+
"max":23,
1355+
"min":3,
1356+
"pattern":"-?\\d{1,15}\\.\\d{1,4}",
1357+
"sensitive":true
1358+
},
11961359
"Decision":{
11971360
"type":"string",
11981361
"enum":[
@@ -1836,6 +1999,13 @@
18361999
"fault":true,
18372000
"retryable":{"throttling":false}
18382001
},
2002+
"IpAddr":{
2003+
"type":"string",
2004+
"max":44,
2005+
"min":1,
2006+
"pattern":"[0-9a-fA-F\\.:\\/]*",
2007+
"sensitive":true
2008+
},
18392009
"IsAuthorizedInput":{
18402010
"type":"structure",
18412011
"required":["policyStoreId"],
@@ -2103,7 +2273,7 @@
21032273
"Namespace":{
21042274
"type":"string",
21052275
"max":100,
2106-
"min":1,
2276+
"min":0,
21072277
"pattern":".*",
21082278
"sensitive":true
21092279
},
@@ -2479,7 +2649,7 @@
24792649
"members":{
24802650
"policyStoreId":{
24812651
"shape":"PolicyStoreId",
2482-
"documentation":"<p>The identifier of the PolicyStore where the policy you want information about is stored.</p>"
2652+
"documentation":"<p>The identifier of the policy store where the policy you want information about is stored.</p>"
24832653
},
24842654
"policyId":{
24852655
"shape":"PolicyId",
@@ -2760,7 +2930,6 @@
27602930
},
27612931
"SchemaJson":{
27622932
"type":"string",
2763-
"max":100000,
27642933
"min":1,
27652934
"sensitive":true
27662935
},

0 commit comments

Comments
 (0)