Amazon Verified Permissions

2024/11/06 - Amazon Verified Permissions - 1 new 4 updated api methods

Changes  Adding BatchGetPolicy API which supports the retrieval of multiple policies across multiple policy stores within a single request.

BatchGetPolicy (new) Link ¶

Retrieves information about a group (batch) of policies.

Note

The BatchGetPolicy operation doesn't have its own IAM permission. To authorize this operation for Amazon Web Services principals, include the permission verifiedpermissions:GetPolicy in their IAM policies.

See also: AWS API Documentation

Request Syntax

client.batch_get_policy(
    requests=[
        {
            'policyStoreId': 'string',
            'policyId': 'string'
        },
    ]
)
type requests

list

param requests

[REQUIRED]

An array of up to 100 policies you want information about.

  • (dict) --

    Information about a policy that you include in a BatchGetPolicy API request.

    • policyStoreId (string) -- [REQUIRED]

      The identifier of the policy store where the policy you want information about is stored.

    • policyId (string) -- [REQUIRED]

      The identifier of the policy you want information about.

rtype

dict

returns

Response Syntax

{
    'results': [
        {
            'policyStoreId': 'string',
            'policyId': 'string',
            'policyType': 'STATIC'|'TEMPLATE_LINKED',
            'definition': {
                'static': {
                    'description': 'string',
                    'statement': 'string'
                },
                'templateLinked': {
                    'policyTemplateId': 'string',
                    'principal': {
                        'entityType': 'string',
                        'entityId': 'string'
                    },
                    'resource': {
                        'entityType': 'string',
                        'entityId': 'string'
                    }
                }
            },
            'createdDate': datetime(2015, 1, 1),
            'lastUpdatedDate': datetime(2015, 1, 1)
        },
    ],
    'errors': [
        {
            'code': 'POLICY_STORE_NOT_FOUND'|'POLICY_NOT_FOUND',
            'policyStoreId': 'string',
            'policyId': 'string',
            'message': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • results (list) --

      Information about the policies listed in the request that were successfully returned. These results are returned in the order they were requested.

      • (dict) --

        Contains information about a policy returned from a BatchGetPolicy API request.

        • policyStoreId (string) --

          The identifier of the policy store where the policy you want information about is stored.

        • policyId (string) --

          The identifier of the policy you want information about.

        • policyType (string) --

          The type of the policy. This is one of the following values:

          • STATIC

          • TEMPLATE_LINKED

        • definition (dict) --

          The policy definition of an item in the list of policies returned.

          Note

          This is a Tagged Union structure. Only one of the following top level keys will be set: static, templateLinked. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

          'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
          • static (dict) --

            Information about a static policy that wasn't created with a policy template.

            • description (string) --

              A description of the static policy.

            • statement (string) --

              The content of the static policy written in the Cedar policy language.

          • templateLinked (dict) --

            Information about a template-linked policy that was created by instantiating a policy template.

            • policyTemplateId (string) --

              The unique identifier of the policy template used to create this policy.

            • principal (dict) --

              The principal associated with this template-linked policy. Verified Permissions substitutes this principal for the ?principal placeholder in the policy template when it evaluates an authorization request.

              • entityType (string) --

                The type of an entity.

                Example: "entityType":"typeName"

              • entityId (string) --

                The identifier of an entity.

                "entityId":"identifier"

            • resource (dict) --

              The resource associated with this template-linked policy. Verified Permissions substitutes this resource for the ?resource placeholder in the policy template when it evaluates an authorization request.

              • entityType (string) --

                The type of an entity.

                Example: "entityType":"typeName"

              • entityId (string) --

                The identifier of an entity.

                "entityId":"identifier"

        • createdDate (datetime) --

          The date and time the policy was created.

        • lastUpdatedDate (datetime) --

          The date and time the policy was most recently updated.

    • errors (list) --

      Information about the policies from the request that resulted in an error. These results are returned in the order they were requested.

      • (dict) --

        Contains the information about an error resulting from a BatchGetPolicy API call.

        • code (string) --

          The error code that was returned.

        • policyStoreId (string) --

          The identifier of the policy store associated with the failed request.

        • policyId (string) --

          The identifier of the policy associated with the failed request.

        • message (string) --

          A detailed error message.

BatchIsAuthorized (updated) Link ¶
Changes (request, response)
Request
{'entities': {'entityList': {'attributes': {'decimal': 'string',
                                            'ipaddr': 'string'}}},
 'requests': {'context': {'contextMap': {'decimal': 'string',
                                         'ipaddr': 'string'}}}}
Response
{'results': {'request': {'context': {'contextMap': {'decimal': 'string',
                                                    'ipaddr': 'string'}}}}}

Makes a series of decisions about multiple authorization requests for one principal or resource. Each request contains the equivalent content of an IsAuthorized request: principal, action, resource, and context. Either the principal or the resource parameter must be identical across all requests. For example, Verified Permissions won't evaluate a pair of requests where bob views photo1 and alice views photo2 . Authorization of bob to view photo1 and photo2 , or bob and alice to view photo1 , are valid batches.

The request is evaluated against all policies in the specified policy store that match the entities that you declare. The result of the decisions is a series of Allow or Deny responses, along with the IDs of the policies that produced each decision.

The entities of a BatchIsAuthorized API request can contain up to 100 principals and up to 100 resources. The requests of a BatchIsAuthorized API request can contain up to 30 requests.

Note

The BatchIsAuthorized operation doesn't have its own IAM permission. To authorize this operation for Amazon Web Services principals, include the permission verifiedpermissions:IsAuthorized in their IAM policies.

See also: AWS API Documentation

Request Syntax

client.batch_is_authorized(
    policyStoreId='string',
    entities={
        'entityList': [
            {
                'identifier': {
                    'entityType': 'string',
                    'entityId': 'string'
                },
                'attributes': {
                    'string': {
                        'boolean': True|False,
                        'entityIdentifier': {
                            'entityType': 'string',
                            'entityId': 'string'
                        },
                        'long': 123,
                        'string': 'string',
                        'set': [
                            {'... recursive ...'},
                        ],
                        'record': {
                            'string': {'... recursive ...'}
                        },
                        'ipaddr': 'string',
                        'decimal': 'string'
                    }
                },
                'parents': [
                    {
                        'entityType': 'string',
                        'entityId': 'string'
                    },
                ]
            },
        ]
    },
    requests=[
        {
            'principal': {
                'entityType': 'string',
                'entityId': 'string'
            },
            'action': {
                'actionType': 'string',
                'actionId': 'string'
            },
            'resource': {
                'entityType': 'string',
                'entityId': 'string'
            },
            'context': {
                'contextMap': {
                    'string': {
                        'boolean': True|False,
                        'entityIdentifier': {
                            'entityType': 'string',
                            'entityId': 'string'
                        },
                        'long': 123,
                        'string': 'string',
                        'set': [
                            {'... recursive ...'},
                        ],
                        'record': {
                            'string': {'... recursive ...'}
                        },
                        'ipaddr': 'string',
                        'decimal': 'string'
                    }
                }
            }
        },
    ]
)
type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the ID of the policy store. Policies in this policy store will be used to make the authorization decisions for the input.

type entities

dict

param entities

Specifies the list of resources and principals and their associated attributes that Verified Permissions can examine when evaluating the policies.

Note

You can include only principal and resource entities in this parameter; you can't include actions. You must specify actions in the schema.

Note

This is a Tagged Union structure. Only one of the following top level keys can be set: entityList.

  • entityList (list) --

    An array of entities that are needed to successfully evaluate an authorization request. Each entity in this array must include an identifier for the entity, the attributes of the entity, and a list of any parent entities.

    • (dict) --

      Contains information about an entity that can be referenced in a Cedar policy.

      This data type is used as one of the fields in the EntitiesDefinition structure.

      { "identifier": { "entityType": "Photo", "entityId": "VacationPhoto94.jpg" }, "attributes": {}, "parents": [ { "entityType": "Album", "entityId": "alice_folder" } ] }

      • identifier (dict) -- [REQUIRED]

        The identifier of the entity.

        • entityType (string) -- [REQUIRED]

          The type of an entity.

          Example: "entityType":"typeName"

        • entityId (string) -- [REQUIRED]

          The identifier of an entity.

          "entityId":"identifier"

      • attributes (dict) --

        A list of attributes for the entity.

        • (string) --

          • (dict) --

            The value of an attribute.

            Contains information about the runtime context for a request for which an authorization decision is made.

            This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

            Note

            This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

            • boolean (boolean) --

              An attribute value of Boolean type.

              Example: {"boolean": true}

            • entityIdentifier (dict) --

              An attribute value of type EntityIdentifier.

              Example: "entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}

              • entityType (string) -- [REQUIRED]

                The type of an entity.

                Example: "entityType":"typeName"

              • entityId (string) -- [REQUIRED]

                The identifier of an entity.

                "entityId":"identifier"

            • long (integer) --

              An attribute value of Long type.

              Example: {"long": 0}

            • string (string) --

              An attribute value of String type.

              Example: {"string": "abc"}

            • set (list) --

              An attribute value of Set type.

              Example: {"set": [ {} ] }

              • (dict) --

                The value of an attribute.

                Contains information about the runtime context for a request for which an authorization decision is made.

                This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

                Note

                This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

            • record (dict) --

              An attribute value of Record type.

              Example: {"record": { "keyName": {} } }

              • (string) --

                • (dict) --

                  The value of an attribute.

                  Contains information about the runtime context for a request for which an authorization decision is made.

                  This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

                  Note

                  This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

            • ipaddr (string) --

              An attribute value of ipaddr type.

              Example: {"ip": "192.168.1.100"}

            • decimal (string) --

              An attribute value of decimal type.

              Example: {"decimal": "1.1"}

      • parents (list) --

        The parent entities in the hierarchy that contains the entity. A principal or resource entity can be defined with at most 99 transitive parents per authorization request.

        A transitive parent is an entity in the hierarchy of entities including all direct parents, and parents of parents. For example, a user can be a member of 91 groups if one of those groups is a member of eight groups, for a total of 100: one entity, 91 entity parents, and eight parents of parents.

        • (dict) --

          Contains the identifier of an entity, including its ID and type.

          This data type is used as a request parameter for IsAuthorized operation, and as a response parameter for the CreatePolicy, GetPolicy, and UpdatePolicy operations.

          Example: {"entityId":"string","entityType":"string"}

          • entityType (string) -- [REQUIRED]

            The type of an entity.

            Example: "entityType":"typeName"

          • entityId (string) -- [REQUIRED]

            The identifier of an entity.

            "entityId":"identifier"

type requests

list

param requests

[REQUIRED]

An array of up to 30 requests that you want Verified Permissions to evaluate.

  • (dict) --

    An authorization request that you include in a BatchIsAuthorized API request.

    • principal (dict) --

      Specifies the principal for which the authorization decision is to be made.

      • entityType (string) -- [REQUIRED]

        The type of an entity.

        Example: "entityType":"typeName"

      • entityId (string) -- [REQUIRED]

        The identifier of an entity.

        "entityId":"identifier"

    • action (dict) --

      Specifies the requested action to be authorized. For example, PhotoFlash::ReadPhoto .

      • actionType (string) -- [REQUIRED]

        The type of an action.

      • actionId (string) -- [REQUIRED]

        The ID of an action.

    • resource (dict) --

      Specifies the resource that you want an authorization decision for. For example, PhotoFlash::Photo .

      • entityType (string) -- [REQUIRED]

        The type of an entity.

        Example: "entityType":"typeName"

      • entityId (string) -- [REQUIRED]

        The identifier of an entity.

        "entityId":"identifier"

    • context (dict) --

      Specifies additional context that can be used to make more granular authorization decisions.

      Note

      This is a Tagged Union structure. Only one of the following top level keys can be set: contextMap.

      • contextMap (dict) --

        An list of attributes that are needed to successfully evaluate an authorization request. Each attribute in this array must include a map of a data type and its value.

        Example: "contextMap":{"<KeyName1>":{"boolean":true},"<KeyName2>":{"long":1234}}

        • (string) --

          • (dict) --

            The value of an attribute.

            Contains information about the runtime context for a request for which an authorization decision is made.

            This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

            Note

            This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

            • boolean (boolean) --

              An attribute value of Boolean type.

              Example: {"boolean": true}

            • entityIdentifier (dict) --

              An attribute value of type EntityIdentifier.

              Example: "entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}

              • entityType (string) -- [REQUIRED]

                The type of an entity.

                Example: "entityType":"typeName"

              • entityId (string) -- [REQUIRED]

                The identifier of an entity.

                "entityId":"identifier"

            • long (integer) --

              An attribute value of Long type.

              Example: {"long": 0}

            • string (string) --

              An attribute value of String type.

              Example: {"string": "abc"}

            • set (list) --

              An attribute value of Set type.

              Example: {"set": [ {} ] }

              • (dict) --

                The value of an attribute.

                Contains information about the runtime context for a request for which an authorization decision is made.

                This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

                Note

                This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

            • record (dict) --

              An attribute value of Record type.

              Example: {"record": { "keyName": {} } }

              • (string) --

                • (dict) --

                  The value of an attribute.

                  Contains information about the runtime context for a request for which an authorization decision is made.

                  This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

                  Note

                  This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

            • ipaddr (string) --

              An attribute value of ipaddr type.

              Example: {"ip": "192.168.1.100"}

            • decimal (string) --

              An attribute value of decimal type.

              Example: {"decimal": "1.1"}

rtype

dict

returns

Response Syntax

{
    'results': [
        {
            'request': {
                'principal': {
                    'entityType': 'string',
                    'entityId': 'string'
                },
                'action': {
                    'actionType': 'string',
                    'actionId': 'string'
                },
                'resource': {
                    'entityType': 'string',
                    'entityId': 'string'
                },
                'context': {
                    'contextMap': {
                        'string': {
                            'boolean': True|False,
                            'entityIdentifier': {
                                'entityType': 'string',
                                'entityId': 'string'
                            },
                            'long': 123,
                            'string': 'string',
                            'set': [
                                {'... recursive ...'},
                            ],
                            'record': {
                                'string': {'... recursive ...'}
                            },
                            'ipaddr': 'string',
                            'decimal': 'string'
                        }
                    }
                }
            },
            'decision': 'ALLOW'|'DENY',
            'determiningPolicies': [
                {
                    'policyId': 'string'
                },
            ],
            'errors': [
                {
                    'errorDescription': 'string'
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • results (list) --

      A series of Allow or Deny decisions for each request, and the policies that produced them. These results are returned in the order they were requested.

      • (dict) --

        The decision, based on policy evaluation, from an individual authorization request in a BatchIsAuthorized API request.

        • request (dict) --

          The authorization request that initiated the decision.

          • principal (dict) --

            Specifies the principal for which the authorization decision is to be made.

            • entityType (string) --

              The type of an entity.

              Example: "entityType":"typeName"

            • entityId (string) --

              The identifier of an entity.

              "entityId":"identifier"

          • action (dict) --

            Specifies the requested action to be authorized. For example, PhotoFlash::ReadPhoto .

            • actionType (string) --

              The type of an action.

            • actionId (string) --

              The ID of an action.

          • resource (dict) --

            Specifies the resource that you want an authorization decision for. For example, PhotoFlash::Photo .

            • entityType (string) --

              The type of an entity.

              Example: "entityType":"typeName"

            • entityId (string) --

              The identifier of an entity.

              "entityId":"identifier"

          • context (dict) --

            Specifies additional context that can be used to make more granular authorization decisions.

            Note

            This is a Tagged Union structure. Only one of the following top level keys will be set: contextMap. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

            'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
            • contextMap (dict) --

              An list of attributes that are needed to successfully evaluate an authorization request. Each attribute in this array must include a map of a data type and its value.

              Example: "contextMap":{"<KeyName1>":{"boolean":true},"<KeyName2>":{"long":1234}}

              • (string) --

                • (dict) --

                  The value of an attribute.

                  Contains information about the runtime context for a request for which an authorization decision is made.

                  This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

                  Note

                  This is a Tagged Union structure. Only one of the following top level keys will be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

                  'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
                  • boolean (boolean) --

                    An attribute value of Boolean type.

                    Example: {"boolean": true}

                  • entityIdentifier (dict) --

                    An attribute value of type EntityIdentifier.

                    Example: "entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}

                    • entityType (string) --

                      The type of an entity.

                      Example: "entityType":"typeName"

                    • entityId (string) --

                      The identifier of an entity.

                      "entityId":"identifier"

                  • long (integer) --

                    An attribute value of Long type.

                    Example: {"long": 0}

                  • string (string) --

                    An attribute value of String type.

                    Example: {"string": "abc"}

                  • set (list) --

                    An attribute value of Set type.

                    Example: {"set": [ {} ] }

                    • (dict) --

                      The value of an attribute.

                      Contains information about the runtime context for a request for which an authorization decision is made.

                      This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

                      Note

                      This is a Tagged Union structure. Only one of the following top level keys will be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

                      'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
                  • record (dict) --

                    An attribute value of Record type.

                    Example: {"record": { "keyName": {} } }

                    • (string) --

                      • (dict) --

                        The value of an attribute.

                        Contains information about the runtime context for a request for which an authorization decision is made.

                        This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

                        Note

                        This is a Tagged Union structure. Only one of the following top level keys will be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

                        'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
                  • ipaddr (string) --

                    An attribute value of ipaddr type.

                    Example: {"ip": "192.168.1.100"}

                  • decimal (string) --

                    An attribute value of decimal type.

                    Example: {"decimal": "1.1"}

        • decision (string) --

          An authorization decision that indicates if the authorization request should be allowed or denied.

        • determiningPolicies (list) --

          The list of determining policies used to make the authorization decision. For example, if there are two matching policies, where one is a forbid and the other is a permit, then the forbid policy will be the determining policy. In the case of multiple matching permit policies then there would be multiple determining policies. In the case that no policies match, and hence the response is DENY, there would be no determining policies.

          • (dict) --

            Contains information about one of the policies that determined an authorization decision.

            This data type is used as an element in a response parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

            Example: "determiningPolicies":[{"policyId":"SPEXAMPLEabcdefg111111"}]

            • policyId (string) --

              The Id of a policy that determined to an authorization decision.

              Example: "policyId":"SPEXAMPLEabcdefg111111"

        • errors (list) --

          Errors that occurred while making an authorization decision. For example, a policy might reference an entity or attribute that doesn't exist in the request.

BatchIsAuthorizedWithToken (updated) Link ¶
Changes (request, response)
Request
{'entities': {'entityList': {'attributes': {'decimal': 'string',
                                            'ipaddr': 'string'}}},
 'requests': {'context': {'contextMap': {'decimal': 'string',
                                         'ipaddr': 'string'}}}}
Response
{'results': {'request': {'context': {'contextMap': {'decimal': 'string',
                                                    'ipaddr': 'string'}}}}}

Makes a series of decisions about multiple authorization requests for one token. The principal in this request comes from an external identity source in the form of an identity or access token, formatted as a JSON web token (JWT). The information in the parameters can also define additional context that Verified Permissions can include in the evaluations.

The request is evaluated against all policies in the specified policy store that match the entities that you provide in the entities declaration and in the token. The result of the decisions is a series of Allow or Deny responses, along with the IDs of the policies that produced each decision.

The entities of a BatchIsAuthorizedWithToken API request can contain up to 100 resources and up to 99 user groups. The requests of a BatchIsAuthorizedWithToken API request can contain up to 30 requests.

Note

The BatchIsAuthorizedWithToken operation doesn't have its own IAM permission. To authorize this operation for Amazon Web Services principals, include the permission verifiedpermissions:IsAuthorizedWithToken in their IAM policies.

See also: AWS API Documentation

Request Syntax

client.batch_is_authorized_with_token(
    policyStoreId='string',
    identityToken='string',
    accessToken='string',
    entities={
        'entityList': [
            {
                'identifier': {
                    'entityType': 'string',
                    'entityId': 'string'
                },
                'attributes': {
                    'string': {
                        'boolean': True|False,
                        'entityIdentifier': {
                            'entityType': 'string',
                            'entityId': 'string'
                        },
                        'long': 123,
                        'string': 'string',
                        'set': [
                            {'... recursive ...'},
                        ],
                        'record': {
                            'string': {'... recursive ...'}
                        },
                        'ipaddr': 'string',
                        'decimal': 'string'
                    }
                },
                'parents': [
                    {
                        'entityType': 'string',
                        'entityId': 'string'
                    },
                ]
            },
        ]
    },
    requests=[
        {
            'action': {
                'actionType': 'string',
                'actionId': 'string'
            },
            'resource': {
                'entityType': 'string',
                'entityId': 'string'
            },
            'context': {
                'contextMap': {
                    'string': {
                        'boolean': True|False,
                        'entityIdentifier': {
                            'entityType': 'string',
                            'entityId': 'string'
                        },
                        'long': 123,
                        'string': 'string',
                        'set': [
                            {'... recursive ...'},
                        ],
                        'record': {
                            'string': {'... recursive ...'}
                        },
                        'ipaddr': 'string',
                        'decimal': 'string'
                    }
                }
            }
        },
    ]
)
type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the ID of the policy store. Policies in this policy store will be used to make an authorization decision for the input.

type identityToken

string

param identityToken

Specifies an identity (ID) token for the principal that you want to authorize in each request. This token is provided to you by the identity provider (IdP) associated with the specified identity source. You must specify either an accessToken , an identityToken , or both.

Must be an ID token. Verified Permissions returns an error if the token_use claim in the submitted token isn't id .

type accessToken

string

param accessToken

Specifies an access token for the principal that you want to authorize in each request. This token is provided to you by the identity provider (IdP) associated with the specified identity source. You must specify either an accessToken , an identityToken , or both.

Must be an access token. Verified Permissions returns an error if the token_use claim in the submitted token isn't access .

type entities

dict

param entities

Specifies the list of resources and their associated attributes that Verified Permissions can examine when evaluating the policies.

Warning

You can't include principals in this parameter, only resource and action entities. This parameter can't include any entities of a type that matches the user or group entity types that you defined in your identity source.

  • The BatchIsAuthorizedWithToken operation takes principal attributes from only the identityToken or accessToken passed to the operation.

  • For action entities, you can include only their Identifier and EntityType .

Note

This is a Tagged Union structure. Only one of the following top level keys can be set: entityList.

  • entityList (list) --

    An array of entities that are needed to successfully evaluate an authorization request. Each entity in this array must include an identifier for the entity, the attributes of the entity, and a list of any parent entities.

    • (dict) --

      Contains information about an entity that can be referenced in a Cedar policy.

      This data type is used as one of the fields in the EntitiesDefinition structure.

      { "identifier": { "entityType": "Photo", "entityId": "VacationPhoto94.jpg" }, "attributes": {}, "parents": [ { "entityType": "Album", "entityId": "alice_folder" } ] }

      • identifier (dict) -- [REQUIRED]

        The identifier of the entity.

        • entityType (string) -- [REQUIRED]

          The type of an entity.

          Example: "entityType":"typeName"

        • entityId (string) -- [REQUIRED]

          The identifier of an entity.

          "entityId":"identifier"

      • attributes (dict) --

        A list of attributes for the entity.

        • (string) --

          • (dict) --

            The value of an attribute.

            Contains information about the runtime context for a request for which an authorization decision is made.

            This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

            Note

            This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

            • boolean (boolean) --

              An attribute value of Boolean type.

              Example: {"boolean": true}

            • entityIdentifier (dict) --

              An attribute value of type EntityIdentifier.

              Example: "entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}

              • entityType (string) -- [REQUIRED]

                The type of an entity.

                Example: "entityType":"typeName"

              • entityId (string) -- [REQUIRED]

                The identifier of an entity.

                "entityId":"identifier"

            • long (integer) --

              An attribute value of Long type.

              Example: {"long": 0}

            • string (string) --

              An attribute value of String type.

              Example: {"string": "abc"}

            • set (list) --

              An attribute value of Set type.

              Example: {"set": [ {} ] }

              • (dict) --

                The value of an attribute.

                Contains information about the runtime context for a request for which an authorization decision is made.

                This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

                Note

                This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

            • record (dict) --

              An attribute value of Record type.

              Example: {"record": { "keyName": {} } }

              • (string) --

                • (dict) --

                  The value of an attribute.

                  Contains information about the runtime context for a request for which an authorization decision is made.

                  This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

                  Note

                  This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

            • ipaddr (string) --

              An attribute value of ipaddr type.

              Example: {"ip": "192.168.1.100"}

            • decimal (string) --

              An attribute value of decimal type.

              Example: {"decimal": "1.1"}

      • parents (list) --

        The parent entities in the hierarchy that contains the entity. A principal or resource entity can be defined with at most 99 transitive parents per authorization request.

        A transitive parent is an entity in the hierarchy of entities including all direct parents, and parents of parents. For example, a user can be a member of 91 groups if one of those groups is a member of eight groups, for a total of 100: one entity, 91 entity parents, and eight parents of parents.

        • (dict) --

          Contains the identifier of an entity, including its ID and type.

          This data type is used as a request parameter for IsAuthorized operation, and as a response parameter for the CreatePolicy, GetPolicy, and UpdatePolicy operations.

          Example: {"entityId":"string","entityType":"string"}

          • entityType (string) -- [REQUIRED]

            The type of an entity.

            Example: "entityType":"typeName"

          • entityId (string) -- [REQUIRED]

            The identifier of an entity.

            "entityId":"identifier"

type requests

list

param requests

[REQUIRED]

An array of up to 30 requests that you want Verified Permissions to evaluate.

  • (dict) --

    An authorization request that you include in a BatchIsAuthorizedWithToken API request.

    • action (dict) --

      Specifies the requested action to be authorized. For example, PhotoFlash::ReadPhoto .

      • actionType (string) -- [REQUIRED]

        The type of an action.

      • actionId (string) -- [REQUIRED]

        The ID of an action.

    • resource (dict) --

      Specifies the resource that you want an authorization decision for. For example, PhotoFlash::Photo .

      • entityType (string) -- [REQUIRED]

        The type of an entity.

        Example: "entityType":"typeName"

      • entityId (string) -- [REQUIRED]

        The identifier of an entity.

        "entityId":"identifier"

    • context (dict) --

      Specifies additional context that can be used to make more granular authorization decisions.

      Note

      This is a Tagged Union structure. Only one of the following top level keys can be set: contextMap.

      • contextMap (dict) --

        An list of attributes that are needed to successfully evaluate an authorization request. Each attribute in this array must include a map of a data type and its value.

        Example: "contextMap":{"<KeyName1>":{"boolean":true},"<KeyName2>":{"long":1234}}

        • (string) --

          • (dict) --

            The value of an attribute.

            Contains information about the runtime context for a request for which an authorization decision is made.

            This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

            Note

            This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

            • boolean (boolean) --

              An attribute value of Boolean type.

              Example: {"boolean": true}

            • entityIdentifier (dict) --

              An attribute value of type EntityIdentifier.

              Example: "entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}

              • entityType (string) -- [REQUIRED]

                The type of an entity.

                Example: "entityType":"typeName"

              • entityId (string) -- [REQUIRED]

                The identifier of an entity.

                "entityId":"identifier"

            • long (integer) --

              An attribute value of Long type.

              Example: {"long": 0}

            • string (string) --

              An attribute value of String type.

              Example: {"string": "abc"}

            • set (list) --

              An attribute value of Set type.

              Example: {"set": [ {} ] }

              • (dict) --

                The value of an attribute.

                Contains information about the runtime context for a request for which an authorization decision is made.

                This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

                Note

                This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

            • record (dict) --

              An attribute value of Record type.

              Example: {"record": { "keyName": {} } }

              • (string) --

                • (dict) --

                  The value of an attribute.

                  Contains information about the runtime context for a request for which an authorization decision is made.

                  This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

                  Note

                  This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

            • ipaddr (string) --

              An attribute value of ipaddr type.

              Example: {"ip": "192.168.1.100"}

            • decimal (string) --

              An attribute value of decimal type.

              Example: {"decimal": "1.1"}

rtype

dict

returns

Response Syntax

{
    'principal': {
        'entityType': 'string',
        'entityId': 'string'
    },
    'results': [
        {
            'request': {
                'action': {
                    'actionType': 'string',
                    'actionId': 'string'
                },
                'resource': {
                    'entityType': 'string',
                    'entityId': 'string'
                },
                'context': {
                    'contextMap': {
                        'string': {
                            'boolean': True|False,
                            'entityIdentifier': {
                                'entityType': 'string',
                                'entityId': 'string'
                            },
                            'long': 123,
                            'string': 'string',
                            'set': [
                                {'... recursive ...'},
                            ],
                            'record': {
                                'string': {'... recursive ...'}
                            },
                            'ipaddr': 'string',
                            'decimal': 'string'
                        }
                    }
                }
            },
            'decision': 'ALLOW'|'DENY',
            'determiningPolicies': [
                {
                    'policyId': 'string'
                },
            ],
            'errors': [
                {
                    'errorDescription': 'string'
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • principal (dict) --

      The identifier of the principal in the ID or access token.

      • entityType (string) --

        The type of an entity.

        Example: "entityType":"typeName"

      • entityId (string) --

        The identifier of an entity.

        "entityId":"identifier"

    • results (list) --

      A series of Allow or Deny decisions for each request, and the policies that produced them. These results are returned in the order they were requested.

      • (dict) --

        The decision, based on policy evaluation, from an individual authorization request in a BatchIsAuthorizedWithToken API request.

        • request (dict) --

          The authorization request that initiated the decision.

          • action (dict) --

            Specifies the requested action to be authorized. For example, PhotoFlash::ReadPhoto .

            • actionType (string) --

              The type of an action.

            • actionId (string) --

              The ID of an action.

          • resource (dict) --

            Specifies the resource that you want an authorization decision for. For example, PhotoFlash::Photo .

            • entityType (string) --

              The type of an entity.

              Example: "entityType":"typeName"

            • entityId (string) --

              The identifier of an entity.

              "entityId":"identifier"

          • context (dict) --

            Specifies additional context that can be used to make more granular authorization decisions.

            Note

            This is a Tagged Union structure. Only one of the following top level keys will be set: contextMap. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

            'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
            • contextMap (dict) --

              An list of attributes that are needed to successfully evaluate an authorization request. Each attribute in this array must include a map of a data type and its value.

              Example: "contextMap":{"<KeyName1>":{"boolean":true},"<KeyName2>":{"long":1234}}

              • (string) --

                • (dict) --

                  The value of an attribute.

                  Contains information about the runtime context for a request for which an authorization decision is made.

                  This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

                  Note

                  This is a Tagged Union structure. Only one of the following top level keys will be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

                  'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
                  • boolean (boolean) --

                    An attribute value of Boolean type.

                    Example: {"boolean": true}

                  • entityIdentifier (dict) --

                    An attribute value of type EntityIdentifier.

                    Example: "entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}

                    • entityType (string) --

                      The type of an entity.

                      Example: "entityType":"typeName"

                    • entityId (string) --

                      The identifier of an entity.

                      "entityId":"identifier"

                  • long (integer) --

                    An attribute value of Long type.

                    Example: {"long": 0}

                  • string (string) --

                    An attribute value of String type.

                    Example: {"string": "abc"}

                  • set (list) --

                    An attribute value of Set type.

                    Example: {"set": [ {} ] }

                    • (dict) --

                      The value of an attribute.

                      Contains information about the runtime context for a request for which an authorization decision is made.

                      This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

                      Note

                      This is a Tagged Union structure. Only one of the following top level keys will be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

                      'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
                  • record (dict) --

                    An attribute value of Record type.

                    Example: {"record": { "keyName": {} } }

                    • (string) --

                      • (dict) --

                        The value of an attribute.

                        Contains information about the runtime context for a request for which an authorization decision is made.

                        This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

                        Note

                        This is a Tagged Union structure. Only one of the following top level keys will be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

                        'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
                  • ipaddr (string) --

                    An attribute value of ipaddr type.

                    Example: {"ip": "192.168.1.100"}

                  • decimal (string) --

                    An attribute value of decimal type.

                    Example: {"decimal": "1.1"}

        • decision (string) --

          An authorization decision that indicates if the authorization request should be allowed or denied.

        • determiningPolicies (list) --

          The list of determining policies used to make the authorization decision. For example, if there are two matching policies, where one is a forbid and the other is a permit, then the forbid policy will be the determining policy. In the case of multiple matching permit policies then there would be multiple determining policies. In the case that no policies match, and hence the response is DENY, there would be no determining policies.

          • (dict) --

            Contains information about one of the policies that determined an authorization decision.

            This data type is used as an element in a response parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

            Example: "determiningPolicies":[{"policyId":"SPEXAMPLEabcdefg111111"}]

            • policyId (string) --

              The Id of a policy that determined to an authorization decision.

              Example: "policyId":"SPEXAMPLEabcdefg111111"

        • errors (list) --

          Errors that occurred while making an authorization decision. For example, a policy might reference an entity or attribute that doesn't exist in the request.

IsAuthorized (updated) Link ¶
Changes (request)
{'context': {'contextMap': {'decimal': 'string', 'ipaddr': 'string'}},
 'entities': {'entityList': {'attributes': {'decimal': 'string',
                                            'ipaddr': 'string'}}}}

Makes an authorization decision about a service request described in the parameters. The information in the parameters can also define additional context that Verified Permissions can include in the evaluation. The request is evaluated against all matching policies in the specified policy store. The result of the decision is either Allow or Deny , along with a list of the policies that resulted in the decision.

See also: AWS API Documentation

Request Syntax

client.is_authorized(
    policyStoreId='string',
    principal={
        'entityType': 'string',
        'entityId': 'string'
    },
    action={
        'actionType': 'string',
        'actionId': 'string'
    },
    resource={
        'entityType': 'string',
        'entityId': 'string'
    },
    context={
        'contextMap': {
            'string': {
                'boolean': True|False,
                'entityIdentifier': {
                    'entityType': 'string',
                    'entityId': 'string'
                },
                'long': 123,
                'string': 'string',
                'set': [
                    {'... recursive ...'},
                ],
                'record': {
                    'string': {'... recursive ...'}
                },
                'ipaddr': 'string',
                'decimal': 'string'
            }
        }
    },
    entities={
        'entityList': [
            {
                'identifier': {
                    'entityType': 'string',
                    'entityId': 'string'
                },
                'attributes': {
                    'string': {
                        'boolean': True|False,
                        'entityIdentifier': {
                            'entityType': 'string',
                            'entityId': 'string'
                        },
                        'long': 123,
                        'string': 'string',
                        'set': [
                            {'... recursive ...'},
                        ],
                        'record': {
                            'string': {'... recursive ...'}
                        },
                        'ipaddr': 'string',
                        'decimal': 'string'
                    }
                },
                'parents': [
                    {
                        'entityType': 'string',
                        'entityId': 'string'
                    },
                ]
            },
        ]
    }
)
type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the ID of the policy store. Policies in this policy store will be used to make an authorization decision for the input.

type principal

dict

param principal

Specifies the principal for which the authorization decision is to be made.

  • entityType (string) -- [REQUIRED]

    The type of an entity.

    Example: "entityType":"typeName"

  • entityId (string) -- [REQUIRED]

    The identifier of an entity.

    "entityId":"identifier"

type action

dict

param action

Specifies the requested action to be authorized. For example, is the principal authorized to perform this action on the resource?

  • actionType (string) -- [REQUIRED]

    The type of an action.

  • actionId (string) -- [REQUIRED]

    The ID of an action.

type resource

dict

param resource

Specifies the resource for which the authorization decision is to be made.

  • entityType (string) -- [REQUIRED]

    The type of an entity.

    Example: "entityType":"typeName"

  • entityId (string) -- [REQUIRED]

    The identifier of an entity.

    "entityId":"identifier"

type context

dict

param context

Specifies additional context that can be used to make more granular authorization decisions.

Note

This is a Tagged Union structure. Only one of the following top level keys can be set: contextMap.

  • contextMap (dict) --

    An list of attributes that are needed to successfully evaluate an authorization request. Each attribute in this array must include a map of a data type and its value.

    Example: "contextMap":{"<KeyName1>":{"boolean":true},"<KeyName2>":{"long":1234}}

    • (string) --

      • (dict) --

        The value of an attribute.

        Contains information about the runtime context for a request for which an authorization decision is made.

        This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

        • boolean (boolean) --

          An attribute value of Boolean type.

          Example: {"boolean": true}

        • entityIdentifier (dict) --

          An attribute value of type EntityIdentifier.

          Example: "entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}

          • entityType (string) -- [REQUIRED]

            The type of an entity.

            Example: "entityType":"typeName"

          • entityId (string) -- [REQUIRED]

            The identifier of an entity.

            "entityId":"identifier"

        • long (integer) --

          An attribute value of Long type.

          Example: {"long": 0}

        • string (string) --

          An attribute value of String type.

          Example: {"string": "abc"}

        • set (list) --

          An attribute value of Set type.

          Example: {"set": [ {} ] }

          • (dict) --

            The value of an attribute.

            Contains information about the runtime context for a request for which an authorization decision is made.

            This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

            Note

            This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

        • record (dict) --

          An attribute value of Record type.

          Example: {"record": { "keyName": {} } }

          • (string) --

            • (dict) --

              The value of an attribute.

              Contains information about the runtime context for a request for which an authorization decision is made.

              This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

              Note

              This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

        • ipaddr (string) --

          An attribute value of ipaddr type.

          Example: {"ip": "192.168.1.100"}

        • decimal (string) --

          An attribute value of decimal type.

          Example: {"decimal": "1.1"}

type entities

dict

param entities

Specifies the list of resources and principals and their associated attributes that Verified Permissions can examine when evaluating the policies.

Note

You can include only principal and resource entities in this parameter; you can't include actions. You must specify actions in the schema.

Note

This is a Tagged Union structure. Only one of the following top level keys can be set: entityList.

  • entityList (list) --

    An array of entities that are needed to successfully evaluate an authorization request. Each entity in this array must include an identifier for the entity, the attributes of the entity, and a list of any parent entities.

    • (dict) --

      Contains information about an entity that can be referenced in a Cedar policy.

      This data type is used as one of the fields in the EntitiesDefinition structure.

      { "identifier": { "entityType": "Photo", "entityId": "VacationPhoto94.jpg" }, "attributes": {}, "parents": [ { "entityType": "Album", "entityId": "alice_folder" } ] }

      • identifier (dict) -- [REQUIRED]

        The identifier of the entity.

        • entityType (string) -- [REQUIRED]

          The type of an entity.

          Example: "entityType":"typeName"

        • entityId (string) -- [REQUIRED]

          The identifier of an entity.

          "entityId":"identifier"

      • attributes (dict) --

        A list of attributes for the entity.

        • (string) --

          • (dict) --

            The value of an attribute.

            Contains information about the runtime context for a request for which an authorization decision is made.

            This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

            Note

            This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

            • boolean (boolean) --

              An attribute value of Boolean type.

              Example: {"boolean": true}

            • entityIdentifier (dict) --

              An attribute value of type EntityIdentifier.

              Example: "entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}

              • entityType (string) -- [REQUIRED]

                The type of an entity.

                Example: "entityType":"typeName"

              • entityId (string) -- [REQUIRED]

                The identifier of an entity.

                "entityId":"identifier"

            • long (integer) --

              An attribute value of Long type.

              Example: {"long": 0}

            • string (string) --

              An attribute value of String type.

              Example: {"string": "abc"}

            • set (list) --

              An attribute value of Set type.

              Example: {"set": [ {} ] }

              • (dict) --

                The value of an attribute.

                Contains information about the runtime context for a request for which an authorization decision is made.

                This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

                Note

                This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

            • record (dict) --

              An attribute value of Record type.

              Example: {"record": { "keyName": {} } }

              • (string) --

                • (dict) --

                  The value of an attribute.

                  Contains information about the runtime context for a request for which an authorization decision is made.

                  This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

                  Note

                  This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

            • ipaddr (string) --

              An attribute value of ipaddr type.

              Example: {"ip": "192.168.1.100"}

            • decimal (string) --

              An attribute value of decimal type.

              Example: {"decimal": "1.1"}

      • parents (list) --

        The parent entities in the hierarchy that contains the entity. A principal or resource entity can be defined with at most 99 transitive parents per authorization request.

        A transitive parent is an entity in the hierarchy of entities including all direct parents, and parents of parents. For example, a user can be a member of 91 groups if one of those groups is a member of eight groups, for a total of 100: one entity, 91 entity parents, and eight parents of parents.

        • (dict) --

          Contains the identifier of an entity, including its ID and type.

          This data type is used as a request parameter for IsAuthorized operation, and as a response parameter for the CreatePolicy, GetPolicy, and UpdatePolicy operations.

          Example: {"entityId":"string","entityType":"string"}

          • entityType (string) -- [REQUIRED]

            The type of an entity.

            Example: "entityType":"typeName"

          • entityId (string) -- [REQUIRED]

            The identifier of an entity.

            "entityId":"identifier"

rtype

dict

returns

Response Syntax

{
    'decision': 'ALLOW'|'DENY',
    'determiningPolicies': [
        {
            'policyId': 'string'
        },
    ],
    'errors': [
        {
            'errorDescription': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • decision (string) --

      An authorization decision that indicates if the authorization request should be allowed or denied.

    • determiningPolicies (list) --

      The list of determining policies used to make the authorization decision. For example, if there are two matching policies, where one is a forbid and the other is a permit, then the forbid policy will be the determining policy. In the case of multiple matching permit policies then there would be multiple determining policies. In the case that no policies match, and hence the response is DENY, there would be no determining policies.

      • (dict) --

        Contains information about one of the policies that determined an authorization decision.

        This data type is used as an element in a response parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

        Example: "determiningPolicies":[{"policyId":"SPEXAMPLEabcdefg111111"}]

        • policyId (string) --

          The Id of a policy that determined to an authorization decision.

          Example: "policyId":"SPEXAMPLEabcdefg111111"

    • errors (list) --

      Errors that occurred while making an authorization decision, for example, a policy references an Entity or entity Attribute that does not exist in the slice.

IsAuthorizedWithToken (updated) Link ¶
Changes (request)
{'context': {'contextMap': {'decimal': 'string', 'ipaddr': 'string'}},
 'entities': {'entityList': {'attributes': {'decimal': 'string',
                                            'ipaddr': 'string'}}}}

Makes an authorization decision about a service request described in the parameters. The principal in this request comes from an external identity source in the form of an identity token formatted as a JSON web token (JWT). The information in the parameters can also define additional context that Verified Permissions can include in the evaluation. The request is evaluated against all matching policies in the specified policy store. The result of the decision is either Allow or Deny , along with a list of the policies that resulted in the decision.

Verified Permissions validates each token that is specified in a request by checking its expiration date and its signature.

Warning

Tokens from an identity source user continue to be usable until they expire. Token revocation and resource deletion have no effect on the validity of a token in your policy store

See also: AWS API Documentation

Request Syntax

client.is_authorized_with_token(
    policyStoreId='string',
    identityToken='string',
    accessToken='string',
    action={
        'actionType': 'string',
        'actionId': 'string'
    },
    resource={
        'entityType': 'string',
        'entityId': 'string'
    },
    context={
        'contextMap': {
            'string': {
                'boolean': True|False,
                'entityIdentifier': {
                    'entityType': 'string',
                    'entityId': 'string'
                },
                'long': 123,
                'string': 'string',
                'set': [
                    {'... recursive ...'},
                ],
                'record': {
                    'string': {'... recursive ...'}
                },
                'ipaddr': 'string',
                'decimal': 'string'
            }
        }
    },
    entities={
        'entityList': [
            {
                'identifier': {
                    'entityType': 'string',
                    'entityId': 'string'
                },
                'attributes': {
                    'string': {
                        'boolean': True|False,
                        'entityIdentifier': {
                            'entityType': 'string',
                            'entityId': 'string'
                        },
                        'long': 123,
                        'string': 'string',
                        'set': [
                            {'... recursive ...'},
                        ],
                        'record': {
                            'string': {'... recursive ...'}
                        },
                        'ipaddr': 'string',
                        'decimal': 'string'
                    }
                },
                'parents': [
                    {
                        'entityType': 'string',
                        'entityId': 'string'
                    },
                ]
            },
        ]
    }
)
type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the ID of the policy store. Policies in this policy store will be used to make an authorization decision for the input.

type identityToken

string

param identityToken

Specifies an identity token for the principal to be authorized. This token is provided to you by the identity provider (IdP) associated with the specified identity source. You must specify either an accessToken , an identityToken , or both.

Must be an ID token. Verified Permissions returns an error if the token_use claim in the submitted token isn't id .

type accessToken

string

param accessToken

Specifies an access token for the principal to be authorized. This token is provided to you by the identity provider (IdP) associated with the specified identity source. You must specify either an accessToken , an identityToken , or both.

Must be an access token. Verified Permissions returns an error if the token_use claim in the submitted token isn't access .

type action

dict

param action

Specifies the requested action to be authorized. Is the specified principal authorized to perform this action on the specified resource.

  • actionType (string) -- [REQUIRED]

    The type of an action.

  • actionId (string) -- [REQUIRED]

    The ID of an action.

type resource

dict

param resource

Specifies the resource for which the authorization decision is made. For example, is the principal allowed to perform the action on the resource?

  • entityType (string) -- [REQUIRED]

    The type of an entity.

    Example: "entityType":"typeName"

  • entityId (string) -- [REQUIRED]

    The identifier of an entity.

    "entityId":"identifier"

type context

dict

param context

Specifies additional context that can be used to make more granular authorization decisions.

Note

This is a Tagged Union structure. Only one of the following top level keys can be set: contextMap.

  • contextMap (dict) --

    An list of attributes that are needed to successfully evaluate an authorization request. Each attribute in this array must include a map of a data type and its value.

    Example: "contextMap":{"<KeyName1>":{"boolean":true},"<KeyName2>":{"long":1234}}

    • (string) --

      • (dict) --

        The value of an attribute.

        Contains information about the runtime context for a request for which an authorization decision is made.

        This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

        • boolean (boolean) --

          An attribute value of Boolean type.

          Example: {"boolean": true}

        • entityIdentifier (dict) --

          An attribute value of type EntityIdentifier.

          Example: "entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}

          • entityType (string) -- [REQUIRED]

            The type of an entity.

            Example: "entityType":"typeName"

          • entityId (string) -- [REQUIRED]

            The identifier of an entity.

            "entityId":"identifier"

        • long (integer) --

          An attribute value of Long type.

          Example: {"long": 0}

        • string (string) --

          An attribute value of String type.

          Example: {"string": "abc"}

        • set (list) --

          An attribute value of Set type.

          Example: {"set": [ {} ] }

          • (dict) --

            The value of an attribute.

            Contains information about the runtime context for a request for which an authorization decision is made.

            This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

            Note

            This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

        • record (dict) --

          An attribute value of Record type.

          Example: {"record": { "keyName": {} } }

          • (string) --

            • (dict) --

              The value of an attribute.

              Contains information about the runtime context for a request for which an authorization decision is made.

              This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

              Note

              This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

        • ipaddr (string) --

          An attribute value of ipaddr type.

          Example: {"ip": "192.168.1.100"}

        • decimal (string) --

          An attribute value of decimal type.

          Example: {"decimal": "1.1"}

type entities

dict

param entities

Specifies the list of resources and their associated attributes that Verified Permissions can examine when evaluating the policies.

Warning

You can't include principals in this parameter, only resource and action entities. This parameter can't include any entities of a type that matches the user or group entity types that you defined in your identity source.

  • The IsAuthorizedWithToken operation takes principal attributes from only the identityToken or accessToken passed to the operation.

  • For action entities, you can include only their Identifier and EntityType .

Note

This is a Tagged Union structure. Only one of the following top level keys can be set: entityList.

  • entityList (list) --

    An array of entities that are needed to successfully evaluate an authorization request. Each entity in this array must include an identifier for the entity, the attributes of the entity, and a list of any parent entities.

    • (dict) --

      Contains information about an entity that can be referenced in a Cedar policy.

      This data type is used as one of the fields in the EntitiesDefinition structure.

      { "identifier": { "entityType": "Photo", "entityId": "VacationPhoto94.jpg" }, "attributes": {}, "parents": [ { "entityType": "Album", "entityId": "alice_folder" } ] }

      • identifier (dict) -- [REQUIRED]

        The identifier of the entity.

        • entityType (string) -- [REQUIRED]

          The type of an entity.

          Example: "entityType":"typeName"

        • entityId (string) -- [REQUIRED]

          The identifier of an entity.

          "entityId":"identifier"

      • attributes (dict) --

        A list of attributes for the entity.

        • (string) --

          • (dict) --

            The value of an attribute.

            Contains information about the runtime context for a request for which an authorization decision is made.

            This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

            Note

            This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

            • boolean (boolean) --

              An attribute value of Boolean type.

              Example: {"boolean": true}

            • entityIdentifier (dict) --

              An attribute value of type EntityIdentifier.

              Example: "entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}

              • entityType (string) -- [REQUIRED]

                The type of an entity.

                Example: "entityType":"typeName"

              • entityId (string) -- [REQUIRED]

                The identifier of an entity.

                "entityId":"identifier"

            • long (integer) --

              An attribute value of Long type.

              Example: {"long": 0}

            • string (string) --

              An attribute value of String type.

              Example: {"string": "abc"}

            • set (list) --

              An attribute value of Set type.

              Example: {"set": [ {} ] }

              • (dict) --

                The value of an attribute.

                Contains information about the runtime context for a request for which an authorization decision is made.

                This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

                Note

                This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

            • record (dict) --

              An attribute value of Record type.

              Example: {"record": { "keyName": {} } }

              • (string) --

                • (dict) --

                  The value of an attribute.

                  Contains information about the runtime context for a request for which an authorization decision is made.

                  This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

                  Note

                  This is a Tagged Union structure. Only one of the following top level keys can be set: boolean, entityIdentifier, long, string, set, record, ipaddr, decimal.

            • ipaddr (string) --

              An attribute value of ipaddr type.

              Example: {"ip": "192.168.1.100"}

            • decimal (string) --

              An attribute value of decimal type.

              Example: {"decimal": "1.1"}

      • parents (list) --

        The parent entities in the hierarchy that contains the entity. A principal or resource entity can be defined with at most 99 transitive parents per authorization request.

        A transitive parent is an entity in the hierarchy of entities including all direct parents, and parents of parents. For example, a user can be a member of 91 groups if one of those groups is a member of eight groups, for a total of 100: one entity, 91 entity parents, and eight parents of parents.

        • (dict) --

          Contains the identifier of an entity, including its ID and type.

          This data type is used as a request parameter for IsAuthorized operation, and as a response parameter for the CreatePolicy, GetPolicy, and UpdatePolicy operations.

          Example: {"entityId":"string","entityType":"string"}

          • entityType (string) -- [REQUIRED]

            The type of an entity.

            Example: "entityType":"typeName"

          • entityId (string) -- [REQUIRED]

            The identifier of an entity.

            "entityId":"identifier"

rtype

dict

returns

Response Syntax

{
    'decision': 'ALLOW'|'DENY',
    'determiningPolicies': [
        {
            'policyId': 'string'
        },
    ],
    'errors': [
        {
            'errorDescription': 'string'
        },
    ],
    'principal': {
        'entityType': 'string',
        'entityId': 'string'
    }
}

Response Structure

  • (dict) --

    • decision (string) --

      An authorization decision that indicates if the authorization request should be allowed or denied.

    • determiningPolicies (list) --

      The list of determining policies used to make the authorization decision. For example, if there are multiple matching policies, where at least one is a forbid policy, then because forbid always overrides permit the forbid policies are the determining policies. If all matching policies are permit policies, then those policies are the determining policies. When no policies match and the response is the default DENY, there are no determining policies.

      • (dict) --

        Contains information about one of the policies that determined an authorization decision.

        This data type is used as an element in a response parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations.

        Example: "determiningPolicies":[{"policyId":"SPEXAMPLEabcdefg111111"}]

        • policyId (string) --

          The Id of a policy that determined to an authorization decision.

          Example: "policyId":"SPEXAMPLEabcdefg111111"

    • errors (list) --

      Errors that occurred while making an authorization decision. For example, a policy references an entity or entity attribute that does not exist in the slice.

    • principal (dict) --

      The identifier of the principal in the ID or access token.

      • entityType (string) --

        The type of an entity.

        Example: "entityType":"typeName"

      • entityId (string) --

        The identifier of an entity.

        "entityId":"identifier"