Amazon Verified Permissions

2023/06/13 - Amazon Verified Permissions - 24 new api methods

Changes  GA release of Amazon Verified Permissions.

UpdateIdentitySource (new) Link ¶

Updates the specified identity source to use a new identity provider (IdP) source, or to change the mapping of identities from the IdP to a different principal entity type.

See also: AWS API Documentation

Request Syntax

client.update_identity_source(
    policyStoreId='string',
    identitySourceId='string',
    updateConfiguration={
        'cognitoUserPoolConfiguration': {
            'userPoolArn': 'string',
            'clientIds': [
                'string',
            ]
        }
    },
    principalEntityType='string'
)
type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the ID of the policy store that contains the identity source that you want to update.

type identitySourceId

string

param identitySourceId

[REQUIRED]

Specifies the ID of the identity source that you want to update.

type updateConfiguration

dict

param updateConfiguration

[REQUIRED]

Specifies the details required to communicate with the identity provider (IdP) associated with this identity source.

Note

At this time, the only valid member of this structure is a Amazon Cognito user pool configuration.

You must specify a userPoolArn , and optionally, a ClientId .

Note

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

  • cognitoUserPoolConfiguration (dict) --

    Contains configuration details of a Amazon Cognito user pool.

    • userPoolArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the Amazon Cognito user pool associated with this identity source.

    • clientIds (list) --

      The client ID of an app client that is configured for the specified Amazon Cognito user pool.

      • (string) --

type principalEntityType

string

param principalEntityType

Specifies the data type of principals generated for identities authenticated by the identity source.

rtype

dict

returns

Response Syntax

{
    'createdDate': datetime(2015, 1, 1),
    'identitySourceId': 'string',
    'lastUpdatedDate': datetime(2015, 1, 1),
    'policyStoreId': 'string'
}

Response Structure

  • (dict) --

    • createdDate (datetime) --

      The date and time that the updated identity source was originally created.

    • identitySourceId (string) --

      The ID of the updated identity source.

    • lastUpdatedDate (datetime) --

      The date and time that the identity source was most recently updated.

    • policyStoreId (string) --

      The ID of the policy store that contains the updated identity source.

IsAuthorizedWithToken (new) Link ¶

Makes an authorization decision about a service request described in the parameters. The principal in this request comes from an external identity source. 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.

Warning

If you delete a Amazon Cognito user pool or user, tokens from that deleted pool or that deleted user continue to be usable until they expire.

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 ...'}
                }
            }
        }
    },
    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 ...'}
                        }
                    }
                },
                '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 or an IdentityToken , but not both.

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 or an IdentityToken , but not both.

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: "Context":{"<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 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.

        • 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 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.

        • 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 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.

type entities

dict

param entities

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

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.

      { "id": { "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 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.

            • 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 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.

            • 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 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.

      • parents (list) --

        The parents in the hierarchy that contains the entity.

        • (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 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 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.

      • (dict) --

        Contains a description of an evaluation error.

        This data type is used as a request parameter in the IsAuthorized and IsAuthorizedWithToken operations.

        • errorDescription (string) --

          The error description.

GetPolicyStore (new) Link ¶

Retrieves details about a policy store.

See also: AWS API Documentation

Request Syntax

client.get_policy_store(
    policyStoreId='string'
)
type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the ID of the policy store that you want information about.

rtype

dict

returns

Response Syntax

{
    'policyStoreId': 'string',
    'arn': 'string',
    'validationSettings': {
        'mode': 'OFF'|'STRICT'
    },
    'createdDate': datetime(2015, 1, 1),
    'lastUpdatedDate': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • policyStoreId (string) --

      The ID of the policy store;

    • arn (string) --

      The Amazon Resource Name (ARN) of the policy store.

    • validationSettings (dict) --

      The current validation settings for the policy store.

      • mode (string) --

        The validation mode currently configured for this policy store. The valid values are:

        • OFF – Neither Verified Permissions nor Cedar perform any validation on policies. No validation errors are reported by either service.

        • STRICT – Requires a schema to be present in the policy store. Cedar performs validation on all submitted new or updated static policies and policy templates. Any that fail validation are rejected and Cedar doesn't store them in the policy store.

        Warning

        If Mode=STRICT and the policy store doesn't contain a schema, Verified Permissions rejects all static policies and policy templates because there is no schema to validate against.

        To submit a static policy or policy template without a schema, you must turn off validation.

    • createdDate (datetime) --

      The date and time that the policy store was originally created.

    • lastUpdatedDate (datetime) --

      The date and time that the policy store was last updated.

DeletePolicyStore (new) Link ¶

Deletes the specified policy store.

This operation is idempotent. If you specify a policy store that does not exist, the request response will still return a successful HTTP 200 status code.

See also: AWS API Documentation

Request Syntax

client.delete_policy_store(
    policyStoreId='string'
)
type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the ID of the policy store that you want to delete.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

DeletePolicyTemplate (new) Link ¶

Deletes the specified policy template from the policy store.

Warning

This operation also deletes any policies that were created from the specified policy template. Those policies are immediately removed from all future API responses, and are asynchronously deleted from the policy store.

See also: AWS API Documentation

Request Syntax

client.delete_policy_template(
    policyStoreId='string',
    policyTemplateId='string'
)
type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the ID of the policy store that contains the policy template that you want to delete.

type policyTemplateId

string

param policyTemplateId

[REQUIRED]

Specifies the ID of the policy template that you want to delete.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

ListPolicyStores (new) Link ¶

Returns a paginated list of all policy stores in the calling Amazon Web Services account.

See also: AWS API Documentation

Request Syntax

client.list_policy_stores(
    nextToken='string',
    maxResults=123
)
type nextToken

string

param nextToken

Specifies that you want to receive the next page of results. Valid only if you received a NextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's NextToken response to request the next page of results.

type maxResults

integer

param maxResults

Specifies the total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the number you specify, the NextToken response element is returned with a value (not null). Include the specified value as the NextToken request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.

rtype

dict

returns

Response Syntax

{
    'nextToken': 'string',
    'policyStores': [
        {
            'policyStoreId': 'string',
            'arn': 'string',
            'createdDate': datetime(2015, 1, 1)
        },
    ]
}

Response Structure

  • (dict) --

    • nextToken (string) --

      If present, this value indicates that more output is available than is included in the current response. Use this value in the NextToken request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the NextToken response element comes back as null . This indicates that this is the last page of results.

    • policyStores (list) --

      The list of policy stores in the account.

      • (dict) --

        Contains information about a policy store.

        This data type is used as a response parameter for the ListPolicyStores operation.

        • policyStoreId (string) --

          The unique identifier of the policy store.

        • arn (string) --

          The Amazon Resource Name (ARN) of the policy store.

        • createdDate (datetime) --

          The date and time the policy was created.

UpdatePolicyStore (new) Link ¶

Modifies the validation setting for a policy store.

See also: AWS API Documentation

Request Syntax

client.update_policy_store(
    policyStoreId='string',
    validationSettings={
        'mode': 'OFF'|'STRICT'
    }
)
type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the ID of the policy store that you want to update

type validationSettings

dict

param validationSettings

[REQUIRED]

A structure that defines the validation settings that want to enable for the policy store.

  • mode (string) -- [REQUIRED]

    The validation mode currently configured for this policy store. The valid values are:

    • OFF – Neither Verified Permissions nor Cedar perform any validation on policies. No validation errors are reported by either service.

    • STRICT – Requires a schema to be present in the policy store. Cedar performs validation on all submitted new or updated static policies and policy templates. Any that fail validation are rejected and Cedar doesn't store them in the policy store.

    Warning

    If Mode=STRICT and the policy store doesn't contain a schema, Verified Permissions rejects all static policies and policy templates because there is no schema to validate against.

    To submit a static policy or policy template without a schema, you must turn off validation.

rtype

dict

returns

Response Syntax

{
    'policyStoreId': 'string',
    'arn': 'string',
    'createdDate': datetime(2015, 1, 1),
    'lastUpdatedDate': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • policyStoreId (string) --

      The ID of the updated policy store.

    • arn (string) --

      The Amazon Resource Name (ARN) of the updated policy store.

    • createdDate (datetime) --

      The date and time that the policy store was originally created.

    • lastUpdatedDate (datetime) --

      The date and time that the policy store was most recently updated.

CreateIdentitySource (new) Link ¶

Creates a reference to an Amazon Cognito user pool as an external identity provider (IdP).

After you create an identity source, you can use the identities provided by the IdP as proxies for the principal in authorization queries that use the IsAuthorizedWithToken operation. These identities take the form of tokens that contain claims about the user, such as IDs, attributes and group memberships. Amazon Cognito provides both identity tokens and access tokens, and Verified Permissions can use either or both. Any combination of identity and access tokens results in the same Cedar principal. Verified Permissions automatically translates the information about the identities into the standard Cedar attributes that can be evaluated by your policies. Because the Amazon Cognito identity and access tokens can contain different information, the tokens you choose to use determine which principal attributes are available to access when evaluating Cedar policies.

Warning

If you delete a Amazon Cognito user pool or user, tokens from that deleted pool or that deleted user continue to be usable until they expire.

Note

To reference a user from this identity source in your Cedar policies, use the following syntax.

IdentityType::"<CognitoUserPoolIdentifier>|<CognitoClientId>

Where IdentityType is the string that you provide to the PrincipalEntityType parameter for this operation. The CognitoUserPoolId and CognitoClientId are defined by the Amazon Cognito user pool.

See also: AWS API Documentation

Request Syntax

client.create_identity_source(
    clientToken='string',
    policyStoreId='string',
    configuration={
        'cognitoUserPoolConfiguration': {
            'userPoolArn': 'string',
            'clientIds': [
                'string',
            ]
        }
    },
    principalEntityType='string'
)
type clientToken

string

param clientToken

Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value..

If you don't provide this value, then Amazon Web Services generates a random one for you.

If you retry the operation with the same ClientToken , but with different parameters, the retry fails with an IdempotentParameterMismatch error.

This field is autopopulated if not provided.

type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the ID of the policy store in which you want to store this identity source. Only policies and requests made using this policy store can reference identities from the identity provider configured in the new identity source.

type configuration

dict

param configuration

[REQUIRED]

Specifies the details required to communicate with the identity provider (IdP) associated with this identity source.

Note

At this time, the only valid member of this structure is a Amazon Cognito user pool configuration.

You must specify a UserPoolArn , and optionally, a ClientId .

Note

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

  • cognitoUserPoolConfiguration (dict) --

    Contains configuration details of a Amazon Cognito user pool that Verified Permissions can use as a source of authenticated identities as entities. It specifies the Amazon Resource Name (ARN) of a Amazon Cognito user pool and one or more application client IDs.

    Example: "configuration":{"cognitoUserPoolConfiguration":{"userPoolArn":"cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5","clientIds": ["a1b2c3d4e5f6g7h8i9j0kalbmc"]}}

    • userPoolArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the Amazon Cognito user pool that contains the identities to be authorized.

      Example: "UserPoolArn": "cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5"

    • clientIds (list) --

      The unique application client IDs that are associated with the specified Amazon Cognito user pool.

      Example: "ClientIds": ["&ExampleCogClientId;"]

      • (string) --

type principalEntityType

string

param principalEntityType

Specifies the namespace and data type of the principals generated for identities authenticated by the new identity source.

rtype

dict

returns

Response Syntax

{
    'createdDate': datetime(2015, 1, 1),
    'identitySourceId': 'string',
    'lastUpdatedDate': datetime(2015, 1, 1),
    'policyStoreId': 'string'
}

Response Structure

  • (dict) --

    • createdDate (datetime) --

      The date and time the identity source was originally created.

    • identitySourceId (string) --

      The unique ID of the new identity source.

    • lastUpdatedDate (datetime) --

      The date and time the identity source was most recently updated.

    • policyStoreId (string) --

      The ID of the policy store that contains the identity source.

CreatePolicyTemplate (new) Link ¶

Creates a policy template. A template can use placeholders for the principal and resource. A template must be instantiated into a policy by associating it with specific principals and resources to use for the placeholders. That instantiated policy can then be considered in authorization decisions. The instantiated policy works identically to any other policy, except that it is dynamically linked to the template. If the template changes, then any policies that are linked to that template are immediately updated as well.

See also: AWS API Documentation

Request Syntax

client.create_policy_template(
    clientToken='string',
    policyStoreId='string',
    description='string',
    statement='string'
)
type clientToken

string

param clientToken

Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value..

If you don't provide this value, then Amazon Web Services generates a random one for you.

If you retry the operation with the same ClientToken , but with different parameters, the retry fails with an IdempotentParameterMismatch error.

This field is autopopulated if not provided.

type policyStoreId

string

param policyStoreId

[REQUIRED]

The ID of the policy store in which to create the policy template.

type description

string

param description

Specifies a description for the policy template.

type statement

string

param statement

[REQUIRED]

Specifies the content that you want to use for the new policy template, written in the Cedar policy language.

rtype

dict

returns

Response Syntax

{
    'policyStoreId': 'string',
    'policyTemplateId': 'string',
    'createdDate': datetime(2015, 1, 1),
    'lastUpdatedDate': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • policyStoreId (string) --

      The ID of the policy store that contains the policy template.

    • policyTemplateId (string) --

      The unique ID of the new policy template.

    • createdDate (datetime) --

      The date and time the policy template was originally created.

    • lastUpdatedDate (datetime) --

      The date and time the policy template was most recently updated.

DeleteIdentitySource (new) Link ¶

Deletes an identity source that references an identity provider (IdP) such as Amazon Cognito. After you delete the identity source, you can no longer use tokens for identities from that identity source to represent principals in authorization queries made using IsAuthorizedWithToken. operations.

See also: AWS API Documentation

Request Syntax

client.delete_identity_source(
    policyStoreId='string',
    identitySourceId='string'
)
type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the ID of the policy store that contains the identity source that you want to delete.

type identitySourceId

string

param identitySourceId

[REQUIRED]

Specifies the ID of the identity source that you want to delete.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

GetIdentitySource (new) Link ¶

Retrieves the details about the specified identity source.

See also: AWS API Documentation

Request Syntax

client.get_identity_source(
    policyStoreId='string',
    identitySourceId='string'
)
type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the ID of the policy store that contains the identity source you want information about.

type identitySourceId

string

param identitySourceId

[REQUIRED]

Specifies the ID of the identity source you want information about.

rtype

dict

returns

Response Syntax

{
    'createdDate': datetime(2015, 1, 1),
    'details': {
        'clientIds': [
            'string',
        ],
        'userPoolArn': 'string',
        'discoveryUrl': 'string',
        'openIdIssuer': 'COGNITO'
    },
    'identitySourceId': 'string',
    'lastUpdatedDate': datetime(2015, 1, 1),
    'policyStoreId': 'string',
    'principalEntityType': 'string'
}

Response Structure

  • (dict) --

    • createdDate (datetime) --

      The date and time that the identity source was originally created.

    • details (dict) --

      A structure that describes the configuration of the identity source.

      • clientIds (list) --

        The application client IDs associated with the specified Amazon Cognito user pool that are enabled for this identity source.

        • (string) --

      • userPoolArn (string) --

        The Amazon Resource Name (ARN) of the Amazon Cognito user pool whose identities are accessible to this Verified Permissions policy store.

      • discoveryUrl (string) --

        The well-known URL that points to this user pool's OIDC discovery endpoint. This is a URL string in the following format. This URL replaces the placeholders for both the Amazon Web Services Region and the user pool identifier with those appropriate for this user pool.

        https://cognito-idp.<region>.amazonaws.com/<user-pool-id>/.well-known/openid-configuration

      • openIdIssuer (string) --

        A string that identifies the type of OIDC service represented by this identity source.

        At this time, the only valid value is cognito .

    • identitySourceId (string) --

      The ID of the identity source.

    • lastUpdatedDate (datetime) --

      The date and time that the identity source was most recently updated.

    • policyStoreId (string) --

      The ID of the policy store that contains the identity source.

    • principalEntityType (string) --

      The data type of principals generated for identities authenticated by this identity source.

CreatePolicy (new) Link ¶

Creates a Cedar policy and saves it in the specified policy store. You can create either a static policy or a policy linked to a policy template.

  • To create a static policy, provide the Cedar policy text in the StaticPolicy section of the PolicyDefinition .

  • To create a policy that is dynamically linked to a policy template, specify the policy template ID and the principal and resource to associate with this policy in the templateLinked section of the PolicyDefinition . If the policy template is ever updated, any policies linked to the policy template automatically use the updated template.

Note

Creating a policy causes it to be validated against the schema in the policy store. If the policy doesn't pass validation, the operation fails and the policy isn't stored.

See also: AWS API Documentation

Request Syntax

client.create_policy(
    clientToken='string',
    policyStoreId='string',
    definition={
        'static': {
            'description': 'string',
            'statement': 'string'
        },
        'templateLinked': {
            'policyTemplateId': 'string',
            'principal': {
                'entityType': 'string',
                'entityId': 'string'
            },
            'resource': {
                'entityType': 'string',
                'entityId': 'string'
            }
        }
    }
)
type clientToken

string

param clientToken

Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value..

If you don't provide this value, then Amazon Web Services generates a random one for you.

If you retry the operation with the same ClientToken , but with different parameters, the retry fails with an IdempotentParameterMismatch error.

This field is autopopulated if not provided.

type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the PolicyStoreId of the policy store you want to store the policy in.

type definition

dict

param definition

[REQUIRED]

A structure that specifies the policy type and content to use for the new policy. You must include either a static or a templateLinked element. The policy content must be written in the Cedar policy language.

Note

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

  • static (dict) --

    A structure that describes a static policy. An static policy doesn't use a template or allow placeholders for entities.

    • description (string) --

      The description of the static policy.

    • statement (string) -- [REQUIRED]

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

  • templateLinked (dict) --

    A structure that describes a policy that was instantiated from a template. The template can specify placeholders for principal and resource . When you use CreatePolicy to create a policy from a template, you specify the exact principal and resource to use for the instantiated policy.

    • policyTemplateId (string) -- [REQUIRED]

      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) -- [REQUIRED]

        The type of an entity.

        Example: "entityType":"typeName"

      • entityId (string) -- [REQUIRED]

        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) -- [REQUIRED]

        The type of an entity.

        Example: "entityType":"typeName"

      • entityId (string) -- [REQUIRED]

        The identifier of an entity.

        "entityId":"identifier"

rtype

dict

returns

Response Syntax

{
    'policyStoreId': 'string',
    'policyId': 'string',
    'policyType': 'STATIC'|'TEMPLATE_LINKED',
    'principal': {
        'entityType': 'string',
        'entityId': 'string'
    },
    'resource': {
        'entityType': 'string',
        'entityId': 'string'
    },
    'createdDate': datetime(2015, 1, 1),
    'lastUpdatedDate': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • policyStoreId (string) --

      The ID of the policy store that contains the new policy.

    • policyId (string) --

      The unique ID of the new policy.

    • policyType (string) --

      The policy type of the new policy.

    • principal (dict) --

      The principal specified in the new policy's scope. This response element isn't present when principal isn't specified in the policy content.

      • entityType (string) --

        The type of an entity.

        Example: "entityType":"typeName"

      • entityId (string) --

        The identifier of an entity.

        "entityId":"identifier"

    • resource (dict) --

      The resource specified in the new policy's scope. This response element isn't present when the resource isn't specified in the policy content.

      • 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 originally created.

    • lastUpdatedDate (datetime) --

      The date and time the policy was last updated.

GetPolicy (new) Link ¶

Retrieves information about the specified policy.

See also: AWS API Documentation

Request Syntax

client.get_policy(
    policyStoreId='string',
    policyId='string'
)
type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the ID of the policy store that contains the policy that you want information about.

type policyId

string

param policyId

[REQUIRED]

Specifies the ID of the policy you want information about.

rtype

dict

returns

Response Syntax

{
    'policyStoreId': 'string',
    'policyId': 'string',
    'policyType': 'STATIC'|'TEMPLATE_LINKED',
    'principal': {
        'entityType': 'string',
        'entityId': 'string'
    },
    'resource': {
        'entityType': 'string',
        'entityId': 'string'
    },
    '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)
}

Response Structure

  • (dict) --

    • policyStoreId (string) --

      The ID of the policy store that contains the policy that you want information about.

    • policyId (string) --

      The unique ID of the policy that you want information about.

    • policyType (string) --

      The type of the policy.

    • principal (dict) --

      The principal specified in the policy's scope. This element isn't included in the response when Principal isn't present in the policy content.

      • entityType (string) --

        The type of an entity.

        Example: "entityType":"typeName"

      • entityId (string) --

        The identifier of an entity.

        "entityId":"identifier"

    • resource (dict) --

      The resource specified in the policy's scope. This element isn't included in the response when Resource isn't present in the policy content.

      • entityType (string) --

        The type of an entity.

        Example: "entityType":"typeName"

      • entityId (string) --

        The identifier of an entity.

        "entityId":"identifier"

    • definition (dict) --

      The definition of the requested policy.

      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 that the policy was originally created.

    • lastUpdatedDate (datetime) --

      The date and time that the policy was last updated.

GetPolicyTemplate (new) Link ¶

Retrieve the details for the specified policy template in the specified policy store.

See also: AWS API Documentation

Request Syntax

client.get_policy_template(
    policyStoreId='string',
    policyTemplateId='string'
)
type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the ID of the policy store that contains the policy template that you want information about.

type policyTemplateId

string

param policyTemplateId

[REQUIRED]

Specifies the ID of the policy template that you want information about.

rtype

dict

returns

Response Syntax

{
    'policyStoreId': 'string',
    'policyTemplateId': 'string',
    'description': 'string',
    'statement': 'string',
    'createdDate': datetime(2015, 1, 1),
    'lastUpdatedDate': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • policyStoreId (string) --

      The ID of the policy store that contains the policy template.

    • policyTemplateId (string) --

      The ID of the policy template.

    • description (string) --

      The description of the policy template.

    • statement (string) --

      The content of the body of the policy template written in the Cedar policy language.

    • createdDate (datetime) --

      The date and time that the policy template was originally created.

    • lastUpdatedDate (datetime) --

      The date and time that the policy template was most recently updated.

ListPolicies (new) Link ¶

Returns a paginated list of all policies stored in the specified policy store.

See also: AWS API Documentation

Request Syntax

client.list_policies(
    policyStoreId='string',
    nextToken='string',
    maxResults=123,
    filter={
        'principal': {
            'unspecified': True|False,
            'identifier': {
                'entityType': 'string',
                'entityId': 'string'
            }
        },
        'resource': {
            'unspecified': True|False,
            'identifier': {
                'entityType': 'string',
                'entityId': 'string'
            }
        },
        'policyType': 'STATIC'|'TEMPLATE_LINKED',
        'policyTemplateId': 'string'
    }
)
type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the ID of the policy store you want to list policies from.

type nextToken

string

param nextToken

Specifies that you want to receive the next page of results. Valid only if you received a NextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's NextToken response to request the next page of results.

type maxResults

integer

param maxResults

Specifies the total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the number you specify, the NextToken response element is returned with a value (not null). Include the specified value as the NextToken request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.

type filter

dict

param filter

Specifies a filter that limits the response to only policies that match the specified criteria. For example, you list only the policies that reference a specified principal.

  • principal (dict) --

    Filters the output to only policies that reference the specified principal.

    Note

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

    • unspecified (boolean) --

      Used to indicate that a principal or resource is not specified. This can be used to search for policies that are not associated with a specific principal or resource.

    • identifier (dict) --

      The identifier of the entity. It can consist of either an EntityType and EntityId, a principal, or a resource.

      • entityType (string) -- [REQUIRED]

        The type of an entity.

        Example: "entityType":"typeName"

      • entityId (string) -- [REQUIRED]

        The identifier of an entity.

        "entityId":"identifier"

  • resource (dict) --

    Filters the output to only policies that reference the specified resource.

    Note

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

    • unspecified (boolean) --

      Used to indicate that a principal or resource is not specified. This can be used to search for policies that are not associated with a specific principal or resource.

    • identifier (dict) --

      The identifier of the entity. It can consist of either an EntityType and EntityId, a principal, or a resource.

      • entityType (string) -- [REQUIRED]

        The type of an entity.

        Example: "entityType":"typeName"

      • entityId (string) -- [REQUIRED]

        The identifier of an entity.

        "entityId":"identifier"

  • policyType (string) --

    Filters the output to only policies of the specified type.

  • policyTemplateId (string) --

    Filters the output to only template-linked policies that were instantiated from the specified policy template.

rtype

dict

returns

Response Syntax

{
    'nextToken': 'string',
    'policies': [
        {
            'policyStoreId': 'string',
            'policyId': 'string',
            'policyType': 'STATIC'|'TEMPLATE_LINKED',
            'principal': {
                'entityType': 'string',
                'entityId': 'string'
            },
            'resource': {
                'entityType': 'string',
                'entityId': 'string'
            },
            'definition': {
                'static': {
                    'description': 'string'
                },
                'templateLinked': {
                    'policyTemplateId': 'string',
                    'principal': {
                        'entityType': 'string',
                        'entityId': 'string'
                    },
                    'resource': {
                        'entityType': 'string',
                        'entityId': 'string'
                    }
                }
            },
            'createdDate': datetime(2015, 1, 1),
            'lastUpdatedDate': datetime(2015, 1, 1)
        },
    ]
}

Response Structure

  • (dict) --

    • nextToken (string) --

      If present, this value indicates that more output is available than is included in the current response. Use this value in the NextToken request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the NextToken response element comes back as null . This indicates that this is the last page of results.

    • policies (list) --

      Lists all policies that are available in the specified policy store.

      • (dict) --

        Contains information about a policy.

        This data type is used as a response parameter for the ListPolicies operation.

        • policyStoreId (string) --

          The identifier of the PolicyStore 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

          • templateLinked

        • principal (dict) --

          The principal associated with the policy.

          • 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 the policy.

          • entityType (string) --

            The type of an entity.

            Example: "entityType":"typeName"

          • entityId (string) --

            The identifier of an entity.

            "entityId":"identifier"

        • 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.

          • 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.

IsAuthorized (new) Link ¶

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 ...'}
                }
            }
        }
    },
    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 ...'}
                        }
                    }
                },
                '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: "Context":{"<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 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.

        • 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 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.

        • 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 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.

type entities

dict

param entities

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

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.

      { "id": { "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 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.

            • 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 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.

            • 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 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.

      • parents (list) --

        The parents in the hierarchy that contains the entity.

        • (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 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.

      • (dict) --

        Contains a description of an evaluation error.

        This data type is used as a request parameter in the IsAuthorized and IsAuthorizedWithToken operations.

        • errorDescription (string) --

          The error description.

ListIdentitySources (new) Link ¶

Returns a paginated list of all of the identity sources defined in the specified policy store.

See also: AWS API Documentation

Request Syntax

client.list_identity_sources(
    policyStoreId='string',
    nextToken='string',
    maxResults=123,
    filters=[
        {
            'principalEntityType': 'string'
        },
    ]
)
type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the ID of the policy store that contains the identity sources that you want to list.

type nextToken

string

param nextToken

Specifies that you want to receive the next page of results. Valid only if you received a NextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's NextToken response to request the next page of results.

type maxResults

integer

param maxResults

Specifies the total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the number you specify, the NextToken response element is returned with a value (not null). Include the specified value as the NextToken request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.

type filters

list

param filters

Specifies characteristics of an identity source that you can use to limit the output to matching identity sources.

  • (dict) --

    A structure that defines characteristics of an identity source that you can use to filter.

    This data type is used as a request parameter for the ListIdentityStores operation.

    • principalEntityType (string) --

      The Cedar entity type of the principals returned by the identity provider (IdP) associated with this identity source.

rtype

dict

returns

Response Syntax

{
    'nextToken': 'string',
    'identitySources': [
        {
            'createdDate': datetime(2015, 1, 1),
            'details': {
                'clientIds': [
                    'string',
                ],
                'userPoolArn': 'string',
                'discoveryUrl': 'string',
                'openIdIssuer': 'COGNITO'
            },
            'identitySourceId': 'string',
            'lastUpdatedDate': datetime(2015, 1, 1),
            'policyStoreId': 'string',
            'principalEntityType': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • nextToken (string) --

      If present, this value indicates that more output is available than is included in the current response. Use this value in the NextToken request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the NextToken response element comes back as null . This indicates that this is the last page of results.

    • identitySources (list) --

      The list of identity sources stored in the specified policy store.

      • (dict) --

        A structure that defines an identity source.

        This data type is used as a request parameter for the ListIdentityStores operation.

        • createdDate (datetime) --

          The date and time the identity source was originally created.

        • details (dict) --

          A structure that contains the details of the associated identity provider (IdP).

          • clientIds (list) --

            The application client IDs associated with the specified Amazon Cognito user pool that are enabled for this identity source.

            • (string) --

          • userPoolArn (string) --

            The Amazon Cognito user pool whose identities are accessible to this Verified Permissions policy store.

          • discoveryUrl (string) --

            The well-known URL that points to this user pool's OIDC discovery endpoint. This is a URL string in the following format. This URL replaces the placeholders for both the Amazon Web Services Region and the user pool identifier with those appropriate for this user pool.

            https://cognito-idp.<region>.amazonaws.com/<user-pool-id>/.well-known/openid-configuration

          • openIdIssuer (string) --

            A string that identifies the type of OIDC service represented by this identity source.

            At this time, the only valid value is cognito .

        • identitySourceId (string) --

          The unique identifier of the identity source.

        • lastUpdatedDate (datetime) --

          The date and time the identity source was most recently updated.

        • policyStoreId (string) --

          The identifier of the policy store that contains the identity source.

        • principalEntityType (string) --

          The Cedar entity type of the principals returned from the IdP associated with this identity source.

CreatePolicyStore (new) Link ¶

Creates a policy store. A policy store is a container for policy resources.

See also: AWS API Documentation

Request Syntax

client.create_policy_store(
    clientToken='string',
    validationSettings={
        'mode': 'OFF'|'STRICT'
    }
)
type clientToken

string

param clientToken

Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value..

If you don't provide this value, then Amazon Web Services generates a random one for you.

If you retry the operation with the same ClientToken , but with different parameters, the retry fails with an IdempotentParameterMismatch error.

This field is autopopulated if not provided.

type validationSettings

dict

param validationSettings

[REQUIRED]

Specifies the validation setting for this policy store.

Currently, the only valid and required value is Mode .

Warning

We recommend that you turn on STRICT mode only after you define a schema. If a schema doesn't exist, then STRICT mode causes any policy to fail validation, and Verified Permissions rejects the policy. You can turn off validation by using the UpdatePolicyStore. Then, when you have a schema defined, use UpdatePolicyStore again to turn validation back on.

  • mode (string) -- [REQUIRED]

    The validation mode currently configured for this policy store. The valid values are:

    • OFF – Neither Verified Permissions nor Cedar perform any validation on policies. No validation errors are reported by either service.

    • STRICT – Requires a schema to be present in the policy store. Cedar performs validation on all submitted new or updated static policies and policy templates. Any that fail validation are rejected and Cedar doesn't store them in the policy store.

    Warning

    If Mode=STRICT and the policy store doesn't contain a schema, Verified Permissions rejects all static policies and policy templates because there is no schema to validate against.

    To submit a static policy or policy template without a schema, you must turn off validation.

rtype

dict

returns

Response Syntax

{
    'policyStoreId': 'string',
    'arn': 'string',
    'createdDate': datetime(2015, 1, 1),
    'lastUpdatedDate': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • policyStoreId (string) --

      The unique ID of the new policy store.

    • arn (string) --

      The Amazon Resource Name (ARN) of the new policy store.

    • createdDate (datetime) --

      The date and time the policy store was originally created.

    • lastUpdatedDate (datetime) --

      The date and time the policy store was last updated.

PutSchema (new) Link ¶

Creates or updates the policy schema in the specified policy store. The schema is used to validate any Cedar policies and policy templates submitted to the policy store. Any changes to the schema validate only policies and templates submitted after the schema change. Existing policies and templates are not re-evaluated against the changed schema. If you later update a policy, then it is evaluated against the new schema at that time.

See also: AWS API Documentation

Request Syntax

client.put_schema(
    policyStoreId='string',
    definition={
        'cedarJson': 'string'
    }
)
type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the ID of the policy store in which to place the schema.

type definition

dict

param definition

[REQUIRED]

Specifies the definition of the schema to be stored. The schema definition must be written in Cedar schema JSON.

Note

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

  • cedarJson (string) --

    A JSON string representation of the schema supported by applications that use this policy store. For more information, see Policy store schema in the Amazon Verified Permissions User Guide .

rtype

dict

returns

Response Syntax

{
    'policyStoreId': 'string',
    'namespaces': [
        'string',
    ],
    'createdDate': datetime(2015, 1, 1),
    'lastUpdatedDate': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • policyStoreId (string) --

      The unique ID of the policy store that contains the schema.

    • namespaces (list) --

      Identifies the namespaces of the entities referenced by this schema.

      • (string) --

    • createdDate (datetime) --

      The date and time that the schema was originally created.

    • lastUpdatedDate (datetime) --

      The date and time that the schema was last updated.

UpdatePolicyTemplate (new) Link ¶

Updates the specified policy template. You can update only the description and the some elements of the policyBody.

Warning

Changes you make to the policy template content are immediately reflected in authorization decisions that involve all template-linked policies instantiated from this template.

See also: AWS API Documentation

Request Syntax

client.update_policy_template(
    policyStoreId='string',
    policyTemplateId='string',
    description='string',
    statement='string'
)
type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the ID of the policy store that contains the policy template that you want to update.

type policyTemplateId

string

param policyTemplateId

[REQUIRED]

Specifies the ID of the policy template that you want to update.

type description

string

param description

Specifies a new description to apply to the policy template.

type statement

string

param statement

[REQUIRED]

Specifies new statement content written in Cedar policy language to replace the current body of the policy template.

You can change only the following elements of the policy body:

  • The action referenced by the policy template.

  • Any conditional clauses, such as when or unless clauses.

You can't change the following elements:

  • The effect ( permit or forbid ) of the policy template.

  • The principal referenced by the policy template.

  • The resource referenced by the policy template.

rtype

dict

returns

Response Syntax

{
    'policyStoreId': 'string',
    'policyTemplateId': 'string',
    'createdDate': datetime(2015, 1, 1),
    'lastUpdatedDate': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • policyStoreId (string) --

      The ID of the policy store that contains the updated policy template.

    • policyTemplateId (string) --

      The ID of the updated policy template.

    • createdDate (datetime) --

      The date and time that the policy template was originally created.

    • lastUpdatedDate (datetime) --

      The date and time that the policy template was most recently updated.

UpdatePolicy (new) Link ¶

Modifies a Cedar static policy in the specified policy store. You can change only certain elements of the UpdatePolicyDefinition parameter. You can directly update only static policies. To change a template-linked policy, you must update the template instead, using UpdatePolicyTemplate.

Note

If policy validation is enabled in the policy store, then updating a static policy causes Verified Permissions to validate the policy against the schema in the policy store. If the updated static policy doesn't pass validation, the operation fails and the update isn't stored.

See also: AWS API Documentation

Request Syntax

client.update_policy(
    policyStoreId='string',
    policyId='string',
    definition={
        'static': {
            'description': 'string',
            'statement': 'string'
        }
    }
)
type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the ID of the policy store that contains the policy that you want to update.

type policyId

string

param policyId

[REQUIRED]

Specifies the ID of the policy that you want to update. To find this value, you can use ListPolicies.

type definition

dict

param definition

[REQUIRED]

Specifies the updated policy content that you want to replace on the specified policy. The content must be valid Cedar policy language text.

You can change only the following elements from the policy definition:

  • The action referenced by the policy.

  • Any conditional clauses, such as when or unless clauses.

You can't change the following elements:

  • Changing from static to templateLinked .

  • Changing the effect of the policy from permit or forbid .

  • The principal referenced by the policy.

  • The resource referenced by the policy.

Note

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

  • static (dict) --

    Contains details about the updates to be applied to a static policy.

    • description (string) --

      Specifies the description to be added to or replaced on the static policy.

    • statement (string) -- [REQUIRED]

      Specifies the Cedar policy language text to be added to or replaced on the static policy.

      Warning

      You can change only the following elements from the original content:

      • The action referenced by the policy.

      • Any conditional clauses, such as when or unless clauses.

      You can't change the following elements:

      • Changing from StaticPolicy to TemplateLinkedPolicy .

      • The effect ( permit or forbid ) of the policy.

      • The principal referenced by the policy.

      • The resource referenced by the policy.

rtype

dict

returns

Response Syntax

{
    'policyStoreId': 'string',
    'policyId': 'string',
    'policyType': 'STATIC'|'TEMPLATE_LINKED',
    'principal': {
        'entityType': 'string',
        'entityId': 'string'
    },
    'resource': {
        'entityType': 'string',
        'entityId': 'string'
    },
    'createdDate': datetime(2015, 1, 1),
    'lastUpdatedDate': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • policyStoreId (string) --

      The ID of the policy store that contains the policy that was updated.

    • policyId (string) --

      The ID of the policy that was updated.

    • policyType (string) --

      The type of the policy that was updated.

    • principal (dict) --

      The principal specified in the policy's scope. This element isn't included in the response when Principal isn't present in the policy content.

      • entityType (string) --

        The type of an entity.

        Example: "entityType":"typeName"

      • entityId (string) --

        The identifier of an entity.

        "entityId":"identifier"

    • resource (dict) --

      The resource specified in the policy's scope. This element isn't included in the response when Resource isn't present in the policy content.

      • 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 that the policy was originally created.

    • lastUpdatedDate (datetime) --

      The date and time that the policy was most recently updated.

DeletePolicy (new) Link ¶

Deletes the specified policy from the policy store.

This operation is idempotent; if you specify a policy that doesn't exist, the request response returns a successful HTTP 200 status code.

See also: AWS API Documentation

Request Syntax

client.delete_policy(
    policyStoreId='string',
    policyId='string'
)
type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the ID of the policy store that contains the policy that you want to delete.

type policyId

string

param policyId

[REQUIRED]

Specifies the ID of the policy that you want to delete.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

GetSchema (new) Link ¶

Retrieve the details for the specified schema in the specified policy store.

See also: AWS API Documentation

Request Syntax

client.get_schema(
    policyStoreId='string'
)
type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the ID of the policy store that contains the schema.

rtype

dict

returns

Response Syntax

{
    'policyStoreId': 'string',
    'schema': 'string',
    'createdDate': datetime(2015, 1, 1),
    'lastUpdatedDate': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • policyStoreId (string) --

      The ID of the policy store that contains the schema.

    • schema (string) --

      The body of the schema, written in Cedar schema JSON.

    • createdDate (datetime) --

      The date and time that the schema was originally created.

    • lastUpdatedDate (datetime) --

      The date and time that the schema was most recently updated.

ListPolicyTemplates (new) Link ¶

Returns a paginated list of all policy templates in the specified policy store.

See also: AWS API Documentation

Request Syntax

client.list_policy_templates(
    policyStoreId='string',
    nextToken='string',
    maxResults=123
)
type policyStoreId

string

param policyStoreId

[REQUIRED]

Specifies the ID of the policy store that contains the policy templates you want to list.

type nextToken

string

param nextToken

Specifies that you want to receive the next page of results. Valid only if you received a NextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's NextToken response to request the next page of results.

type maxResults

integer

param maxResults

Specifies the total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the number you specify, the NextToken response element is returned with a value (not null). Include the specified value as the NextToken request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.

rtype

dict

returns

Response Syntax

{
    'nextToken': 'string',
    'policyTemplates': [
        {
            'policyStoreId': 'string',
            'policyTemplateId': 'string',
            'description': 'string',
            'createdDate': datetime(2015, 1, 1),
            'lastUpdatedDate': datetime(2015, 1, 1)
        },
    ]
}

Response Structure

  • (dict) --

    • nextToken (string) --

      If present, this value indicates that more output is available than is included in the current response. Use this value in the NextToken request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the NextToken response element comes back as null . This indicates that this is the last page of results.

    • policyTemplates (list) --

      The list of the policy templates in the specified policy store.

      • (dict) --

        Contains details about a policy template

        This data type is used as a response parameter for the ListPolicyTemplates operation.

        • policyStoreId (string) --

          The unique identifier of the policy store that contains the template.

        • policyTemplateId (string) --

          The unique identifier of the policy template.

        • description (string) --

          The description attached to the policy template.

        • createdDate (datetime) --

          The date and time that the policy template was created.

        • lastUpdatedDate (datetime) --

          The date and time that the policy template was most recently updated.