id
stringlengths
8
78
source
stringclasses
743 values
chunk_id
int64
1
5.05k
text
stringlengths
593
49.7k
amazon-s3-encryption-client-006
amazon-s3-encryption-client.pdf
6
Amazon S3 Encryption Client automatically configures a keyring based on the wrapping key type with default settings and a default cryptographic materials manager (CMM). If you want to customize your client, you can also manually configure your keyring. Note If you use Raw RSA or Raw AES-GCM wrapping keys, you are responsible for generating, storing, and protecting the key material, preferably in a hardware security module (HSM) or key management system. The following examples instantiate the Amazon S3 Encryption Client with the default decryption mode. This means that all objects will be decrypted using the fully supported buffered decryption mode. For more information, see Decryption modes (Version 3.x and later). Topics • AWS KMS wrapping key • Raw AES wrapping key • Raw RSA wrapping key • Manually instantiate the client AWS KMS wrapping key To specify a KMS key as your wrapping key, instantiate your client with the kmsKeyId builder parameter. Examples 14 Amazon S3 Encryption Client Developer Guide To use a KMS key as your wrapping key, you need kms:GenerateDataKey and kms:Decrypt permissions on the KMS key. The value of the kmsKeyId parameter can be any valid KMS key identifier. For details, see Key identifiers in the AWS Key Management Service Developer Guide. // v3 class v3KMSKeyExample { public static void main(String[] args) { S3Client v3Client = S3EncryptionClient.builder() .kmsKeyId(kmsKeyId) .build(); } } Raw AES wrapping key To specify a Raw AES key (javax.crypto.SecretKey) as your wrapping key, instantiate your client with the aesKey builder parameter. // v3 class v3AESKeyExample { public static void main(String[] args) { S3Client v3Client = S3EncryptionClient.builder() .aesKey(aesKey) .build(); } } Raw RSA wrapping key To specify a Raw RSA key (java.security.KeyPair) as your wrapping key, instantiate your client with the rsaKeyPair builder parameter. You can specify an entire RSA key pair or a partial RSA key pair. The value of the rsaKeyPair parameter must include both the public and private keys in the key pair to perform both encrypt and decrypt operations. You can specify the public key to enable the Amazon S3 Encryption Client to perform encrypt operations, or the private key to enable decrypt operations as needed. By specifying a partial key pair you can limit the exposure of your keys. For examples using a partial key pair, see the amazon-s3-encryption-client-java GitHub repository. Examples 15 Amazon S3 Encryption Client RSA key pair Developer Guide To instantiate version 3.x of the client to perform both encrypt and decrypt operations, specify both the public and private keys of your key pair. // v3 class v3RSAKeyPairExample { public static void main(String[] args) { S3Client v3Client = S3EncryptionClient.builder() .rsaKeyPair(rsaKeyPair) .build(); } } Public key To instantiate the client to encrypt only, specify the public key. If you specify the public key alone, all GetObject calls will fail because the private key is required to decrypt. // v3 class v3RSAKeyPairExample { public static void main(String[] args) { S3Client v3Client = S3EncryptionClient.builder() .rsaKeyPair(new PartialRsaKeyPair(null, rsaKeyPair.getPublic())) .build(); } } Private key To instantiate the client to decrypt only, specify the private key. If you specify the private key alone, all PutObject calls will fail because the public key is required to encrypt. // v3 class v3RSAKeyPairExample { public static void main(String[] args) { S3Client v3Client = S3EncryptionClient.builder() .rsaKeyPair(new PartialRsaKeyPair(rsaKeyPair.getPrivate(), null)) .build(); Examples 16 Amazon S3 Encryption Client Developer Guide } } Manually instantiate the client If you want to customize your client, you can manually configure your own keyring and cryptographic materials manager (CMM). The following example manually configures an AWS KMS keyring using a symmetric encryption AWS KMS wrapping key and passes the custom AWS KMS client to the Amazon S3 Encryption Client. // v3 class v3CustomKeyringExample { public static void main(String[] args) { KmsKeyring keyring = KmsKeyring.builder() .wrappingKeyId(KMS_KEY_ID) .kmsClient(customKmsClient) .build(); CryptographicMaterialsManager cmm = DefaultCryptoMaterialsManager.builder() .keyring(keyring) .build(); S3Client v3Client = S3EncryptionClient.builder() .cryptoMaterialsManager(cmm) .build(); } } Encrypting and decrypting Amazon S3 objects The following example shows you how to use the Amazon S3 Encryption Client for Java to encrypt and decrypt Amazon S3 objects. This example uses a Raw RSA wrapping key and instantiates the Amazon S3 Encryption Client with the default decryption mode. 1. Specify your wrapping key by passing it to the Amazon S3 Encryption Client when you instantiate your client. The Amazon S3 Encryption Client for Java automatically configures a keyring based on the wrapping key you specify. // v3 Examples 17 Amazon S3 Encryption Client Developer Guide class v3RSAKeyPairExample { public static void main(String[] args) { S3Client v3Client = S3EncryptionClient.builder() .rsaKeyPair(rsaKeyPair) .build(); } } 2. Encrypt your plaintext object by calling PutObject. a. The Amazon S3 Encryption Client provides the encryption materials: one plaintext data key and one copy of that data key encrypted by your wrapping key. b. The Amazon S3 Encryption Client uses the plaintext data key to encrypt your object, and then
amazon-s3-encryption-client-007
amazon-s3-encryption-client.pdf
7
you instantiate your client. The Amazon S3 Encryption Client for Java automatically configures a keyring based on the wrapping key you specify. // v3 Examples 17 Amazon S3 Encryption Client Developer Guide class v3RSAKeyPairExample { public static void main(String[] args) { S3Client v3Client = S3EncryptionClient.builder() .rsaKeyPair(rsaKeyPair) .build(); } } 2. Encrypt your plaintext object by calling PutObject. a. The Amazon S3 Encryption Client provides the encryption materials: one plaintext data key and one copy of that data key encrypted by your wrapping key. b. The Amazon S3 Encryption Client uses the plaintext data key to encrypt your object, and then discards the plaintext data key. c. The Amazon S3 Encryption Client uploads the encrypted data key and the encrypted object to Amazon S3 as part of the PutObject call. // v3 class v3EncryptExample { public static void main(String[] args) { s3Client.putObject(PutObjectRequest.builder() .bucket(bucket) .key(objectKey) .build(), RequestBody.fromString(objectContent)); } } 3. Decrypt your encrypted object by calling GetObject. a. The Amazon S3 Encryption Client uses your wrapping key to decrypt the encrypted data key. b. The Amazon S3 Encryption Client uses the plaintext data key to decrypt the object, discards the plaintext data key, and returns the plaintext object as part of the GetObject call. // v3 Examples 18 Amazon S3 Encryption Client Developer Guide class v3DecryptExample { public static void main(String[] args) { ResponseBytes<GetObjectResponse> objectResponse = s3Client.getObjectAsBytes(builder -> builder .bucket(bucket) .key(objectKey)); String output = objectResponse.asUtf8String(); } } Note The default decryption mode cannot decrypt objects larger than 64 MB. This decryption mode automatically buffers stream contents into memory to prevent the release of unauthenticated objects. If you attempt to decrypt an object larger than 64 MB, you will receive an exception directing you to enable the delayed authentication decryption mode. For more information, see Decryption modes. 4. Optional: verify that the decrypted object matches the original plaintext object that you uploaded. assert output.equals(objectContent); 5. The Amazon S3 Encryption Client implements the AutoClosable interface, which automatically calls close() when you exit a try-with-resources block for which the object has been declared in the resource specification header. As a best practice, you should either use try-with-resources or explicitly call the close() method. s3Client.close(); Ranged GET requests With Amazon S3, you can download a specific part of an object by performing a ranged GET request. In version 3.x of the Amazon S3 Encryption Client, you must explicitly enable the unauthenticated legacy decryption mode to perform ranged requests. By default, version 3.x of the Amazon S3 Encryption Client encrypts and decrypts your objects using the AES-GCM algorithm suite. However, you can enable it to use the legacy AES-CTR algorithm to partially decrypt your object during a ranged GET request. The Amazon S3 Encryption Examples 19 Amazon S3 Encryption Client Developer Guide Client cannot use AES-GCM for ranged gets because it is an authenticated scheme that appends an authentication tag to the encrypted object. When you request a partial object, the client cannot read the entire object stream to reach the authenticated tag. This means that the partial object is not authenticated. Specifying a range You can include the Range parameter in your GetObject request to download and decrypt a specific byte-range from an object. The start and end indices of the byte range are included in the partial object. The byte-range you specify should reflect to the following format: range("bytes=startIndex–endIndex") The following list details how the Amazon S3 Encryption Client responds to ranged requests that specify an invalid byte-range. For more detailed examples, see the amazon-s3-encryption-client- java GitHub repository. • When the start index is within object range but the end index is greater than the object's total length, the Amazon S3 Encryption Client returns the object from the start index to the end of the original plaintext object. • When the start index is greater than the end index, the Amazon S3 Encryption Client returns the entire object. • When the range is specified with an invalid format, the Amazon S3 Encryption Client returns the entire object. For example, if the range was specified as range("10-20"), instead of range("bytes=10-20"), then the Amazon S3 Encryption Client will return the entire object. • When both the start and end indicies are greater than the original plaintext object's total length, but still within the same cipher block, the Amazon S3 Encryption Client returns an empty object. • When both the start and end indicies are greater than the original plaintext object's total length, and are outside of the object's cipher block, the GetObject request fails. Performing a ranged request The following walkthrough explains how to perform a ranged request when using version 3.x of the Amazon S3 Encryption Client. Examples 20 Amazon S3 Encryption Client Developer Guide 1. Enable ranged gets by specifying the enableLegacyUnauthenticatedModes parameter when you instantiate your client. The following example specifies a raw AES
amazon-s3-encryption-client-008
amazon-s3-encryption-client.pdf
8
total length, but still within the same cipher block, the Amazon S3 Encryption Client returns an empty object. • When both the start and end indicies are greater than the original plaintext object's total length, and are outside of the object's cipher block, the GetObject request fails. Performing a ranged request The following walkthrough explains how to perform a ranged request when using version 3.x of the Amazon S3 Encryption Client. Examples 20 Amazon S3 Encryption Client Developer Guide 1. Enable ranged gets by specifying the enableLegacyUnauthenticatedModes parameter when you instantiate your client. The following example specifies a raw AES key as the wrapping key. // v3 class v3EnableRangedGetsExample { public static void main(String[] args) { S3Client v3Client = S3EncryptionClient.builder() .aesKey(aesKey) .enableLegacyUnauthenticatedModes(true) .build(); } } 2. Partially decrypt your encrypted object by specifying the byte-range in your GetObject request. The following example specifies a start index at byte 10 and end index at byte 20. // v3 class v3RangedGetExample { public static void main(String[] args) { ResponseBytes<GetObjectResponse> objectResponse = v3Client.getObjectAsBytes(builder -> builder .bucket(bucket) .range("bytes=10-20") .key(objectKey)); String output = objectResponse.asUtf8String(); } } 3. Optional: verify that the decrypted partial object matches the original plaintext object that you uploaded at the same range. assert output.equals(objectContent); 4. The Amazon S3 Encryption Client implements the AutoClosable interface, which automatically calls close() when you exit a try-with-resources block for which the Examples 21 Amazon S3 Encryption Client Developer Guide object has been declared in the resource specification header. As a best practice, you should either use try-with-resources or explicitly call the close() method. s3Client.close(); Multipart upload Amazon S3 allows you to upload a single object as a set of parts using multipart uploads. Amazon S3 recommends that when your object size reaches 100 MB, you should consider using multipart uploads. In version 3.x of the Amazon S3 Encryption Client, you can perform multipart uploads with the low-level API or the high-level API. Use the low-level API when you need to vary part sizes during the upload or require more control over the multipart upload process. Use the high- level API to simplify the multipart upload process by enabling the Amazon S3 Encryption Client to automatically perform multipart uploads. Multipart Upload (high-level API) When you use the high-level API, the Amazon S3 Encryption Client automatically performs multipart uploads for all objects larger than 5 MB. The Amazon S3 Encryption Client encrypts the object locally and then calls the AWS CRT-based Amazon S3 client to perform the multipart upload to Amazon S3. Note If your permissions to access required Amazon S3 resources or KMS keys are revoked during a multipart upload using the high-level API, the in-progress request may upload successfully. Subsequent multipart upload requests will fail. To enable automatic multipart uploads with the high-level API, you must add dependencies for the AWS CRT-based Amazon S3 client to your Maven project file and specify the enableMultipartPutObject parameter when you instantiate your client. Add dependencies To use the AWS CRT-based Amazon S3 client with the Amazon S3 Encryption Client, add the following two dependencies. For more information on creating dependencies and installing the Amazon S3 Encryption Client, see Installing the Amazon S3 Encryption Client for Java. Examples 22 Amazon S3 Encryption Client Developer Guide <dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>s3</artifactId> <version>2.19.3 <dependency> <groupId>software.amazon.awssdk.crt</groupId> <artifactId>aws-crt</artifactId> <version>0.21.5</version> </dependency> Enable multipart upload To enable the Amazon S3 Encryption Client to automatically perform multipart uploads, specify the enableMultipartPutObject parameter when you instantiate your client. The following example specifies a raw AES key as the wrapping key. // v3 class v3EnableMultipartUploadExample { public static void main(String[] args) { S3Client v3Client = S3EncryptionClient.builder() .aesKey(aesKey) .enableMultipartPutObject(true) .build(); } } Multipart Upload (low-level API) The Amazon S3 Encryption Client does not require any additional configuration to use the low- level API. Use the following API calls to generate a multipart upload request with version 3.x of the Amazon S3 Encryption Client. 1. Start the multipart upload process by calling CreateMultipartUpload. 2. Call UploadPart to upload each part of your object. When you upload the final part, you must specify isLastPart for the Amazon S3 Encryption Client to be able to call cipher.doFinal() // v3 Examples 23 Amazon S3 Encryption Client Developer Guide class v3UploadFinalPartExample { public static void main(String[] args) { UploadPartRequest uploadPartRequest = UploadPartRequest.builder() .bucket(bucket) .key(objectKey) .uploadId(initiateResult.uploadId()) .partNumber(partsSent) .overrideConfiguration(isLastPart(true)) .build(); } } 3. Call CompleteMultipartUpload to finish the process. Asynchronous programming in the Amazon S3 Encryption Client for Java Version 3.x of the Amazon S3 Encryption Client provides a nonblocking asynchronous client that implements high concurrency across a few threads. The asynchronous client enables you to perform requests sequentially without waiting to view results between each request. The default Amazon S3 Encryption Client uses synchronous methods that block your thread’s execution until the client receives a response from Amazon S3. The asynchronous client returns immediately, giving control back
amazon-s3-encryption-client-009
amazon-s3-encryption-client.pdf
9
args) { UploadPartRequest uploadPartRequest = UploadPartRequest.builder() .bucket(bucket) .key(objectKey) .uploadId(initiateResult.uploadId()) .partNumber(partsSent) .overrideConfiguration(isLastPart(true)) .build(); } } 3. Call CompleteMultipartUpload to finish the process. Asynchronous programming in the Amazon S3 Encryption Client for Java Version 3.x of the Amazon S3 Encryption Client provides a nonblocking asynchronous client that implements high concurrency across a few threads. The asynchronous client enables you to perform requests sequentially without waiting to view results between each request. The default Amazon S3 Encryption Client uses synchronous methods that block your thread’s execution until the client receives a response from Amazon S3. The asynchronous client returns immediately, giving control back to the calling thread without waiting for a response. Because an asynchronous method returns before a response is available, you need a way to get the response when it’s ready. The methods in version 3.x of the Amazon S3 Encryption Client return CompletableFuture objects that allow you to access the response when it’s ready. Topics • Instantiating the asynchronous client • Encrypt and decrypt with the asynchronous client Instantiating the asynchronous client To use the asynchronous client, you must specify the S3AsyncEncryptionClient builder and the builder parameter that identifies your wrapping key when you instantiate your client. The Amazon S3 Encryption Client supports the following wrapping keys: symmetric AWS KMS keys, raw AES-GCM keys, and raw RSA keys. Asynchronous programming 24 Amazon S3 Encryption Client Developer Guide Note If you use Raw RSA or Raw AES-GCM wrapping keys, you are responsible for generating, storing, and protecting the key material, preferably in a hardware security module (HSM) or key management system. The following examples instantiate the asynchronous Amazon S3 Encryption Client with the default decryption mode. This means that all objects will be decrypted using the fully supported buffered decryption mode. For more information, see Decryption modes (Version 3.x and later). KMS key To specify a KMS key as your wrapping key, instantiate your client with the kmsKeyId builder parameter. The value of the kmsKeyId parameter can be any valid KMS key identifier. For details, see Key identifiers in the AWS Key Management Service Developer Guide. // v3 class v3KMSKeyExample { public static void main(String[] args) { S3Client v3Client = S3EncryptionClient.builder() .kmsKeyId(kmsKeyId) .build(); } } Raw AES key To specify a raw AES key (javax.crypto.SecretKey) as your wrapping key, instantiate your client with the aesKey builder parameter. // v3 class v3AESKeyExample { public static void main(String[] args) { S3Client v3Client = S3EncryptionClient.builder() .aesKey(aesKey) .build(); } } Asynchronous programming 25 Amazon S3 Encryption Client Raw RSA key Developer Guide To specify a raw RSA key (java.security.KeyPair) as your wrapping key, instantiate your client with the rsaKeyPair builder parameter. You can specify an entire RSA key pair or a partial RSA key pair. The value of the rsaKeyPair parameter must include both the public and private keys in the key pair to perform both encrypt and decrypt operations. You can specify the public key to enable the Amazon S3 Encryption Client to perform encrypt operations, or the private key to enable decrypt operations as needed. By specifying a partial key pair you can limit the exposure of your keys. For examples using a partial key pair, see the amazon-s3- encryption-client-java GitHub repository. To instantiate version 3.x of the client to perform both encrypt and decrypt operations, specify both the public and private keys of your key pair. // v3 class v3RSAKeyPairExample { public static void main(String[] args) { S3Client v3Client = S3EncryptionClient.builder() .rsaKeyPair(rsaKeyPair) .build(); } } To instantiate the client to encrypt only, specify the public key. If you specify the public key alone, all GetObject calls will fail because the private key is required to decrypt. // v3 class v3RSAKeyPairExample { public static void main(String[] args) { S3Client v3Client = S3EncryptionClient.builder() .rsaKeyPair(new PartialRsaKeyPair(null, rsaKeyPair.getPublic())) .build(); } } To instantiate the client to decrypt only, specify the private key. If you specify the private key alone, all PutObject calls will fail because the public key is required to encrypt. // v3 Asynchronous programming 26 Amazon S3 Encryption Client Developer Guide class v3RSAKeyPairExample { public static void main(String[] args) { S3Client v3Client = S3EncryptionClient.builder() .rsaKeyPair(new PartialRsaKeyPair(rsaKeyPair.getPrivate(), null)) .build(); } } You can customize your asynchronous client by specifying different builder parameters to enable the features you need. By default, version 3.x of the Amazon S3 Encryption Client does not support legacy decryption, ranged 'GET' requests, or multipart uploads (via the high-level API). For example, if you need to decrypt data keys that were encrypted with a legacy wrapping algorithm, specify the enableLegacyWrappingAlgorithms parameter when you instantiate your client. The following example specifies a raw AES key as the wrapping key. // v3 class v3EnableLegacyModesAsyncClientExample { public static void main(String[] args) { S3AsyncClient v3Client = S3AsyncEncryptionClient.builder() .aesKey(AES_KEY) .enableLegacyWrappingAlgorithms(true) .build(); } } Encrypt and decrypt with the asynchronous client The following walkthrough demonstrates how encrypt and
amazon-s3-encryption-client-010
amazon-s3-encryption-client.pdf
10
features you need. By default, version 3.x of the Amazon S3 Encryption Client does not support legacy decryption, ranged 'GET' requests, or multipart uploads (via the high-level API). For example, if you need to decrypt data keys that were encrypted with a legacy wrapping algorithm, specify the enableLegacyWrappingAlgorithms parameter when you instantiate your client. The following example specifies a raw AES key as the wrapping key. // v3 class v3EnableLegacyModesAsyncClientExample { public static void main(String[] args) { S3AsyncClient v3Client = S3AsyncEncryptionClient.builder() .aesKey(AES_KEY) .enableLegacyWrappingAlgorithms(true) .build(); } } Encrypt and decrypt with the asynchronous client The following walkthrough demonstrates how encrypt and decrypt asynchronously with version 3.x of the Amazon S3 Encryption Client. 1. Instantiate your asynchronous client with the S3AsyncEncryptionClient builder. The following example specifies a raw AES key as the wrapping key. // v3 class v3EnableAsyncClientExample { public static void main(String[] args) { Asynchronous programming 27 Amazon S3 Encryption Client Developer Guide S3AsyncClient v3Client = S3AsyncEncryptionClient.builder() .aesKey(AES_KEY) .build(); } } 2. Call PutObject to encrypt a plaintext object and upload it to Amazon S3. The asynchronous client stores the response to confirm that the PutObject request completed when you call GetObject in the future. // v3 class v3PutObjectAsyncClientExample { public static void main(String[] args) { CompletableFuture<PutObjectResponse> futurePut = v3AsyncClient.putObject(builder -> builder .bucket(bucket) .key(objectKey) .build(), AsyncRequestBody.fromString(objectContent)); // Block on completion of the futurePut futurePut.join(); } } 3. Call GetObject to download and decrypt the encrypted object. // v3 class v3GetObjectAsyncClientExample { public static void main(String[] args) { CompletableFuture<ResponseBytes<GetObjectResponse>> futureGet = v3AsyncClient.getObject(builder -> builder .bucket(bucket) .key(objectKey) .build(), AsyncResponseTransformer.toBytes()); // Wait for the future to complete ResponseBytes<GetObjectResponse> getResponse = futureGet.join(); } } 4. Optional: verify that the decrypted object matches the original plaintext object that you uploaded. Asynchronous programming 28 Amazon S3 Encryption Client Developer Guide assert output.equals(objectContent); 5. The Amazon S3 Encryption Client implements the AutoClosable interface, which automatically calls close() when you exit a try-with-resources block for which the object has been declared in the resource specification header. As a best practice, you should either use try-with-resources or explicitly call the close() method. s3Client.close(); Note The default decryption mode cannot decrypt objects larger than 64 MB. This decryption mode automatically buffers stream contents into memory to prevent the release of unauthenticated objects. If you attempt to decrypt an object larger than 64 MB, you will receive an exception directing you to enable the delayed authentication decryption mode. For more information, see Decryption modes. Migrating to version 3.x of the Amazon S3 Encryption Client for Java The v3Client constructor does not use the EncryptionMaterialsProvider that was required in versions 1.x and 2.x of the Amazon S3 Encryption Client. Instead, you use a parameter of the v3Client builder to specify your wrapping key. The Amazon S3 Encryption Client supports the following wrapping keys: AWS Key Management Service (AWS KMS) symmetric AWS KMS keys, raw AES-GCM (Advanced Encryption Standard/Galois Counter Mode) keys, and raw RSA keys. The Amazon S3 Encryption Client optimizes its settings based on the wrapping key type. When updating from earlier versions of the Amazon S3 Encryption Client to version 3.x, you need to update your client builder code to use the new, simpler interface for the v3Client. If you're decrypting ciphertext that was encrypted by earlier versions of the Amazon S3 Encryption Client, you might also need to allow the Amazon S3 Encryption Client to decrypt legacy encryption algorithms. To update to Amazon S3 Encryption Client version 3.x, delete the code that instantiates the EncryptionMaterialsProvider. Then replace the code that calls the v1Client or v2Client Migrate to version 3.x 29 Amazon S3 Encryption Client Developer Guide builder with code that calls the v3Client builder. Use a parameter of the v3Client builder to specify your wrapping key. The following examples show the equivalent code required to specify a KMS key as the wrapping key in versions 1.x, 2.x, and 3.x of the Amazon S3 Encryption Client. Version 1.x In Amazon S3 Encryption Client version 1.x, you instantiate an EncryptionMaterialsProvider with your wrapping key, and then specify that materials provider when instantiating the v1Client object. // v1 class v1KMSKeyExample { public static void main(String[] args) { EncryptionMaterialsProvider materialsProvider = new KMSEncryptionMaterialsProvider(kmsKeyId); AmazonS3Encryption v1Client = AmazonS3EncryptionClient.encryptionBuilder() .withEncryptionMaterialsProvider(materialsProvider) .build(); } } Version 2.x In Amazon S3 Encryption Client version 2.x, you instantiate an EncryptionMaterialsProvider with your wrapping key, and then specify that materials provider when instantiating the v2Client object. // v2 class v2KMSKeyExample { public static void main(String[] args) { EncryptionMaterialsProvider materialsProvider = new KMSEncryptionMaterialsProvider(kmsKeyId); AmazonS3EncryptionV2 v2Client = AmazonS3EncryptionClientV2.encryptionBuilder() .withEncryptionMaterialsProvider(materialsProvider) .build(); Migrate to version 3.x 30 Amazon S3 Encryption Client Developer Guide } } Version 3.x In Amazon S3 Encryption Client version 3.x, the v3Client constructor requires only a parameter that identifies the wrapping key. For a KMS key, use the kmsKeyId parameter. The value of the kmsKeyId parameter can be any valid KMS
amazon-s3-encryption-client-011
amazon-s3-encryption-client.pdf
11
Amazon S3 Encryption Client version 2.x, you instantiate an EncryptionMaterialsProvider with your wrapping key, and then specify that materials provider when instantiating the v2Client object. // v2 class v2KMSKeyExample { public static void main(String[] args) { EncryptionMaterialsProvider materialsProvider = new KMSEncryptionMaterialsProvider(kmsKeyId); AmazonS3EncryptionV2 v2Client = AmazonS3EncryptionClientV2.encryptionBuilder() .withEncryptionMaterialsProvider(materialsProvider) .build(); Migrate to version 3.x 30 Amazon S3 Encryption Client Developer Guide } } Version 3.x In Amazon S3 Encryption Client version 3.x, the v3Client constructor requires only a parameter that identifies the wrapping key. For a KMS key, use the kmsKeyId parameter. The value of the kmsKeyId parameter can be any valid KMS key identifier. For details, see Key identifiers in the AWS Key Management Service Developer Guide. // v3 class v3KMSKeyExample { public static void main(String[] args) { S3Client v3Client = S3EncryptionClient.builder() .kmsKeyId(kmsKeyId) .build(); } } Enable legacy decryption modes If you need to decrypt objects or data keys that were encrypted with a legacy algorithm, or you need to partially decrypt an AES-GCM encrypted object when performing a ranged request, you need to explicitly enable this behavior when you instantiate the client. The v3Client encrypts only with fully supported algorithms. It will never encrypt with a legacy algorithm. By default, it decrypts only with fully supported algorithms, but you can enable it to decrypt with both fully supported and legacy algorithms. For more information, see Decryption modes (Amazon S3 Encryption Client for Java version 3.x and later). The enableLegacyUnauthenticatedModes parameter of the v3Client builder enables the Amazon S3 Encryption Client to decrypt encrypted objects with a fully supported or legacy encryption algorithm. Version 3.x of the Amazon S3 Encryption Client uses one of the fully supported wrapping algorithms and the wrapping key you specify to encrypt and decrypt the data keys. The enableLegacyWrappingAlgorithms parameter of the v3Client builder enables the Amazon S3 Encryption Client to decrypt encrypted data keys with a fully supported or legacy wrapping algorithm. Migrate to version 3.x 31 Amazon S3 Encryption Client Developer Guide If your v3Client doesn't include the necessary legacy decryption mode with a value of true, and it encounters an object encrypted with a legacy algorithm, it throws S3EncryptionClientException. For example, this code builds a v3Client object with a user-provided raw AES wrapping key. This client always encrypts only with fully supported algorithms. However, it can decrypt objects and data keys encrypted with fully supported or legacy algorithms. // v3 class v3EnableLegacyDecryptionModesExample { public static void main(String[] args) { S3Client v3Client = S3EncryptionClient.builder() .aesKey(aesKey) .enableLegacyUnauthenticatedModes(true) .enableLegacyWrappingAlgorithms(true) .build(); } } The legacy decryption modes are designed to be a temporary fix. After you've re-encrypted all of your objects with fully supported algorithms, you can eliminate it from your code. Amazon S3 Encryption Client for Go Note This documentation describes the Amazon S3 Encryption Client version 3.x, which is an independent library. For information about previous versions of the Amazon S3 Encryption Client, see the AWS SDK Developer Guide for your programming language. This topic explains how to install and use the Amazon S3 Encryption Client for Go. For details about programming with the Amazon S3 Encryption Client for Go, see the amazon-s3-encryption- client-go repository on GitHub. Topics • Prerequisites • Installation Go 32 Amazon S3 Encryption Client Developer Guide • Amazon S3 Encryption Client for Go examples • Migrating to version 3.x of the Amazon S3 Encryption Client for Go Prerequisites Before you install the Amazon S3 Encryption Client for Go, be sure you have the following prerequisites. A Go development environment The Amazon S3 Encryption Client for Go requires Go 1.20 or later, but we recommend that you use the latest version. You can view your current version of Go by running the following command. go version AWS SDK for Go 2.x The Amazon S3 Encryption Client for Go requires the Amazon S3 and AWS KMS service clients of the AWS SDK for Go 2.x. Service clients can be constructed using either the NewFromConfig or New function. For more information, see Using the AWS SDK for Go V2 with AWS services in the AWS SDK for Go Developer Guide. For information about updating your version of the AWS SDK for Go, see Migration to the AWS SDK for Go V2 in the AWS SDK for Go Developer Guide. Installation To install the Amazon S3 Encryption Client for Go and its dependencies, run the following Go command. go get github.com/aws/amazon-s3-encryption-client-go Amazon S3 Encryption Client for Go examples The following examples show you how to use the Amazon S3 Encryption Client for Go to encrypt and decrypt Amazon S3 objects. These examples show how to use version 3.x of the Amazon S3 Encryption Client for Go. Prerequisites 33 Amazon S3 Encryption Client Developer Guide Note The Amazon S3 Encryption Client for Go does not support asynchronous programming, multipart uploads, or ranged GET requests. To use these
amazon-s3-encryption-client-012
amazon-s3-encryption-client.pdf
12
for Go Developer Guide. Installation To install the Amazon S3 Encryption Client for Go and its dependencies, run the following Go command. go get github.com/aws/amazon-s3-encryption-client-go Amazon S3 Encryption Client for Go examples The following examples show you how to use the Amazon S3 Encryption Client for Go to encrypt and decrypt Amazon S3 objects. These examples show how to use version 3.x of the Amazon S3 Encryption Client for Go. Prerequisites 33 Amazon S3 Encryption Client Developer Guide Note The Amazon S3 Encryption Client for Go does not support asynchronous programming, multipart uploads, or ranged GET requests. To use these features with version 3.x of the Amazon S3 Encryption Client, you must use the Amazon S3 Encryption Client for Java. Topics • Instantiating the Amazon S3 Encryption Client • Encrypting and decrypting Amazon S3 objects Instantiating the Amazon S3 Encryption Client After installing the Amazon S3 Encryption Client for Go, you are ready to instantiate your client and begin encrypting and decrypting your Amazon S3 objects. If you have encrypted objects under a previous version of the Amazon S3 Encryption Client, you may need to enable legacy decryption modes when you instantiate the updated client. For more information, see Migrating to version 3.x of the Amazon S3 Encryption Client for Go. The Amazon S3 Encryption Client for Go supports keyrings that use symmetric encryption KMS keys as the wrapping key. The Amazon S3 Encryption Client for Go does not support keyrings that use Raw AES-GCM or Raw RSA wrapping keys. To use Raw AES-GCM or Raw RSA wrapping keys, you must use the Amazon S3 Encryption Client for Java. For more information, see Instantiating the Amazon S3 Encryption Client for Java. To use a KMS key as your wrapping key, you need kms:GenerateDataKey and kms:Decrypt permissions on the KMS key. To specify a KMS key, use any valid KMS key identifier. For details, see Key identifiers in the AWS Key Management Service Developer Guide. The following example instantiates the Amazon S3 Encryption Client with the default decryption mode. This means that all objects will be decrypted using the fully supported buffered decryption mode. For more information, see Decryption modes (Version 3.x and later). import ( ... // Import the materials and client package "github.com/aws/amazon-s3-encryption-client-go/client" "github.com/aws/amazon-s3-encryption-client-go/materials" ... Examples 34 Amazon S3 Encryption Client ) s3EncryptionClient, err := client.New(s3Client, cmm) Developer Guide // Create the keyring and cryptographic materials manager (CMM) cmm, err := materials.NewCryptographicMaterialsManager(materials.NewKmsKeyring(kmsClient, kmsKeyArn, func(options *materials.KeyringOptions) { options.EnableLegacyWrappingAlgorithms = false })) if err != nil { t.Fatalf("error while creating new CMM") } s3EncryptionClient, err := client.New(s3Client, cmm) Encrypting and decrypting Amazon S3 objects The following example shows you how to use the Amazon S3 Encryption Client for Go to encrypt and decrypt Amazon S3 objects. 1. Create a keyring with a KMS key as your wrapping key when you instantiate your client. s3Client = s3.NewFromConfig(cfg) kmsClient := kms.NewFromConfig(cfg) cmm, err := materials.NewCryptographicMaterialsManager(materials.NewKmsKeyring(kmsClient, kmsKeyArn, func(options *materials.KeyringOptions) { options.EnableLegacyWrappingAlgorithms = false })) if err != nil { t.Fatalf("error while creating new CMM") } 2. Encrypt your plaintext object by calling PutObject. To include an optional material description, add an EncryptionContext value to the context and supply this value to the PutObject request. a. The Amazon S3 Encryption Client provides the encryption materials: one plaintext data key and one copy of that data key encrypted by your wrapping key. b. The Amazon S3 Encryption Client uses the plaintext data key to encrypt your object, and then discards the plaintext data key. Examples 35 Amazon S3 Encryption Client Developer Guide c. The Amazon S3 Encryption Client uploads the encrypted data key and the encrypted object to Amazon S3 as part of the PutObject call. ctx := context.Background() ... encryptionContext := context.WithValue(ctx, "EncryptionContext", map[string]string{"ec-key": "ec-value"}) s3EncryptionClient, err := client.New(s3Client, cmm) _, err = s3EncryptionClient.PutObject(encryptionContext, &s3.PutObjectInput{ Bucket: aws.String(bucket), Key: aws.String(objectKey), Body: bytes.NewReader([]byte(plaintext)), }) if err != nil { t.Fatalf("error while encrypting: %v", err) } 3. Decrypt your encrypted object by calling GetObject. a. The Amazon S3 Encryption Client uses your wrapping key to decrypt the encrypted data key. b. The Amazon S3 Encryption Client uses the plaintext data key to decrypt the object, discards the plaintext data key, and returns the plaintext object as part of the GetObject call. result, err := s3EncryptionClient.GetObject(ctx, &s3.GetObjectInput{ Bucket: aws.String(bucket), Key: aws.String(objectKey), }) if err != nil { return fmt.Errorf("error while decrypting: %v", err) } decryptedPlaintext, err := io.ReadAll(result.Body) if err != nil { return fmt.Errorf("failed to read decrypted plaintext into byte array") } Examples 36 Amazon S3 Encryption Client Developer Guide 4. Optional: verify that the decrypted object matches the original plaintext object that you uploaded. if e, a := []byte(plaintext), decryptedPlaintext; !bytes.Equal(e, a) { return fmt.Errorf("expect %v text, got %v", e, a) } Migrating to version 3.x of the Amazon S3 Encryption Client for Go With version 3.x
amazon-s3-encryption-client-013
amazon-s3-encryption-client.pdf
13
the GetObject call. result, err := s3EncryptionClient.GetObject(ctx, &s3.GetObjectInput{ Bucket: aws.String(bucket), Key: aws.String(objectKey), }) if err != nil { return fmt.Errorf("error while decrypting: %v", err) } decryptedPlaintext, err := io.ReadAll(result.Body) if err != nil { return fmt.Errorf("failed to read decrypted plaintext into byte array") } Examples 36 Amazon S3 Encryption Client Developer Guide 4. Optional: verify that the decrypted object matches the original plaintext object that you uploaded. if e, a := []byte(plaintext), decryptedPlaintext; !bytes.Equal(e, a) { return fmt.Errorf("expect %v text, got %v", e, a) } Migrating to version 3.x of the Amazon S3 Encryption Client for Go With version 3.x of the Amazon S3 Encryption Client for Go, you create one client for both encryption and decryption. Version 3.x replaces the cipher data generators with the cryptographic materials manager (CMM), and replaces the KMS key providers, NewKMSContextKeyGenerator, with the NewKmsKeyring. When updating from earlier versions of the Amazon S3 Encryption Client to version 3.x, you need to update your client builder code to use the new, simpler client. If you're decrypting ciphertext that was encrypted by earlier versions of the Amazon S3 Encryption Client, you might also need to allow the Amazon S3 Encryption Client to decrypt legacy encryption algorithms. The following examples show the equivalent code required to specify a KMS key provider with a KMS key ID in versions 1.x, 2.x, and 3.x of the Amazon S3 Encryption Client. Version 1.x In version 1.x, you use the NewKMSKeyGeneratorWith function to construct the cipherDataGenerator. sess := session.Must(session.NewSession()) kmsClient := kms.New(sess) cmkID := "1234abcd-12ab-34cd-56ef-1234567890ab" cipherDataGenerator := s3crypto.NewKMSKeyGenerator(kmsClient, kmsKeyID) Version 2.x In version 2.x, you use the NewKMSContextKeyGenerator function to construct the cipherDataGenerator. sess := session.Must(session.NewSession()) kmsClient := kms.New(sess) Migrate to version 3.x 37 Amazon S3 Encryption Client Developer Guide cmkID := "1234abcd-12ab-34cd-56ef-1234567890ab" var matDesc s3crypto.MaterialDescription // changed NewKMSKeyGenerator to NewKMSContextKeyGenerator cipherDataGenerator := s3crypto.NewKMSContextKeyGenerator(kmsClient, kmsKeyID, matDesc) Version 3.x In version 3.x, you use the NewKmsKeyring function to construct your cryptographic materials manager (CMM). s3Client := s3.NewFromConfig(cfg) kmsClient := kms.NewFromConfig(cfg) cmm, err := materials.NewCryptographicMaterialsManager(materials.NewKmsKeyring(kmsClient, kmsKeyID)) if err != nil { return fmt.Errorf("error while creating new CMM") } Migrating from version 2.x The following example demonstrates how to migrate a version 2.x application that uses the NewKMSContextKeyGenerator KMS key provider with a material description and AESGCMContentCipherBuilderV2 content cipher to version 3.x of the Amazon S3 Encryption Client for Go. func KmsContextV2toV3GCMExample() error { bucket := LoadBucket() kmsKeyAlias := LoadAwsKmsAlias() objectKey := "my-object-key" region := "us-west-2" plaintext := "This is an example.\n" // Create an S3EC Go v2 encryption client // using the KMS client from AWS SDK for Go v1 sessKms, err := sessionV1.NewSession(&awsV1.Config{ Region: aws.String(region), }) Migrate to version 3.x 38 Amazon S3 Encryption Client Developer Guide kmsSvc := kmsV1.New(sessKms) handler := s3cryptoV2.NewKMSContextKeyGenerator(kmsSvc, kmsKeyAlias, s3cryptoV2.MaterialDescription{}) builder := s3cryptoV2.AESGCMContentCipherBuilderV2(handler) encClient, err := s3cryptoV2.NewEncryptionClientV2(sessKms, builder) if err != nil { log.Fatalf("error creating new v2 client: %v", err) } // Encrypt using KMS+Context and AES-GCM content cipher _, err = encClient.PutObject(&s3V1.PutObjectInput{ Bucket: aws.String(bucket), Key: aws.String(objectKey), Body: bytes.NewReader([]byte(plaintext)), }) if err != nil { log.Fatalf("error calling putObject: %v", err) } fmt.Printf("successfully uploaded file to %s/%s\n", bucket, key) // Create an S3EC Go v3 client // using the KMS client from AWS SDK for Go v2 ctx := context.Background() cfg, err := config.LoadDefaultConfig(ctx, config.WithRegion(region), ) kmsV2 := kms.NewFromConfig(cfg) cmm, err := materials.NewCryptographicMaterialsManager(materials.NewKmsKeyring(kmsV2, kmsKeyAlias)) if err != nil { t.Fatalf("error while creating new CMM") } s3V2 := s3.NewFromConfig(cfg) s3ecV3, err := client.New(s3V2, cmm) result, err := s3ecV3.GetObject(ctx, &s3.GetObjectInput{ Bucket: aws.String(bucket), Key: aws.String(objectKey), }) if err != nil { t.Fatalf("error while decrypting: %v", err) Migrate to version 3.x 39 Amazon S3 Encryption Client } Enable legacy decryption modes Developer Guide If you need to decrypt objects or data keys that were encrypted with a legacy algorithm, or you need to partially decrypt an AES-GCM encrypted object when performing a ranged request, you need to explicitly enable this behavior when you instantiate the client. Version 3.x of the Amazon S3 Encryption Client encrypts only with fully supported algorithms. It will never encrypt with a legacy algorithm. By default, it decrypts only with fully supported algorithms, but you can enable it to decrypt with both fully supported and legacy algorithms. For more information, see Decryption modes (Amazon S3 Encryption Client for Java version 3.x and later). The enableLegacyUnauthenticatedModes flag enables the Amazon S3 Encryption Client to decrypt encrypted objects with a fully supported or legacy encryption algorithm. Version 3.x of the Amazon S3 Encryption Client uses one of the fully supported wrapping algorithms and the wrapping key you specify to encrypt and decrypt the data keys. The enableLegacyWrappingAlgorithms flag enables the Amazon S3 Encryption Client to decrypt encrypted data keys with a fully supported or legacy wrapping algorithm. If your client doesn't include the necessary legacy decryption mode with a value of true, and it encounters an object encrypted with a
amazon-s3-encryption-client-014
amazon-s3-encryption-client.pdf
14
Java version 3.x and later). The enableLegacyUnauthenticatedModes flag enables the Amazon S3 Encryption Client to decrypt encrypted objects with a fully supported or legacy encryption algorithm. Version 3.x of the Amazon S3 Encryption Client uses one of the fully supported wrapping algorithms and the wrapping key you specify to encrypt and decrypt the data keys. The enableLegacyWrappingAlgorithms flag enables the Amazon S3 Encryption Client to decrypt encrypted data keys with a fully supported or legacy wrapping algorithm. If your client doesn't include the necessary legacy decryption mode with a value of true, and it encounters an object encrypted with a legacy algorithm, it throws S3EncryptionClientException. The following example enables the enableLegacyUnauthenticatedModes and enableLegacyWrappingAlgorithms flags. This client always encrypts only with fully supported algorithms. However, it can decrypt objects and data keys encrypted with fully supported or legacy algorithms. cmm, err := materials.NewCryptographicMaterialsManager(materials.NewKmsKeyring(kmsClient, , func(options *materials.KeyringOptions) { options.EnableLegacyWrappingAlgorithms = true }) if err != nil { t.Fatalf("error while creating new CMM") } Migrate to version 3.x 40 Amazon S3 Encryption Client Developer Guide client, err := client.New(s3Client, cmm, func(clientOptions *client.EncryptionClientOptions) { clientOptions.EnableLegacyUnauthenticatedModes = true }) if err != nil { // handle error } The legacy decryption modes are designed to be a temporary fix. After you've re-encrypted all of your objects with fully supported algorithms, you can eliminate it from your code. Migrate to version 3.x 41 Amazon S3 Encryption Client Developer Guide Supported encryption algorithms Note This documentation describes the Amazon S3 Encryption Client version 3.x, which is an independent library. For information about previous versions of the Amazon S3 Encryption Client, see the AWS SDK Developer Guide for your programming language. The Amazon S3 Encryption Client supports industry-standard algorithms for encrypting objects and data keys. As our knowledge evolves, we adjust our support for encryption algorithms to ensure that your sensitive data is protected. The following topic provides context on which encryption algorithms are fully supported and the different decryption modes supported in version 3.x of the Amazon S3 Encryption Client. Topics • Encryption algorithms (Version 3.x and later) • Decryption modes (version 3.x and later) • Encryption algorithms (Version 2.x and earlier) Encryption algorithms (Version 3.x and later) In versions 3.x and later, the Amazon S3 Encryption Client will use fully supported algorithms to encrypt and decrypt objects and data keys. You can enable the Amazon S3 Encryption Client to decrypt objects and data keys with a legacy encryption algorithm, but it will not encrypt with a legacy encryption algorithm. It encrypts only with a fully supported encryption algorithm. The following tables list the object encryption algorithms and wrapping algorithms that are supported in version 3.x of the Amazon S3 Encryption Client. Use these tables to determine if any of your objects or data keys were encrypted with an algorithm that is no longer supported. If you need to decrypt objects or data keys that were encrypted with a legacy algorithm, see Enable legacy decryption modes. Encrypting objects — The following table lists the fully supported (Full) and previously supported (Legacy) encryption algorithms that are used to encrypt objects. Encryption algorithms (Version 3.x and later) 42 Amazon S3 Encryption Client Developer Guide Algorithm AES-GCM AES-CBC Support Full Legacy Encrypting data keys — The following table lists the fully supported (Full) and previously supported (Legacy) wrapping algorithms that are used to encrypt the data keys that encrypt your objects. Version 3.x of the Amazon S3 Encryption Client uses one of the fully supported wrapping algorithms and the wrapping key you specify to encrypt and decrypt the data keys. Algorithm AES-GCM AWS KMS (with an encryption context) RSA-OAEP-MGF1 and SHA-1 AES AESWrap Support Full Full Full Legacy Legacy AWS KMS (without an encryption context) Legacy RSA-OAEP-MGF-1 and SHA-256 RSA Legacy Legacy Decryption modes (version 3.x and later) Version 3.x of the Amazon S3 Encryption Client defines four modes of support for decryption that you can use to enable the client to decrypt objects and data keys with either fully supported or legacy algorithms. Decryption modes (version 3.x and later) 43 Amazon S3 Encryption Client Fully supported Developer Guide By default, version 3.x of the Amazon S3 Encryption Client encrypts and decrypts your objects using the AES-GCM algorithm suite. AES-GCM is an authenticated scheme. This means that an authentication tag is appended to the encrypted object. The default behavior for versions 1.x and 2.x allowed streaming decryption of AES-GCM encrypted objects. Because authentication happens at the end of the decryption process, the entire object must be read before the cipher can validate the integrity of it. This allows plaintext objects to be released and used before the authentication tag is validated. Version 3.x of the Amazon S3 Encryption Client supports streaming decryption of AES-GCM encrypted objects, but we recommend using the default decryption mode to prevent the release of unauthenticated
amazon-s3-encryption-client-015
amazon-s3-encryption-client.pdf
15
is an authenticated scheme. This means that an authentication tag is appended to the encrypted object. The default behavior for versions 1.x and 2.x allowed streaming decryption of AES-GCM encrypted objects. Because authentication happens at the end of the decryption process, the entire object must be read before the cipher can validate the integrity of it. This allows plaintext objects to be released and used before the authentication tag is validated. Version 3.x of the Amazon S3 Encryption Client supports streaming decryption of AES-GCM encrypted objects, but we recommend using the default decryption mode to prevent the release of unauthenticated plaintext objects. Buffered (default) By default, version 3.x of the Amazon S3 Encryption Client automatically buffers the stream contents into memory as the decrypted object is read to prevent the release of unauthenticated objects. If the client reaches the end of the stream, and the authentication fails, your GetObject request will throw an exception and the unauthenticated object will not be returned. When you use the buffered decryption mode with the Amazon S3 Encryption Client for Java, the default maximum object size that can be decrypted is 64 MB. However, you can use the optional setBufferSize parameter to customize the maximum object size that the mode will buffer. You can use the setBufferSize parameter to specify any integer between 16 bytes and 64 GB as the maxiumum object size. The following Java example instantiates the v3Client with a raw AES wrapping key and a maximum object size of 32 MiB. // v3 class v3DefaultDecryptionModeExample { public static void main(String[] args) { S3Client v3Client = S3EncryptionClient.builder() .aesKey(aesKey) .setBufferSize(32 * 1024 * 1024) // OPTIONAL .build(); } Fully supported 44 Amazon S3 Encryption Client } Developer Guide When you use the buffered decryption mode with the Amazon S3 Encryption Client for Go, the default maximum object size that can be decrypted is 63 GiB. You cannot set a custom buffer size with the Amazon S3 Encryption Client for Go. As a result, the buffered decryption mode does not require any additional configuration when you instatiate your client with the Amazon S3 Encryption Client for Go. We recommend that you use the buffered decryption mode whenever possible. Since this is the default mode, you do not need to specify the buffered decryption mode when you instantiate your client. Delayed authentication Note The Amazon S3 Encryption Client for Go does not support the delayed authentication mode. To decrypt objects under the delayed authentication mode, you must use the Amazon S3 Encryption Client for Java. The delayed authentication mode also supports streaming decryption of AES-GCM encrypted objects, but it does not buffer or interrupt the stream to prevent unauthenticated objects from being returned. We recommend using the Buffered (default) decryption mode whenever possible. However, you might want to use the delayed authentication mode if you established your own method of buffering the stream while using versions 1.x and 2.x of the client. If you use the delayed authentication mode and are processing the plaintext data from the stream before reading to the end, you must account for the delayed authentication. Read the entire object to the end before you start using the decrypted object. When using this decryption mode, the Amazon S3 Encryption Client will not authenticate any object until it reaches the end of the stream. You will need to manually roll back any data from the stream if an exception is thrown at the end of the stream. To enable the delayed authentication mode, specify the enableDelayedAuthenticationMode parameter when you instantiate the v3Client. The following example specifies a raw AES key as the wrapping key. This client only encrypts with fully supported algorithms and decrypts using the delayed authentication mode. Fully supported 45 Amazon S3 Encryption Client // v3 Developer Guide class v3DelayedAuthenticationModeExample { public static void main(String[] args) { S3Client v3Client = S3EncryptionClient.builder() .aesKey(aesKey) .enableDelayedAuthenticationMode(true) .build(); } } Legacy Legacy wrapping algorithms By default, the Amazon S3 Encryption Client uses the wrapping key you specify and one of the fully supported wrapping algorithms to encrypt and decrypt the data keys that encrypt your objects. If you need to decrypt data keys that were encrypted with a legacy wrapping algorithm, you must specify the enableLegacyWrappingAlgorithms parameter when you instantiate your client. Java The following example specifies a raw AES key as the wrapping key. This client only encrypts with fully supported wrapping algorithms. However, it can decrypt data keys encrypted with fully supported or legacy wrapping algorithms. // v3 class v3LegacyWrappingAlgorithmsExample { public static void main(String[] args) { S3Client v3Client = S3EncryptionClient.builder() .aesKey(aesKey) .enableLegacyWrappingAlgorithms(true) .build(); } } Legacy 46 Amazon S3 Encryption Client Go Developer Guide The following example creates a keyring that uses a KMS key as the wrapping key and only encrypts with fully supported wrapping algorithms. However, it can decrypt
amazon-s3-encryption-client-016
amazon-s3-encryption-client.pdf
16
the enableLegacyWrappingAlgorithms parameter when you instantiate your client. Java The following example specifies a raw AES key as the wrapping key. This client only encrypts with fully supported wrapping algorithms. However, it can decrypt data keys encrypted with fully supported or legacy wrapping algorithms. // v3 class v3LegacyWrappingAlgorithmsExample { public static void main(String[] args) { S3Client v3Client = S3EncryptionClient.builder() .aesKey(aesKey) .enableLegacyWrappingAlgorithms(true) .build(); } } Legacy 46 Amazon S3 Encryption Client Go Developer Guide The following example creates a keyring that uses a KMS key as the wrapping key and only encrypts with fully supported wrapping algorithms. However, it can decrypt data keys encrypted with fully supported or legacy wrapping algorithms. cmm, err := materials.NewCryptographicMaterialsManager(materials.NewKmsKeyring(kmsClient, kmsKeyArn, func(options *materials.KeyringOptions) { options.EnableLegacyWrappingAlgorithms = true }) Unauthenticated legacy object encryption algorithms If you need to decrypt objects that were encrypted with a legacy algorithm, or you need to partially decrypt an AES-GCM encrypted object by performing a ranged request, you need to use the unauthenticated legacy mode. The Amazon S3 Encryption Client will decrypt objects with a legacy encryption algorithm, but will use the fully supported AES-GCM algorithm to encrypt any objects that you upload to Amazon S3. The decryption of AES-CBC encrypted objects and ranged requests are considered unauthenticated because the algorithms do not provide any form of authentication to ensure the integrity of the object. To enable the unauthenticated legacy mode, specify the enableLegacyUnauthenticatedModes parameter when you instantiate the v3Client. Java The following example specifies an AES key as the wrapping key. This client only encrypts with fully supported algorithms. However, it can decrypt objects encrypted with fully supported or legacy algorithms. // v3 class v3UnauthenticatedLegacyModesExample { public static void main(String[] args) { S3Client v3Client = S3EncryptionClient.builder() .aesKey(aesKey) .enableLegacyUnauthenticatedModes(true) .build(); } } Legacy 47 Amazon S3 Encryption Client Go Developer Guide The following example creates a cryptographic materials manager that only encrypts with fully supported wrapping algorithms. However, it can decrypt objects encrypted with fully supported or legacy algorithms. client, err := NewS3EncryptionClientV3(s3Client, cmm, func(clientOptions *client.EncryptionClientOptions) { clientOptions.EnableLegacyUnauthenticatedModes = true }) if err != nil { // handle error } The enableLegacyModes parameter is designed to be a temporary fix. After you've re- encrypted all of your objects with fully supported algorithms, you can remove it from your code. Encryption algorithms (Version 2.x and earlier) The following tables list the object encryption and wrapping algorithms that are supported in versions 2.x and earlier of the Amazon S3 Encryption Client. Versions 1.x and 2.x of the Amazon S3 Encryption Client are included in the following AWS SDKs. Encrypting objects — The following table lists encryption algorithms that are used to encrypt objects. Algorithm C++ AES-GCM Full Go Full Java Full AES-CBC Legacy Legacy Legacy .NET PHP v3 Ruby v2 Full No Full No Full Legacy Encrypting data keys — The following table lists encryption algorithms that are used to encrypt the data keys that were used to encrypt objects. Encryption algorithms (Version 2.x and earlier) 48 Amazon S3 Encryption Client Developer Guide Algorithm C++ AES-ECB No AES-GCM Full AESWrap Legacy Go No No No Java .NET PHP v3 Ruby v2 Legacy Legacy Full Full Legacy Legacy No No No Legacy Full Legacy KMS Legacy Legacy Legacy Legacy Legacy Legacy KMS +context RSA RSA-OAEP- SHA1 Full Full Full Full Full Full No No No No Legacy Full No Full No No Legacy Full Encryption algorithms (Version 2.x and earlier) 49 Amazon S3 Encryption Client Developer Guide Document history for the Amazon S3 Encryption Client Developer Guide The following table describes significant changes to the Amazon S3 Encryption Client Developer Guide. In addition to these major changes, we also update the documentation frequently to improve the descriptions and examples, and to address the feedback that you send to us. Change Description Date Amazon S3 Encryption Client for Go version 3.x Added and updated documentation for version 3.x November 16, 2023 Initial release of the Amazon S3 Encryption Client for Go. The initial release of this documentation describes version 3.x of the Amazon S3 Encryption Client for Java. April 5, 2023 50
amazon-verified-permissions-api-001
amazon-verified-permissions-api.pdf
1
API Reference Guide Amazon Verified Permissions Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon Verified Permissions API Reference Guide Amazon Verified Permissions: API Reference Guide Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon. Amazon Verified Permissions Table of Contents API Reference Guide Welcome ........................................................................................................................................... 1 Actions .............................................................................................................................................. 3 BatchGetPolicy .............................................................................................................................................. 5 Request Syntax ........................................................................................................................................ 5 Request Parameters ................................................................................................................................ 5 Response Syntax ...................................................................................................................................... 6 Response Elements ................................................................................................................................. 6 Errors .......................................................................................................................................................... 7 Examples ................................................................................................................................................... 8 See Also .................................................................................................................................................. 11 BatchIsAuthorized ...................................................................................................................................... 12 Request Syntax ...................................................................................................................................... 12 Request Parameters .............................................................................................................................. 13 Response Syntax ................................................................................................................................... 14 Response Elements ............................................................................................................................... 15 Errors ....................................................................................................................................................... 15 Examples ................................................................................................................................................. 17 See Also .................................................................................................................................................. 21 BatchIsAuthorizedWithToken ................................................................................................................... 23 Request Syntax ...................................................................................................................................... 23 Request Parameters .............................................................................................................................. 24 Response Syntax ................................................................................................................................... 26 Response Elements ............................................................................................................................... 27 Errors ....................................................................................................................................................... 27 Examples ................................................................................................................................................. 29 See Also .................................................................................................................................................. 33 CreateIdentitySource ................................................................................................................................. 34 Request Syntax ...................................................................................................................................... 35 Request Parameters .............................................................................................................................. 35 Response Syntax ................................................................................................................................... 37 Response Elements ............................................................................................................................... 37 Errors ....................................................................................................................................................... 38 Examples ................................................................................................................................................. 40 See Also .................................................................................................................................................. 43 iii Amazon Verified Permissions API Reference Guide CreatePolicy ................................................................................................................................................. 44 Request Syntax ...................................................................................................................................... 44 Request Parameters .............................................................................................................................. 44 Response Syntax ................................................................................................................................... 46 Response Elements ............................................................................................................................... 46 Errors ....................................................................................................................................................... 48 Examples ................................................................................................................................................. 50 See Also .................................................................................................................................................. 55 CreatePolicyStore ....................................................................................................................................... 57 Request Syntax ...................................................................................................................................... 57 Request Parameters .............................................................................................................................. 57 Response Syntax ................................................................................................................................... 59 Response Elements ............................................................................................................................... 60 Errors ....................................................................................................................................................... 61 Examples ................................................................................................................................................. 63 See Also .................................................................................................................................................. 64 CreatePolicyTemplate ................................................................................................................................ 65 Request Syntax ...................................................................................................................................... 65 Request Parameters .............................................................................................................................. 65 Response Syntax ................................................................................................................................... 67 Response Elements ............................................................................................................................... 67 Errors ....................................................................................................................................................... 68 Examples ................................................................................................................................................. 70 See Also .................................................................................................................................................. 71 DeleteIdentitySource ................................................................................................................................. 73 Request Syntax ...................................................................................................................................... 73 Request Parameters .............................................................................................................................. 73 Response Elements ............................................................................................................................... 74 Errors ....................................................................................................................................................... 74 Examples ................................................................................................................................................. 76 See Also .................................................................................................................................................. 77 DeletePolicy ................................................................................................................................................. 78 Request Syntax ...................................................................................................................................... 78 Request Parameters .............................................................................................................................. 78 Response Elements ............................................................................................................................... 79 Errors ....................................................................................................................................................... 79 iv Amazon Verified Permissions API Reference Guide Examples ................................................................................................................................................. 81 See Also .................................................................................................................................................. 82 DeletePolicyStore ....................................................................................................................................... 83 Request Syntax ...................................................................................................................................... 83 Request Parameters .............................................................................................................................. 83 Response Elements ............................................................................................................................... 83 Errors ....................................................................................................................................................... 84 Examples ................................................................................................................................................. 86 See Also .................................................................................................................................................. 86 DeletePolicyTemplate ................................................................................................................................ 88 Request Syntax ...................................................................................................................................... 88 Request Parameters .............................................................................................................................. 88 Response Elements ............................................................................................................................... 89 Errors ....................................................................................................................................................... 89 Examples ................................................................................................................................................. 91 See Also .................................................................................................................................................. 92 GetIdentitySource ....................................................................................................................................... 93 Request Syntax ...................................................................................................................................... 93 Request Parameters .............................................................................................................................. 93 Response Syntax ................................................................................................................................... 94 Response Elements ............................................................................................................................... 94 Errors ....................................................................................................................................................... 95 Examples ................................................................................................................................................. 97 See Also .................................................................................................................................................. 99 GetPolicy .................................................................................................................................................... 100 Request Syntax .................................................................................................................................... 100 Request Parameters ........................................................................................................................... 100 Response Syntax ................................................................................................................................. 101 Response Elements ............................................................................................................................ 101 Errors ..................................................................................................................................................... 103 Examples ............................................................................................................................................... 105 See Also ................................................................................................................................................ 107 GetPolicyStore .......................................................................................................................................... 108 Request Syntax .................................................................................................................................... 108 Request Parameters ........................................................................................................................... 108 Response Syntax ................................................................................................................................. 109 v Amazon Verified Permissions API Reference Guide Response Elements ............................................................................................................................ 109 Errors ..................................................................................................................................................... 111 Examples ............................................................................................................................................... 113 See Also ................................................................................................................................................ 114 GetPolicyTemplate ................................................................................................................................... 115 Request Syntax .................................................................................................................................... 115 Request Parameters ........................................................................................................................... 115 Response Syntax ................................................................................................................................. 116 Response Elements ............................................................................................................................ 116 Errors ..................................................................................................................................................... 117 Examples ............................................................................................................................................... 119 See Also ................................................................................................................................................ 120 GetSchema ................................................................................................................................................ 122 Request Syntax .................................................................................................................................... 122 Request Parameters ........................................................................................................................... 122 Response Syntax ................................................................................................................................. 122 Response Elements ............................................................................................................................ 123 Errors ..................................................................................................................................................... 124 Examples ............................................................................................................................................... 126 See Also ................................................................................................................................................ 127 IsAuthorized .............................................................................................................................................. 129 Request Syntax .................................................................................................................................... 129 Request Parameters ........................................................................................................................... 129 Response Syntax ................................................................................................................................. 131 Response Elements ............................................................................................................................ 131 Errors ..................................................................................................................................................... 132 Examples ............................................................................................................................................... 134 See Also ................................................................................................................................................ 145 IsAuthorizedWithToken ........................................................................................................................... 146 Request Syntax .................................................................................................................................... 146 Request Parameters ........................................................................................................................... 146 Response Syntax ................................................................................................................................. 149 Response Elements ............................................................................................................................ 149 Errors ..................................................................................................................................................... 150 Examples ............................................................................................................................................... 152 See Also ................................................................................................................................................ 154 vi Amazon Verified Permissions API Reference Guide ListIdentitySources ................................................................................................................................... 155 Request Syntax .................................................................................................................................... 155 Request Parameters ........................................................................................................................... 155 Response Syntax ................................................................................................................................. 157 Response Elements ............................................................................................................................ 157 Errors ..................................................................................................................................................... 158 Examples ............................................................................................................................................... 160 See Also ................................................................................................................................................ 161 ListPolicies ................................................................................................................................................. 163 Request Syntax .................................................................................................................................... 163 Request Parameters ........................................................................................................................... 163 Response Syntax ................................................................................................................................. 165 Response Elements ............................................................................................................................ 165 Errors ..................................................................................................................................................... 166 Examples ............................................................................................................................................... 168 See Also ................................................................................................................................................ 177 ListPolicyStores ......................................................................................................................................... 178 Request Syntax .................................................................................................................................... 178 Request Parameters ........................................................................................................................... 178 Response Syntax ................................................................................................................................. 179 Response Elements ............................................................................................................................ 179 Errors ..................................................................................................................................................... 180 Examples ............................................................................................................................................... 182 See Also ................................................................................................................................................ 183 ListPolicyTemplates ................................................................................................................................. 184 Request Syntax .................................................................................................................................... 184 Request Parameters ........................................................................................................................... 184 Response Syntax ................................................................................................................................. 185 Response Elements ............................................................................................................................ 186 Errors ..................................................................................................................................................... 186 Examples ............................................................................................................................................... 188 See Also ................................................................................................................................................ 189 ListTagsForResource ................................................................................................................................ 191 Request Syntax .................................................................................................................................... 191 Request Parameters ........................................................................................................................... 191 Response Syntax ................................................................................................................................. 191 vii Amazon Verified Permissions API Reference Guide Response
amazon-verified-permissions-api-002
amazon-verified-permissions-api.pdf
2
163 Response Syntax ................................................................................................................................. 165 Response Elements ............................................................................................................................ 165 Errors ..................................................................................................................................................... 166 Examples ............................................................................................................................................... 168 See Also ................................................................................................................................................ 177 ListPolicyStores ......................................................................................................................................... 178 Request Syntax .................................................................................................................................... 178 Request Parameters ........................................................................................................................... 178 Response Syntax ................................................................................................................................. 179 Response Elements ............................................................................................................................ 179 Errors ..................................................................................................................................................... 180 Examples ............................................................................................................................................... 182 See Also ................................................................................................................................................ 183 ListPolicyTemplates ................................................................................................................................. 184 Request Syntax .................................................................................................................................... 184 Request Parameters ........................................................................................................................... 184 Response Syntax ................................................................................................................................. 185 Response Elements ............................................................................................................................ 186 Errors ..................................................................................................................................................... 186 Examples ............................................................................................................................................... 188 See Also ................................................................................................................................................ 189 ListTagsForResource ................................................................................................................................ 191 Request Syntax .................................................................................................................................... 191 Request Parameters ........................................................................................................................... 191 Response Syntax ................................................................................................................................. 191 vii Amazon Verified Permissions API Reference Guide Response Elements ............................................................................................................................ 192 Errors ..................................................................................................................................................... 192 See Also ................................................................................................................................................ 194 PutSchema ................................................................................................................................................. 195 Request Syntax .................................................................................................................................... 195 Request Parameters ........................................................................................................................... 195 Response Syntax ................................................................................................................................. 196 Response Elements ............................................................................................................................ 196 Errors ..................................................................................................................................................... 197 Examples ............................................................................................................................................... 199 See Also ................................................................................................................................................ 201 TagResource .............................................................................................................................................. 202 Request Syntax .................................................................................................................................... 202 Request Parameters ........................................................................................................................... 202 Response Elements ............................................................................................................................ 203 Errors ..................................................................................................................................................... 203 See Also ................................................................................................................................................ 205 UntagResource .......................................................................................................................................... 207 Request Syntax .................................................................................................................................... 207 Request Parameters ........................................................................................................................... 207 Response Elements ............................................................................................................................ 208 Errors ..................................................................................................................................................... 208 See Also ................................................................................................................................................ 210 UpdateIdentitySource ............................................................................................................................. 211 Request Syntax .................................................................................................................................... 211 Request Parameters ........................................................................................................................... 211 Response Syntax ................................................................................................................................. 212 Response Elements ............................................................................................................................ 213 Errors ..................................................................................................................................................... 214 Examples ............................................................................................................................................... 216 See Also ................................................................................................................................................ 218 UpdatePolicy ............................................................................................................................................. 220 Request Syntax .................................................................................................................................... 220 Request Parameters ........................................................................................................................... 221 Response Syntax ................................................................................................................................. 222 Response Elements ............................................................................................................................ 223 viii Amazon Verified Permissions API Reference Guide Errors ..................................................................................................................................................... 224 Examples ............................................................................................................................................... 226 See Also ................................................................................................................................................ 228 UpdatePolicyStore ................................................................................................................................... 229 Request Syntax .................................................................................................................................... 229 Request Parameters ........................................................................................................................... 229 Response Syntax ................................................................................................................................. 230 Response Elements ............................................................................................................................ 231 Errors ..................................................................................................................................................... 231 Examples ............................................................................................................................................... 233 See Also ................................................................................................................................................ 234 UpdatePolicyTemplate ............................................................................................................................ 236 Request Syntax .................................................................................................................................... 236 Request Parameters ........................................................................................................................... 236 Response Syntax ................................................................................................................................. 238 Response Elements ............................................................................................................................ 238 Errors ..................................................................................................................................................... 239 Examples ............................................................................................................................................... 241 See Also ................................................................................................................................................ 242 Data Types ................................................................................................................................... 244 ActionIdentifier ......................................................................................................................................... 247 Contents ............................................................................................................................................... 247 See Also ................................................................................................................................................ 248 AttributeValue ........................................................................................................................................... 249 Contents ............................................................................................................................................... 249 See Also ................................................................................................................................................ 251 BatchGetPolicyErrorItem ........................................................................................................................ 252 Contents ............................................................................................................................................... 252 See Also ................................................................................................................................................ 253 BatchGetPolicyInputItem ........................................................................................................................ 254 Contents ............................................................................................................................................... 254 See Also ................................................................................................................................................ 254 BatchGetPolicyOutputItem .................................................................................................................... 256 Contents ............................................................................................................................................... 256 See Also ................................................................................................................................................ 257 BatchIsAuthorizedInputItem .................................................................................................................. 258 ix Amazon Verified Permissions API Reference Guide Contents ............................................................................................................................................... 258 See Also ................................................................................................................................................ 259 BatchIsAuthorizedOutputItem ............................................................................................................... 260 Contents ............................................................................................................................................... 260 See Also ................................................................................................................................................ 261 BatchIsAuthorizedWithTokenInputItem ............................................................................................... 262 Contents ............................................................................................................................................... 262 See Also ................................................................................................................................................ 262 BatchIsAuthorizedWithTokenOutputItem ........................................................................................... 264 Contents ............................................................................................................................................... 264 See Also ................................................................................................................................................ 265 CognitoGroupConfiguration ................................................................................................................... 266 Contents ............................................................................................................................................... 266 See Also ................................................................................................................................................ 266 CognitoGroupConfigurationDetail ........................................................................................................ 267 Contents ............................................................................................................................................... 267 See Also ................................................................................................................................................ 267 CognitoGroupConfigurationItem .......................................................................................................... 268 Contents ............................................................................................................................................... 268 See Also ................................................................................................................................................ 268 CognitoUserPoolConfiguration .............................................................................................................. 269 Contents ............................................................................................................................................... 269 See Also ................................................................................................................................................ 270 CognitoUserPoolConfigurationDetail ................................................................................................... 271 Contents ............................................................................................................................................... 271 See Also ................................................................................................................................................ 272 CognitoUserPoolConfigurationItem ..................................................................................................... 274 Contents ............................................................................................................................................... 274 See Also ................................................................................................................................................ 275 Configuration ............................................................................................................................................ 277 Contents ............................................................................................................................................... 277 See Also ................................................................................................................................................ 278 ConfigurationDetail ................................................................................................................................. 279 Contents ............................................................................................................................................... 279 See Also ................................................................................................................................................ 280 ConfigurationItem .................................................................................................................................... 281 x Amazon Verified Permissions API Reference Guide Contents ............................................................................................................................................... 281 See Also ................................................................................................................................................ 282 ContextDefinition ..................................................................................................................................... 283 Contents ............................................................................................................................................... 283 See Also ................................................................................................................................................ 284 DeterminingPolicyItem ........................................................................................................................... 285 Contents ............................................................................................................................................... 285 See Also ................................................................................................................................................ 285 EntitiesDefinition ...................................................................................................................................... 286 Contents ............................................................................................................................................... 286 See Also ................................................................................................................................................ 287 EntityIdentifier .......................................................................................................................................... 288 Contents ............................................................................................................................................... 288 See Also ................................................................................................................................................ 289 EntityItem .................................................................................................................................................. 290 Contents ............................................................................................................................................... 290 See Also ................................................................................................................................................ 291 EntityReference ........................................................................................................................................ 292 Contents ............................................................................................................................................... 292 See Also ................................................................................................................................................ 293 EvaluationErrorItem ................................................................................................................................. 294 Contents ............................................................................................................................................... 294 See Also ................................................................................................................................................ 294 IdentitySourceDetails .............................................................................................................................. 295 Contents ............................................................................................................................................... 295 See Also ................................................................................................................................................ 296 IdentitySourceFilter ................................................................................................................................. 298 Contents ............................................................................................................................................... 298 See Also ................................................................................................................................................ 298 IdentitySourceItem .................................................................................................................................. 299 Contents ............................................................................................................................................... 299 See Also ................................................................................................................................................ 300 IdentitySourceItemDetails ...................................................................................................................... 302 Contents ............................................................................................................................................... 302 See Also ................................................................................................................................................ 303 OpenIdConnectAccessTokenConfiguration ......................................................................................... 305 xi Amazon Verified Permissions API Reference Guide Contents ............................................................................................................................................... 305 See Also ................................................................................................................................................ 306 OpenIdConnectAccessTokenConfigurationDetail .............................................................................. 307 Contents ............................................................................................................................................... 307 See Also ................................................................................................................................................ 308 OpenIdConnectAccessTokenConfigurationItem ................................................................................. 309 Contents ............................................................................................................................................... 309 See Also ................................................................................................................................................ 310 OpenIdConnectConfiguration ................................................................................................................ 311 Contents ............................................................................................................................................... 311 See Also ................................................................................................................................................ 312 OpenIdConnectConfigurationDetail ..................................................................................................... 313 Contents ............................................................................................................................................... 313 See Also ................................................................................................................................................ 314 OpenIdConnectConfigurationItem ....................................................................................................... 315 Contents ............................................................................................................................................... 315 See Also ................................................................................................................................................ 316 OpenIdConnectGroupConfiguration .................................................................................................... 317 Contents ............................................................................................................................................... 317 See Also ................................................................................................................................................ 318 OpenIdConnectGroupConfigurationDetail .......................................................................................... 319 Contents ............................................................................................................................................... 319 See Also ................................................................................................................................................ 320 OpenIdConnectGroupConfigurationItem ............................................................................................ 321 Contents ............................................................................................................................................... 321 See Also ................................................................................................................................................ 322 OpenIdConnectIdentityTokenConfiguration ....................................................................................... 323 Contents ............................................................................................................................................... 323 See Also ................................................................................................................................................ 324 OpenIdConnectIdentityTokenConfigurationDetail ............................................................................ 325 Contents ............................................................................................................................................... 325 See Also ................................................................................................................................................ 326 OpenIdConnectIdentityTokenConfigurationItem .............................................................................. 327 Contents ............................................................................................................................................... 327 See Also ................................................................................................................................................ 328 OpenIdConnectTokenSelection ............................................................................................................. 329 xii Amazon Verified Permissions API Reference Guide Contents ............................................................................................................................................... 329 See Also ................................................................................................................................................ 330 OpenIdConnectTokenSelectionDetail .................................................................................................. 331 Contents ............................................................................................................................................... 331 See Also ................................................................................................................................................ 332 OpenIdConnectTokenSelectionItem ..................................................................................................... 333 Contents ............................................................................................................................................... 333 See Also ................................................................................................................................................ 334 PolicyDefinition ........................................................................................................................................ 335 Contents ............................................................................................................................................... 335 See Also ................................................................................................................................................ 336 PolicyDefinitionDetail .............................................................................................................................. 337 Contents ............................................................................................................................................... 337 See Also ................................................................................................................................................ 337 PolicyDefinitionItem ................................................................................................................................
amazon-verified-permissions-api-003
amazon-verified-permissions-api.pdf
3
320 OpenIdConnectGroupConfigurationItem ............................................................................................ 321 Contents ............................................................................................................................................... 321 See Also ................................................................................................................................................ 322 OpenIdConnectIdentityTokenConfiguration ....................................................................................... 323 Contents ............................................................................................................................................... 323 See Also ................................................................................................................................................ 324 OpenIdConnectIdentityTokenConfigurationDetail ............................................................................ 325 Contents ............................................................................................................................................... 325 See Also ................................................................................................................................................ 326 OpenIdConnectIdentityTokenConfigurationItem .............................................................................. 327 Contents ............................................................................................................................................... 327 See Also ................................................................................................................................................ 328 OpenIdConnectTokenSelection ............................................................................................................. 329 xii Amazon Verified Permissions API Reference Guide Contents ............................................................................................................................................... 329 See Also ................................................................................................................................................ 330 OpenIdConnectTokenSelectionDetail .................................................................................................. 331 Contents ............................................................................................................................................... 331 See Also ................................................................................................................................................ 332 OpenIdConnectTokenSelectionItem ..................................................................................................... 333 Contents ............................................................................................................................................... 333 See Also ................................................................................................................................................ 334 PolicyDefinition ........................................................................................................................................ 335 Contents ............................................................................................................................................... 335 See Also ................................................................................................................................................ 336 PolicyDefinitionDetail .............................................................................................................................. 337 Contents ............................................................................................................................................... 337 See Also ................................................................................................................................................ 337 PolicyDefinitionItem ................................................................................................................................ 339 Contents ............................................................................................................................................... 339 See Also ................................................................................................................................................ 339 PolicyFilter ................................................................................................................................................. 341 Contents ............................................................................................................................................... 341 See Also ................................................................................................................................................ 342 PolicyItem .................................................................................................................................................. 343 Contents ............................................................................................................................................... 343 See Also ................................................................................................................................................ 345 PolicyStoreItem ........................................................................................................................................ 346 Contents ............................................................................................................................................... 346 See Also ................................................................................................................................................ 347 PolicyTemplateItem ................................................................................................................................. 348 Contents ............................................................................................................................................... 348 See Also ................................................................................................................................................ 349 ResourceConflict ....................................................................................................................................... 350 Contents ............................................................................................................................................... 350 See Also ................................................................................................................................................ 350 SchemaDefinition ..................................................................................................................................... 351 Contents ............................................................................................................................................... 351 See Also ................................................................................................................................................ 351 StaticPolicyDefinition .............................................................................................................................. 353 xiii Amazon Verified Permissions API Reference Guide Contents ............................................................................................................................................... 353 See Also ................................................................................................................................................ 353 StaticPolicyDefinitionDetail ................................................................................................................... 355 Contents ............................................................................................................................................... 355 See Also ................................................................................................................................................ 355 StaticPolicyDefinitionItem ...................................................................................................................... 357 Contents ............................................................................................................................................... 357 See Also ................................................................................................................................................ 357 TemplateLinkedPolicyDefinition ........................................................................................................... 358 Contents ............................................................................................................................................... 358 See Also ................................................................................................................................................ 359 TemplateLinkedPolicyDefinitionDetail ................................................................................................. 360 Contents ............................................................................................................................................... 360 See Also ................................................................................................................................................ 361 TemplateLinkedPolicyDefinitionItem ................................................................................................... 362 Contents ............................................................................................................................................... 362 See Also ................................................................................................................................................ 363 UpdateCognitoGroupConfiguration ..................................................................................................... 364 Contents ............................................................................................................................................... 364 See Also ................................................................................................................................................ 364 UpdateCognitoUserPoolConfiguration ................................................................................................ 365 Contents ............................................................................................................................................... 365 See Also ................................................................................................................................................ 366 UpdateConfiguration ............................................................................................................................... 367 Contents ............................................................................................................................................... 367 See Also ................................................................................................................................................ 367 UpdateOpenIdConnectAccessTokenConfiguration ............................................................................ 369 Contents ............................................................................................................................................... 369 See Also ................................................................................................................................................ 370 UpdateOpenIdConnectConfiguration .................................................................................................. 371 Contents ............................................................................................................................................... 371 See Also ................................................................................................................................................ 372 UpdateOpenIdConnectGroupConfiguration ....................................................................................... 373 Contents ............................................................................................................................................... 373 See Also ................................................................................................................................................ 374 UpdateOpenIdConnectIdentityTokenConfiguration ......................................................................... 375 xiv Amazon Verified Permissions API Reference Guide Contents ............................................................................................................................................... 375 See Also ................................................................................................................................................ 376 UpdateOpenIdConnectTokenSelection ................................................................................................ 377 Contents ............................................................................................................................................... 377 See Also ................................................................................................................................................ 378 UpdatePolicyDefinition ........................................................................................................................... 379 Contents ............................................................................................................................................... 379 See Also ................................................................................................................................................ 379 UpdateStaticPolicyDefinition ................................................................................................................. 380 Contents ............................................................................................................................................... 380 See Also ................................................................................................................................................ 381 ValidationExceptionField ........................................................................................................................ 382 Contents ............................................................................................................................................... 382 See Also ................................................................................................................................................ 382 ValidationSettings .................................................................................................................................... 383 Contents ............................................................................................................................................... 383 See Also ................................................................................................................................................ 384 Making API requests ................................................................................................................... 385 Verified Permissions endpoints ............................................................................................................. 385 Query parameters .................................................................................................................................... 385 Request identifiers ................................................................................................................................... 385 Query API authentication ....................................................................................................................... 386 Available libraries ..................................................................................................................................... 386 Making API requests using the POST method ................................................................................... 386 Common Parameters ................................................................................................................... 389 Common Errors ............................................................................................................................ 392 Document history ........................................................................................................................ 394 AWS Glossary ............................................................................................................................... 395 xv Amazon Verified Permissions API Reference Guide Welcome Amazon Verified Permissions is a permissions management service from AWS. You can use Verified Permissions to manage permissions for your application, and authorize user access based on those permissions. Using Verified Permissions, application developers can grant access based on information about the users, resources, and requested actions. You can also evaluate additional information like group membership, attributes of the resources, and session context, such as time of request and IP addresses. Verified Permissions manages these permissions by letting you create and store authorization policies for your applications, such as consumer-facing web sites and enterprise business systems. Verified Permissions uses Cedar as the policy language to express your permission requirements. Cedar supports both role-based access control (RBAC) and attribute-based access control (ABAC) authorization models. For more information about configuring, administering, and using Amazon Verified Permissions in your applications, see the Amazon Verified Permissions User Guide. For more information about the Cedar policy language, see the Cedar Policy Language Guide. Important When you write Cedar policies that reference principals, resources and actions, you can define the unique identifiers used for each of those elements. We strongly recommend that you follow these best practices: • Use values like universally unique identifiers (UUIDs) for all principal and resource identifiers. For example, if user jane leaves the company, and you later let someone else use the name jane, then that new user automatically gets access to everything granted by policies that still reference User::"jane". Cedar can’t distinguish between the new user and the old. This applies to both principal and resource identifiers. Always use identifiers that are guaranteed unique and never reused to ensure that you don’t unintentionally grant access because of the presence of an old identifier in a policy. Where you use a UUID for an entity, we recommend that you follow it with the // comment specifier and the ‘friendly’ name of your entity. This helps to make your policies 1 Amazon Verified Permissions API Reference Guide easier to understand. For example: principal == User::"a1b2c3d4-e5f6-a1b2-c3d4- EXAMPLE11111", // alice • Do not include personally identifying, confidential, or sensitive information as part of the unique identifier for your principals or resources. These identifiers are included in log entries shared in AWS CloudTrail trails. Several operations return structures that appear similar, but have
amazon-verified-permissions-api-004
amazon-verified-permissions-api.pdf
4
presence of an old identifier in a policy. Where you use a UUID for an entity, we recommend that you follow it with the // comment specifier and the ‘friendly’ name of your entity. This helps to make your policies 1 Amazon Verified Permissions API Reference Guide easier to understand. For example: principal == User::"a1b2c3d4-e5f6-a1b2-c3d4- EXAMPLE11111", // alice • Do not include personally identifying, confidential, or sensitive information as part of the unique identifier for your principals or resources. These identifiers are included in log entries shared in AWS CloudTrail trails. Several operations return structures that appear similar, but have different purposes. As new functionality is added to the product, the structure used in a parameter of one operation might need to change in a way that wouldn't make sense for the same parameter in a different operation. To help you understand the purpose of each, the following naming convention is used for the structures: • Parameter type structures that end in Detail are used in Get operations. • Parameter type structures that end in Item are used in List operations. • Parameter type structures that use neither suffix are used in the mutating (create and update) operations. Note The example HTTP query requests and responses in this guide are displayed with the JSON formatted across multiple lines for readability. The actual query responses from the Amazon Verified Permissions service do not include this extra whitespace. We want your feedback about this documentation Our goal is to help you get everything you can from Amazon Verified Permissions. If this guide helps you to do that, then let us know. If the guide isn't helping you, then we want to hear from you so we can address the issue. Use the Feedback link that's in the upper-right corner of every page. That sends your comments directly to the writers of this guide. We review every submission, looking for opportunities to improve the documentation. Thank you in advance for your help! This document was last published on May 21, 2025. 2 Amazon Verified Permissions API Reference Guide Actions The following actions are supported: • BatchGetPolicy • BatchIsAuthorized • BatchIsAuthorizedWithToken • CreateIdentitySource • CreatePolicy • CreatePolicyStore • CreatePolicyTemplate • DeleteIdentitySource • DeletePolicy • DeletePolicyStore • DeletePolicyTemplate • GetIdentitySource • GetPolicy • GetPolicyStore • GetPolicyTemplate • GetSchema • IsAuthorized • IsAuthorizedWithToken • ListIdentitySources • ListPolicies • ListPolicyStores • ListPolicyTemplates • ListTagsForResource • PutSchema • TagResource • UntagResource • UpdateIdentitySource 3 Amazon Verified Permissions • UpdatePolicy • UpdatePolicyStore • UpdatePolicyTemplate API Reference Guide 4 Amazon Verified Permissions BatchGetPolicy Retrieves information about a group (batch) of policies. API Reference Guide Note The BatchGetPolicy operation doesn't have its own IAM permission. To authorize this operation for AWS principals, include the permission verifiedpermissions:GetPolicy in their IAM policies. Request Syntax { "requests": [ { "policyId": "string", "policyStoreId": "string" } ] } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. requests An array of up to 100 policies you want information about. Type: Array of BatchGetPolicyInputItem objects Array Members: Minimum number of 1 item. Maximum number of 100 items. BatchGetPolicy 5 API Reference Guide Amazon Verified Permissions Required: Yes Response Syntax { "errors": [ { "code": "string", "message": "string", "policyId": "string", "policyStoreId": "string" } ], "results": [ { "createdDate": "string", "definition": { ... }, "lastUpdatedDate": "string", "policyId": "string", "policyStoreId": "string", "policyType": "string" } ] } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. errors Information about the policies from the request that resulted in an error. These results are returned in the order they were requested. Type: Array of BatchGetPolicyErrorItem objects results Information about the policies listed in the request that were successfully returned. These results are returned in the order they were requested. Response Syntax 6 Amazon Verified Permissions API Reference Guide Type: Array of BatchGetPolicyOutputItem objects Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in
amazon-verified-permissions-api-005
amazon-verified-permissions-api.pdf
5
Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType Errors 7 Amazon Verified Permissions API Reference Guide The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example The following example retrieves information about the specified policies contained in the specified policy stores. . Examples 8 Amazon Verified Permissions Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.BatchGetPolicy User-Agent: <UserAgentString> API Reference Guide Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { { "requests": [ { "policyId": "SPEXAMPLEabcdefg111111", "policyStoreId": "PSEXAMPLEabcdefg111111" }, { "policyId": "SPEXAMPLEabcdefg222222", "policyStoreId": "PSEXAMPLEabcdefg111111" }, { "policyId": "SPEXAMPLEabcdefg333333", "policyStoreId": "PSEXAMPLEabcdefg111111" } ] } } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive Examples 9 Amazon Verified Permissions { "results": [ { API Reference Guide "policyStoreId": "PSEXAMPLEabcdefg111111", "policyId": "SPEXAMPLEabcdefg111111", "policyType": "STATIC", "definition": { "static": { "description": "Users can manage account resources in any account they own.", "statement": "permit (principal, action in PhotoFlash::Action:: \"ManageAccount\",resource) when { resource in principal.Account };" } }, "createdDate": "2024-10-18T18:53:39.258153Z", "lastUpdatedDate": "2024-10-18T18:53:39.258153Z" }, { "policyStoreId": "PSEXAMPLEabcdefg111111", "policyId": "SPEXAMPLEabcdefg222222", "policyType": "STATIC", "definition": { "static": { "description": "User alice can't delete any photos.", "statement": "forbid (principal == PhotoFlash::User::\"alice\", action in [PhotoFlash::Action::\"DeletePhoto\"], resource);" } }, "createdDate": "2024-10-18T18:57:03.305027Z", "lastUpdatedDate": "2024-10-18T18:57:03.305027Z" }, { "policyStoreId": "PSEXAMPLEabcdefg111111", "policyId": "SPEXAMPLEabcdefg333333", "policyType": "STATIC", "definition": { "static": { "description": "User alice can view and delete photos.", "statement": "permit (principal == PhotoFlash::User::\"alice\", action in [PhotoFlash::Action::\"DeletePhoto\", PhotoFlash::Action::\"ViewPhoto\"], resource);" } }, "createdDate": "2024-10-18T18:57:48.005343Z", Examples 10 Amazon Verified Permissions API Reference Guide "lastUpdatedDate": "2024-10-18T18:57:48.005343Z" } ] } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 11 Amazon Verified Permissions BatchIsAuthorized API Reference Guide 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
amazon-verified-permissions-api-006
amazon-verified-permissions-api.pdf
6
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 AWS principals, include the permission verifiedpermissions:IsAuthorized in their IAM policies. Request Syntax { "entities": { ... }, "policyStoreId": "string", "requests": [ { "action": { "actionId": "string", "actionType": "string" }, "context": { ... }, "principal": { "entityId": "string", "entityType": "string" BatchIsAuthorized 12 API Reference Guide Amazon Verified Permissions }, "resource": { "entityId": "string", "entityType": "string" } } ] } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. policyStoreId Specifies the ID of the policy store. Policies in this policy store will be used to make the authorization decisions for the input. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes requests An array of up to 30 requests that you want Verified Permissions to evaluate. Type: Array of BatchIsAuthorizedInputItem objects Array Members: Minimum number of 1 item. Required: Yes Request Parameters 13 Amazon Verified Permissions entities API Reference Guide (Optional) Specifies the list of resources and principals and their associated attributes that Verified Permissions can examine when evaluating the policies. These additional entities and their attributes can be referenced and checked by conditional elements in the policies in the specified policy store. Note You can include only principal and resource entities in this parameter; you can't include actions. You must specify actions in the schema. Type: EntitiesDefinition object Note: This object is a Union. Only one member of this object can be specified or returned. Required: No Response Syntax { "results": [ { "decision": "string", "determiningPolicies": [ { "policyId": "string" } ], "errors": [ { "errorDescription": "string" } ], "request": { "action": { "actionId": "string", "actionType": "string" }, "context": { ... }, Response Syntax 14 Amazon Verified Permissions API Reference Guide "principal": { "entityId": "string", "entityType": "string" }, "resource": { "entityId": "string", "entityType": "string" } } } ] } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. results 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. Type: Array of BatchIsAuthorizedOutputItem objects Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 Response Elements 15 Amazon Verified Permissions ResourceNotFoundException API Reference Guide The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. Errors 16 Amazon Verified Permissions API Reference Guide • UnsafeOptionalAttributeAccess The policy attempts to access a record or
amazon-verified-permissions-api-007
amazon-verified-permissions-api.pdf
7
isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. Errors 16 Amazon Verified Permissions API Reference Guide • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example requests for multiple principals and actions with one resource The following example requests two authorization decisions for two principals of type User named Alice and Annalisa. Alice wants to perform the ViewPhoto operation on a resource of type Photo named VacationPhoto94.jpg. The photo is in Alice's account. Annalisa wants to delete VacationPhoto94.jpg. The response shows that Alice's request was allowed by one policy and Annalisa's request was denied because the photo is in someone else's account. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.BatchIsAuthorized User-Agent: <UserAgentString> Examples 17 Amazon Verified Permissions API Reference Guide Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "requests": [ { "principal": { "entityType": "PhotoFlash::User", "entityId": "Alice" }, "action": { "actionType": "PhotoFlash::Action", "actionId": "ViewPhoto" }, "resource": { "entityType": "PhotoFlash::Photo", "entityId": "VacationPhoto94.jpg" } }, { "principal": { "entityType": "PhotoFlash::User", "entityId": "Annalisa" }, "action": { "actionType": "PhotoFlash::Action", "actionId": "DeletePhoto" }, "resource": { "entityType": "PhotoFlash::Photo", "entityId": "VacationPhoto94.jpg" } } ], "entities": { "entityList": [ { "identifier": { "entityType": "PhotoFlash::User", "entityId": "Alice" }, "attributes": { "Account": { Examples 18 Amazon Verified Permissions API Reference Guide "entityIdentifier": { "entityType": "PhotoFlash::Account", "entityId": "1234" } }, "Email": { "string": "" } }, "parents": [] }, { "identifier": { "entityType": "PhotoFlash::User", "entityId": "Annalisa" }, "attributes": { "Account": { "entityIdentifier": { "entityType": "PhotoFlash::Account", "entityId": "5678" } }, "Email": { "string": "" } }, "parents": [] }, { "identifier": { "entityType": "PhotoFlash::Photo", "entityId": "VacationPhoto94.jpg" }, "attributes": { "IsPrivate": { "boolean": false }, "Name": { "string": "" } }, "parents": [ { Examples 19 Amazon Verified Permissions API Reference Guide "entityType": "PhotoFlash::Account", "entityId": "1234" } ] }, { "identifier": { "entityType": "PhotoFlash::Account", "entityId": "1234" }, "attributes": { "Name": { "string": "" } }, "parents": [] } ] }, "policyStoreId": "PSEXAMPLEabcdefg111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "results": [ { "request": { "principal": { "entityType": "PhotoFlash::User", "entityId": "alice" }, "action": { Examples 20 Amazon Verified Permissions API Reference Guide "actionType": "PhotoFlash::Action", "actionId": "ViewPhoto" }, "resource": { "entityType": "PhotoFlash::Photo", "entityId": "VacationPhoto94.jpg" } }, "decision": "ALLOW", "determiningPolicies": [ { "policyId": "SPEXAMPLEabcdefg111111" } ], "errors": [] }, { "request": { "principal": { "entityType": "PhotoFlash::User", "entityId": "annalisa" }, "action": { "actionType": "PhotoFlash::Action", "actionId": "DeletePhoto" }, "resource": { "entityType": "PhotoFlash::Photo", "entityId": "VacationPhoto94.jpg" } }, "decision": "DENY", "determiningPolicies": [], "errors": [] } ] } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: See Also 21 API Reference Guide Amazon Verified Permissions • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 22 Amazon Verified Permissions API Reference Guide BatchIsAuthorizedWithToken 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
amazon-verified-permissions-api-008
amazon-verified-permissions-api.pdf
8
SDK for Python • AWS SDK for Ruby V3 See Also 22 Amazon Verified Permissions API Reference Guide BatchIsAuthorizedWithToken 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 AWS principals, include the permission verifiedpermissions:IsAuthorizedWithToken in their IAM policies. Request Syntax { "accessToken": "string", "entities": { ... }, "identityToken": "string", "policyStoreId": "string", "requests": [ { "action": { "actionId": "string", "actionType": "string" }, "context": { ... }, "resource": { "entityId": "string", "entityType": "string" } BatchIsAuthorizedWithToken 23 Amazon Verified Permissions API Reference Guide } ] } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. policyStoreId Specifies the ID of the policy store. Policies in this policy store will be used to make an authorization decision for the input. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes requests An array of up to 30 requests that you want Verified Permissions to evaluate. Type: Array of BatchIsAuthorizedWithTokenInputItem objects Array Members: Minimum number of 1 item. Required: Yes 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. Request Parameters 24 Amazon Verified Permissions API Reference Guide Must be an access token. Verified Permissions returns an error if the token_use claim in the submitted token isn't access. Type: String Length Constraints: Minimum length of 1. Maximum length of 131072. Pattern: [A-Za-z0-9-_=]+.[A-Za-z0-9-_=]+.[A-Za-z0-9-_=]+ Required: No entities (Optional) Specifies the list of resources and their associated attributes that Verified Permissions can examine when evaluating the policies. These additional entities and their attributes can be referenced and checked by conditional elements in the policies in the specified policy store. Important 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. Type: EntitiesDefinition object Note: This object is a Union. Only one member of this object can be specified or returned. Required: No 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. Request Parameters 25 Amazon Verified Permissions Type: String API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 131072. Pattern: [A-Za-z0-9-_=]+.[A-Za-z0-9-_=]+.[A-Za-z0-9-_=]+ Required: No Response Syntax { "principal": { "entityId": "string", "entityType": "string" }, "results": [ { "decision": "string", "determiningPolicies": [ { "policyId": "string" } ], "errors": [ { "errorDescription": "string" } ], "request": { "action": { "actionId": "string", "actionType": "string" }, "context": { ... }, "resource": { "entityId": "string", "entityType": "string" } } } ] } Response Syntax 26 Amazon Verified Permissions Response Elements API Reference Guide If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. results 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. Type: Array of BatchIsAuthorizedWithTokenOutputItem objects principal The identifier of the principal in the ID or access token. Type: EntityIdentifier object Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this
amazon-verified-permissions-api-009
amazon-verified-permissions-api.pdf
9
Response Elements API Reference Guide If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. results 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. Type: Array of BatchIsAuthorizedWithTokenOutputItem objects principal The identifier of the principal in the ID or access token. Type: EntityIdentifier object Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. Response Elements 27 Amazon Verified Permissions HTTP Status Code: 400 ValidationException API Reference Guide The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Errors 28 Amazon Verified Permissions API Reference Guide Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example requests for multiple actions and resource The following example requests two authorization decisions for a principal from a user pool token. This variation on the PhotoFlash sample policy store has the following policy: • principal in PhotoFlash::FriendGroup::"us-east-1_EXAMPLE|MyExampleGroup" The user's token contains a cognito:groups claim that includes MyExampleGroup. • action in [PhotoFlash::Action::"FullPhotoAccess"] The actions ViewPhoto and SharePhoto have FullPhotoAccess as a parent in the policy store schema. • resource in PhotoFlash::Album::"MyExampleAlbum1" The album membership of the photos is declared in entities. The result of this batch of requests is that the user can view and share a photo in an album that is authorized for their friend group, but not a photo in a different album. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Examples 29 Amazon Verified Permissions Accept-Encoding: identity API Reference Guide X-Amz-Target: VerifiedPermissions.BatchIsAuthorizedWithToken User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "identityToken": "eyJra12345EXAMPLE", "requests": [ { "action": { "actionType": "PhotoFlash::Action", "actionId": "ViewPhoto" }, "resource": { "entityType": "PhotoFlash::Photo", "entityId": "VacationPhoto94.jpg" } }, { "action": { "actionType": "PhotoFlash::Action", "actionId": "SharePhoto" }, "resource": { "entityType": "PhotoFlash::Photo", "entityId": "VacationPhoto94.jpg" } }, { "action": { "actionType": "PhotoFlash::Action", "actionId": "ViewPhoto" }, "resource": { "entityType": "PhotoFlash::Photo", "entityId": "OfficePhoto94.jpg" } } ], "entities": { "entityList": [ { Examples 30 Amazon Verified Permissions API Reference Guide "identifier": { "entityType": "PhotoFlash::Photo", "entityId": "VacationPhoto94.jpg" }, "parents": [ { "entityType": "PhotoFlash::Album", "entityId": "MyExampleAlbum1" } ] }, { "identifier": { "entityType": "PhotoFlash::Photo", "entityId": "OfficePhoto94.jpg" }, "parents": [ { "entityType": "PhotoFlash::Album", "entityId": "MyExampleAlbum2" } ] } ] }, "policyStoreId": "PSEXAMPLEabcdefg111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "principal": { "entityType": "PhotoFlash::User", Examples 31 Amazon Verified Permissions API Reference Guide "entityId": "us-east-1_EXAMPLE|a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" }, "results": [ { "request": { "action": { "actionType": "PhotoFlash::Action", "actionId": "ViewPhoto" }, "resource": { "entityType": "PhotoFlash::Photo", "entityId": "VacationPhoto94.jpg" } }, "decision":
amazon-verified-permissions-api-010
amazon-verified-permissions-api.pdf
10
"PhotoFlash::Photo", "entityId": "VacationPhoto94.jpg" }, "parents": [ { "entityType": "PhotoFlash::Album", "entityId": "MyExampleAlbum1" } ] }, { "identifier": { "entityType": "PhotoFlash::Photo", "entityId": "OfficePhoto94.jpg" }, "parents": [ { "entityType": "PhotoFlash::Album", "entityId": "MyExampleAlbum2" } ] } ] }, "policyStoreId": "PSEXAMPLEabcdefg111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "principal": { "entityType": "PhotoFlash::User", Examples 31 Amazon Verified Permissions API Reference Guide "entityId": "us-east-1_EXAMPLE|a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" }, "results": [ { "request": { "action": { "actionType": "PhotoFlash::Action", "actionId": "ViewPhoto" }, "resource": { "entityType": "PhotoFlash::Photo", "entityId": "VacationPhoto94.jpg" } }, "decision": "ALLOW", "determiningPolicies": [ { "policyId": "SPEXAMPLEabcdefg111111" } ], "errors": [] }, { "request": { "action": { "actionType": "PhotoFlash::Action", "actionId": "SharePhoto" }, "resource": { "entityType": "PhotoFlash::Photo", "entityId": "VacationPhoto94.jpg" } }, "decision": "ALLOW", "determiningPolicies": [ { "policyId": "SPEXAMPLEabcdefg111111" } ], "errors": [] }, { "request": { "action": { Examples 32 Amazon Verified Permissions API Reference Guide "actionType": "PhotoFlash::Action", "actionId": "ViewPhoto" }, "resource": { "entityType": "PhotoFlash::Photo", "entityId": "OfficePhoto94.jpg" } }, "decision": "DENY", "determiningPolicies": [], "errors": [] } ] } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 33 Amazon Verified Permissions API Reference Guide CreateIdentitySource Adds an identity source to a policy store–an Amazon Cognito user pool or OpenID Connect (OIDC) 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 or BatchIsAuthorizedWithToken API operations. These identities take the form of tokens that contain claims about the user, such as IDs, attributes and group memberships. Identity sources provide identity (ID) tokens and access tokens. Verified Permissions derives information about your user and session from token claims. Access tokens provide action context to your policies, and ID tokens provide principal Attributes. Important 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 Note To reference a user from this identity source in your Cedar policies, refer to the following syntax examples. • Amazon Cognito user pool: Namespace::[Entity type]::[User pool ID]|[user principal attribute], for example MyCorp::User::us-east-1_EXAMPLE| a1b2c3d4-5678-90ab-cdef-EXAMPLE11111. • OpenID Connect (OIDC) provider: Namespace::[Entity type]:: [entityIdPrefix]|[user principal attribute], for example MyCorp::User::MyOIDCProvider|a1b2c3d4-5678-90ab-cdef-EXAMPLE22222. CreateIdentitySource 34 Amazon Verified Permissions API Reference Guide Note Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations. Request Syntax { "clientToken": "string", "configuration": { ... }, "policyStoreId": "string", "principalEntityType": "string" } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. configuration Specifies the details required to communicate with the identity provider (IdP) associated with this identity source. Type: Configuration object Note: This object is a Union. Only one member of this object can be specified or returned. Required: Yes Request Syntax 35 Amazon Verified Permissions policyStoreId API Reference Guide 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: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes 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 AWS generates a random one for you. If you retry the operation with the same ClientToken, but with different parameters, the retry fails with an ConflictException error. Verified Permissions recognizes a ClientToken for eight hours. After eight hours, the next request with the same parameters performs the operation again regardless of the value of ClientToken. Type: String Length Constraints: Minimum length of 1. Maximum length of 64. Pattern: [a-zA-Z0-9-]* Required: No principalEntityType Specifies the namespace and data type of the principals generated for identities authenticated by the new
amazon-verified-permissions-api-011
amazon-verified-permissions-api.pdf
11
a UUID type of value.. If you don't provide this value, then AWS generates a random one for you. If you retry the operation with the same ClientToken, but with different parameters, the retry fails with an ConflictException error. Verified Permissions recognizes a ClientToken for eight hours. After eight hours, the next request with the same parameters performs the operation again regardless of the value of ClientToken. Type: String Length Constraints: Minimum length of 1. Maximum length of 64. Pattern: [a-zA-Z0-9-]* Required: No principalEntityType Specifies the namespace and data type of the principals generated for identities authenticated by the new identity source. Type: String Request Parameters 36 Amazon Verified Permissions API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: .* Required: No Response Syntax { "createdDate": "string", "identitySourceId": "string", "lastUpdatedDate": "string", "policyStoreId": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. createdDate The date and time the identity source was originally created. Type: Timestamp identitySourceId The unique ID of the new identity source. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-]* lastUpdatedDate The date and time the identity source was most recently updated. Type: Timestamp Response Syntax 37 Amazon Verified Permissions policyStoreId API Reference Guide The ID of the policy store that contains the identity source. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 ConflictException The request failed because another request to modify a resource occurred at the same. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 ServiceQuotaExceededException The request failed because it would cause a service quota to be exceeded. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. Errors 38 Amazon Verified Permissions HTTP Status Code: 400 ValidationException API Reference Guide The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Errors 39 Amazon Verified Permissions API Reference Guide Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example The following example request creates an identity source that Verified Permissions can use to retrieve authenticated identities for authorization requests. The specified identity provider (IdP) is a Amazon Cognito user pool. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.CreateIdentitySource User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "configuration": { "cognitoUserPoolConfiguration": { "userPoolArn": "arn:aws:cognito-idp:us-east-1:123456789012:userpool/us- east-1_1a2b3c4d5", "clientIds": ["a1b2c3d4e5f6g7h8i9j0kalbmc"], "groupConfiguration": { "groupEntityType": "MyCorp::UserGroup" Examples 40 Amazon Verified Permissions } } }, "policyStoreId": "PSEXAMPLEabcdefg111111", "principalEntityType": "MyCorp::User", "clientToken": "a1b2c3d4-e5f6-a1b2-c3d4-TOKEN1111111" API Reference Guide } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method
amazon-verified-permissions-api-012
amazon-verified-permissions-api.pdf
12
creates an identity source that Verified Permissions can use to retrieve authenticated identities for authorization requests. The specified identity provider (IdP) is a Amazon Cognito user pool. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.CreateIdentitySource User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "configuration": { "cognitoUserPoolConfiguration": { "userPoolArn": "arn:aws:cognito-idp:us-east-1:123456789012:userpool/us- east-1_1a2b3c4d5", "clientIds": ["a1b2c3d4e5f6g7h8i9j0kalbmc"], "groupConfiguration": { "groupEntityType": "MyCorp::UserGroup" Examples 40 Amazon Verified Permissions } } }, "policyStoreId": "PSEXAMPLEabcdefg111111", "principalEntityType": "MyCorp::User", "clientToken": "a1b2c3d4-e5f6-a1b2-c3d4-TOKEN1111111" API Reference Guide } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "createdDate":"2023-05-19T20:30:28.214829Z", "identitySourceId":"ISEXAMPLEabcdefg111111", "lastUpdatedDate":"2023-05-19T20:30:28.214829Z", "policyStoreId":"PSEXAMPLEabcdefg111111" } Example The following example request creates an identity source that Verified Permissions can use to retrieve authenticated identities for authorization requests. The specified identity provider (IdP) is OpenID Connect (OIDC). Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.CreateIdentitySource User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Examples 41 Amazon Verified Permissions API Reference Guide Content-Length: <PayloadSizeBytes> { "configuration": { "openIdConnectConfiguration": { "issuer": "https://auth.example.com", "tokenSelection": { "accessTokenOnly": { "audiences": [ "1example23456789", "2example10111213" ], "principalIdClaim": "sub" } }, "entityIdPrefix": "MyOIDCProvider", "groupConfiguration": { "groupClaim": "groups", "groupEntityType": "MyCorp::UserGroup" } } }, "policyStoreId": "PSEXAMPLEabcdefg111111", "principalEntityType": "MyCorp::User", "clientToken": "a1b2c3d4-e5f6-a1b2-c3d4-TOKEN1111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "createdDate":"2023-05-19T20:30:28.214829Z", "identitySourceId":"ISEXAMPLEabcdefg111111", "lastUpdatedDate":"2023-05-19T20:30:28.214829Z", Examples 42 Amazon Verified Permissions API Reference Guide "policyStoreId":"PSEXAMPLEabcdefg111111" } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 43 Amazon Verified Permissions CreatePolicy API Reference Guide 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. Note Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations. Request Syntax { "clientToken": "string", "definition": { ... }, "policyStoreId": "string" } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. CreatePolicy 44 Amazon Verified Permissions API Reference Guide Note In the following list, the required parameters are described first. definition 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. Type: PolicyDefinition object Note: This object is a Union. Only one member of this object can be specified or returned. Required: Yes policyStoreId Specifies the PolicyStoreId of the policy store you want to store the policy in. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes 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 AWS generates a random one for you. If you retry the operation with the same ClientToken, but with different parameters, the retry fails with an ConflictException error. Verified Permissions recognizes a ClientToken for eight hours. After eight hours, the next request with the same parameters performs the operation again regardless of the value of ClientToken. Request Parameters 45 Amazon Verified Permissions Type: String API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 64. Pattern: [a-zA-Z0-9-]* Required: No Response Syntax { "actions": [
amazon-verified-permissions-api-013
amazon-verified-permissions-api.pdf
13
that you use a UUID type of value.. If you don't provide this value, then AWS generates a random one for you. If you retry the operation with the same ClientToken, but with different parameters, the retry fails with an ConflictException error. Verified Permissions recognizes a ClientToken for eight hours. After eight hours, the next request with the same parameters performs the operation again regardless of the value of ClientToken. Request Parameters 45 Amazon Verified Permissions Type: String API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 64. Pattern: [a-zA-Z0-9-]* Required: No Response Syntax { "actions": [ { "actionId": "string", "actionType": "string" } ], "createdDate": "string", "effect": "string", "lastUpdatedDate": "string", "policyId": "string", "policyStoreId": "string", "policyType": "string", "principal": { "entityId": "string", "entityType": "string" }, "resource": { "entityId": "string", "entityType": "string" } } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. createdDate The date and time the policy was originally created. Response Syntax 46 API Reference Guide Amazon Verified Permissions Type: Timestamp lastUpdatedDate The date and time the policy was last updated. Type: Timestamp policyId The unique ID of the new policy. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-]* policyStoreId The ID of the policy store that contains the new policy. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* policyType The policy type of the new policy. Type: String Valid Values: STATIC | TEMPLATE_LINKED actions The action that a policy permits or forbids. For example, {"actions": [{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"}, {"entityID": "SharePhoto", "entityType": "PhotoFlash::Action"}]}. Type: Array of ActionIdentifier objects effect The effect of the decision that a policy returns to an authorization request. For example, "effect": "Permit". Response Elements 47 Amazon Verified Permissions Type: String Valid Values: Permit | Forbid principal API Reference Guide The principal specified in the new policy's scope. This response element isn't present when principal isn't specified in the policy content. Type: EntityIdentifier object resource 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. Type: EntityIdentifier object Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 ConflictException The request failed because another request to modify a resource occurred at the same. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 Errors 48 Amazon Verified Permissions API Reference Guide ServiceQuotaExceededException The request failed because it would cause a service quota to be exceeded. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more Errors 49 Amazon Verified Permissions API Reference Guide information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain
amazon-verified-permissions-api-014
amazon-verified-permissions-api.pdf
14
first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example 1 The following example request creates a static policy with a policy scope that specifies both a principal and a resource. The response includes both the Principal and Resource elements because both were specified in the request policy scope. Note The JSON in the parameters of this operation are strings that can contain embedded quotation marks (") within the outermost quotation mark pair. When you are calling the API directly, using a tool like the AWS CLI or Postman, you have to stringify the JSON object by preceding all embedded quotation marks with a backslash character ( \" ) and combining all lines into a single text line with no line breaks. Examples 50 Amazon Verified Permissions API Reference Guide Example strings are displayed wrapped across multiple lines here for readability, but the operation requires the parameters be submitted as single line strings. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.CreatePolicy User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "definition": { "static": { "description": "Grant members of janeFriends UserGroup view and share access to the vacationFolder Album", "statement": "permit( principal in PhotoFlash::UserGroup::\"janeFriends\", action in [PhotoFlash::Action::\"ViewPhoto\", PhotoFlash::Action::\"SharePhoto\"], resource in PhotoFlash::Album::\"vacationFolder\" );" } }, "policyStoreId": "PSEXAMPLEabcdefg111111", "clientToken": "a1b2c3d4-e5f6-a1b2-c3d4-TOKEN1111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive Examples 51 API Reference Guide Amazon Verified Permissions { "actions": [ { "actionId": "ViewPhoto", "actionType": "PhotoFlash::Action" }, { "actionId": "SharePhoto", "actionType": "PhotoFlash::Action" } ], "createdDate":"2023-05-16T20:33:01.730817Z", "effect": "Permit", "lastUpdatedDate":"2023-05-16T20:33:01.730817Z", "policyId":"SPEXAMPLEabcdefg111111", "policyStoreId":"PSEXAMPLEabcdefg111111", "policyType": "STATIC", "principal": { "entityId": "janeFriends", "entityType": "PhotoFlash::UserGroup" }, "resource": { "entityId": "vacationFolder", "entityType": "PhotoFlash::Album" } } Example 2 The following example creates a static policy with a policy scope that identifies a specific resource but does not specify a principal. Therefore, the response does not include a Principal element. Note The JSON in the parameters of this operation are strings that can contain embedded quotation marks (") within the outermost quotation mark pair. When you are calling the API directly, using a tool like the AWS CLI or Postman, you have to stringify the JSON object by preceding all embedded quotation marks with a backslash character ( \" ) and combining all lines into a single text line with no line breaks. Example strings are displayed wrapped across multiple lines here for readability, but the operation requires the parameters be submitted as single line strings. Examples 52 Amazon Verified Permissions Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.CreatePolicy User-Agent: <UserAgentString> API Reference Guide Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "definition": { "static": { "description": "Grant everyone full access to the publicFolder Album", "statement": "permit(principal, action, resource in PhotoFlash::Album:: \"publicFolder\");" } }, "policyStoreId": "PSEXAMPLEabcdefg111111", "clientToken": "a1b2c3d4-e5f6-a1b2-c3d4-TOKEN1111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "createdDate": "2023-05-16T21:19:44.528576+00:00", "effect": "Permit", "lastUpdatedDate": "2023-05-16T21:19:44.528576+00:00", "policyId": "SPEXAMPLEabcdefg222222", "policyStoreId": "PSEXAMPLEabcdefg111111", "policyType": "STATIC", Examples 53 Amazon Verified Permissions "resource": { "entityId": "publicFolder", "entityType": "PhotoFlash::Album" } } Example 3 API Reference Guide The following example creates a template-linked policy using the following policy template and associates the specified principal to use with the new template-linked policy. permit ( principal in ?principal, action == PhotoFlash::Action::"ViewPhoto", resource == PhotoFlash::Photo::"VacationPhoto94.jpg" ); Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.CreatePolicy User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "definition": { "templateLinked": { "policyTemplateId": "PTEXAMPLEabcdefg111111", "principal": { "entityType": "PhotoFlash::User", "entityId": "alice" } } }, "policyStoreId": "PSEXAMPLEabcdefg111111", "clientToken": "a1b2c3d4-e5f6-a1b2-c3d4-TOKEN1111111" } Examples 54 Amazon Verified Permissions Sample Response API Reference Guide HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "actions": [ { "actionId": "FullPhotoAccess", "actionType": "PhotoFlash::Action" } ], "createdDate":"2023-05-22T18:57:53.298278Z", "effect": "Permit", "lastUpdatedDate":"2023-05-22T18:57:53.298278Z", "policyId": "TPEXAMPLEabcdefg111111", "policyStoreId": "PSEXAMPLEabcdefg111111", "policyType": "TEMPLATE_LINKED", "principal": { "entityType": "PhotoFlash::User", "entityId": "alice" }, "resource": { "entityType": "PhotoFlash::Photo", "entityId": "VacationPhoto94.jpg" } } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command
amazon-verified-permissions-api-015
amazon-verified-permissions-api.pdf
15
"alice" } } }, "policyStoreId": "PSEXAMPLEabcdefg111111", "clientToken": "a1b2c3d4-e5f6-a1b2-c3d4-TOKEN1111111" } Examples 54 Amazon Verified Permissions Sample Response API Reference Guide HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "actions": [ { "actionId": "FullPhotoAccess", "actionType": "PhotoFlash::Action" } ], "createdDate":"2023-05-22T18:57:53.298278Z", "effect": "Permit", "lastUpdatedDate":"2023-05-22T18:57:53.298278Z", "policyId": "TPEXAMPLEabcdefg111111", "policyStoreId": "PSEXAMPLEabcdefg111111", "policyType": "TEMPLATE_LINKED", "principal": { "entityType": "PhotoFlash::User", "entityId": "alice" }, "resource": { "entityType": "PhotoFlash::Photo", "entityId": "VacationPhoto94.jpg" } } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET See Also 55 API Reference Guide Amazon Verified Permissions • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 56 Amazon Verified Permissions CreatePolicyStore API Reference Guide Creates a policy store. A policy store is a container for policy resources. Note Although Cedar supports multiple namespaces, Verified Permissions currently supports only one namespace per policy store. Note Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations. Request Syntax { "clientToken": "string", "deletionProtection": "string", "description": "string", "tags": { "string" : "string" }, "validationSettings": { "mode": "string" } } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. CreatePolicyStore 57 Amazon Verified Permissions API Reference Guide Note In the following list, the required parameters are described first. validationSettings Specifies the validation setting for this policy store. Currently, the only valid and required value is Mode. Important 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. Type: ValidationSettings object Required: Yes 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 AWS generates a random one for you. If you retry the operation with the same ClientToken, but with different parameters, the retry fails with an ConflictException error. Verified Permissions recognizes a ClientToken for eight hours. After eight hours, the next request with the same parameters performs the operation again regardless of the value of ClientToken. Type: String Request Parameters 58 Amazon Verified Permissions API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 64. Pattern: [a-zA-Z0-9-]* Required: No deletionProtection Specifies whether the policy store can be deleted. If enabled, the policy store can't be deleted. The default state is DISABLED. Type: String Valid Values: ENABLED | DISABLED Required: No description Descriptive text that you can provide to help with identification of the current policy store. Type: String Length Constraints: Minimum length of 0. Maximum length of 150. Required: No tags The list of key-value pairs to associate with the policy store. Type: String to string map Map Entries: Minimum number of 0 items. Maximum number of 200 items. Key Length Constraints: Minimum length of 1. Maximum length of 128. Value Length Constraints: Minimum length of 0. Maximum length of 256. Required: No Response Syntax { Response Syntax 59 Amazon Verified Permissions API Reference Guide "arn": "string", "createdDate": "string", "lastUpdatedDate": "string", "policyStoreId": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. arn The Amazon Resource Name (ARN) of the new policy store. Type: String Length Constraints: Minimum length of 1. Maximum length of 2500. Pattern: arn:[^:]*:[^:]*:[^:]*:[^:]*:.* createdDate The date and time the policy store was originally created. Type: Timestamp lastUpdatedDate The date and time the policy store was last updated. Type: Timestamp policyStoreId The unique ID of the new policy store. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Response Elements 60 Amazon Verified Permissions Errors API Reference Guide For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to
amazon-verified-permissions-api-016
amazon-verified-permissions-api.pdf
16
(ARN) of the new policy store. Type: String Length Constraints: Minimum length of 1. Maximum length of 2500. Pattern: arn:[^:]*:[^:]*:[^:]*:[^:]*:.* createdDate The date and time the policy store was originally created. Type: Timestamp lastUpdatedDate The date and time the policy store was last updated. Type: Timestamp policyStoreId The unique ID of the new policy store. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Response Elements 60 Amazon Verified Permissions Errors API Reference Guide For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 ConflictException The request failed because another request to modify a resource occurred at the same. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ServiceQuotaExceededException The request failed because it would cause a service quota to be exceeded. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId Errors 61 Amazon Verified Permissions API Reference Guide The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Errors 62 Amazon Verified Permissions API Reference Guide Examples Example The following example creates a new policy store with strict validation turned on. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.CreatePolicyStore User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "validationSettings": {"mode": "STRICT"}, "clientToken": "a1b2c3d4-e5f6-a1b2-c3d4-TOKEN1111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "policyStoreId":"PSEXAMPLEabcdefg111111", "arn":"arn:aws:verifiedpermissions::123456789012:policy-store/ PSEXAMPLEabcdefg111111", "createdDate":"2023-05-16T17:41:29.103459Z", "lastUpdatedDate":"2023-05-16T17:41:29.103459Z" } Examples 63 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 64 Amazon Verified Permissions API Reference Guide CreatePolicyTemplate 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. Note Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations. Request Syntax { "clientToken": "string", "description": "string", "policyStoreId": "string", "statement":
amazon-verified-permissions-api-017
amazon-verified-permissions-api.pdf
17
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. Note Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations. Request Syntax { "clientToken": "string", "description": "string", "policyStoreId": "string", "statement": "string" } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. policyStoreId The ID of the policy store in which to create the policy template. CreatePolicyTemplate 65 Amazon Verified Permissions Type: String API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes statement Specifies the content that you want to use for the new policy template, written in the Cedar policy language. Type: String Length Constraints: Minimum length of 1. Maximum length of 10000. Required: Yes 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 AWS generates a random one for you. If you retry the operation with the same ClientToken, but with different parameters, the retry fails with an ConflictException error. Verified Permissions recognizes a ClientToken for eight hours. After eight hours, the next request with the same parameters performs the operation again regardless of the value of ClientToken. Type: String Length Constraints: Minimum length of 1. Maximum length of 64. Pattern: [a-zA-Z0-9-]* Required: No Request Parameters 66 Amazon Verified Permissions description API Reference Guide Specifies a description for the policy template. Type: String Length Constraints: Minimum length of 0. Maximum length of 150. Required: No Response Syntax { "createdDate": "string", "lastUpdatedDate": "string", "policyStoreId": "string", "policyTemplateId": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. createdDate The date and time the policy template was originally created. Type: Timestamp lastUpdatedDate The date and time the policy template was most recently updated. Type: Timestamp policyStoreId The ID of the policy store that contains the policy template. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Response Syntax 67 Amazon Verified Permissions Pattern: [a-zA-Z0-9-/_]* policyTemplateId The unique ID of the new policy template. Type: String API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 ConflictException The request failed because another request to modify a resource occurred at the same. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 ServiceQuotaExceededException The request failed because it would cause a service quota to be exceeded. HTTP Status Code: 400 Errors 68 Amazon Verified Permissions ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException API Reference Guide The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in
amazon-verified-permissions-api-018
amazon-verified-permissions-api.pdf
18
includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its Errors 69 Amazon Verified Permissions API Reference Guide value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example The following example creates a policy template that has a placeholder for the principal. Note The JSON in the parameters of this operation are strings that can contain embedded quotation marks (") within the outermost quotation mark pair. When you are calling the API directly, using a tool like the AWS CLI or Postman, you have to stringify the JSON object by preceding all embedded quotation marks with a backslash character ( \" ) and combining all lines into a single text line with no line breaks. Example strings are displayed wrapped across multiple lines here for readability, but the operation requires the parameters be submitted as single line strings. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity Examples 70 Amazon Verified Permissions API Reference Guide X-Amz-Target: VerifiedPermissions.CreatePolicyTemplate User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "description": "Template for research dept", "policyStoreId": "PSEXAMPLEabcdefg111111", "statement": "\"AccessVacation\"\npermit(\n principal in ?principal,\n action == Action::\"view\",\n resource == Photo::\"VacationPhoto94.jpg\"\n)\nwhen {\n principal has department && principal.department == \"research\"\n};", "clientToken": "a1b2c3d4-e5f6-a1b2-c3d4-TOKEN1111111"} Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "policyStoreId":"PSEXAMPLEabcdefg111111", "policyTemplateId":"PTEXAMPLEabcdefg111111", "createdDate":"2023-05-17T18:58:48.795411Z", "lastUpdatedDate":"2023-05-17T18:58:48.795411Z" } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ See Also 71 Amazon Verified Permissions • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 API Reference Guide See Also 72 Amazon Verified Permissions API Reference Guide DeleteIdentitySource 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. Request Syntax { "identitySourceId": "string", "policyStoreId": "string" } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. identitySourceId Specifies the ID of the identity source that you want to delete. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-]* Required: Yes policyStoreId Specifies the ID of the policy store that contains the identity source that you want to delete. DeleteIdentitySource 73 Amazon Verified Permissions Type: String API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes Response Elements If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body. Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 ConflictException The request failed because another request to modify a resource occurred at the same. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't
amazon-verified-permissions-api-019
amazon-verified-permissions-api.pdf
19
[a-zA-Z0-9-/_]* Required: Yes Response Elements If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body. Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 ConflictException The request failed because another request to modify a resource occurred at the same. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. Response Elements 74 Amazon Verified Permissions HTTP Status Code: 400 ValidationException API Reference Guide The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Errors 75 Amazon Verified Permissions API Reference Guide Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example The following example request deletes the specified identity source. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.DeleteIdentitySource User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "identitySourceId": "ISEXAMPLEabcdefg111111", "policyStoreId": "PSEXAMPLEabcdefg111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Examples 76 Amazon Verified Permissions API Reference Guide Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive {} See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 77 Amazon Verified Permissions DeletePolicy Deletes the specified policy from the policy store. API Reference Guide This operation is idempotent; if you specify a policy that doesn't exist, the request response returns a successful HTTP 200 status code. Request Syntax { "policyId": "string", "policyStoreId": "string" } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. policyId Specifies the ID of the policy that you want to delete. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-]* Required: Yes policyStoreId Specifies the ID of the policy store that contains the policy that you want to delete. DeletePolicy 78 Amazon Verified Permissions Type: String API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes Response Elements If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body. Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 ConflictException
amazon-verified-permissions-api-020
amazon-verified-permissions-api.pdf
20
1. Maximum length of 200. Pattern: [a-zA-Z0-9-]* Required: Yes policyStoreId Specifies the ID of the policy store that contains the policy that you want to delete. DeletePolicy 78 Amazon Verified Permissions Type: String API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes Response Elements If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body. Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 ConflictException The request failed because another request to modify a resource occurred at the same. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. Response Elements 79 Amazon Verified Permissions HTTP Status Code: 400 ValidationException API Reference Guide The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Errors 80 Amazon Verified Permissions API Reference Guide Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example The following example deletes the specified policy from its policy store. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.DeletePolicy User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "policyId": "SPEXAMPLEabcdefg111111", "policyStoreId": "PSEXAMPLEabcdefg111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Examples 81 Amazon Verified Permissions API Reference Guide Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive {} See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 82 Amazon Verified Permissions DeletePolicyStore Deletes the specified policy store. API Reference Guide 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. Request Syntax { "policyStoreId": "string" } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. policyStoreId Specifies the ID of the policy store that you want to delete. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes Response Elements If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body. DeletePolicyStore 83 Amazon Verified Permissions Errors API Reference Guide For information about the errors that are common to all actions, see Common
amazon-verified-permissions-api-021
amazon-verified-permissions-api.pdf
21
that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. policyStoreId Specifies the ID of the policy store that you want to delete. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes Response Elements If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body. DeletePolicyStore 83 Amazon Verified Permissions Errors API Reference Guide For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 InvalidStateException The policy store can't be deleted because deletion protection is enabled. To delete this policy store, disable deletion protection. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication Errors 84 Amazon Verified Permissions API Reference Guide The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Errors 85 Amazon Verified Permissions API Reference Guide Examples Example The following example deletes the specified policy store. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.DeletePolicyStore User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "policyStoreId": "PSEXAMPLEabcdefg111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive {} See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface Examples 86 API Reference Guide Amazon Verified Permissions • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 87 Amazon Verified Permissions API Reference Guide DeletePolicyTemplate Deletes the specified policy template from the policy store. Important 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. Request Syntax { "policyStoreId": "string", "policyTemplateId": "string" } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. policyStoreId Specifies the ID of the policy store that contains the policy template that you want to delete. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes DeletePolicyTemplate 88 Amazon Verified Permissions policyTemplateId API Reference Guide Specifies the ID of the policy template that you want to delete. Type: String Length Constraints:
amazon-verified-permissions-api-022
amazon-verified-permissions-api.pdf
22
"policyStoreId": "string", "policyTemplateId": "string" } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. policyStoreId Specifies the ID of the policy store that contains the policy template that you want to delete. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes DeletePolicyTemplate 88 Amazon Verified Permissions policyTemplateId API Reference Guide Specifies the ID of the policy template that you want to delete. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes Response Elements If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body. Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 ConflictException The request failed because another request to modify a resource occurred at the same. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 Response Elements 89 Amazon Verified Permissions ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException API Reference Guide The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its Errors 90 Amazon Verified Permissions API Reference Guide value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example The following example deletes a policy template. Before you can perform this operation, you must first delete any template-linked policies that were instantiated from this policy template. To delete them, use DeletePolicy. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.DeletePolicyTemplate User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "policyStoreId": "PSEXAMPLEabcdefg111111", "policyTemplateId": "PTEXAMPLEabcdefg111111" } Examples 91 API Reference Guide Amazon Verified Permissions Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive {} See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 92 Amazon Verified Permissions GetIdentitySource Retrieves the details about the specified identity source. API Reference Guide Request Syntax { "identitySourceId": "string", "policyStoreId": "string" } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. identitySourceId Specifies the ID of the identity source you
amazon-verified-permissions-api-023
amazon-verified-permissions-api.pdf
23
V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 92 Amazon Verified Permissions GetIdentitySource Retrieves the details about the specified identity source. API Reference Guide Request Syntax { "identitySourceId": "string", "policyStoreId": "string" } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. identitySourceId Specifies the ID of the identity source you want information about. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-]* Required: Yes policyStoreId Specifies the ID of the policy store that contains the identity source you want information about. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* GetIdentitySource 93 API Reference Guide Amazon Verified Permissions Required: Yes Response Syntax { "configuration": { ... }, "createdDate": "string", "details": { "clientIds": [ "string" ], "discoveryUrl": "string", "openIdIssuer": "string", "userPoolArn": "string" }, "identitySourceId": "string", "lastUpdatedDate": "string", "policyStoreId": "string", "principalEntityType": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. createdDate The date and time that the identity source was originally created. Type: Timestamp identitySourceId The ID of the identity source. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-]* lastUpdatedDate The date and time that the identity source was most recently updated. Response Syntax 94 API Reference Guide Amazon Verified Permissions Type: Timestamp policyStoreId The ID of the policy store that contains the identity source. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* principalEntityType The data type of principals generated for identities authenticated by this identity source. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: .* configuration Contains configuration information about an identity source. Type: ConfigurationDetail object Note: This object is a Union. Only one member of this object can be specified or returned. details This parameter has been deprecated. A structure that describes the configuration of the identity source. Type: IdentitySourceDetails object Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 Errors 95 Amazon Verified Permissions InternalServerException API Reference Guide The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute Errors 96 Amazon Verified Permissions API Reference Guide The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example The following example retrieves the details for the specified identity source. Sample Request POST
amazon-verified-permissions-api-024
amazon-verified-permissions-api.pdf
24
Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example The following example retrieves the details for the specified identity source. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.GetIdentitySource User-Agent: <UserAgentString> Examples 97 Amazon Verified Permissions API Reference Guide Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "identitySourceId": "ISEXAMPLEabcdefg111111", "policyStoreId": "PSEXAMPLEabcdefg111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "createdDate": "2023-05-19T20:30:28.173926Z", "details": { "clientIds": [ "a1b2c3d4e5f6g7h8i9j0kalbmc" ], "userPoolArn":"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us- east-1_1a2b3c4d5", "discoveryUrl":"https://cognito-idp.us-east-1.amazonaws.com/us- east-1_1a2b3c4d5", "openIdIssuer":"COGNITO" }, "identitySourceId":"ISEXAMPLEabcdefg111111", "lastUpdatedDate":"2023-05-22T20:45:59.962216Z", "policyStoreId":"PSEXAMPLEabcdefg111111", "principalEntityType":"MyCorp::User", "configuration": { "cognitoUserPoolConfiguration": { "userPoolArn": "arn:aws:cognito-idp:us-east-1:123456789012:userpool/us- east-1_1a2b3c4d5", "clientIds": [], "issuer": "https://cognito-idp.us-east-1.amazonaws.com/us- east-1_1a2b3c4d5", "groupConfiguration": { Examples 98 Amazon Verified Permissions API Reference Guide "groupEntityType": "MyCorp::UserGroup" } } } } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 99 API Reference Guide Amazon Verified Permissions GetPolicy Retrieves information about the specified policy. Request Syntax { "policyId": "string", "policyStoreId": "string" } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. policyId Specifies the ID of the policy you want information about. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-]* Required: Yes policyStoreId Specifies the ID of the policy store that contains the policy that you want information about. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. GetPolicy 100 Amazon Verified Permissions API Reference Guide Pattern: [a-zA-Z0-9-/_]* Required: Yes Response Syntax { "actions": [ { "actionId": "string", "actionType": "string" } ], "createdDate": "string", "definition": { ... }, "effect": "string", "lastUpdatedDate": "string", "policyId": "string", "policyStoreId": "string", "policyType": "string", "principal": { "entityId": "string", "entityType": "string" }, "resource": { "entityId": "string", "entityType": "string" } } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. createdDate The date and time that the policy was originally created. Type: Timestamp Response Syntax 101 Amazon Verified Permissions definition The definition of the requested policy. Type: PolicyDefinitionDetail object API Reference Guide Note: This object is a Union. Only one member of this object can be specified or returned. lastUpdatedDate The date and time that the policy was last updated. Type: Timestamp policyId The unique ID of the policy that you want information about. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-]* policyStoreId The ID of the policy store that contains the policy that you want information about. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* policyType The type of the policy. Type: String Valid Values: STATIC | TEMPLATE_LINKED actions The action that a policy permits or forbids. For example, {"actions": [{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"}, {"entityID": "SharePhoto", "entityType": "PhotoFlash::Action"}]}. Response Elements 102 Amazon Verified Permissions API Reference Guide Type: Array of ActionIdentifier objects effect The effect of the decision that a policy returns to an authorization request. For example, "effect": "Permit". Type: String Valid Values: Permit | Forbid principal 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. Type: EntityIdentifier object resource 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. Type: EntityIdentifier object Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. Errors 103 Amazon Verified Permissions HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400
amazon-verified-permissions-api-025
amazon-verified-permissions-api.pdf
25
This element isn't included in the response when Resource isn't present in the policy content. Type: EntityIdentifier object Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. Errors 103 Amazon Verified Permissions HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException API Reference Guide The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess Errors 104 Amazon Verified Permissions API Reference Guide The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example The following example retrieves information about the specified policy contained in the specified policy store. In this example, the requested policy is a template-linked policy, so it returns the ID of the policy template, and the specific principal and resource used by this policy. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.GetPolicy User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { Examples 105 Amazon Verified Permissions API Reference Guide "policyId": "SPEXAMPLEabcdefg111111", "policyStoreId": "PSEXAMPLEabcdefg111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "actions": [ { "actionId": "SharePhoto", "actionType": "PhotoFlash::Action" } ], "createdDate":"2023-05-16T20:33:01.730817Z", "definition": { "static": { "description": "Grant everyone of janeFriends UserGroup permission to share photos in the vacationFolder Album", "statement": "permit(principal in PhotoFlash::UserGroup::\"janeFriends \", action in PhotoFlash::Action::\"SharePhoto\", resource in PhotoFlash::Album:: \"vacationFolder\");" } }, "effect": "Permit", "lastUpdatedDate":"2023-05-16T20:33:01.730817Z", "policyId":"SPEXAMPLEabcdefg111111", "policyStoreId":"PSEXAMPLEabcdefg111111", "policyType":"STATIC", "principal": { "entityId": "PhotoFlash::UserGroup", "entityType": "janeFriends" }, "resource": { Examples 106 Amazon Verified Permissions API Reference Guide "entityId": "vacationFolder", "entityType": "PhotoFlash::Album" } } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 107 API Reference Guide Amazon Verified Permissions GetPolicyStore Retrieves details about a policy store. Request Syntax { "policyStoreId": "string", "tags": boolean } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. policyStoreId Specifies the ID of the policy store that you want information about. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes tags Specifies whether to return the tags that are attached to the policy store. If this parameter is included in the API call, the tags are returned, otherwise they are not returned. GetPolicyStore
amazon-verified-permissions-api-026
amazon-verified-permissions-api.pdf
26
boolean } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. policyStoreId Specifies the ID of the policy store that you want information about. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes tags Specifies whether to return the tags that are attached to the policy store. If this parameter is included in the API call, the tags are returned, otherwise they are not returned. GetPolicyStore 108 Amazon Verified Permissions API Reference Guide Note If this parameter is included in the API call but there are no tags attached to the policy store, the tags response parameter is omitted from the response. Type: Boolean Required: No Response Syntax { "arn": "string", "cedarVersion": "string", "createdDate": "string", "deletionProtection": "string", "description": "string", "lastUpdatedDate": "string", "policyStoreId": "string", "tags": { "string" : "string" }, "validationSettings": { "mode": "string" } } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. arn The Amazon Resource Name (ARN) of the policy store. Type: String Length Constraints: Minimum length of 1. Maximum length of 2500. Response Syntax 109 Amazon Verified Permissions API Reference Guide Pattern: arn:[^:]*:[^:]*:[^:]*:[^:]*:.* createdDate The date and time that the policy store was originally created. Type: Timestamp lastUpdatedDate The date and time that the policy store was last updated. Type: Timestamp policyStoreId The ID of the policy store; Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* validationSettings The current validation settings for the policy store. Type: ValidationSettings object cedarVersion The version of the Cedar language used with policies, policy templates, and schemas in this policy store. For more information, see Amazon Verified Permissions upgrade to Cedar v4 FAQ. Type: String Valid Values: CEDAR_2 | CEDAR_4 deletionProtection Specifies whether the policy store can be deleted. If enabled, the policy store can't be deleted. The default state is DISABLED. Type: String Valid Values: ENABLED | DISABLED Response Elements 110 Amazon Verified Permissions description API Reference Guide Descriptive text that you can provide to help with identification of the current policy store. Type: String Length Constraints: Minimum length of 0. Maximum length of 150. tags The list of tags associated with the policy store. Type: String to string map Map Entries: Minimum number of 0 items. Maximum number of 200 items. Key Length Constraints: Minimum length of 1. Maximum length of 128. Value Length Constraints: Minimum length of 0. Maximum length of 256. Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. Errors 111 Amazon Verified Permissions HTTP Status Code: 400 ValidationException API Reference Guide The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Errors 112 Amazon Verified Permissions API Reference Guide Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The
amazon-verified-permissions-api-027
amazon-verified-permissions-api.pdf
27
Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Errors 112 Amazon Verified Permissions API Reference Guide Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example The following example retrieves details about the specified policy store. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.GetPolicyStore User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "policyStoreId": "PSEXAMPLEabcdefg111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> Examples 113 API Reference Guide Amazon Verified Permissions vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "policyStoreId": "PSEXAMPLEabcdefg111111", "arn": "arn:aws:verifiedpermissions::123456789012:policy-store/ PSEXAMPLEabcdefg111111", "validationSettings": {"mode":"STRICT"}, "createdDate": "2023-05-17T16:20:22.75472Z", "lastUpdatedDate": "2023-05-17T16:20:22.75472Z" } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 114 Amazon Verified Permissions GetPolicyTemplate API Reference Guide Retrieve the details for the specified policy template in the specified policy store. Request Syntax { "policyStoreId": "string", "policyTemplateId": "string" } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. policyStoreId Specifies the ID of the policy store that contains the policy template that you want information about. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes policyTemplateId Specifies the ID of the policy template that you want information about. Type: String GetPolicyTemplate 115 Amazon Verified Permissions API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes Response Syntax { "createdDate": "string", "description": "string", "lastUpdatedDate": "string", "policyStoreId": "string", "policyTemplateId": "string", "statement": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. createdDate The date and time that the policy template was originally created. Type: Timestamp lastUpdatedDate The date and time that the policy template was most recently updated. Type: Timestamp policyStoreId The ID of the policy store that contains the policy template. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Response Syntax 116 Amazon Verified Permissions API Reference Guide Pattern: [a-zA-Z0-9-/_]* policyTemplateId The ID of the policy template. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* statement The content of the body of the policy template written in the Cedar policy language. Type: String Length Constraints: Minimum length of 1. Maximum length of 10000. description The description of the policy template. Type: String Length Constraints: Minimum length of 0. Maximum length of 150. Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 Errors 117 Amazon Verified Permissions ResourceNotFoundException API Reference Guide The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid
amazon-verified-permissions-api-028
amazon-verified-permissions-api.pdf
28
Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more Errors 118 Amazon Verified Permissions API Reference Guide information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example The following example displays the details of the specified policy template. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.GetPolicyTemplate User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> Examples 119 Amazon Verified Permissions API Reference Guide { "policyStoreId": "PSEXAMPLEabcdefg111111", "policyTemplateId": "PTEXAMPLEabcdefg111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "policyStoreId":"PSEXAMPLEabcdefg111111", "policyTemplateId":"PTEXAMPLEabcdefg111111", "description":"Template for research dept", "statement":"\"ResearchAccess\"\npermit(\n principal in ?principal,\n action == Action::\"view\",\n resource in ?resource"\n)\nwhen {\n principal has department && principal.department == \"research\"\n};", "createdDate":"2023-05-17T18:58:48.795411Z", "lastUpdatedDate":"2023-05-17T18:58:48.795411Z" } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 See Also 120 Amazon Verified Permissions • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 API Reference Guide See Also 121 Amazon Verified Permissions GetSchema API Reference Guide Retrieve the details for the specified schema in the specified policy store. Request Syntax { "policyStoreId": "string" } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. policyStoreId Specifies the ID of the policy store that contains the schema. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes Response Syntax { "createdDate": "string", "lastUpdatedDate": "string", "namespaces": [ "string" ], GetSchema 122 Amazon Verified Permissions API Reference Guide "policyStoreId": "string", "schema": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. createdDate The date and time that the schema was originally created. Type: Timestamp lastUpdatedDate The date and time that the schema was most recently updated. Type: Timestamp policyStoreId The ID of the policy store that contains the schema. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* schema The body of the schema, written in Cedar schema JSON. Type: String Length Constraints: Minimum length of 1. namespaces The namespaces of the entities referenced by this schema. Type: Array of strings Response Elements 123 Amazon Verified Permissions API Reference Guide Length Constraints: Minimum length of 0. Maximum length of 100. Pattern: .* Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again
amazon-verified-permissions-api-029
amazon-verified-permissions-api.pdf
29
of 200. Pattern: [a-zA-Z0-9-/_]* schema The body of the schema, written in Cedar schema JSON. Type: String Length Constraints: Minimum length of 1. namespaces The namespaces of the entities referenced by this schema. Type: Array of strings Response Elements 123 Amazon Verified Permissions API Reference Guide Length Constraints: Minimum length of 0. Maximum length of 100. Pattern: .* Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId Errors 124 Amazon Verified Permissions API Reference Guide The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Errors 125 Amazon Verified Permissions API Reference Guide Examples Example The following example retrieves the current schema stored in the specified policy store. Note The JSON in the parameters of this operation are strings that can contain embedded quotation marks (") within the outermost quotation mark pair. When you are calling the API directly, using a tool like the AWS CLI or Postman, you have to stringify the JSON object by preceding all embedded quotation marks with a backslash character ( \" ) and combining all lines into a single text line with no line breaks. Example strings are displayed wrapped across multiple lines here for readability, but the operation requires the parameters be submitted as single line strings. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.GetSchema User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "policyStoreId": "PSEXAMPLEabcdefg111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin Examples 126 Amazon Verified Permissions API Reference Guide vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "policyStoreId":"PSEXAMPLEabcdefg111111", "schema": "{ \"My::Application\": { \"actions\": { \"remoteAccess\": { \"appliesTo\": { \"principalTypes\": [\"Employee\"] } } }, \"entityTypes\": { \"Employee\": { \"shape\": { \"attributes\": { \"jobLevel\": { \"type\": \"Long\" }, \"name\": { \"type\":\"String\" } }, \"type\": \"Record\" } } } } }", "createdDate": "2023-05-18T14:46:35.020571Z", "lastUpdatedDate":"2023-05-23T16:48:20.95041Z" } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 See Also 127 Amazon Verified Permissions • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 API Reference Guide See Also 128 Amazon Verified Permissions IsAuthorized API Reference Guide 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
amazon-verified-permissions-api-030
amazon-verified-permissions-api.pdf
30
• AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 See Also 127 Amazon Verified Permissions • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 API Reference Guide See Also 128 Amazon Verified Permissions IsAuthorized API Reference Guide 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. Request Syntax { "action": { "actionId": "string", "actionType": "string" }, "context": { ... }, "entities": { ... }, "policyStoreId": "string", "principal": { "entityId": "string", "entityType": "string" }, "resource": { "entityId": "string", "entityType": "string" } } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. IsAuthorized 129 Amazon Verified Permissions policyStoreId API Reference Guide Specifies the ID of the policy store. Policies in this policy store will be used to make an authorization decision for the input. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes action Specifies the requested action to be authorized. For example, is the principal authorized to perform this action on the resource? Type: ActionIdentifier object Required: No context Specifies additional context that can be used to make more granular authorization decisions. Type: ContextDefinition object Note: This object is a Union. Only one member of this object can be specified or returned. Required: No entities (Optional) Specifies the list of resources and principals and their associated attributes that Verified Permissions can examine when evaluating the policies. These additional entities and their attributes can be referenced and checked by conditional elements in the policies in the specified policy store. Note You can include only principal and resource entities in this parameter; you can't include actions. You must specify actions in the schema. Request Parameters 130 Amazon Verified Permissions API Reference Guide Type: EntitiesDefinition object Note: This object is a Union. Only one member of this object can be specified or returned. Required: No principal Specifies the principal for which the authorization decision is to be made. Type: EntityIdentifier object Required: No resource Specifies the resource for which the authorization decision is to be made. Type: EntityIdentifier object Required: No Response Syntax { "decision": "string", "determiningPolicies": [ { "policyId": "string" } ], "errors": [ { "errorDescription": "string" } ] } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. Response Syntax 131 Amazon Verified Permissions decision API Reference Guide An authorization decision that indicates if the authorization request should be allowed or denied. Type: String Valid Values: ALLOW | DENY determiningPolicies 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. Type: Array of DeterminingPolicyItem objects errors 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. Type: Array of EvaluationErrorItem objects Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. Errors 132 Amazon Verified Permissions HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException API Reference Guide The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action
amazon-verified-permissions-api-031
amazon-verified-permissions-api.pdf
31
Errors 132 Amazon Verified Permissions HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException API Reference Guide The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess Errors 133 Amazon Verified Permissions API Reference Guide The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example 1 The following example requests an authorization decision for a principal of type User named Alice, who wants to perform the updatePhoto operation, on a resource of type Photo named VacationPhoto94.jpg. The response shows that the request was allowed by one policy. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.IsAuthorized User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> Examples 134 Amazon Verified Permissions API Reference Guide { "principal": { "entityType": "PhotoFlash::User", "entityId": "alice" }, "action": { "actionType": "Action", "actionId": "view" }, "resource": { "entityType": "PhotoFlash::Photo", "entityId": "VacationPhoto94.jpg" }, "policyStoreId": "PSEXAMPLEabcdefg111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "decision": "ALLOW", "determiningPolicies": [ { "policyId": "SPEXAMPLEabcdefg111111" } ], "errors": [] } Example 2 The following example is the same as the previous example, except that the principal is User::"bob", and the policy store doesn't contain any policy that allows that user access to Examples 135 Amazon Verified Permissions API Reference Guide Album::"alice_folder". The output infers that the Deny was implicit because the list of DeterminingPolicies is empty. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.IsAuthorized User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "principal": { "entityType": "PhotoFlash::User", "entityId": "bob" }, "action": { "actionType": "Action", "actionId": "view" }, "resource": { "entityType": "PhotoFlash::Photo", "entityId": "VacationPhoto94.jpg" }, "policyStoreId": "PSEXAMPLEabcdefg111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive Examples 136 Amazon Verified Permissions { "decision": "DENY", "determiningPolicies": [], "errors": [] } Example 3 - entityList API Reference Guide The following example is a more extensive request for an authorization decision for a principal of type User named alice, who wants to perform the updatePhoto operation, on a resource of type Photo named VacationPhoto94.jpg. The request includes the optional entities element, that specifies that the photo is contained in an Album named alice_folder. Those additional entities and their attributes can be referenced and checked by conditional elements in the policies in the specified policy store. In this example, the policy that permits access specifies that User::"alice" is allowed to update photos in the folder Album::"alice_folder" This example uses the entityList parameter for EntitiesDefinition. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.IsAuthorized User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "policyStoreId": "PSEXAMPLEabcdefg111111", "principal": { "entityType": "PhotoFlash::User", "entityId": "alice" }, "action": { "actionType": "Action", "actionId": "updatePhoto" }, Examples 137 API Reference Guide Amazon Verified Permissions "resource": { "entityType": "PhotoFlash::Photo", "entityId": "VacationPhoto94.jpg" }, "entities": { "entityList": [ { "identifier": { "entityType": "PhotoFlash::Photo", "entityId":
amazon-verified-permissions-api-032
amazon-verified-permissions-api.pdf
32
elements in the policies in the specified policy store. In this example, the policy that permits access specifies that User::"alice" is allowed to update photos in the folder Album::"alice_folder" This example uses the entityList parameter for EntitiesDefinition. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.IsAuthorized User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "policyStoreId": "PSEXAMPLEabcdefg111111", "principal": { "entityType": "PhotoFlash::User", "entityId": "alice" }, "action": { "actionType": "Action", "actionId": "updatePhoto" }, Examples 137 API Reference Guide Amazon Verified Permissions "resource": { "entityType": "PhotoFlash::Photo", "entityId": "VacationPhoto94.jpg" }, "entities": { "entityList": [ { "identifier": { "entityType": "PhotoFlash::Photo", "entityId": "VacationPhoto94.jpg" }, "attributes": {}, "parents": [ { "entityType": "PhotoFlash::Album", "entityId": "alice_folder" } ] }, { "identifier": { "entityType": "PhotoFlash::Album", "entityId": "alice_folder" } } ] } } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "determiningPolicies": [ Examples 138 Amazon Verified Permissions { "PolicyId": "SPEXAMPLEabcdefg111111" } API Reference Guide ], "decision": "ALLOW", "errors": [] } Example 4 - entityList The following example relies on the DigitalPetStore sample app and the policy Customer Role - Get Order. To satisfy this policy, Alice must be in the Customer role and the Order must have Alice in the owner attribute. To define Alice and the order with these properties, we must dive deeper into the entities element and declare that Alice is a customer, and the order is owned by Alice. Because Alice is the customer who placed the order, Verified Permissions returns an ALLOW decision to their request for the action DigitalPetStore::GetOrder. This example uses the entityList parameter for EntitiesDefinition. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.IsAuthorized User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "principal": { "entityType": "DigitalPetStore::User", "entityId": "Alice" }, "action": { "actionType": "DigitalPetStore::Action", "actionId": "GetOrder" }, "resource": { "entityType": "DigitalPetStore::Order", "entityId": "1234" Examples 139 Amazon Verified Permissions }, "entities": { "entityList": [ { "identifier": { "entityType": "DigitalPetStore::User", "entityId": "Alice" }, "attributes": { "memberId": { "string": "5cad60b9-209c-46d6-bfb7-536c341634ca" } }, "parents": [ { "entityType": "DigitalPetStore::Role", "entityId": "Customer" } ] }, { "identifier": { "entityType": "DigitalPetStore::Order", "entityId": "1234" }, "attributes": { "owner": { "entityIdentifier": { "entityType": "DigitalPetStore::User", "entityId": "Alice" } } }, "parents": [] } ] }, "policyStoreId": "PSEXAMPLEabcdefg111111" } Sample Response HTTP/1.1 200 OK Examples API Reference Guide 140 Amazon Verified Permissions API Reference Guide Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "decision": "ALLOW", "determiningPolicies": [ { "policyId": "SPEXAMPLEabcdefg111111" } ], "errors": [] } Example 5 - cedarJson The following example is a more extensive request for an authorization decision for a principal of type User named alice, who wants to perform the updatePhoto operation, on a resource of type Photo named VacationPhoto94.jpg. The request includes the optional entities element, that specifies that the photo is contained in an Album named alice_folder. Those additional entities and their attributes can be referenced and checked by conditional elements in the policies in the specified policy store. In this example, the policy that permits access specifies that User::"alice" is allowed to update photos in the folder Album::"alice_folder" This example uses the cedarJson parameter for EntitiesDefinition. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.IsAuthorized User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Examples 141 Amazon Verified Permissions API Reference Guide Content-Length: <PayloadSizeBytes> { "policyStoreId": "PSEXAMPLEabcdefg111111", "principal": { "entityType": "PhotoFlash::User", "entityId": "alice" }, "action": { "actionType": "Action", "actionId": "updatePhoto" }, "resource": { "entityType": "PhotoFlash::Photo", "entityId": "VacationPhoto94.jpg" }, "entities": { {"cedarJson": " [{\"uid\":{\"type\":\"PhotoFlash::Photo\",\"id\":\"VacationPhoto94.jpg\"}, \"attrs\":{}, \"parents\":[{\"type\":\"PhotoFlash::Album\",\"id\":\"alice_folder\"}]} ], [{\"uid\":{\"type\":\"PhotoFlash::Album\",\"id\":\"alice_folder\"}, \"attrs\":{}, \"parents\":[]} ]" } } } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { Examples 142 Amazon Verified Permissions API Reference Guide "determiningPolicies": [ { "PolicyId": "SPEXAMPLEabcdefg111111" } ], "decision": "ALLOW", "errors": [] } Example 6 - cedarJson The following example relies on the DigitalPetStore sample app and the policy Customer Role - Get Order. To satisfy this policy, Alice must be in the Customer role and the Order must have Alice in the owner attribute. To define Alice and the order with these properties, we must dive deeper into the entities element and declare that Alice is a customer, and the order is owned by Alice. Because Alice is the customer who placed the order, Verified Permissions returns an ALLOW decision to their request for the action DigitalPetStore::GetOrder. This example uses the cedarJson parameter for EntitiesDefinition. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.IsAuthorized User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "principal": { "entityType": "DigitalPetStore::User", "entityId": "Alice" }, "action": { "actionType": "DigitalPetStore::Action", "actionId": "GetOrder" }, "resource": { Examples 143 Amazon
amazon-verified-permissions-api-033
amazon-verified-permissions-api.pdf
33
Alice and the order with these properties, we must dive deeper into the entities element and declare that Alice is a customer, and the order is owned by Alice. Because Alice is the customer who placed the order, Verified Permissions returns an ALLOW decision to their request for the action DigitalPetStore::GetOrder. This example uses the cedarJson parameter for EntitiesDefinition. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.IsAuthorized User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "principal": { "entityType": "DigitalPetStore::User", "entityId": "Alice" }, "action": { "actionType": "DigitalPetStore::Action", "actionId": "GetOrder" }, "resource": { Examples 143 Amazon Verified Permissions API Reference Guide "entityType": "DigitalPetStore::Order", "entityId": "1234" }, "entities": { {"cedarJson": " [{\"uid\":{\"type\":\"DigitalPetStore::User\",\"id\":\"Alice\"}, \"attrs\":{\"memberId\":\"5cad60b9-209c-46d6-bfb7-536c341634ca\"}, \"parents\":[{\"type\":\"DigitalPetStore::Role\",\"id\":\"Customer\"}]} ], [{\"uid\":{\"type\":\"DigitalPetStore::Order\",\"id\":\"1234\"}, \"attrs\":{\"owner\":{\"type\":\"DigitalPetStore::User\",\"id\":\"Alice \"}, \"parents\":[]} ]" } }, "policyStoreId": "PSEXAMPLEabcdefg111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "decision": "ALLOW", "determiningPolicies": [ { "policyId": "SPEXAMPLEabcdefg111111" } ], "errors": [] } Examples 144 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 145 Amazon Verified Permissions API Reference Guide IsAuthorizedWithToken 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. Important 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 Request Syntax { "accessToken": "string", "action": { "actionId": "string", "actionType": "string" }, "context": { ... }, "entities": { ... }, "identityToken": "string", "policyStoreId": "string", "resource": { "entityId": "string", "entityType": "string" } } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. IsAuthorizedWithToken 146 Amazon Verified Permissions API Reference Guide The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. policyStoreId Specifies the ID of the policy store. Policies in this policy store will be used to make an authorization decision for the input. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes 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: String Length Constraints: Minimum length of 1. Maximum length of 131072. Pattern: [A-Za-z0-9-_=]+.[A-Za-z0-9-_=]+.[A-Za-z0-9-_=]+ Required: No action Specifies the requested action to be authorized. Is the specified principal authorized to perform this action on the specified resource. Request Parameters 147 Amazon Verified Permissions API Reference Guide Type: ActionIdentifier object Required: No context Specifies additional context that can be used to make more granular authorization decisions. Type: ContextDefinition object Note: This object is a Union. Only one member of this object can be specified or returned. Required: No entities (Optional) Specifies the list of resources and their associated attributes that Verified Permissions can examine when evaluating the policies. These additional entities and their attributes can be referenced and checked by conditional elements in the policies in the specified policy store. Important 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. Type: EntitiesDefinition object Note: This object is a Union. Only one member of this object can be specified or returned. Required: No identityToken Specifies an identity token for the principal to
amazon-verified-permissions-api-034
amazon-verified-permissions-api.pdf
34
specified policy store. Important 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. Type: EntitiesDefinition object Note: This object is a Union. Only one member of this object can be specified or returned. Required: No 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. Request Parameters 148 Amazon Verified Permissions API Reference Guide Must be an ID token. Verified Permissions returns an error if the token_use claim in the submitted token isn't id. Type: String Length Constraints: Minimum length of 1. Maximum length of 131072. Pattern: [A-Za-z0-9-_=]+.[A-Za-z0-9-_=]+.[A-Za-z0-9-_=]+ Required: No resource Specifies the resource for which the authorization decision is made. For example, is the principal allowed to perform the action on the resource? Type: EntityIdentifier object Required: No Response Syntax { "decision": "string", "determiningPolicies": [ { "policyId": "string" } ], "errors": [ { "errorDescription": "string" } ], "principal": { "entityId": "string", "entityType": "string" } } Response Elements If the action is successful, the service sends back an HTTP 200 response. Response Syntax 149 Amazon Verified Permissions API Reference Guide The following data is returned in JSON format by the service. decision An authorization decision that indicates if the authorization request should be allowed or denied. Type: String Valid Values: ALLOW | DENY determiningPolicies 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. Type: Array of DeterminingPolicyItem objects errors 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. Type: Array of EvaluationErrorItem objects principal The identifier of the principal in the ID or access token. Type: EntityIdentifier object Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 Errors 150 Amazon Verified Permissions InternalServerException API Reference Guide The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. Errors 151 Amazon Verified Permissions • MissingAttribute API Reference Guide The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed
amazon-verified-permissions-api-035
amazon-verified-permissions-api.pdf
35
for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example The following example requests an authorization decision for a user who was authenticated by Amazon Cognito. The request uses the identity token provided by Amazon Cognito instead of the access token. In this example, the specified information store is configured to return principals as entities of type CognitoUser. The policy store contains a policy with the following statement. permit( principal == CognitoUser::"us-east-1_1a2b3c4d5|a1b2c3d4e5f6g7h8i9j0kalbmc", action, Examples 152 Amazon Verified Permissions API Reference Guide resource == PhotoFlash::Photo::"VacationPhoto94.jpg" ); Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.IsAuthorizedWithToken User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "action": { "actionId": "View", "actionType": "Action" }, "resource": { "entityId": "vacationPhoto94.jpg", "entityType": "PhotoFlash::Photo" } "identityToken": "AbCdE12345...long.string...54321EdCbA", } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "decision":"Allow", "determiningPolicies":[ { Examples 153 Amazon Verified Permissions API Reference Guide "determiningPolicyId":"SPEXAMPLEabcdefg111111" } ], "errors":[] } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 154 Amazon Verified Permissions API Reference Guide ListIdentitySources Returns a paginated list of all of the identity sources defined in the specified policy store. Request Syntax { "filters": [ { "principalEntityType": "string" } ], "maxResults": number, "nextToken": "string", "policyStoreId": "string" } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. policyStoreId Specifies the ID of the policy store that contains the identity sources that you want to list. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes ListIdentitySources 155 Amazon Verified Permissions filters API Reference Guide Specifies characteristics of an identity source that you can use to limit the output to matching identity sources. Type: Array of IdentitySourceFilter objects Array Members: Minimum number of 0 items. Maximum number of 10 items. Required: No maxResults Specifies the total number of results that you want included in each response. 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 set of 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. If you do not specify this parameter, the operation defaults to 10 identity sources per response. You can specify a maximum of 50 identity sources per response. Type: Integer Valid Range: Minimum value of 1. Required: No 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: String Length Constraints: Minimum length of 1. Maximum length of 8000. Pattern: [A-Za-z0-9-_=+/\.]* Required: No Request Parameters 156 API Reference Guide Amazon Verified Permissions Response Syntax { "identitySources": [ { "configuration": { ... }, "createdDate": "string", "details": { "clientIds": [ "string" ], "discoveryUrl": "string", "openIdIssuer": "string", "userPoolArn": "string" }, "identitySourceId": "string", "lastUpdatedDate": "string", "policyStoreId": "string", "principalEntityType": "string" } ], "nextToken": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. identitySources The list of identity sources stored in the specified policy store. Type: Array of IdentitySourceItem objects nextToken If present, this
amazon-verified-permissions-api-036
amazon-verified-permissions-api.pdf
36
of 8000. Pattern: [A-Za-z0-9-_=+/\.]* Required: No Request Parameters 156 API Reference Guide Amazon Verified Permissions Response Syntax { "identitySources": [ { "configuration": { ... }, "createdDate": "string", "details": { "clientIds": [ "string" ], "discoveryUrl": "string", "openIdIssuer": "string", "userPoolArn": "string" }, "identitySourceId": "string", "lastUpdatedDate": "string", "policyStoreId": "string", "principalEntityType": "string" } ], "nextToken": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. identitySources The list of identity sources stored in the specified policy store. Type: Array of IdentitySourceItem objects nextToken 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. Type: String Response Syntax 157 Amazon Verified Permissions API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 8000. Pattern: [A-Za-z0-9-_=+/\.]* Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId Errors 158 Amazon Verified Permissions API Reference Guide The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Errors 159 Amazon Verified Permissions API Reference Guide Examples Example The following example request creates lists the identity sources currently defined in the specified policy store. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.ListIdentitySources User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "policyStoreId": "PSEXAMPLEabcdefg111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "identitySources": [ { "createdDate": "2023-05-19T20:29:23.66812Z", "details": { "clientIds": ["a1b2c3d4e5f6g7h8i9j0kalbmc"], "userPoolArn":"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us- east-1_1a2b3c4d5", Examples 160 Amazon Verified Permissions API Reference Guide "discoveryUrl":"https://cognito-idp.us-east-1.amazonaws.com/us- east-1_1a2b3c4d5", "openIdIssuer":"COGNITO" }, "identitySourceId":"ISEXAMPLEabcdefg111111", "lastUpdatedDate":"2023-05-19T20:29:23.66812Z", "policyStoreId":"PSEXAMPLEabcdefg111111", "principalEntityType":"MyCorp::User", "configuration": { "cognitoUserPoolConfiguration": { "userPoolArn": "arn:aws:cognito-idp:us-east-1:123456789012:userpool/ us-east-1_1a2b3c4d5", "clientIds": [], "issuer": "https://cognito-idp.us-east-1.amazonaws.com/us- east-1_1a2b3c4d5", "groupConfiguration": { "groupEntityType": "MyCorp::UserGroup" } } } } ] } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 161 Amazon Verified Permissions API Reference Guide See Also 162 Amazon Verified Permissions ListPolicies API
amazon-verified-permissions-api-037
amazon-verified-permissions-api.pdf
37
{ "groupEntityType": "MyCorp::UserGroup" } } } } ] } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 161 Amazon Verified Permissions API Reference Guide See Also 162 Amazon Verified Permissions ListPolicies API Reference Guide Returns a paginated list of all policies stored in the specified policy store. Request Syntax { "filter": { "policyTemplateId": "string", "policyType": "string", "principal": { ... }, "resource": { ... } }, "maxResults": number, "nextToken": "string", "policyStoreId": "string" } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. policyStoreId Specifies the ID of the policy store you want to list policies from. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes ListPolicies 163 Amazon Verified Permissions filter API Reference Guide 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. Type: PolicyFilter object Required: No maxResults Specifies the total number of results that you want included in each response. 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 set of 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. If you do not specify this parameter, the operation defaults to 10 policies per response. You can specify a maximum of 50 policies per response. Type: Integer Valid Range: Minimum value of 1. Required: No 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: String Length Constraints: Minimum length of 1. Maximum length of 8000. Pattern: [A-Za-z0-9-_=+/\.]* Required: No Request Parameters 164 API Reference Guide Amazon Verified Permissions Response Syntax { "nextToken": "string", "policies": [ { "actions": [ { "actionId": "string", "actionType": "string" } ], "createdDate": "string", "definition": { ... }, "effect": "string", "lastUpdatedDate": "string", "policyId": "string", "policyStoreId": "string", "policyType": "string", "principal": { "entityId": "string", "entityType": "string" }, "resource": { "entityId": "string", "entityType": "string" } } ] } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. policies Lists all policies that are available in the specified policy store. Type: Array of PolicyItem objects Response Syntax 165 Amazon Verified Permissions nextToken API Reference Guide 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. Type: String Length Constraints: Minimum length of 1. Maximum length of 8000. Pattern: [A-Za-z0-9-_=+/\.]* Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. Errors 166 Amazon Verified Permissions API Reference Guide The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified
amazon-verified-permissions-api-038
amazon-verified-permissions-api.pdf
38
it exceeded a throttling quota. HTTP Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. Errors 166 Amazon Verified Permissions API Reference Guide The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. Errors 167 Amazon Verified Permissions API Reference Guide • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example 1 The following example lists all policies in the policy store. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.ListPolicies User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "policyStoreId": "PSEXAMPLEabcdefg111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { Examples 168 Amazon Verified Permissions "policies": [ { "createdDate":"2023-05-16T20:33:01.730817Z", "effect": "Permit", "definition": { "static": { API Reference Guide "description": "Grant members of janeFriends UserGroup access to the vacationFolder Album" } }, "lastUpdatedDate": "2023-05-16T21:12:52.882422+00:00", "policyId": "SPEXAMPLEabcdefg111111", "policyStoreId": "PSEXAMPLEabcdefg111111", "policyType": "STATIC", "principal": { "entityId": "janeFriends", "entityType": "UserGroup" }, "actions": [ { "actionId": "ViewPhoto", "actionType": "PhotoFlash::Action" }, { "actionId": "SharePhoto", "actionType": "PhotoFlash::Action" } ], "resource": { "entityId": "vacationFolder", "entityType": "Album" } }, { "createdDate": "2023-05-16T21:19:44.528576+00:00", "effect": "Permit", "definition": { "static": { "description": "Grant everyone access to the publicFolder Album" } }, "lastUpdatedDate": "2023-05-16T21:19:44.528576+00:00", "policyId": "SPEXAMPLEabcdefg222222", "policyStoreId": "PSEXAMPLEabcdefg111111", Examples 169 Amazon Verified Permissions API Reference Guide "policyType": "STATIC", "actions": [ { "actionId": "ViewPhoto", "actionType": "PhotoFlash::Action" }, { "actionId": "SharePhoto", "actionType": "PhotoFlash::Action" } ], "resource": { "entityId": "publicFolder", "entityType": "Album" } } ] } Example 2 The following example lists all policies for a specified principal. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.ListPolicies User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "filter": { "principal": { "identifier": { "entityType": "User", "entityId": "alice" } } Examples 170 Amazon Verified Permissions API Reference Guide } } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "policies": [ { "policyStoreId": "ps-f0ff7596-a721-4df2-8c04-45bcb8e12ccd", "policyId": "ip-376c8292-968e-48fb-8b77-5f695e8be789", "arn": "arn:aws:verifiedpermissions:123456789012::policy/ps-f0ff7596- a721-4df2-8c04-45bcb8e12ccd/ip-376c8292-968e-48fb-8b77-5f695e8be789", "policyType": "STATIC", "principal": { "entityType": "User", "entityId": "alice" }, "actions": [ { "actionId": "ViewPhoto", "actionType": "PhotoFlash::Action" }, { "actionId": "SharePhoto", "actionType": "PhotoFlash::Action" } ], "resource": { "entityType": "Album", "entityId": "bob_folder" }, "policyDefinition": { "static": { Examples 171 Amazon Verified Permissions API Reference Guide "description": "An example policy" } }, "createdDate": "2022-12-09T22:55:16.067533Z", "lastUpdatedDate": "2022-12-09T22:55:16.067533Z" }, { "policyStoreId": "ps-f0ff7596-a721-4df2-8c04-45bcb8e12ccd", "policyId": "ip-9faa0844-24a0-4d81-a937-0ad7b155750a", "arn": "arn:aws:verifiedpermissions:123456789012::policy/ps-f0ff7596- a721-4df2-8c04-45bcb8e12ccd/ip-9faa0844-24a0-4d81-a937-0ad7b155750a", "policyType": "STATIC", "principal": { "entityType": "User", "entityId": "alice" }, "actions": [ { "actionId": "ViewPhoto", "actionType": "PhotoFlash::Action" }, { "actionId": "SharePhoto", "actionType": "PhotoFlash::Action" } ], "resource": { "entityType": "Album", "entityId": "alice_folder" }, "policyDefinition": { "static": {} }, "createdDate": "2022-12-09T23:00:24.66266Z", "lastUpdatedDate": "2022-12-09T23:00:24.66266Z" } ] } Example 3 The following example uses the Filter parameter to list only the template-linked policies in the specified policy store. Examples 172 Amazon Verified Permissions Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.ListPolicies User-Agent: <UserAgentString> API Reference Guide Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "filter": { "policyType": "TEMPLATE_LINKED" } } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type:
amazon-verified-permissions-api-039
amazon-verified-permissions-api.pdf
39
"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action" }, { "actionId": "SharePhoto", "actionType": "PhotoFlash::Action" } ], "resource": { "entityType": "Album", "entityId": "alice_folder" }, "policyDefinition": { "static": {} }, "createdDate": "2022-12-09T23:00:24.66266Z", "lastUpdatedDate": "2022-12-09T23:00:24.66266Z" } ] } Example 3 The following example uses the Filter parameter to list only the template-linked policies in the specified policy store. Examples 172 Amazon Verified Permissions Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.ListPolicies User-Agent: <UserAgentString> API Reference Guide Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "filter": { "policyType": "TEMPLATE_LINKED" } } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "policies": [{ "policyStoreId": "PSEXAMPLEabcdefg111111", "policyId": "TPEXAMPLEabcdefg111111", "arn": "arn:aws:verifiedpermissions:us-east-1:123456789012:policy/ PSEXAMPLEabcdefg111111/TPEXAMPLEabcdefg111111", "policyType": "TEMPLATE_LINKED", "principal": { "entityType": "User", "entityId": "alice" }, "actions": [ { Examples 173 Amazon Verified Permissions API Reference Guide "actionId": "ViewPhoto", "actionType": "PhotoFlash::Action" }, { "actionId": "SharePhoto", "actionType": "PhotoFlash::Action" } ], "resource": { "entityType": "Photo", "entityId": "pic.jpg" }, "policyDefinition": { "templateLinked": { "policyTemplateId": "PTEXAMPLEabcdefg111111", "principal": { "entityType": "User", "entityId": "alice" }, "actions": [ { "actionId": "ViewPhoto", "actionType": "PhotoFlash::Action" }, { "actionId": "SharePhoto", "actionType": "PhotoFlash::Action" } ], "resource": { "entityType": "Photo", "entityId": "pic.jpg" } } }, "createdDate": "2023-06-13T16:03:07.620867Z", "lastUpdatedDate": "2023-06-13T16:03:07.620867Z" }] } Examples 174 Amazon Verified Permissions Example 4 API Reference Guide The following example uses the Filter parameter to list only those policies that were instantiated from the specified policy template. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.ListPolicies User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "filter": { "policyTemplateId": "PTEXAMPLEabcdefg111111" } } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "policies": [{ "policyStoreId": "PSEXAMPLEabcdefg111111", "policyId": "TPEXAMPLEabcdefg111111", "arn": "arn:aws:verifiedpermissions::128716708097:policy/ PSEXAMPLEabcdefg111111/TPEXAMPLEabcdefg111111", "policyType": "TEMPLATE_LINKED", "principal": { Examples 175 Amazon Verified Permissions API Reference Guide "entityType": "User", "entityId": "alice" }, "actions": [ { "actionId": "ViewPhoto", "actionType": "PhotoFlash::Action" }, { "actionId": "SharePhoto", "actionType": "PhotoFlash::Action" } ], "resource": { "entityType": "Photo", "entityId": "pic.jpg" }, "policyDefinition": { "templateLinked": { "policyTemplateId": "pt-e42e3eee-8cbc-4af6-a187-4c94773ec89b", "principal": { "entityType": "User", "entityId": "alice" }, "actions": [ { "actionId": "ViewPhoto", "actionType": "PhotoFlash::Action" }, { "actionId": "SharePhoto", "actionType": "PhotoFlash::Action" } ], "resource": { "entityType": "Photo", "entityId": "pic.jpg" } } }, "createdDate": "2023-03-15T16:03:07.620867Z", "lastUpdatedDate": "2023-03-15T16:03:07.620867Z" }] Examples 176 Amazon Verified Permissions API Reference Guide } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 177 Amazon Verified Permissions ListPolicyStores API Reference Guide Returns a paginated list of all policy stores in the calling AWS account. Request Syntax { "maxResults": number, "nextToken": "string" } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. maxResults Specifies the total number of results that you want included in each response. 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 set of 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. If you do not specify this parameter, the operation defaults to 10 policy stores per response. You can specify a maximum of 50 policy stores per response. Type: Integer Valid Range: Minimum value of 1. Required: No ListPolicyStores 178 Amazon Verified Permissions nextToken API Reference Guide 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: String Length Constraints: Minimum length of 1. Maximum length of 8000. Pattern: [A-Za-z0-9-_=+/\.]* Required: No Response Syntax { "nextToken": "string", "policyStores": [ { "arn": "string", "createdDate": "string", "description": "string", "lastUpdatedDate": "string", "policyStoreId": "string" } ] } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. policyStores The list of policy stores in the account. Type: Array of PolicyStoreItem objects Response Syntax 179
amazon-verified-permissions-api-040
amazon-verified-permissions-api.pdf
40
Set this parameter to the value provided by the previous call's NextToken response to request the next page of results. Type: String Length Constraints: Minimum length of 1. Maximum length of 8000. Pattern: [A-Za-z0-9-_=+/\.]* Required: No Response Syntax { "nextToken": "string", "policyStores": [ { "arn": "string", "createdDate": "string", "description": "string", "lastUpdatedDate": "string", "policyStoreId": "string" } ] } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. policyStores The list of policy stores in the account. Type: Array of PolicyStoreItem objects Response Syntax 179 Amazon Verified Permissions nextToken API Reference Guide 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. Type: String Length Constraints: Minimum length of 1. Maximum length of 8000. Pattern: [A-Za-z0-9-_=+/\.]* Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: Errors 180 Amazon Verified Permissions API Reference Guide • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Errors 181 Amazon Verified Permissions API Reference Guide Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example The following example lists all policy stores in the AWS account in the AWS Region in which you call the operation. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.ListPolicyStores User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> {} Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "policyStores": [ { Examples 182 Amazon Verified Permissions API Reference Guide "policyStoreId": "PSEXAMPLEabcdefg111111", "arn":"arn:aws:verifiedpermissions::123456789012:policy-store/ PSEXAMPLEabcdefg111111", "createdDate":"2023-05-16T17:41:29.103459Z" }, { "policyStoreId":"PSEXAMPLEabcdefg222222", "arn":"arn:aws:verifiedpermissions::123456789012:policy-store/ PSEXAMPLEabcdefg222222", "createdDate":"2023-05-16T18:23:04.985521Z" } ] } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 183 Amazon Verified Permissions API Reference Guide ListPolicyTemplates Returns a paginated list of all policy templates in the specified policy store. Request Syntax { "maxResults": number, "nextToken": "string", "policyStoreId": "string" } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following
amazon-verified-permissions-api-041
amazon-verified-permissions-api.pdf
41
.NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 183 Amazon Verified Permissions API Reference Guide ListPolicyTemplates Returns a paginated list of all policy templates in the specified policy store. Request Syntax { "maxResults": number, "nextToken": "string", "policyStoreId": "string" } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. policyStoreId Specifies the ID of the policy store that contains the policy templates you want to list. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes maxResults Specifies the total number of results that you want included in each response. 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 ListPolicyTemplates 184 Amazon Verified Permissions API Reference Guide the next call to the operation to get the next set of 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. If you do not specify this parameter, the operation defaults to 10 policy templates per response. You can specify a maximum of 50 policy templates per response. Type: Integer Valid Range: Minimum value of 1. Required: No 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: String Length Constraints: Minimum length of 1. Maximum length of 8000. Pattern: [A-Za-z0-9-_=+/\.]* Required: No Response Syntax { "nextToken": "string", "policyTemplates": [ { "createdDate": "string", "description": "string", "lastUpdatedDate": "string", "policyStoreId": "string", "policyTemplateId": "string" } ] Response Syntax 185 API Reference Guide Amazon Verified Permissions } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. policyTemplates The list of the policy templates in the specified policy store. Type: Array of PolicyTemplateItem objects nextToken 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. Type: String Length Constraints: Minimum length of 1. Maximum length of 8000. Pattern: [A-Za-z0-9-_=+/\.]* Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 Response Elements 186 Amazon Verified Permissions ResourceNotFoundException API Reference Guide The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more Errors 187 Amazon Verified Permissions API Reference Guide information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence
amazon-verified-permissions-api-042
amazon-verified-permissions-api.pdf
42
in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more Errors 187 Amazon Verified Permissions API Reference Guide information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example The following example retrieves a list of all of the policy templates in the specified policy store. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.ListPolicyTemplates User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> Examples 188 API Reference Guide Amazon Verified Permissions { "policyStoreId": "PSEXAMPLEabcdefg111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "policyTemplates": [ { "createdDate": "2023-05-17T18:55:20.888033+00:00", "description": "Generic template", "lastUpdatedDate": "2023-05-17T18:55:20.888033+00:00", "policyStoreId": "PSEXAMPLEabcdefg111111", "policyTemplateId": "PTEXAMPLEabcdefg111111" }, { "createdDate": "2023-05-17T18:58:48.795411+00:00", "description": "Template for research dept", "lastUpdatedDate": "2023-05-17T18:58:48.795411+00:00", "policyStoreId": "PSEXAMPLEabcdefg111111", "policyTemplateId": "PTEXAMPLEabcdefg222222" } ] } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET See Also 189 API Reference Guide Amazon Verified Permissions • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 190 Amazon Verified Permissions API Reference Guide ListTagsForResource Returns the tags associated with the specified Amazon Verified Permissions resource. In Verified Permissions, policy stores can be tagged. Request Syntax { "resourceArn": "string" } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. resourceArn The ARN of the resource for which you want to view tags. Type: String Length Constraints: Minimum length of 1. Maximum length of 2048. Required: Yes Response Syntax { "tags": { "string" : "string" } } ListTagsForResource 191 Amazon Verified Permissions Response Elements API Reference Guide If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. tags The list of tags associated with the resource. Type: String to string map Map Entries: Minimum number of 0 items. Maximum number of 200 items. Key Length Constraints: Minimum length of 1. Maximum length of 128. Value Length Constraints: Minimum length of 0. Maximum length of 256. Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. Response Elements 192 Amazon Verified Permissions HTTP Status Code: 400 ValidationException API Reference Guide The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions
amazon-verified-permissions-api-043
amazon-verified-permissions-api.pdf
43
is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Errors 193 Amazon Verified Permissions API Reference Guide Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 194 Amazon Verified Permissions PutSchema API Reference Guide 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. Note Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations. Request Syntax { "definition": { ... }, "policyStoreId": "string" } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. definition Specifies the definition of the schema to be stored. The schema definition must be written in Cedar schema JSON. Type: SchemaDefinition object PutSchema 195 Amazon Verified Permissions API Reference Guide Note: This object is a Union. Only one member of this object can be specified or returned. Required: Yes policyStoreId Specifies the ID of the policy store in which to place the schema. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes Response Syntax { "createdDate": "string", "lastUpdatedDate": "string", "namespaces": [ "string" ], "policyStoreId": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. createdDate The date and time that the schema was originally created. Type: Timestamp lastUpdatedDate The date and time that the schema was last updated. Type: Timestamp Response Syntax 196 Amazon Verified Permissions namespaces API Reference Guide Identifies the namespaces of the entities referenced by this schema. Type: Array of strings Length Constraints: Minimum length of 0. Maximum length of 100. Pattern: .* policyStoreId The unique ID of the policy store that contains the schema. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 ConflictException The request failed because another request to modify a resource occurred at the same. HTTP Status Code: 400 InternalServerException The request
amazon-verified-permissions-api-044
amazon-verified-permissions-api.pdf
44
of the entities referenced by this schema. Type: Array of strings Length Constraints: Minimum length of 0. Maximum length of 100. Pattern: .* policyStoreId The unique ID of the policy store that contains the schema. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 ConflictException The request failed because another request to modify a resource occurred at the same. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. Errors 197 Amazon Verified Permissions HTTP Status Code: 400 ServiceQuotaExceededException API Reference Guide The request failed because it would cause a service quota to be exceeded. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more Errors 198 Amazon Verified Permissions API Reference Guide information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example The following example creates a new schema, or updates an existing schema, in the specified policy store. Note that the schema text is shown line wrapped for readability. You should submit the entire schema text as a single line of text. Note The JSON in the parameters of this operation are strings that can contain embedded quotation marks (") within the outermost quotation mark pair. When you are calling the API directly, using a tool like the AWS CLI or Postman, you have to stringify the JSON object by preceding all embedded quotation marks with a backslash character ( \" ) and combining all lines into a single text line with no line breaks. Examples 199 Amazon Verified Permissions API Reference Guide Example strings are displayed wrapped across multiple lines here for readability, but the operation requires the parameters be submitted as single line strings. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.PutSchema User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "policyStoreId": "PSEXAMPLEabcdefg111111", "definition": {"cedarJson": "{\"MySampleNamespace\": {\"actions\": {\"remoteAccess \": { \"appliesTo\": {\"principalTypes\": [\"Employee\"]}}},\"entityTypes\": {\"Employee\": { \"shape\": {\"attributes\": {\"jobLevel\": {\"type\": \"Long\"},\"name\": { \"type\": \"String\"}},\"type\": \"Record\"}}}}}"} Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "createdDate": "2023-06-13T19:28:06.003726Z", "lastUpdatedDate": "2023-06-13T19:28:06.003726Z", "Namespaces": [ "My::Sample::Namespace" Examples 200 Amazon Verified Permissions ], "policyStoreId": "PSEXAMPLEabcdefg111111" } See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python •
amazon-verified-permissions-api-045
amazon-verified-permissions-api.pdf
45
<PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "createdDate": "2023-06-13T19:28:06.003726Z", "lastUpdatedDate": "2023-06-13T19:28:06.003726Z", "Namespaces": [ "My::Sample::Namespace" Examples 200 Amazon Verified Permissions ], "policyStoreId": "PSEXAMPLEabcdefg111111" } See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 201 Amazon Verified Permissions TagResource API Reference Guide Assigns one or more tags (key-value pairs) to the specified Amazon Verified Permissions resource. Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values. In Verified Permissions, policy stores can be tagged. Tags don't have any semantic meaning to AWS and are interpreted strictly as strings of characters. You can use the TagResource action with a resource that already has tags. If you specify a new tag key, this tag is appended to the list of tags associated with the resource. If you specify a tag key that is already associated with the resource, the new tag value that you specify replaces the previous value for that tag. You can associate as many as 50 tags with a resource. Request Syntax { "resourceArn": "string", "tags": { "string" : "string" } } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. resourceArn The ARN of the resource that you're adding tags to. TagResource 202 Amazon Verified Permissions Type: String API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 2048. Required: Yes tags The list of key-value pairs to associate with the resource. Type: String to string map Map Entries: Minimum number of 0 items. Maximum number of 200 items. Key Length Constraints: Minimum length of 1. Maximum length of 128. Value Length Constraints: Minimum length of 0. Maximum length of 256. Required: Yes Response Elements If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body. Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 Response Elements 203 Amazon Verified Permissions ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 TooManyTagsException API Reference Guide No more tags be added because the limit (50) has been reached. To add new tags, use UntagResource to remove existing tags. HTTP Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more Errors 204 Amazon Verified Permissions API Reference Guide information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an
amazon-verified-permissions-api-046
amazon-verified-permissions-api.pdf
46
operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python See Also 205 Amazon Verified Permissions • AWS SDK for Ruby V3 API Reference Guide See Also 206 Amazon Verified Permissions UntagResource API Reference Guide Removes one or more tags from the specified Amazon Verified Permissions resource. In Verified Permissions, policy stores can be tagged. Request Syntax { "resourceArn": "string", "tagKeys": [ "string" ] } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. resourceArn The ARN of the resource from which you are removing tags. Type: String Length Constraints: Minimum length of 1. Maximum length of 2048. Required: Yes tagKeys The list of tag keys to remove from the resource. Type: Array of strings Array Members: Minimum number of 1 item. Maximum number of 200 items. Length Constraints: Minimum length of 1. Maximum length of 128. UntagResource 207 Amazon Verified Permissions Required: Yes Response Elements API Reference Guide If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body. Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId Response Elements 208 Amazon Verified Permissions API Reference Guide The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Errors 209 Amazon
amazon-verified-permissions-api-047
amazon-verified-permissions-api.pdf
47
(presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Errors 209 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 210 Amazon Verified Permissions API Reference Guide UpdateIdentitySource Updates the specified identity source to use a new identity provider (IdP), or to change the mapping of identities from the IdP to a different principal entity type. Note Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations. Request Syntax { "identitySourceId": "string", "policyStoreId": "string", "principalEntityType": "string", "updateConfiguration": { ... } } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. identitySourceId Specifies the ID of the identity source that you want to update. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. UpdateIdentitySource 211 Amazon Verified Permissions Pattern: [a-zA-Z0-9-]* Required: Yes policyStoreId API Reference Guide Specifies the ID of the policy store that contains the identity source that you want to update. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes updateConfiguration Specifies the details required to communicate with the identity provider (IdP) associated with this identity source. Type: UpdateConfiguration object Note: This object is a Union. Only one member of this object can be specified or returned. Required: Yes principalEntityType Specifies the data type of principals generated for identities authenticated by the identity source. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: .* Required: No Response Syntax { Response Syntax 212 Amazon Verified Permissions API Reference Guide "createdDate": "string", "identitySourceId": "string", "lastUpdatedDate": "string", "policyStoreId": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. createdDate The date and time that the updated identity source was originally created. Type: Timestamp identitySourceId The ID of the updated identity source. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-]* lastUpdatedDate The date and time that the identity source was most recently updated. Type: Timestamp policyStoreId The ID of the policy store that contains the updated identity source. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Response Elements 213 Amazon Verified Permissions Errors API Reference Guide For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 ConflictException The request failed because another request to modify a resource occurred at the same. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId Errors 214 Amazon Verified Permissions API Reference Guide The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used
amazon-verified-permissions-api-048
amazon-verified-permissions-api.pdf
48
reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId Errors 214 Amazon Verified Permissions API Reference Guide The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Errors 215 Amazon Verified Permissions API Reference Guide Examples Example The following example updates the configuration of the specified identity source with a new user pool configuration. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.UpdateIdentitySource User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "identitySourceId": "ISEXAMPLEabcdefg111111", "policyStoreId": "PSEXAMPLEabcdefg111111", "updateConfiguration": { "cognitoUserPoolConfiguration": { "userPoolArn": "arn:aws:cognito-idp:us-east-1:123456789012:userpool/us- east-1_1a2b3c4d5", "clientIds": ["a1b2c3d4e5f6g7h8i9j0kalbmc"], "groupConfiguration": { "groupEntityType": "MyCorp::UserGroup" } } }, "principalEntityType": "MyCorp::User", "clientToken": "a1b2c3d4-e5f6-a1b2-c3d4-TOKEN1111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> Examples 216 API Reference Guide Amazon Verified Permissions vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "createdDate": "2023-05-19T20:30:28.173926Z", "identitySourceId": "ISEXAMPLEabcdefg111111", "lastUpdatedDate": "2023-05-22T20:45:59.962216Z", "policyStoreId":"PSEXAMPLEabcdefg111111" } Example The following example updates the configuration of the specified identity source with a new OIDC configuration. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.UpdateIdentitySource User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "identitySourceId": "ISEXAMPLEabcdefg111111", "policyStoreId": "PSEXAMPLEabcdefg111111", "openIdConnectConfiguration": { "issuer": "https://auth.example.com", "tokenSelection": { "accessTokenOnly": { "audiences": [ "1example23456789", "2example10111213" ], "principalIdClaim": "sub" } Examples 217 API Reference Guide Amazon Verified Permissions }, "entityIdPrefix": "MyOIDCProvider", "groupConfiguration": { "groupClaim": "groups", "groupEntityType": "MyCorp::UserGroup" } }, "principalEntityType": "MyCorp::User", "clientToken": "a1b2c3d4-e5f6-a1b2-c3d4-TOKEN1111111" } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "createdDate": "2023-05-19T20:30:28.173926Z", "identitySourceId": "ISEXAMPLEabcdefg111111", "lastUpdatedDate": "2023-05-22T20:45:59.962216Z", "policyStoreId":"PSEXAMPLEabcdefg111111" } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 See Also 218 Amazon Verified Permissions • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 API Reference Guide See Also 219 Amazon Verified Permissions UpdatePolicy API Reference Guide 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. • When you edit a static policy, you can change only certain elements of a static policy: • The action referenced by the policy. • A condition clause, such as when and unless. You can't change these elements of a static policy: • Changing a policy from a static policy to a template-linked policy. • Changing the effect of a static policy from permit or forbid. • The principal referenced by a static policy. • The resource referenced by a static policy. • To update a template-linked policy, you must
amazon-verified-permissions-api-049
amazon-verified-permissions-api.pdf
49
pass validation, the operation fails and the update isn't stored. • When you edit a static policy, you can change only certain elements of a static policy: • The action referenced by the policy. • A condition clause, such as when and unless. You can't change these elements of a static policy: • Changing a policy from a static policy to a template-linked policy. • Changing the effect of a static policy from permit or forbid. • The principal referenced by a static policy. • The resource referenced by a static policy. • To update a template-linked policy, you must update the template instead. Note Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations. Request Syntax { "definition": { ... }, UpdatePolicy 220 Amazon Verified Permissions API Reference Guide "policyId": "string", "policyStoreId": "string" } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. definition 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. Type: UpdatePolicyDefinition object Note: This object is a Union. Only one member of this object can be specified or returned. Required: Yes policyId Specifies the ID of the policy that you want to update. To find this value, you can use ListPolicies. Request Parameters 221 Amazon Verified Permissions Type: String API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-]* Required: Yes policyStoreId Specifies the ID of the policy store that contains the policy that you want to update. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes Response Syntax { "actions": [ { "actionId": "string", "actionType": "string" } ], "createdDate": "string", "effect": "string", "lastUpdatedDate": "string", "policyId": "string", "policyStoreId": "string", "policyType": "string", "principal": { "entityId": "string", "entityType": "string" }, "resource": { "entityId": "string", "entityType": "string" } Response Syntax 222 API Reference Guide Amazon Verified Permissions } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. createdDate The date and time that the policy was originally created. Type: Timestamp lastUpdatedDate The date and time that the policy was most recently updated. Type: Timestamp policyId The ID of the policy that was updated. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-]* policyStoreId The ID of the policy store that contains the policy that was updated. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* policyType The type of the policy that was updated. Type: String Valid Values: STATIC | TEMPLATE_LINKED Response Elements 223 Amazon Verified Permissions actions API Reference Guide The action that a policy permits or forbids. For example, {"actions": [{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"}, {"entityID": "SharePhoto", "entityType": "PhotoFlash::Action"}]}. Type: Array of ActionIdentifier objects effect The effect of the decision that a policy returns to an authorization request. For example, "effect": "Permit". Type: String Valid Values: Permit | Forbid principal 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. Type: EntityIdentifier object resource 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. Type: EntityIdentifier object Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 ConflictException The request failed because another request to modify a resource occurred at the same. Errors 224 Amazon Verified Permissions HTTP Status Code: 400 InternalServerException API Reference Guide The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 ServiceQuotaExceededException The request failed because it would cause a service quota to be exceeded. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements.
amazon-verified-permissions-api-050
amazon-verified-permissions-api.pdf
50
modify a resource occurred at the same. Errors 224 Amazon Verified Permissions HTTP Status Code: 400 InternalServerException API Reference Guide The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 ServiceQuotaExceededException The request failed because it would cause a service quota to be exceeded. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. Errors 225 Amazon Verified Permissions • UnexpectedType API Reference Guide The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example The following example replaces the definition of the specified static policy with a new one. Examples 226 Amazon Verified Permissions Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.UpdatePolicy User-Agent: <UserAgentString> API Reference Guide Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "policyStoreId": "PSEXAMPLEabcdefg111111", "policyId": "SPEXAMPLEabcdefg111111", "definition": { "static": { "statement": "permit(principal, action in PhotoFlash::Action::\"ViewPhoto \", resource in PhotoFlash::Album::\"public_folder\");" } } } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "actions": [ { "actionId": "ViewPhoto", "actionType": "PhotoFlash::Action" } ], Examples 227 Amazon Verified Permissions API Reference Guide "createdDate": "20230613T22:56:48.020321Z", "effect": "Permit", "lastUpdatedDate": "20230613T23:26:09.764859Z", "policyId": "SPEXAMPLEabcdefg111111", "policyStoreId": "PSEXAMPLEabcdefg111111", "policyType": "STATIC", "resource": { "entityType": "PhotoFlash::Album", "entityId": "public_folder" } } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 See Also 228 Amazon Verified Permissions UpdatePolicyStore Modifies the validation setting for a policy store. API Reference Guide Note Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations. Request Syntax { "deletionProtection": "string", "description": "string", "policyStoreId": "string", "validationSettings": { "mode": "string" } } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. policyStoreId Specifies the ID of the policy store that you want to update Type: String Length Constraints: Minimum length of 1. Maximum length of 200. UpdatePolicyStore 229 Amazon Verified Permissions API Reference Guide Pattern: [a-zA-Z0-9-/_]* Required: Yes validationSettings A structure that defines the validation settings that want to enable for the policy store. Type: ValidationSettings object Required: Yes deletionProtection Specifies whether the policy store can be deleted. If enabled, the policy store can't be deleted. When you call UpdatePolicyStore, this parameter is unchanged unless
amazon-verified-permissions-api-051
amazon-verified-permissions-api.pdf
51
following data in JSON format. Note In the following list, the required parameters are described first. policyStoreId Specifies the ID of the policy store that you want to update Type: String Length Constraints: Minimum length of 1. Maximum length of 200. UpdatePolicyStore 229 Amazon Verified Permissions API Reference Guide Pattern: [a-zA-Z0-9-/_]* Required: Yes validationSettings A structure that defines the validation settings that want to enable for the policy store. Type: ValidationSettings object Required: Yes deletionProtection Specifies whether the policy store can be deleted. If enabled, the policy store can't be deleted. When you call UpdatePolicyStore, this parameter is unchanged unless explicitly included in the call. Type: String Valid Values: ENABLED | DISABLED Required: No description Descriptive text that you can provide to help with identification of the current policy store. Type: String Length Constraints: Minimum length of 0. Maximum length of 150. Required: No Response Syntax { "arn": "string", "createdDate": "string", "lastUpdatedDate": "string", "policyStoreId": "string" } Response Syntax 230 Amazon Verified Permissions Response Elements API Reference Guide If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. arn The Amazon Resource Name (ARN) of the updated policy store. Type: String Length Constraints: Minimum length of 1. Maximum length of 2500. Pattern: arn:[^:]*:[^:]*:[^:]*:[^:]*:.* createdDate The date and time that the policy store was originally created. Type: Timestamp lastUpdatedDate The date and time that the policy store was most recently updated. Type: Timestamp policyStoreId The ID of the updated policy store. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. Response Elements 231 Amazon Verified Permissions HTTP Status Code: 400 ConflictException API Reference Guide The request failed because another request to modify a resource occurred at the same. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. HTTP Status Code: 400 ValidationException The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. Errors 232 Amazon Verified Permissions • IncompatibleTypes API Reference Guide The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example The following example turns off the validation settings for a policy store. Sample Request POST HTTP/1.1 Examples 233 Amazon Verified Permissions API Reference Guide Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.UpdatePolicyStore User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "policyStoreId": "PSEXAMPLEabcdefg111111", "validationSettings": { "mode": "OFF" } } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "policyStoreId": "PSEXAMPLEabcdefg111111", "arn": "arn:aws:verifiedpermissions::123456789012:policy-store/ PSEXAMPLEabcdefg111111", "createdDate": "2023-05-17T18:36:10.134448Z", "lastUpdatedDate": "2023-05-23T18:18:12.443083Z" } See Also For more information about using this API in one of the language-specific AWS SDKs, see
amazon-verified-permissions-api-052
amazon-verified-permissions-api.pdf
52
off the validation settings for a policy store. Sample Request POST HTTP/1.1 Examples 233 Amazon Verified Permissions API Reference Guide Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.UpdatePolicyStore User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "policyStoreId": "PSEXAMPLEabcdefg111111", "validationSettings": { "mode": "OFF" } } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "policyStoreId": "PSEXAMPLEabcdefg111111", "arn": "arn:aws:verifiedpermissions::123456789012:policy-store/ PSEXAMPLEabcdefg111111", "createdDate": "2023-05-17T18:36:10.134448Z", "lastUpdatedDate": "2023-05-23T18:18:12.443083Z" } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ See Also 234 Amazon Verified Permissions • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 API Reference Guide See Also 235 Amazon Verified Permissions API Reference Guide UpdatePolicyTemplate Updates the specified policy template. You can update only the description and the some elements of the policyBody. Important Changes you make to the policy template content are immediately (within the constraints of eventual consistency) reflected in authorization decisions that involve all template- linked policies instantiated from this template. Note Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations. Request Syntax { "description": "string", "policyStoreId": "string", "policyTemplateId": "string", "statement": "string" } Request Parameters For information about the parameters that are common to all actions, see Common Parameters. The request accepts the following data in JSON format. Note In the following list, the required parameters are described first. UpdatePolicyTemplate 236 Amazon Verified Permissions policyStoreId API Reference Guide Specifies the ID of the policy store that contains the policy template that you want to update. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes policyTemplateId Specifies the ID of the policy template that you want to update. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes statement 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. Type: String Length Constraints: Minimum length of 1. Maximum length of 10000. Required: Yes Request Parameters 237 Amazon Verified Permissions description API Reference Guide Specifies a new description to apply to the policy template. Type: String Length Constraints: Minimum length of 0. Maximum length of 150. Required: No Response Syntax { "createdDate": "string", "lastUpdatedDate": "string", "policyStoreId": "string", "policyTemplateId": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. createdDate The date and time that the policy template was originally created. Type: Timestamp lastUpdatedDate The date and time that the policy template was most recently updated. Type: Timestamp policyStoreId The ID of the policy store that contains the updated policy template. Type: String Response Syntax 238 Amazon Verified Permissions API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* policyTemplateId The ID of the updated policy template. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You don't have sufficient access to perform this action. HTTP Status Code: 400 ConflictException The request failed because another request to modify a resource occurred at the same. HTTP Status Code: 400 InternalServerException The request failed because of an internal error. Try your request again later HTTP Status Code: 500 ResourceNotFoundException The request failed because it references a resource that doesn't exist. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. Errors 239 Amazon Verified Permissions HTTP Status Code: 400 ValidationException API Reference Guide The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found
amazon-verified-permissions-api-053
amazon-verified-permissions-api.pdf
53
request failed because it references a resource that doesn't exist. HTTP Status Code: 400 ThrottlingException The request failed because it exceeded a throttling quota. Errors 239 Amazon Verified Permissions HTTP Status Code: 400 ValidationException API Reference Guide The request failed because one or more input parameters don't satisfy their constraint requirements. The output is provided as a list of fields and a reason for each field that isn't valid. The possible reasons include the following: • UnrecognizedEntityType The policy includes an entity type that isn't found in the schema. • UnrecognizedActionId The policy includes an action id that isn't found in the schema. • InvalidActionApplication The policy includes an action that, according to the schema, doesn't support the specified principal and resource. • UnexpectedType The policy included an operand that isn't a valid type for the specified operation. • IncompatibleTypes The types of elements included in a set, or the types of expressions used in an if...then...else clause aren't compatible in this context. • MissingAttribute The policy attempts to access a record or entity attribute that isn't specified in the schema. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • UnsafeOptionalAttributeAccess The policy attempts to access a record or entity attribute that is optional and isn't guaranteed to be present. Test for the existence of the attribute first before attempting to access its value. For more information, see the has (presence of attribute test) operator in the Cedar Policy Language Guide. • ImpossiblePolicy Errors 240 Amazon Verified Permissions API Reference Guide Cedar has determined that a policy condition always evaluates to false. If the policy is always false, it can never apply to any query, and so it can never affect an authorization decision. • WrongNumberArguments The policy references an extension type with the wrong number of arguments. • FunctionArgumentValidationError Cedar couldn't parse the argument passed to an extension type. For example, a string that is to be parsed as an IPv4 address can contain only digits and the period character. HTTP Status Code: 400 Examples Example The following example updates a policy template with both a new description and a new policy body. The effect, principal, and resource are the same as the original policy template. Only the action in the head, and the when and unless clauses can be different. Note The JSON in the parameters of this operation are strings that can contain embedded quotation marks (") within the outermost quotation mark pair. When you are calling the API directly, using a tool like the AWS CLI or Postman, you have to stringify the JSON object by preceding all embedded quotation marks with a backslash character ( \" ) and combining all lines into a single text line with no line breaks. Example strings are displayed wrapped across multiple lines here for readability, but the operation requires the parameters be submitted as single line strings. Sample Request POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.UpdatePolicyTemplate Examples 241 Amazon Verified Permissions API Reference Guide User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "description": "My updated template description", "policyStoreId": "PSEXAMPLEabcdefg111111", "policyTemplateId": "PTEXAMPLEabcdefg111111", "statement":"\"ResearchAccess\"\npermit(\n principal in ?principal,\n action == Action::\"view\",\n resource in ?resource\"\n)\nwhen {\n principal has department && principal.department == \"research\"\n};", } Sample Response HTTP/1.1 200 OK Date: Tue, 13 Jun 2023 20:00:59 GMT Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes> vary: origin vary: access-control-request-method vary: access-control-request-headers x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111 Connection: keep-alive { "policyStoreId":"PSEXAMPLEabcdefg111111", "policyTemplateId":"PTEXAMPLEabcdefg111111", "createdDate":"2023-05-17T18:58:48.795411Z", "lastUpdatedDate":"2023-05-17T19:18:48.870209Z" } See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ See Also 242 Amazon Verified Permissions • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 API Reference Guide See Also 243 Amazon Verified Permissions Data Types API Reference Guide The Amazon Verified Permissions API contains several data types that various actions use. This section describes each data type in detail. Note The order of each element in a data type structure is not guaranteed. Applications should not assume a particular order. The following data types are supported: • ActionIdentifier • AttributeValue • BatchGetPolicyErrorItem • BatchGetPolicyInputItem • BatchGetPolicyOutputItem • BatchIsAuthorizedInputItem • BatchIsAuthorizedOutputItem • BatchIsAuthorizedWithTokenInputItem • BatchIsAuthorizedWithTokenOutputItem • CognitoGroupConfiguration • CognitoGroupConfigurationDetail • CognitoGroupConfigurationItem • CognitoUserPoolConfiguration • CognitoUserPoolConfigurationDetail • CognitoUserPoolConfigurationItem • Configuration • ConfigurationDetail • ConfigurationItem • ContextDefinition • DeterminingPolicyItem 244 Amazon Verified Permissions • EntitiesDefinition • EntityIdentifier • EntityItem • EntityReference • EvaluationErrorItem • IdentitySourceDetails • IdentitySourceFilter • IdentitySourceItem • IdentitySourceItemDetails • OpenIdConnectAccessTokenConfiguration • OpenIdConnectAccessTokenConfigurationDetail •
amazon-verified-permissions-api-054
amazon-verified-permissions-api.pdf
54
describes each data type in detail. Note The order of each element in a data type structure is not guaranteed. Applications should not assume a particular order. The following data types are supported: • ActionIdentifier • AttributeValue • BatchGetPolicyErrorItem • BatchGetPolicyInputItem • BatchGetPolicyOutputItem • BatchIsAuthorizedInputItem • BatchIsAuthorizedOutputItem • BatchIsAuthorizedWithTokenInputItem • BatchIsAuthorizedWithTokenOutputItem • CognitoGroupConfiguration • CognitoGroupConfigurationDetail • CognitoGroupConfigurationItem • CognitoUserPoolConfiguration • CognitoUserPoolConfigurationDetail • CognitoUserPoolConfigurationItem • Configuration • ConfigurationDetail • ConfigurationItem • ContextDefinition • DeterminingPolicyItem 244 Amazon Verified Permissions • EntitiesDefinition • EntityIdentifier • EntityItem • EntityReference • EvaluationErrorItem • IdentitySourceDetails • IdentitySourceFilter • IdentitySourceItem • IdentitySourceItemDetails • OpenIdConnectAccessTokenConfiguration • OpenIdConnectAccessTokenConfigurationDetail • OpenIdConnectAccessTokenConfigurationItem • OpenIdConnectConfiguration • OpenIdConnectConfigurationDetail • OpenIdConnectConfigurationItem • OpenIdConnectGroupConfiguration • OpenIdConnectGroupConfigurationDetail • OpenIdConnectGroupConfigurationItem • OpenIdConnectIdentityTokenConfiguration • OpenIdConnectIdentityTokenConfigurationDetail • OpenIdConnectIdentityTokenConfigurationItem • OpenIdConnectTokenSelection • OpenIdConnectTokenSelectionDetail • OpenIdConnectTokenSelectionItem • PolicyDefinition • PolicyDefinitionDetail • PolicyDefinitionItem • PolicyFilter • PolicyItem • PolicyStoreItem API Reference Guide 245 Amazon Verified Permissions • PolicyTemplateItem • ResourceConflict • SchemaDefinition • StaticPolicyDefinition • StaticPolicyDefinitionDetail • StaticPolicyDefinitionItem • TemplateLinkedPolicyDefinition • TemplateLinkedPolicyDefinitionDetail • TemplateLinkedPolicyDefinitionItem • UpdateCognitoGroupConfiguration • UpdateCognitoUserPoolConfiguration • UpdateConfiguration • UpdateOpenIdConnectAccessTokenConfiguration • UpdateOpenIdConnectConfiguration • UpdateOpenIdConnectGroupConfiguration • UpdateOpenIdConnectIdentityTokenConfiguration • UpdateOpenIdConnectTokenSelection • UpdatePolicyDefinition • UpdateStaticPolicyDefinition • ValidationExceptionField • ValidationSettings API Reference Guide 246 Amazon Verified Permissions ActionIdentifier API Reference Guide Contains information about an action for a request for which an authorization decision is made. This data type is used as a request parameter to the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations. Example: { "actionId": "<action name>", "actionType": "Action" } Contents Note In the following list, the required parameters are described first. actionId The ID of an action. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: .* Required: Yes actionType The type of an action. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: Action$|^.+::Action Required: Yes ActionIdentifier 247 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 248 Amazon Verified Permissions AttributeValue The value of an attribute. API Reference Guide 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. Contents Note In the following list, the required parameters are described first. Important This data type is a UNION, so only one of the following members can be specified when used or returned. boolean An attribute value of Boolean type. Example: {"boolean": true} Type: Boolean Required: No decimal An attribute value of decimal type. Example: {"decimal": "1.1"} Type: String Length Constraints: Minimum length of 3. Maximum length of 23. AttributeValue 249 Amazon Verified Permissions API Reference Guide Pattern: -?\d{1,15}\.\d{1,4} Required: No entityIdentifier An attribute value of type EntityIdentifier. Example: "entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"} Type: EntityIdentifier object Required: No ipaddr An attribute value of ipaddr type. Example: {"ip": "192.168.1.100"} Type: String Length Constraints: Minimum length of 1. Maximum length of 44. Pattern: [0-9a-fA-F\.:\/]* Required: No long An attribute value of Long type. Example: {"long": 0} Type: Long Required: No record An attribute value of Record type. Example: {"record": { "keyName": {} } } Type: String to AttributeValue object map Contents 250 API Reference Guide Amazon Verified Permissions Required: No set An attribute value of Set type. Example: {"set": [ {} ] } Type: Array of AttributeValue objects Required: No string An attribute value of String type. Example: {"string": "abc"} Type: String Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 251 Amazon Verified Permissions API Reference Guide BatchGetPolicyErrorItem Contains the information about an error resulting from a BatchGetPolicy API call. Contents Note In the following list, the required parameters are described first. code The error code that was returned. Type: String Valid Values: POLICY_STORE_NOT_FOUND | POLICY_NOT_FOUND Required: Yes message A detailed error message. Type: String Required: Yes policyId The identifier of the policy associated with the failed request. Type: String Required: Yes policyStoreId The identifier of the policy store associated with the failed request. Type: String Required: Yes BatchGetPolicyErrorItem 252 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 253 Amazon Verified Permissions API Reference Guide BatchGetPolicyInputItem Information about a policy that you include in a BatchGetPolicy API request. Contents Note In the following list, the required parameters are
amazon-verified-permissions-api-055
amazon-verified-permissions-api.pdf
55
with the failed request. Type: String Required: Yes policyStoreId The identifier of the policy store associated with the failed request. Type: String Required: Yes BatchGetPolicyErrorItem 252 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 253 Amazon Verified Permissions API Reference Guide BatchGetPolicyInputItem Information about a policy that you include in a BatchGetPolicy API request. Contents Note In the following list, the required parameters are described first. policyId The identifier of the policy you want information about. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-]* Required: Yes policyStoreId The identifier of the policy store where the policy you want information about is stored. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ BatchGetPolicyInputItem 254 Amazon Verified Permissions • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference Guide See Also 255 Amazon Verified Permissions API Reference Guide BatchGetPolicyOutputItem Contains information about a policy returned from a BatchGetPolicy API request. Contents Note In the following list, the required parameters are described first. createdDate The date and time the policy was created. Type: Timestamp Required: Yes definition The policy definition of an item in the list of policies returned. Type: PolicyDefinitionDetail object Note: This object is a Union. Only one member of this object can be specified or returned. Required: Yes lastUpdatedDate The date and time the policy was most recently updated. Type: Timestamp Required: Yes policyId The identifier of the policy you want information about. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. BatchGetPolicyOutputItem 256 Amazon Verified Permissions Pattern: [a-zA-Z0-9-]* Required: Yes policyStoreId API Reference Guide The identifier of the policy store where the policy you want information about is stored. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes policyType The type of the policy. This is one of the following values: • STATIC • TEMPLATE_LINKED Type: String Valid Values: STATIC | TEMPLATE_LINKED Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 257 Amazon Verified Permissions API Reference Guide BatchIsAuthorizedInputItem An authorization request that you include in a BatchIsAuthorized API request. Contents Note In the following list, the required parameters are described first. action Specifies the requested action to be authorized. For example, PhotoFlash::ReadPhoto. Type: ActionIdentifier object Required: No context Specifies additional context that can be used to make more granular authorization decisions. Type: ContextDefinition object Note: This object is a Union. Only one member of this object can be specified or returned. Required: No principal Specifies the principal for which the authorization decision is to be made. Type: EntityIdentifier object Required: No resource Specifies the resource that you want an authorization decision for. For example, PhotoFlash::Photo. Type: EntityIdentifier object BatchIsAuthorizedInputItem 258 Amazon Verified Permissions Required: No See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 259 Amazon Verified Permissions API Reference Guide BatchIsAuthorizedOutputItem The decision, based on policy evaluation, from an individual authorization request in a BatchIsAuthorized API request. Contents Note In the following list, the required parameters are described first. decision An authorization decision that indicates if the authorization request should be allowed or denied. Type: String Valid Values: ALLOW | DENY Required: Yes determiningPolicies 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. Type: Array of DeterminingPolicyItem objects Required: Yes errors 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. Type: Array of EvaluationErrorItem objects BatchIsAuthorizedOutputItem 260 API Reference Guide Amazon Verified Permissions Required: Yes request The authorization request that initiated the decision. Type: BatchIsAuthorizedInputItem object Required: Yes See Also For more information about using this API in
amazon-verified-permissions-api-056
amazon-verified-permissions-api.pdf
56
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. Type: Array of DeterminingPolicyItem objects Required: Yes errors 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. Type: Array of EvaluationErrorItem objects BatchIsAuthorizedOutputItem 260 API Reference Guide Amazon Verified Permissions Required: Yes request The authorization request that initiated the decision. Type: BatchIsAuthorizedInputItem object Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 261 Amazon Verified Permissions API Reference Guide BatchIsAuthorizedWithTokenInputItem An authorization request that you include in a BatchIsAuthorizedWithToken API request. Contents Note In the following list, the required parameters are described first. action Specifies the requested action to be authorized. For example, PhotoFlash::ReadPhoto. Type: ActionIdentifier object Required: No context Specifies additional context that can be used to make more granular authorization decisions. Type: ContextDefinition object Note: This object is a Union. Only one member of this object can be specified or returned. Required: No resource Specifies the resource that you want an authorization decision for. For example, PhotoFlash::Photo. Type: EntityIdentifier object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: BatchIsAuthorizedWithTokenInputItem 262 Amazon Verified Permissions • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference Guide See Also 263 Amazon Verified Permissions API Reference Guide BatchIsAuthorizedWithTokenOutputItem The decision, based on policy evaluation, from an individual authorization request in a BatchIsAuthorizedWithToken API request. Contents Note In the following list, the required parameters are described first. decision An authorization decision that indicates if the authorization request should be allowed or denied. Type: String Valid Values: ALLOW | DENY Required: Yes determiningPolicies 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. Type: Array of DeterminingPolicyItem objects Required: Yes errors 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. Type: Array of EvaluationErrorItem objects BatchIsAuthorizedWithTokenOutputItem 264 API Reference Guide Amazon Verified Permissions Required: Yes request The authorization request that initiated the decision. Type: BatchIsAuthorizedWithTokenInputItem object Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 265 Amazon Verified Permissions API Reference Guide CognitoGroupConfiguration The type of entity that a policy store maps to groups from an Amazon Cognito user pool identity source. This data type is part of a CognitoUserPoolConfiguration structure and is a request parameter in CreateIdentitySource. Contents Note In the following list, the required parameters are described first. groupEntityType The name of the schema entity type that's mapped to the user pool group. Defaults to AWS::CognitoGroup. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: ([_a-zA-Z][_a-zA-Z0-9]*::)*[_a-zA-Z][_a-zA-Z0-9]* Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 CognitoGroupConfiguration 266 Amazon Verified Permissions API Reference Guide CognitoGroupConfigurationDetail The type of entity that a policy store maps to groups from an Amazon Cognito user pool identity source. This data type is part of an CognitoUserPoolConfigurationDetail structure and is a response parameter to GetIdentitySource. Contents Note In the following list, the required parameters are described first. groupEntityType The name of the schema entity type that's mapped to the user pool group. Defaults to AWS::CognitoGroup. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: ([_a-zA-Z][_a-zA-Z0-9]*::)*[_a-zA-Z][_a-zA-Z0-9]* Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 CognitoGroupConfigurationDetail 267 Amazon Verified Permissions API Reference Guide CognitoGroupConfigurationItem The type of entity that a policy store maps to groups from an Amazon Cognito user pool identity source. This data type is part of an CognitoUserPoolConfigurationItem structure and is a response
amazon-verified-permissions-api-057
amazon-verified-permissions-api.pdf
57
the user pool group. Defaults to AWS::CognitoGroup. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: ([_a-zA-Z][_a-zA-Z0-9]*::)*[_a-zA-Z][_a-zA-Z0-9]* Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 CognitoGroupConfigurationDetail 267 Amazon Verified Permissions API Reference Guide CognitoGroupConfigurationItem The type of entity that a policy store maps to groups from an Amazon Cognito user pool identity source. This data type is part of an CognitoUserPoolConfigurationItem structure and is a response parameter to ListIdentitySources. Contents Note In the following list, the required parameters are described first. groupEntityType The name of the schema entity type that's mapped to the user pool group. Defaults to AWS::CognitoGroup. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: ([_a-zA-Z][_a-zA-Z0-9]*::)*[_a-zA-Z][_a-zA-Z0-9]* Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 CognitoGroupConfigurationItem 268 Amazon Verified Permissions API Reference Guide CognitoUserPoolConfiguration The configuration for an identity source that represents a connection to an Amazon Cognito user pool used as an identity provider for Verified Permissions. This data type part of a Configuration structure that is used as a parameter to CreateIdentitySource. Example:"CognitoUserPoolConfiguration":{"UserPoolArn":"arn:aws:cognito- idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5","ClientIds": ["a1b2c3d4e5f6g7h8i9j0kalbmc"],"groupConfiguration": {"groupEntityType": "MyCorp::Group"}} Contents Note In the following list, the required parameters are described first. userPoolArn The Amazon Resource Name (ARN) of the Amazon Cognito user pool that contains the identities to be authorized. Example: "UserPoolArn": "arn:aws:cognito-idp:us- east-1:123456789012:userpool/us-east-1_1a2b3c4d5" Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: arn:[a-zA-Z0-9-]+:cognito-idp:(([a-zA-Z0-9-]+:\d{12}:userpool/ [\w-]+_[0-9a-zA-Z]+)) Required: Yes clientIds The unique application client IDs that are associated with the specified Amazon Cognito user pool. CognitoUserPoolConfiguration 269 Amazon Verified Permissions API Reference Guide Example: "ClientIds": ["&ExampleCogClientId;"] Type: Array of strings Array Members: Minimum number of 0 items. Maximum number of 1000 items. Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: .* Required: No groupConfiguration The type of entity that a policy store maps to groups from an Amazon Cognito user pool identity source. Type: CognitoGroupConfiguration object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 270 Amazon Verified Permissions API Reference Guide CognitoUserPoolConfigurationDetail The configuration for an identity source that represents a connection to an Amazon Cognito user pool used as an identity provider for Verified Permissions. This data type is used as a field that is part of an ConfigurationDetail structure that is part of the response to GetIdentitySource. Example:"CognitoUserPoolConfiguration":{"UserPoolArn":"arn:aws:cognito- idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5","ClientIds": ["a1b2c3d4e5f6g7h8i9j0kalbmc"],"groupConfiguration": {"groupEntityType": "MyCorp::Group"}} Contents Note In the following list, the required parameters are described first. clientIds The unique application client IDs that are associated with the specified Amazon Cognito user pool. Example: "clientIds": ["&ExampleCogClientId;"] Type: Array of strings Array Members: Minimum number of 0 items. Maximum number of 1000 items. Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: .* Required: Yes issuer The OpenID Connect (OIDC) issuer ID of the Amazon Cognito user pool that contains the identities to be authorized. CognitoUserPoolConfigurationDetail 271 Amazon Verified Permissions API Reference Guide Example: "issuer": "https://cognito-idp.us-east-1.amazonaws.com/us- east-1_1a2b3c4d5" Type: String Length Constraints: Minimum length of 1. Maximum length of 2048. Pattern: https://.* Required: Yes userPoolArn The Amazon Resource Name (ARN) of the Amazon Cognito user pool that contains the identities to be authorized. Example: "userPoolArn": "arn:aws:cognito-idp:us- east-1:123456789012:userpool/us-east-1_1a2b3c4d5" Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: arn:[a-zA-Z0-9-]+:cognito-idp:(([a-zA-Z0-9-]+:\d{12}:userpool/ [\w-]+_[0-9a-zA-Z]+)) Required: Yes groupConfiguration The type of entity that a policy store maps to groups from an Amazon Cognito user pool identity source. Type: CognitoGroupConfigurationDetail object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ See Also 272 Amazon Verified Permissions • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference Guide See Also 273 Amazon Verified Permissions API Reference Guide CognitoUserPoolConfigurationItem The configuration for an identity source that represents a connection to an Amazon Cognito user pool used as an identity provider for Verified Permissions. This data type is used as a field that is part of the ConfigurationItem structure that is part of the response to ListIdentitySources. Example:"CognitoUserPoolConfiguration":{"UserPoolArn":"arn:aws:cognito- idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5","ClientIds": ["a1b2c3d4e5f6g7h8i9j0kalbmc"],"groupConfiguration": {"groupEntityType": "MyCorp::Group"}} Contents Note In the following list, the required parameters are described first. clientIds The unique application client IDs that are associated with the specified Amazon Cognito user pool. Example: "clientIds": ["&ExampleCogClientId;"] Type: Array of strings Array Members: Minimum number of 0 items. Maximum number of 1000 items. Length
amazon-verified-permissions-api-058
amazon-verified-permissions-api.pdf
58
The configuration for an identity source that represents a connection to an Amazon Cognito user pool used as an identity provider for Verified Permissions. This data type is used as a field that is part of the ConfigurationItem structure that is part of the response to ListIdentitySources. Example:"CognitoUserPoolConfiguration":{"UserPoolArn":"arn:aws:cognito- idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5","ClientIds": ["a1b2c3d4e5f6g7h8i9j0kalbmc"],"groupConfiguration": {"groupEntityType": "MyCorp::Group"}} Contents Note In the following list, the required parameters are described first. clientIds The unique application client IDs that are associated with the specified Amazon Cognito user pool. Example: "clientIds": ["&ExampleCogClientId;"] Type: Array of strings Array Members: Minimum number of 0 items. Maximum number of 1000 items. Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: .* Required: Yes issuer The OpenID Connect (OIDC) issuer ID of the Amazon Cognito user pool that contains the identities to be authorized. CognitoUserPoolConfigurationItem 274 Amazon Verified Permissions API Reference Guide Example: "issuer": "https://cognito-idp.us-east-1.amazonaws.com/us- east-1_1a2b3c4d5" Type: String Length Constraints: Minimum length of 1. Maximum length of 2048. Pattern: https://.* Required: Yes userPoolArn The Amazon Resource Name (ARN) of the Amazon Cognito user pool that contains the identities to be authorized. Example: "userPoolArn": "arn:aws:cognito-idp:us- east-1:123456789012:userpool/us-east-1_1a2b3c4d5" Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: arn:[a-zA-Z0-9-]+:cognito-idp:(([a-zA-Z0-9-]+:\d{12}:userpool/ [\w-]+_[0-9a-zA-Z]+)) Required: Yes groupConfiguration The type of entity that a policy store maps to groups from an Amazon Cognito user pool identity source. Type: CognitoGroupConfigurationItem object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ See Also 275 Amazon Verified Permissions • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference Guide See Also 276 Amazon Verified Permissions Configuration API Reference Guide Contains configuration information used when creating a new identity source. This data type is used as a request parameter for the CreateIdentitySource operation. Contents Note In the following list, the required parameters are described first. Important This data type is a UNION, so only one of the following members can be specified when used or returned. cognitoUserPoolConfiguration 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":"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us- east-1_1a2b3c4d5","clientIds": ["a1b2c3d4e5f6g7h8i9j0kalbmc"],"groupConfiguration": {"groupEntityType": "MyCorp::Group"}}} Type: CognitoUserPoolConfiguration object Required: No openIdConnectConfiguration Contains configuration details of an OpenID Connect (OIDC) identity provider, or identity source, that Verified Permissions can use to generate entities from authenticated identities. It specifies the issuer URL, token type that you want to use, and policy store entity details. Configuration 277 Amazon Verified Permissions API Reference Guide Example:"configuration":{"openIdConnectConfiguration": {"issuer":"https://auth.example.com","tokenSelection": {"accessTokenOnly":{"audiences":["https://myapp.example.com","https:// myapp2.example.com"],"principalIdClaim":"sub"}},"entityIdPrefix":"MyOIDCProvider","groupConfiguration": {"groupClaim":"groups","groupEntityType":"MyCorp::UserGroup"}}} Type: OpenIdConnectConfiguration object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 278 Amazon Verified Permissions API Reference Guide ConfigurationDetail Contains configuration information about an identity source. This data type is a response parameter to the GetIdentitySource operation. Contents Note In the following list, the required parameters are described first. Important This data type is a UNION, so only one of the following members can be specified when used or returned. cognitoUserPoolConfiguration 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, the policy store entity that you want to assign to user groups, and one or more application client IDs. Example: "configuration":{"cognitoUserPoolConfiguration": {"userPoolArn":"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us- east-1_1a2b3c4d5","clientIds": ["a1b2c3d4e5f6g7h8i9j0kalbmc"],"groupConfiguration": {"groupEntityType": "MyCorp::Group"}}} Type: CognitoUserPoolConfigurationDetail object Required: No openIdConnectConfiguration Contains configuration details of an OpenID Connect (OIDC) identity provider, or identity source, that Verified Permissions can use to generate entities from authenticated identities. It specifies the issuer URL, token type that you want to use, and policy store entity details. ConfigurationDetail 279 Amazon Verified Permissions API Reference Guide Example:"configuration":{"openIdConnectConfiguration": {"issuer":"https://auth.example.com","tokenSelection": {"accessTokenOnly":{"audiences":["https://myapp.example.com","https:// myapp2.example.com"],"principalIdClaim":"sub"}},"entityIdPrefix":"MyOIDCProvider","groupConfiguration": {"groupClaim":"groups","groupEntityType":"MyCorp::UserGroup"}}} Type: OpenIdConnectConfigurationDetail object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 280 Amazon Verified Permissions ConfigurationItem API Reference Guide Contains configuration information about an identity source. This data type is a response parameter to the ListIdentitySources operation. Contents Note In the following list, the required parameters are described first. Important This data type is a UNION, so only one of the following members can be specified when used or returned. cognitoUserPoolConfiguration 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
amazon-verified-permissions-api-059
amazon-verified-permissions-api.pdf
59
• AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 280 Amazon Verified Permissions ConfigurationItem API Reference Guide Contains configuration information about an identity source. This data type is a response parameter to the ListIdentitySources operation. Contents Note In the following list, the required parameters are described first. Important This data type is a UNION, so only one of the following members can be specified when used or returned. cognitoUserPoolConfiguration 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, the policy store entity that you want to assign to user groups, and one or more application client IDs. Example: "configuration":{"cognitoUserPoolConfiguration": {"userPoolArn":"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us- east-1_1a2b3c4d5","clientIds": ["a1b2c3d4e5f6g7h8i9j0kalbmc"],"groupConfiguration": {"groupEntityType": "MyCorp::Group"}}} Type: CognitoUserPoolConfigurationItem object Required: No openIdConnectConfiguration Contains configuration details of an OpenID Connect (OIDC) identity provider, or identity source, that Verified Permissions can use to generate entities from authenticated identities. It specifies the issuer URL, token type that you want to use, and policy store entity details. ConfigurationItem 281 Amazon Verified Permissions API Reference Guide Example:"configuration":{"openIdConnectConfiguration": {"issuer":"https://auth.example.com","tokenSelection": {"accessTokenOnly":{"audiences":["https://myapp.example.com","https:// myapp2.example.com"],"principalIdClaim":"sub"}},"entityIdPrefix":"MyOIDCProvider","groupConfiguration": {"groupClaim":"groups","groupEntityType":"MyCorp::UserGroup"}}} Type: OpenIdConnectConfigurationItem object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 282 Amazon Verified Permissions ContextDefinition API Reference Guide Contains additional details about the context of the request. Verified Permissions evaluates this information in an authorization request as part of the when and unless clauses in a policy. This data type is used as a request parameter for the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations. If you're passing context as part of the request, exactly one instance of context must be passed. If you don't want to pass context, omit the context parameter from your request rather than sending context {}. Example: "context":{"contextMap":{"<KeyName1>": {"boolean":true},"<KeyName2>":{"long":1234}}} Contents Note In the following list, the required parameters are described first. Important This data type is a UNION, so only one of the following members can be specified when used or returned. cedarJson A Cedar JSON string representation of the context needed to successfully evaluate an authorization request. Example: {"cedarJson":"{\"<KeyName1>\": true, \"<KeyName2>\": 1234}" } Type: String Required: No ContextDefinition 283 Amazon Verified Permissions contextMap API Reference Guide 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}} Type: String to AttributeValue object map Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 284 Amazon Verified Permissions API Reference Guide DeterminingPolicyItem 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"}] Contents Note In the following list, the required parameters are described first. policyId The Id of a policy that determined to an authorization decision. Example: "policyId":"SPEXAMPLEabcdefg111111" Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-]* Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 DeterminingPolicyItem 285 Amazon Verified Permissions EntitiesDefinition API Reference Guide Contains the list of entities to be considered during an authorization request. This includes all principals, resources, and actions required to successfully evaluate the request. This data type is used as a field in the response parameter for the IsAuthorized and IsAuthorizedWithToken operations. Contents Note In the following list, the required parameters are described first. Important This data type is a UNION, so only one of the following members can be specified when used or returned. cedarJson A Cedar JSON string representation of the entities needed to successfully evaluate an authorization request. Example: {"cedarJson": "[{\"uid\":{\"type\":\"Photo\",\"id\": \"VacationPhoto94.jpg\"},\"attrs\":{\"accessLevel\":\"public\"}, \"parents\":[]}]"} Type: String Required: No entityList 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. EntitiesDefinition 286 Amazon Verified Permissions API Reference Guide Note If you include multiple entities with the same identifier, only the last one is processed in the request. Type: Array of EntityItem objects Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for
amazon-verified-permissions-api-060
amazon-verified-permissions-api.pdf
60
\"parents\":[]}]"} Type: String Required: No entityList 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. EntitiesDefinition 286 Amazon Verified Permissions API Reference Guide Note If you include multiple entities with the same identifier, only the last one is processed in the request. Type: Array of EntityItem objects Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 287 Amazon Verified Permissions EntityIdentifier API Reference Guide 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"} Contents Note In the following list, the required parameters are described first. entityId The identifier of an entity. "entityId":"identifier" Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: .* Required: Yes entityType The type of an entity. Example: "entityType":"typeName" Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: .* Required: Yes EntityIdentifier 288 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 289 Amazon Verified Permissions EntityItem API Reference Guide 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" } ] } Contents Note In the following list, the required parameters are described first. identifier The identifier of the entity. Type: EntityIdentifier object Required: Yes attributes A list of attributes for the entity. Type: String to AttributeValue object map Required: No parents 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. EntityItem 290 Amazon Verified Permissions API Reference Guide Type: Array of EntityIdentifier objects Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 291 Amazon Verified Permissions EntityReference API Reference Guide Contains information about a principal or resource that can be referenced in a Cedar policy. This data type is used as part of the PolicyFilter structure that is used as a request parameter for the ListPolicies operation.. Contents Note In the following list, the required parameters are described first. Important This data type is a UNION, so only one of the following members can be specified when used or returned. identifier The identifier of the entity. It can consist of either an EntityType and EntityId, a principal, or a resource. Type: EntityIdentifier object Required: No unspecified 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. Type: Boolean Required: No EntityReference 292 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 293 Amazon Verified Permissions API Reference Guide EvaluationErrorItem Contains a description of an evaluation error. This data type is a response parameter of the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations. Contents Note In the following list, the required parameters are described first. errorDescription The error description. Type: String Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 EvaluationErrorItem 294 Amazon Verified Permissions API Reference Guide IdentitySourceDetails This data type has been deprecated. A structure that contains configuration of the identity source. This data type was a response parameter for the GetIdentitySource operation. Replaced
amazon-verified-permissions-api-061
amazon-verified-permissions-api.pdf
61
parameter of the IsAuthorized, BatchIsAuthorized, and IsAuthorizedWithToken operations. Contents Note In the following list, the required parameters are described first. errorDescription The error description. Type: String Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 EvaluationErrorItem 294 Amazon Verified Permissions API Reference Guide IdentitySourceDetails This data type has been deprecated. A structure that contains configuration of the identity source. This data type was a response parameter for the GetIdentitySource operation. Replaced by ConfigurationDetail. Contents Note In the following list, the required parameters are described first. clientIds This member has been deprecated. The application client IDs associated with the specified Amazon Cognito user pool that are enabled for this identity source. Type: Array of strings Array Members: Minimum number of 0 items. Maximum number of 1000 items. Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: .* Required: No discoveryUrl This member has been deprecated. 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 AWS 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 IdentitySourceDetails 295 Amazon Verified Permissions Type: String API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 2048. Pattern: https://.* Required: No openIdIssuer This member has been deprecated. A string that identifies the type of OIDC service represented by this identity source. At this time, the only valid value is cognito. Type: String Valid Values: COGNITO Required: No userPoolArn This member has been deprecated. The Amazon Resource Name (ARN) of the Amazon Cognito user pool whose identities are accessible to this Verified Permissions policy store. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: arn:[a-zA-Z0-9-]+:cognito-idp:(([a-zA-Z0-9-]+:\d{12}:userpool/ [\w-]+_[0-9a-zA-Z]+)) Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ See Also 296 Amazon Verified Permissions • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference Guide See Also 297 Amazon Verified Permissions API Reference Guide IdentitySourceFilter A structure that defines characteristics of an identity source that you can use to filter. This data type is a request parameter for the ListIdentityStores operation. Contents Note In the following list, the required parameters are described first. principalEntityType The Cedar entity type of the principals returned by the identity provider (IdP) associated with this identity source. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: .* Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 IdentitySourceFilter 298 Amazon Verified Permissions API Reference Guide IdentitySourceItem A structure that defines an identity source. This data type is a response parameter to the ListIdentitySources operation. Contents Note In the following list, the required parameters are described first. createdDate The date and time the identity source was originally created. Type: Timestamp Required: Yes identitySourceId The unique identifier of the identity source. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-]* Required: Yes lastUpdatedDate The date and time the identity source was most recently updated. Type: Timestamp Required: Yes policyStoreId The identifier of the policy store that contains the identity source. IdentitySourceItem 299 Amazon Verified Permissions Type: String API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes principalEntityType The Cedar entity type of the principals returned from the IdP associated with this identity source. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: .* Required: Yes configuration Contains configuration information about an identity source. Type: ConfigurationItem object Note: This object is a Union. Only one member of this object can be specified or returned. Required: No details This member has been deprecated. A structure that contains the details of the associated identity provider (IdP). Type: IdentitySourceItemDetails object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: See Also 300 Amazon Verified Permissions • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference Guide See Also 301 Amazon Verified Permissions API Reference Guide IdentitySourceItemDetails This data type has been deprecated. A structure that contains configuration of the identity source. This data type was a response parameter for the ListIdentitySources operation. Replaced by ConfigurationItem. Contents Note In the following list, the required parameters are described first.
amazon-verified-permissions-api-062
amazon-verified-permissions-api.pdf
62
IdentitySourceItemDetails object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: See Also 300 Amazon Verified Permissions • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference Guide See Also 301 Amazon Verified Permissions API Reference Guide IdentitySourceItemDetails This data type has been deprecated. A structure that contains configuration of the identity source. This data type was a response parameter for the ListIdentitySources operation. Replaced by ConfigurationItem. Contents Note In the following list, the required parameters are described first. clientIds This member has been deprecated. The application client IDs associated with the specified Amazon Cognito user pool that are enabled for this identity source. Type: Array of strings Array Members: Minimum number of 0 items. Maximum number of 1000 items. Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: .* Required: No discoveryUrl This member has been deprecated. 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 AWS 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 IdentitySourceItemDetails 302 Amazon Verified Permissions Type: String API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 2048. Pattern: https://.* Required: No openIdIssuer This member has been deprecated. A string that identifies the type of OIDC service represented by this identity source. At this time, the only valid value is cognito. Type: String Valid Values: COGNITO Required: No userPoolArn This member has been deprecated. The Amazon Cognito user pool whose identities are accessible to this Verified Permissions policy store. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: arn:[a-zA-Z0-9-]+:cognito-idp:(([a-zA-Z0-9-]+:\d{12}:userpool/ [\w-]+_[0-9a-zA-Z]+)) Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ See Also 303 Amazon Verified Permissions • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference Guide See Also 304 Amazon Verified Permissions API Reference Guide OpenIdConnectAccessTokenConfiguration The configuration of an OpenID Connect (OIDC) identity source for handling access token claims. Contains the claim that you want to identify as the principal in an authorization request, and the values of the aud claim, or audiences, that you want to accept. This data type is part of a OpenIdConnectTokenSelection structure, which is a parameter of CreateIdentitySource. Contents Note In the following list, the required parameters are described first. audiences The access token aud claim values that you want to accept in your policy store. For example, https://myapp.example.com, https://myapp2.example.com. Type: Array of strings Array Members: Minimum number of 1 item. Maximum number of 255 items. Length Constraints: Minimum length of 1. Maximum length of 255. Required: No principalIdClaim The claim that determines the principal in OIDC access tokens. For example, sub. Type: String Length Constraints: Minimum length of 1. Required: No OpenIdConnectAccessTokenConfiguration 305 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 306 Amazon Verified Permissions API Reference Guide OpenIdConnectAccessTokenConfigurationDetail The configuration of an OpenID Connect (OIDC) identity source for handling access token claims. Contains the claim that you want to identify as the principal in an authorization request, and the values of the aud claim, or audiences, that you want to accept. This data type is part of a OpenIdConnectTokenSelectionDetail structure, which is a parameter of GetIdentitySource. Contents Note In the following list, the required parameters are described first. audiences The access token aud claim values that you want to accept in your policy store. For example, https://myapp.example.com, https://myapp2.example.com. Type: Array of strings Array Members: Minimum number of 1 item. Maximum number of 255 items. Length Constraints: Minimum length of 1. Maximum length of 255. Required: No principalIdClaim The claim that determines the principal in OIDC access tokens. For example, sub. Type: String Length Constraints: Minimum length of 1. Required: No OpenIdConnectAccessTokenConfigurationDetail 307 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 308 Amazon Verified Permissions API Reference Guide OpenIdConnectAccessTokenConfigurationItem The configuration of an OpenID Connect (OIDC) identity source for handling access token claims. Contains the claim that you want to identify as the principal in an authorization request, and the values of the aud claim, or audiences, that you want to accept. This data type is part of
amazon-verified-permissions-api-063
amazon-verified-permissions-api.pdf
63
Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 308 Amazon Verified Permissions API Reference Guide OpenIdConnectAccessTokenConfigurationItem The configuration of an OpenID Connect (OIDC) identity source for handling access token claims. Contains the claim that you want to identify as the principal in an authorization request, and the values of the aud claim, or audiences, that you want to accept. This data type is part of a OpenIdConnectTokenSelectionItem structure, which is a parameter of ListIdentitySources. Contents Note In the following list, the required parameters are described first. audiences The access token aud claim values that you want to accept in your policy store. For example, https://myapp.example.com, https://myapp2.example.com. Type: Array of strings Array Members: Minimum number of 1 item. Maximum number of 255 items. Length Constraints: Minimum length of 1. Maximum length of 255. Required: No principalIdClaim The claim that determines the principal in OIDC access tokens. For example, sub. Type: String Length Constraints: Minimum length of 1. Required: No OpenIdConnectAccessTokenConfigurationItem 309 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 310 Amazon Verified Permissions API Reference Guide OpenIdConnectConfiguration Contains configuration details of an OpenID Connect (OIDC) identity provider, or identity source, that Verified Permissions can use to generate entities from authenticated identities. It specifies the issuer URL, token type that you want to use, and policy store entity details. This data type is part of a Configuration structure, which is a parameter to CreateIdentitySource. Contents Note In the following list, the required parameters are described first. issuer The issuer URL of an OIDC identity provider. This URL must have an OIDC discovery endpoint at the path .well-known/openid-configuration. Type: String Length Constraints: Minimum length of 1. Maximum length of 2048. Pattern: https://.* Required: Yes tokenSelection The token type that you want to process from your OIDC identity provider. Your policy store can process either identity (ID) or access tokens from a given OIDC identity source. Type: OpenIdConnectTokenSelection object Note: This object is a Union. Only one member of this object can be specified or returned. Required: Yes entityIdPrefix A descriptive string that you want to prefix to user entities from your OIDC identity provider. For example, if you set an entityIdPrefix of MyOIDCProvider, you can reference principals in your policies in the format MyCorp::User::MyOIDCProvider|Carlos. OpenIdConnectConfiguration 311 Amazon Verified Permissions Type: String API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 100. Required: No groupConfiguration The claim in OIDC identity provider tokens that indicates a user's group membership, and the entity type that you want to map it to. For example, this object can map the contents of a groups claim to MyCorp::UserGroup. Type: OpenIdConnectGroupConfiguration object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 312 Amazon Verified Permissions API Reference Guide OpenIdConnectConfigurationDetail Contains configuration details of an OpenID Connect (OIDC) identity provider, or identity source, that Verified Permissions can use to generate entities from authenticated identities. It specifies the issuer URL, token type that you want to use, and policy store entity details. This data type is part of a ConfigurationDetail structure, which is a parameter to GetIdentitySource. Contents Note In the following list, the required parameters are described first. issuer The issuer URL of an OIDC identity provider. This URL must have an OIDC discovery endpoint at the path .well-known/openid-configuration. Type: String Length Constraints: Minimum length of 1. Maximum length of 2048. Pattern: https://.* Required: Yes tokenSelection The token type that you want to process from your OIDC identity provider. Your policy store can process either identity (ID) or access tokens from a given OIDC identity source. Type: OpenIdConnectTokenSelectionDetail object Note: This object is a Union. Only one member of this object can be specified or returned. Required: Yes entityIdPrefix A descriptive string that you want to prefix to user entities from your OIDC identity provider. For example, if you set an entityIdPrefix of MyOIDCProvider, you can reference principals in your policies in the format MyCorp::User::MyOIDCProvider|Carlos. OpenIdConnectConfigurationDetail 313 Amazon Verified Permissions Type: String API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 100. Required: No groupConfiguration The claim in OIDC identity provider tokens that indicates a user's group membership, and the entity type that you want to map it to. For example, this object
amazon-verified-permissions-api-064
amazon-verified-permissions-api.pdf
64
one member of this object can be specified or returned. Required: Yes entityIdPrefix A descriptive string that you want to prefix to user entities from your OIDC identity provider. For example, if you set an entityIdPrefix of MyOIDCProvider, you can reference principals in your policies in the format MyCorp::User::MyOIDCProvider|Carlos. OpenIdConnectConfigurationDetail 313 Amazon Verified Permissions Type: String API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 100. Required: No groupConfiguration The claim in OIDC identity provider tokens that indicates a user's group membership, and the entity type that you want to map it to. For example, this object can map the contents of a groups claim to MyCorp::UserGroup. Type: OpenIdConnectGroupConfigurationDetail object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 314 Amazon Verified Permissions API Reference Guide OpenIdConnectConfigurationItem Contains configuration details of an OpenID Connect (OIDC) identity provider, or identity source, that Verified Permissions can use to generate entities from authenticated identities. It specifies the issuer URL, token type that you want to use, and policy store entity details. This data type is part of a ConfigurationItem structure, which is a parameter to ListIdentitySources. Contents Note In the following list, the required parameters are described first. issuer The issuer URL of an OIDC identity provider. This URL must have an OIDC discovery endpoint at the path .well-known/openid-configuration. Type: String Length Constraints: Minimum length of 1. Maximum length of 2048. Pattern: https://.* Required: Yes tokenSelection The token type that you want to process from your OIDC identity provider. Your policy store can process either identity (ID) or access tokens from a given OIDC identity source. Type: OpenIdConnectTokenSelectionItem object Note: This object is a Union. Only one member of this object can be specified or returned. Required: Yes entityIdPrefix A descriptive string that you want to prefix to user entities from your OIDC identity provider. For example, if you set an entityIdPrefix of MyOIDCProvider, you can reference principals in your policies in the format MyCorp::User::MyOIDCProvider|Carlos. OpenIdConnectConfigurationItem 315 Amazon Verified Permissions Type: String API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 100. Required: No groupConfiguration The claim in OIDC identity provider tokens that indicates a user's group membership, and the entity type that you want to map it to. For example, this object can map the contents of a groups claim to MyCorp::UserGroup. Type: OpenIdConnectGroupConfigurationItem object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 316 Amazon Verified Permissions API Reference Guide OpenIdConnectGroupConfiguration The claim in OIDC identity provider tokens that indicates a user's group membership, and the entity type that you want to map it to. For example, this object can map the contents of a groups claim to MyCorp::UserGroup. This data type is part of a OpenIdConnectConfiguration structure, which is a parameter of CreateIdentitySource. Contents Note In the following list, the required parameters are described first. groupClaim The token claim that you want Verified Permissions to interpret as group membership. For example, groups. Type: String Length Constraints: Minimum length of 1. Required: Yes groupEntityType The policy store entity type that you want to map your users' group claim to. For example, MyCorp::UserGroup. A group entity type is an entity that can have a user entity type as a member. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: ([_a-zA-Z][_a-zA-Z0-9]*::)*[_a-zA-Z][_a-zA-Z0-9]* Required: Yes OpenIdConnectGroupConfiguration 317 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 318 Amazon Verified Permissions API Reference Guide OpenIdConnectGroupConfigurationDetail The claim in OIDC identity provider tokens that indicates a user's group membership, and the entity type that you want to map it to. For example, this object can map the contents of a groups claim to MyCorp::UserGroup. This data type is part of a OpenIdConnectConfigurationDetail structure, which is a parameter of GetIdentitySource. Contents Note In the following list, the required parameters are described first. groupClaim The token claim that you want Verified Permissions to interpret as group membership. For example, groups. Type: String Length Constraints: Minimum length of 1. Required: Yes groupEntityType The policy store entity type that you want to map your users' group claim to. For example, MyCorp::UserGroup. A group entity type is an entity that can have a user entity type as a member. Type: String Length Constraints: Minimum length
amazon-verified-permissions-api-065
amazon-verified-permissions-api.pdf
65
groups claim to MyCorp::UserGroup. This data type is part of a OpenIdConnectConfigurationDetail structure, which is a parameter of GetIdentitySource. Contents Note In the following list, the required parameters are described first. groupClaim The token claim that you want Verified Permissions to interpret as group membership. For example, groups. Type: String Length Constraints: Minimum length of 1. Required: Yes groupEntityType The policy store entity type that you want to map your users' group claim to. For example, MyCorp::UserGroup. A group entity type is an entity that can have a user entity type as a member. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: ([_a-zA-Z][_a-zA-Z0-9]*::)*[_a-zA-Z][_a-zA-Z0-9]* Required: Yes OpenIdConnectGroupConfigurationDetail 319 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 320 Amazon Verified Permissions API Reference Guide OpenIdConnectGroupConfigurationItem The claim in OIDC identity provider tokens that indicates a user's group membership, and the entity type that you want to map it to. For example, this object can map the contents of a groups claim to MyCorp::UserGroup. This data type is part of a OpenIdConnectConfigurationItem structure, which is a parameter of ListIdentitySourcea. Contents Note In the following list, the required parameters are described first. groupClaim The token claim that you want Verified Permissions to interpret as group membership. For example, groups. Type: String Length Constraints: Minimum length of 1. Required: Yes groupEntityType The policy store entity type that you want to map your users' group claim to. For example, MyCorp::UserGroup. A group entity type is an entity that can have a user entity type as a member. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: ([_a-zA-Z][_a-zA-Z0-9]*::)*[_a-zA-Z][_a-zA-Z0-9]* Required: Yes OpenIdConnectGroupConfigurationItem 321 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 322 Amazon Verified Permissions API Reference Guide OpenIdConnectIdentityTokenConfiguration The configuration of an OpenID Connect (OIDC) identity source for handling identity (ID) token claims. Contains the claim that you want to identify as the principal in an authorization request, and the values of the aud claim, or audiences, that you want to accept. This data type is part of a OpenIdConnectTokenSelection structure, which is a parameter of CreateIdentitySource. Contents Note In the following list, the required parameters are described first. clientIds The ID token audience, or client ID, claim values that you want to accept in your policy store from an OIDC identity provider. For example, 1example23456789, 2example10111213. Type: Array of strings Array Members: Minimum number of 0 items. Maximum number of 1000 items. Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: .* Required: No principalIdClaim The claim that determines the principal in OIDC access tokens. For example, sub. Type: String Length Constraints: Minimum length of 1. Required: No OpenIdConnectIdentityTokenConfiguration 323 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 324 Amazon Verified Permissions API Reference Guide OpenIdConnectIdentityTokenConfigurationDetail The configuration of an OpenID Connect (OIDC) identity source for handling identity (ID) token claims. Contains the claim that you want to identify as the principal in an authorization request, and the values of the aud claim, or audiences, that you want to accept. This data type is part of a OpenIdConnectTokenSelectionDetail structure, which is a parameter of GetIdentitySource. Contents Note In the following list, the required parameters are described first. clientIds The ID token audience, or client ID, claim values that you want to accept in your policy store from an OIDC identity provider. For example, 1example23456789, 2example10111213. Type: Array of strings Array Members: Minimum number of 0 items. Maximum number of 1000 items. Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: .* Required: No principalIdClaim The claim that determines the principal in OIDC access tokens. For example, sub. Type: String Length Constraints: Minimum length of 1. Required: No OpenIdConnectIdentityTokenConfigurationDetail 325 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 326 Amazon Verified Permissions API Reference Guide OpenIdConnectIdentityTokenConfigurationItem The configuration of an OpenID Connect (OIDC) identity source for handling identity (ID) token claims. Contains the claim that you want to identify as
amazon-verified-permissions-api-066
amazon-verified-permissions-api.pdf
66
claim that determines the principal in OIDC access tokens. For example, sub. Type: String Length Constraints: Minimum length of 1. Required: No OpenIdConnectIdentityTokenConfigurationDetail 325 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 326 Amazon Verified Permissions API Reference Guide OpenIdConnectIdentityTokenConfigurationItem The configuration of an OpenID Connect (OIDC) identity source for handling identity (ID) token claims. Contains the claim that you want to identify as the principal in an authorization request, and the values of the aud claim, or audiences, that you want to accept. This data type is part of a OpenIdConnectTokenSelectionItem structure, which is a parameter of ListIdentitySources. Contents Note In the following list, the required parameters are described first. clientIds The ID token audience, or client ID, claim values that you want to accept in your policy store from an OIDC identity provider. For example, 1example23456789, 2example10111213. Type: Array of strings Array Members: Minimum number of 0 items. Maximum number of 1000 items. Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: .* Required: No principalIdClaim The claim that determines the principal in OIDC access tokens. For example, sub. Type: String Length Constraints: Minimum length of 1. Required: No OpenIdConnectIdentityTokenConfigurationItem 327 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 328 Amazon Verified Permissions API Reference Guide OpenIdConnectTokenSelection The token type that you want to process from your OIDC identity provider. Your policy store can process either identity (ID) or access tokens from a given OIDC identity source. This data type is part of a OpenIdConnectConfiguration structure, which is a parameter of CreateIdentitySource. Contents Note In the following list, the required parameters are described first. Important This data type is a UNION, so only one of the following members can be specified when used or returned. accessTokenOnly The OIDC configuration for processing access tokens. Contains allowed audience claims, for example https://auth.example.com, and the claim that you want to map to the principal, for example sub. Type: OpenIdConnectAccessTokenConfiguration object Required: No identityTokenOnly The OIDC configuration for processing identity (ID) tokens. Contains allowed client ID claims, for example 1example23456789, and the claim that you want to map to the principal, for example sub. Type: OpenIdConnectIdentityTokenConfiguration object Required: No OpenIdConnectTokenSelection 329 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 330 Amazon Verified Permissions API Reference Guide OpenIdConnectTokenSelectionDetail The token type that you want to process from your OIDC identity provider. Your policy store can process either identity (ID) or access tokens from a given OIDC identity source. This data type is part of a OpenIdConnectConfigurationDetail structure, which is a parameter of GetIdentitySource. Contents Note In the following list, the required parameters are described first. Important This data type is a UNION, so only one of the following members can be specified when used or returned. accessTokenOnly The OIDC configuration for processing access tokens. Contains allowed audience claims, for example https://auth.example.com, and the claim that you want to map to the principal, for example sub. Type: OpenIdConnectAccessTokenConfigurationDetail object Required: No identityTokenOnly The OIDC configuration for processing identity (ID) tokens. Contains allowed client ID claims, for example 1example23456789, and the claim that you want to map to the principal, for example sub. Type: OpenIdConnectIdentityTokenConfigurationDetail object Required: No OpenIdConnectTokenSelectionDetail 331 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 332 Amazon Verified Permissions API Reference Guide OpenIdConnectTokenSelectionItem The token type that you want to process from your OIDC identity provider. Your policy store can process either identity (ID) or access tokens from a given OIDC identity source. This data type is part of a OpenIdConnectConfigurationItem structure, which is a parameter of ListIdentitySources. Contents Note In the following list, the required parameters are described first. Important This data type is a UNION, so only one of the following members can be specified when used or returned. accessTokenOnly The OIDC configuration for processing access tokens. Contains allowed audience claims, for example https://auth.example.com, and the claim that you want to map to the principal, for example sub. Type: OpenIdConnectAccessTokenConfigurationItem object Required: No identityTokenOnly
amazon-verified-permissions-api-067
amazon-verified-permissions-api.pdf
67
Your policy store can process either identity (ID) or access tokens from a given OIDC identity source. This data type is part of a OpenIdConnectConfigurationItem structure, which is a parameter of ListIdentitySources. Contents Note In the following list, the required parameters are described first. Important This data type is a UNION, so only one of the following members can be specified when used or returned. accessTokenOnly The OIDC configuration for processing access tokens. Contains allowed audience claims, for example https://auth.example.com, and the claim that you want to map to the principal, for example sub. Type: OpenIdConnectAccessTokenConfigurationItem object Required: No identityTokenOnly The OIDC configuration for processing identity (ID) tokens. Contains allowed client ID claims, for example 1example23456789, and the claim that you want to map to the principal, for example sub. Type: OpenIdConnectIdentityTokenConfigurationItem object Required: No OpenIdConnectTokenSelectionItem 333 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 334 Amazon Verified Permissions PolicyDefinition API Reference Guide A structure that contains the details for a Cedar policy definition. It includes the policy type, a description, and a policy body. This is a top level data type used to create a policy. This data type is used as a request parameter for the CreatePolicy operation. This structure must always have either an static or a templateLinked element. Contents Note In the following list, the required parameters are described first. Important This data type is a UNION, so only one of the following members can be specified when used or returned. static A structure that describes a static policy. An static policy doesn't use a template or allow placeholders for entities. Type: StaticPolicyDefinition object Required: No templateLinked 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. Type: TemplateLinkedPolicyDefinition object Required: No PolicyDefinition 335 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 336 Amazon Verified Permissions API Reference Guide PolicyDefinitionDetail A structure that describes a policy definition. It must always have either an static or a templateLinked element. This data type is used as a response parameter for the GetPolicy operation. Contents Note In the following list, the required parameters are described first. Important This data type is a UNION, so only one of the following members can be specified when used or returned. static Information about a static policy that wasn't created with a policy template. Type: StaticPolicyDefinitionDetail object Required: No templateLinked Information about a template-linked policy that was created by instantiating a policy template. Type: TemplateLinkedPolicyDefinitionDetail object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: PolicyDefinitionDetail 337 Amazon Verified Permissions • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference Guide See Also 338 Amazon Verified Permissions API Reference Guide PolicyDefinitionItem A structure that describes a PolicyDefinintion. It will always have either an StaticPolicy or a TemplateLinkedPolicy element. This data type is used as a response parameter for the CreatePolicy and ListPolicies operations. Contents Note In the following list, the required parameters are described first. Important This data type is a UNION, so only one of the following members can be specified when used or returned. static Information about a static policy that wasn't created with a policy template. Type: StaticPolicyDefinitionItem object Required: No templateLinked Information about a template-linked policy that was created by instantiating a policy template. Type: TemplateLinkedPolicyDefinitionItem object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: PolicyDefinitionItem 339 Amazon Verified Permissions • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference Guide See Also 340 Amazon Verified Permissions PolicyFilter API Reference Guide Contains information about a filter to refine policies returned in a query. This data type is used as a response parameter for the ListPolicies operation. Contents Note In the following list, the required parameters are described first. policyTemplateId Filters the output to only template-linked policies that were instantiated from the specified policy template. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: No policyType Filters the output to only policies of the
amazon-verified-permissions-api-068
amazon-verified-permissions-api.pdf
68
for Java V2 • AWS SDK for Ruby V3 API Reference Guide See Also 340 Amazon Verified Permissions PolicyFilter API Reference Guide Contains information about a filter to refine policies returned in a query. This data type is used as a response parameter for the ListPolicies operation. Contents Note In the following list, the required parameters are described first. policyTemplateId Filters the output to only template-linked policies that were instantiated from the specified policy template. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: No policyType Filters the output to only policies of the specified type. Type: String Valid Values: STATIC | TEMPLATE_LINKED Required: No principal Filters the output to only policies that reference the specified principal. Type: EntityReference object Note: This object is a Union. Only one member of this object can be specified or returned. PolicyFilter 341 Amazon Verified Permissions Required: No resource API Reference Guide Filters the output to only policies that reference the specified resource. Type: EntityReference object Note: This object is a Union. Only one member of this object can be specified or returned. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 342 API Reference Guide Amazon Verified Permissions PolicyItem Contains information about a policy. This data type is used as a response parameter for the ListPolicies operation. Contents Note In the following list, the required parameters are described first. createdDate The date and time the policy was created. Type: Timestamp Required: Yes definition The policy definition of an item in the list of policies returned. Type: PolicyDefinitionItem object Note: This object is a Union. Only one member of this object can be specified or returned. Required: Yes lastUpdatedDate The date and time the policy was most recently updated. Type: Timestamp Required: Yes policyId The identifier of the policy you want information about. Type: String PolicyItem 343 Amazon Verified Permissions API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-]* Required: Yes policyStoreId The identifier of the policy store where the policy you want information about is stored. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes policyType The type of the policy. This is one of the following values: • STATIC • TEMPLATE_LINKED Type: String Valid Values: STATIC | TEMPLATE_LINKED Required: Yes actions The action that a policy permits or forbids. For example, {"actions": [{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"}, {"entityID": "SharePhoto", "entityType": "PhotoFlash::Action"}]}. Type: Array of ActionIdentifier objects Required: No effect The effect of the decision that a policy returns to an authorization request. For example, "effect": "Permit". Contents 344 API Reference Guide Amazon Verified Permissions Type: String Valid Values: Permit | Forbid Required: No principal The principal associated with the policy. Type: EntityIdentifier object Required: No resource The resource associated with the policy. Type: EntityIdentifier object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 345 Amazon Verified Permissions PolicyStoreItem Contains information about a policy store. API Reference Guide This data type is used as a response parameter for the ListPolicyStores operation. Contents Note In the following list, the required parameters are described first. arn The Amazon Resource Name (ARN) of the policy store. Type: String Length Constraints: Minimum length of 1. Maximum length of 2500. Pattern: arn:[^:]*:[^:]*:[^:]*:[^:]*:.* Required: Yes createdDate The date and time the policy was created. Type: Timestamp Required: Yes policyStoreId The unique identifier of the policy store. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes PolicyStoreItem 346 Amazon Verified Permissions description API Reference Guide Descriptive text that you can provide to help with identification of the current policy store. Type: String Length Constraints: Minimum length of 0. Maximum length of 150. Required: No lastUpdatedDate The date and time the policy store was most recently updated. Type: Timestamp Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 347 Amazon Verified Permissions API Reference Guide PolicyTemplateItem Contains details about a policy template This data type is used as a response parameter for the ListPolicyTemplates operation. Contents Note In the following list, the required parameters are described first. createdDate The date and time that the policy template was created. Type: Timestamp Required: Yes lastUpdatedDate The date and time that the policy template was
amazon-verified-permissions-api-069
amazon-verified-permissions-api.pdf
69
For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 347 Amazon Verified Permissions API Reference Guide PolicyTemplateItem Contains details about a policy template This data type is used as a response parameter for the ListPolicyTemplates operation. Contents Note In the following list, the required parameters are described first. createdDate The date and time that the policy template was created. Type: Timestamp Required: Yes lastUpdatedDate The date and time that the policy template was most recently updated. Type: Timestamp Required: Yes policyStoreId The unique identifier of the policy store that contains the template. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes policyTemplateId The unique identifier of the policy template. PolicyTemplateItem 348 Amazon Verified Permissions Type: String API Reference Guide Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes description The description attached to the policy template. Type: String Length Constraints: Minimum length of 0. Maximum length of 150. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 349 API Reference Guide Amazon Verified Permissions ResourceConflict Contains information about a resource conflict. Contents Note In the following list, the required parameters are described first. resourceId The unique identifier of the resource involved in a conflict. Type: String Required: Yes resourceType The type of the resource involved in a conflict. Type: String Valid Values: IDENTITY_SOURCE | POLICY_STORE | POLICY | POLICY_TEMPLATE | SCHEMA Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 ResourceConflict 350 Amazon Verified Permissions SchemaDefinition API Reference Guide Contains a list of principal types, resource types, and actions that can be specified in policies stored in the same policy store. If the validation mode for the policy store is set to STRICT, then policies that can't be validated by this schema are rejected by Verified Permissions and can't be stored in the policy store. Contents Note In the following list, the required parameters are described first. Important This data type is a UNION, so only one of the following members can be specified when used or returned. cedarJson A JSON string representation of the schema supported by applications that use this policy store. To delete the schema, run PutSchema with {} for this parameter. For more information, see Policy store schema in the Amazon Verified Permissions User Guide. Type: String Length Constraints: Minimum length of 1. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ SchemaDefinition 351 Amazon Verified Permissions • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference Guide See Also 352 Amazon Verified Permissions API Reference Guide StaticPolicyDefinition Contains information about a static policy. This data type is used as a field that is part of the PolicyDefinitionDetail type. Contents Note In the following list, the required parameters are described first. statement The policy content of the static policy, written in the Cedar policy language. Type: String Length Constraints: Minimum length of 1. Maximum length of 10000. Required: Yes description The description of the static policy. Type: String Length Constraints: Minimum length of 0. Maximum length of 150. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 StaticPolicyDefinition 353 Amazon Verified Permissions API Reference Guide See Also 354 Amazon Verified Permissions API Reference Guide StaticPolicyDefinitionDetail A structure that contains details about a static policy. It includes the description and policy body. This data type is used within a PolicyDefinition structure as part of a request parameter for the CreatePolicy operation. Contents Note In the following list, the required parameters are described first. statement The content of the static policy written in the Cedar policy language. Type: String Length Constraints: Minimum length of 1. Maximum length of 10000. Required: Yes description A description of the static policy. Type: String Length Constraints: Minimum length of 0. Maximum length of 150. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 StaticPolicyDefinitionDetail 355 Amazon Verified Permissions • AWS
amazon-verified-permissions-api-070
amazon-verified-permissions-api.pdf
70
the CreatePolicy operation. Contents Note In the following list, the required parameters are described first. statement The content of the static policy written in the Cedar policy language. Type: String Length Constraints: Minimum length of 1. Maximum length of 10000. Required: Yes description A description of the static policy. Type: String Length Constraints: Minimum length of 0. Maximum length of 150. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 StaticPolicyDefinitionDetail 355 Amazon Verified Permissions • AWS SDK for Ruby V3 API Reference Guide See Also 356 Amazon Verified Permissions API Reference Guide StaticPolicyDefinitionItem A structure that contains details about a static policy. It includes the description and policy statement. This data type is used within a PolicyDefinition structure as part of a request parameter for the CreatePolicy operation. Contents Note In the following list, the required parameters are described first. description A description of the static policy. Type: String Length Constraints: Minimum length of 0. Maximum length of 150. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 StaticPolicyDefinitionItem 357 Amazon Verified Permissions API Reference Guide TemplateLinkedPolicyDefinition Contains information about a policy created by instantiating a policy template. Contents Note In the following list, the required parameters are described first. policyTemplateId The unique identifier of the policy template used to create this policy. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes principal 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. Type: EntityIdentifier object Required: No resource 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. Type: EntityIdentifier object Required: No TemplateLinkedPolicyDefinition 358 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 359 Amazon Verified Permissions API Reference Guide TemplateLinkedPolicyDefinitionDetail Contains information about a policy that was created by instantiating a policy template. Contents Note In the following list, the required parameters are described first. policyTemplateId The unique identifier of the policy template used to create this policy. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes principal 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. Type: EntityIdentifier object Required: No resource 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. Type: EntityIdentifier object Required: No TemplateLinkedPolicyDefinitionDetail 360 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 361 Amazon Verified Permissions API Reference Guide TemplateLinkedPolicyDefinitionItem Contains information about a policy created by instantiating a policy template. This Contents Note In the following list, the required parameters are described first. policyTemplateId The unique identifier of the policy template used to create this policy. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: [a-zA-Z0-9-/_]* Required: Yes principal 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. Type: EntityIdentifier object Required: No resource 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. Type: EntityIdentifier object TemplateLinkedPolicyDefinitionItem 362 Amazon Verified Permissions Required: No See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 363 Amazon Verified Permissions API Reference Guide UpdateCognitoGroupConfiguration The user group entities from an Amazon Cognito user pool identity source. Contents Note In the following list, the required parameters are described first. groupEntityType The name of the schema entity type that's mapped to the user pool group. Defaults to AWS::CognitoGroup. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: ([_a-zA-Z][_a-zA-Z0-9]*::)*[_a-zA-Z][_a-zA-Z0-9]* Required:
amazon-verified-permissions-api-071
amazon-verified-permissions-api.pdf
71
more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 363 Amazon Verified Permissions API Reference Guide UpdateCognitoGroupConfiguration The user group entities from an Amazon Cognito user pool identity source. Contents Note In the following list, the required parameters are described first. groupEntityType The name of the schema entity type that's mapped to the user pool group. Defaults to AWS::CognitoGroup. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: ([_a-zA-Z][_a-zA-Z0-9]*::)*[_a-zA-Z][_a-zA-Z0-9]* Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 UpdateCognitoGroupConfiguration 364 Amazon Verified Permissions API Reference Guide UpdateCognitoUserPoolConfiguration Contains configuration details of a Amazon Cognito user pool for use with an identity source. Contents Note In the following list, the required parameters are described first. userPoolArn The Amazon Resource Name (ARN) of the Amazon Cognito user pool associated with this identity source. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: arn:[a-zA-Z0-9-]+:cognito-idp:(([a-zA-Z0-9-]+:\d{12}:userpool/ [\w-]+_[0-9a-zA-Z]+)) Required: Yes clientIds The client ID of an app client that is configured for the specified Amazon Cognito user pool. Type: Array of strings Array Members: Minimum number of 0 items. Maximum number of 1000 items. Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: .* Required: No groupConfiguration The configuration of the user groups from an Amazon Cognito user pool identity source. UpdateCognitoUserPoolConfiguration 365 Amazon Verified Permissions API Reference Guide Type: UpdateCognitoGroupConfiguration object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 366 Amazon Verified Permissions API Reference Guide UpdateConfiguration Contains an update to replace the configuration in an existing identity source. Contents Note In the following list, the required parameters are described first. Important This data type is a UNION, so only one of the following members can be specified when used or returned. cognitoUserPoolConfiguration Contains configuration details of a Amazon Cognito user pool. Type: UpdateCognitoUserPoolConfiguration object Required: No openIdConnectConfiguration Contains configuration details of an OpenID Connect (OIDC) identity provider, or identity source, that Verified Permissions can use to generate entities from authenticated identities. It specifies the issuer URL, token type that you want to use, and policy store entity details. Type: UpdateOpenIdConnectConfiguration object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: UpdateConfiguration 367 Amazon Verified Permissions • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 API Reference Guide See Also 368 Amazon Verified Permissions API Reference Guide UpdateOpenIdConnectAccessTokenConfiguration The configuration of an OpenID Connect (OIDC) identity source for handling access token claims. Contains the claim that you want to identify as the principal in an authorization request, and the values of the aud claim, or audiences, that you want to accept. This data type is part of a UpdateOpenIdConnectTokenSelection structure, which is a parameter to UpdateIdentitySource. Contents Note In the following list, the required parameters are described first. audiences The access token aud claim values that you want to accept in your policy store. For example, https://myapp.example.com, https://myapp2.example.com. Type: Array of strings Array Members: Minimum number of 1 item. Maximum number of 255 items. Length Constraints: Minimum length of 1. Maximum length of 255. Required: No principalIdClaim The claim that determines the principal in OIDC access tokens. For example, sub. Type: String Length Constraints: Minimum length of 1. Required: No UpdateOpenIdConnectAccessTokenConfiguration 369 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 370 Amazon Verified Permissions API Reference Guide UpdateOpenIdConnectConfiguration Contains configuration details of an OpenID Connect (OIDC) identity provider, or identity source, that Verified Permissions can use to generate entities from authenticated identities. It specifies the issuer URL, token type that you want to use, and policy store entity details. This data type is part of a UpdateConfiguration structure, which is a parameter to UpdateIdentitySource. Contents Note In the following list, the required parameters are described first. issuer The issuer URL of an OIDC identity provider. This URL must have an OIDC discovery endpoint at the path .well-known/openid-configuration. Type: String Length Constraints: Minimum length of 1. Maximum length of 2048. Pattern: https://.* Required: Yes tokenSelection The token type that you want to process
amazon-verified-permissions-api-072
amazon-verified-permissions-api.pdf
72
Verified Permissions can use to generate entities from authenticated identities. It specifies the issuer URL, token type that you want to use, and policy store entity details. This data type is part of a UpdateConfiguration structure, which is a parameter to UpdateIdentitySource. Contents Note In the following list, the required parameters are described first. issuer The issuer URL of an OIDC identity provider. This URL must have an OIDC discovery endpoint at the path .well-known/openid-configuration. Type: String Length Constraints: Minimum length of 1. Maximum length of 2048. Pattern: https://.* Required: Yes tokenSelection The token type that you want to process from your OIDC identity provider. Your policy store can process either identity (ID) or access tokens from a given OIDC identity source. Type: UpdateOpenIdConnectTokenSelection object Note: This object is a Union. Only one member of this object can be specified or returned. Required: Yes UpdateOpenIdConnectConfiguration 371 Amazon Verified Permissions entityIdPrefix API Reference Guide A descriptive string that you want to prefix to user entities from your OIDC identity provider. For example, if you set an entityIdPrefix of MyOIDCProvider, you can reference principals in your policies in the format MyCorp::User::MyOIDCProvider|Carlos. Type: String Length Constraints: Minimum length of 1. Maximum length of 100. Required: No groupConfiguration The claim in OIDC identity provider tokens that indicates a user's group membership, and the entity type that you want to map it to. For example, this object can map the contents of a groups claim to MyCorp::UserGroup. Type: UpdateOpenIdConnectGroupConfiguration object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 372 Amazon Verified Permissions API Reference Guide UpdateOpenIdConnectGroupConfiguration The claim in OIDC identity provider tokens that indicates a user's group membership, and the entity type that you want to map it to. For example, this object can map the contents of a groups claim to MyCorp::UserGroup. This data type is part of a UpdateOpenIdConnectConfiguration structure, which is a parameter to UpdateIdentitySource. Contents Note In the following list, the required parameters are described first. groupClaim The token claim that you want Verified Permissions to interpret as group membership. For example, groups. Type: String Length Constraints: Minimum length of 1. Required: Yes groupEntityType The policy store entity type that you want to map your users' group claim to. For example, MyCorp::UserGroup. A group entity type is an entity that can have a user entity type as a member. Type: String Length Constraints: Minimum length of 1. Maximum length of 200. Pattern: ([_a-zA-Z][_a-zA-Z0-9]*::)*[_a-zA-Z][_a-zA-Z0-9]* Required: Yes UpdateOpenIdConnectGroupConfiguration 373 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 374 Amazon Verified Permissions API Reference Guide UpdateOpenIdConnectIdentityTokenConfiguration The configuration of an OpenID Connect (OIDC) identity source for handling identity (ID) token claims. Contains the claim that you want to identify as the principal in an authorization request, and the values of the aud claim, or audiences, that you want to accept. This data type is part of a UpdateOpenIdConnectTokenSelection structure, which is a parameter to UpdateIdentitySource. Contents Note In the following list, the required parameters are described first. clientIds The ID token audience, or client ID, claim values that you want to accept in your policy store from an OIDC identity provider. For example, 1example23456789, 2example10111213. Type: Array of strings Array Members: Minimum number of 0 items. Maximum number of 1000 items. Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: .* Required: No principalIdClaim The claim that determines the principal in OIDC access tokens. For example, sub. Type: String Length Constraints: Minimum length of 1. Required: No UpdateOpenIdConnectIdentityTokenConfiguration 375 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 376 Amazon Verified Permissions API Reference Guide UpdateOpenIdConnectTokenSelection The token type that you want to process from your OIDC identity provider. Your policy store can process either identity (ID) or access tokens from a given OIDC identity source. This data type is part of a UpdateOpenIdConnectConfiguration structure, which is a parameter to UpdateIdentitySource. Contents Note In the following list, the required parameters are described first. Important This data type is a UNION, so only one of the following members can be specified when used or returned. accessTokenOnly The OIDC configuration for processing access tokens. Contains allowed audience claims, for example https://auth.example.com, and the claim that you want to map to
amazon-verified-permissions-api-073
amazon-verified-permissions-api.pdf
73
type that you want to process from your OIDC identity provider. Your policy store can process either identity (ID) or access tokens from a given OIDC identity source. This data type is part of a UpdateOpenIdConnectConfiguration structure, which is a parameter to UpdateIdentitySource. Contents Note In the following list, the required parameters are described first. Important This data type is a UNION, so only one of the following members can be specified when used or returned. accessTokenOnly The OIDC configuration for processing access tokens. Contains allowed audience claims, for example https://auth.example.com, and the claim that you want to map to the principal, for example sub. Type: UpdateOpenIdConnectAccessTokenConfiguration object Required: No identityTokenOnly The OIDC configuration for processing identity (ID) tokens. Contains allowed client ID claims, for example 1example23456789, and the claim that you want to map to the principal, for example sub. Type: UpdateOpenIdConnectIdentityTokenConfiguration object Required: No UpdateOpenIdConnectTokenSelection 377 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 378 Amazon Verified Permissions API Reference Guide UpdatePolicyDefinition Contains information about updates to be applied to a policy. This data type is used as a request parameter in the UpdatePolicy operation. Contents Note In the following list, the required parameters are described first. Important This data type is a UNION, so only one of the following members can be specified when used or returned. static Contains details about the updates to be applied to a static policy. Type: UpdateStaticPolicyDefinition object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 UpdatePolicyDefinition 379 Amazon Verified Permissions API Reference Guide UpdateStaticPolicyDefinition Contains information about an update to a static policy. Contents Note In the following list, the required parameters are described first. statement Specifies the Cedar policy language text to be added to or replaced on the static policy. Important 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. Type: String Length Constraints: Minimum length of 1. Maximum length of 10000. Required: Yes description Specifies the description to be added to or replaced on the static policy. Type: String UpdateStaticPolicyDefinition 380 Amazon Verified Permissions API Reference Guide Length Constraints: Minimum length of 0. Maximum length of 150. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 381 Amazon Verified Permissions API Reference Guide ValidationExceptionField Details about a field that failed policy validation. Contents Note In the following list, the required parameters are described first. message Describes the policy validation error. Type: String Required: Yes path The path to the specific element that Verified Permissions found to be not valid. Type: String Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 ValidationExceptionField 382 Amazon Verified Permissions ValidationSettings API Reference Guide A structure that contains Cedar policy validation settings for the policy store. The validation mode determines which validation failures that Cedar considers serious enough to block acceptance of a new or edited static policy or policy template. This data type is used as a request parameter in the CreatePolicyStore and UpdatePolicyStore operations. Contents Note In the following list, the required parameters are described first. mode 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. Important 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. Type: String Valid Values:
amazon-verified-permissions-api-074
amazon-verified-permissions-api.pdf
74
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. Important 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. Type: String Valid Values: OFF | STRICT Required: Yes ValidationSettings 383 Amazon Verified Permissions See Also API Reference Guide For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 See Also 384 Amazon Verified Permissions API Reference Guide Making API requests Query requests for the Amazon Verified Permissions are HTTP or HTTPS requests that use an HTTP verb such as GET or POST. Verified Permissions endpoints An endpoint is a URL that serves as an entry point for a web service. You can select an appropriate AWS Region endpoint when you make your requests to reduce latency. For information about the endpoints used by Verified Permissions, see Amazon Verified Permissions in the Amazon Web Services General Reference. Query parameters Each query request must include some common parameters to handle authentication and selection of an action. For more information, see Common Parameters. Some API operations take lists of parameters. These lists are specified using the following notation: param.member.n Values of n are integers starting from 1. All lists of parameters must follow this notation, including lists that contain only one parameter. A query parameter list looks like the following example. &attribute.member.1=this &attribute.member.2=that Request identifiers In every response from an AWS Query API, there is a ResponseMetadata element, which contains a RequestId element. This string is a unique identifier that AWS assigns to provide tracking information. Although RequestId is included as part of every response, it isn't listed on the individual API documentation pages to improve readability and to reduce redundancy. Verified Permissions endpoints 385 Amazon Verified Permissions API Reference Guide Query API authentication You send query requests over HTTPS. You must include a signature in every query request. For more information about creating and including a signature, see Signing AWS API Requests in the Amazon Web Services General Reference. Available libraries AWS provides libraries, sample code, tutorials, and other resources for software developers who prefer to build applications using language-specific APIs instead of the command-line tools and Query API. These libraries provide basic functions (not included in the APIs), such as request authentication, request retries, and error handling so that it's easier to get started. Verified Permissions libraries and resources are available for the following languages and platforms: • AWS SDK for Go • AWS SDK for Java 2.x • AWS SDK for Java 1.x • AWS SDK for JavaScript • AWS SDK for .NET • AWS SDK for PHP • AWS SDK for Python (Boto) • AWS SDK for Ruby For more information about libraries and sample code in all languages, see Sample Code & Libraries. Making API requests using the POST method If you don't use one of the AWS SDKs, you can make Verified Permissions requests over HTTPS using the POST request method. The POST method requires that you specify the operation in the header of the request and provide the data for the operation in JSON format in the body of the request. Query API authentication 386 Amazon Verified Permissions API Reference Guide Header name Header value Host The Amazon Verified Permissions endpoint. For example: verifiedp ermissions.us-east-1.amazonaws.com X-Amz-Date Authorization You must provide the timestamp in either the HTTP Date header or the AWS x-amz-date header. Some HTTP client libraries don't let you set the Date header. When an x-amz-date header is present, the system ignores any Date header during the request authentication. The x-amz-date header must be specified in ISO 8601 basic format. For example: 20130315T092054Z The set of authorization parameters that AWS uses to ensure the validity and authenticity of the request. For more information about constructing this header, see Signature Version 4 Signing Process in the Amazon Web Services General Reference. X-Amz-Target Specifies the Verified Permissions operation that you want to perform. VerifiedPermissions. API_Name For example, to call the CreatePolicy operation, use the following target value. VerifiedPermissions.CreatePolicy Content-Type Specifies the input format. Use the following value. application/x-amz-json-1.0 Accept Specifies the response format. Use the following value. application/x-amz-json-1.0 Content-Length Size of the payload in bytes. Content-E ncoding Specifies the encoding format of the input and output. Use the following value. Making API requests using the POST
amazon-verified-permissions-api-075
amazon-verified-permissions-api.pdf
75
validity and authenticity of the request. For more information about constructing this header, see Signature Version 4 Signing Process in the Amazon Web Services General Reference. X-Amz-Target Specifies the Verified Permissions operation that you want to perform. VerifiedPermissions. API_Name For example, to call the CreatePolicy operation, use the following target value. VerifiedPermissions.CreatePolicy Content-Type Specifies the input format. Use the following value. application/x-amz-json-1.0 Accept Specifies the response format. Use the following value. application/x-amz-json-1.0 Content-Length Size of the payload in bytes. Content-E ncoding Specifies the encoding format of the input and output. Use the following value. Making API requests using the POST method 387 Amazon Verified Permissions API Reference Guide Header name Header value amz-1.0 The following is an example header for an HTTP request to return a list of all policies in the specified policy store in the AWS account where the Principal references a User named alice. In this example, the Authorization line is word-wrapped here for easier reading. Don't word wrap it in your actual request. POST HTTP/1.1 Host: verifiedpermissions.us-east-1.amazonaws.com X-Amz-Date: 20230613T200059Z Accept-Encoding: identity X-Amz-Target: VerifiedPermissions.ListPolicies User-Agent: <UserAgentString> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature> Content-Length: <PayloadSizeBytes> { "Filter": { "Principal": { "Id": { "EntityType": "User", "EntityId": "alice" } } } } Making API requests using the POST method 388 Amazon Verified Permissions API Reference Guide Common Parameters The following list contains the parameters that all actions use for signing Signature Version 4 requests with a query string. Any action-specific parameters are listed in the topic for that action. For more information about Signature Version 4, see Signing AWS API requests in the IAM User Guide. Action The action to be performed. Type: string Required: Yes Version The API version that the request is written for, expressed in the format YYYY-MM-DD. Type: string Required: Yes X-Amz-Algorithm The hash algorithm that you used to create the request signature. Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header. Type: string Valid Values: AWS4-HMAC-SHA256 Required: Conditional X-Amz-Credential The credential scope value, which is a string that includes your access key, the date, the region you are targeting, the service you are requesting, and a termination string ("aws4_request"). The value is expressed in the following format: access_key/YYYYMMDD/region/service/ aws4_request. 389 Amazon Verified Permissions API Reference Guide For more information, see Create a signed AWS API request in the IAM User Guide. Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header. Type: string Required: Conditional X-Amz-Date The date that is used to create the signature. The format must be ISO 8601 basic format (YYYYMMDD'T'HHMMSS'Z'). For example, the following date time is a valid X-Amz-Date value: 20120325T120000Z. Condition: X-Amz-Date is optional for all requests; it can be used to override the date used for signing requests. If the Date header is specified in the ISO 8601 basic format, X-Amz-Date is not required. When X-Amz-Date is used, it always overrides the value of the Date header. For more information, see Elements of an AWS API request signature in the IAM User Guide. Type: string Required: Conditional X-Amz-Security-Token The temporary security token that was obtained through a call to AWS Security Token Service (AWS STS). For a list of services that support temporary security credentials from AWS STS, see AWS services that work with IAM in the IAM User Guide. Condition: If you're using temporary security credentials from AWS STS, you must include the security token. Type: string Required: Conditional X-Amz-Signature Specifies the hex-encoded signature that was calculated from the string to sign and the derived signing key. Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header. 390 Amazon Verified Permissions Type: string Required: Conditional X-Amz-SignedHeaders API Reference Guide Specifies all the HTTP headers that were included as part of the canonical request. For more information about specifying signed headers, see Create a signed AWS API request in the IAM User Guide. Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header. Type: string Required: Conditional 391 Amazon Verified Permissions API Reference Guide Common Errors This section lists the errors common to the API actions of all AWS services. For errors specific to an API action for this service, see the topic for that API action. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 400 IncompleteSignature The request signature does not conform to AWS standards. HTTP Status Code: 400 InternalFailure The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 InvalidAction The action or operation requested is invalid. Verify that the action is typed correctly. HTTP Status Code: 400 InvalidClientTokenId The X.509 certificate or
amazon-verified-permissions-api-076
amazon-verified-permissions-api.pdf
76
lists the errors common to the API actions of all AWS services. For errors specific to an API action for this service, see the topic for that API action. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 400 IncompleteSignature The request signature does not conform to AWS standards. HTTP Status Code: 400 InternalFailure The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 InvalidAction The action or operation requested is invalid. Verify that the action is typed correctly. HTTP Status Code: 400 InvalidClientTokenId The X.509 certificate or AWS access key ID provided does not exist in our records. HTTP Status Code: 403 NotAuthorized You do not have permission to perform this action. HTTP Status Code: 400 OptInRequired The AWS access key ID needs a subscription for the service. HTTP Status Code: 403 392 Amazon Verified Permissions RequestExpired API Reference Guide The request reached the service more than 15 minutes after the date stamp on the request or more than 15 minutes after the request expiration date (such as for pre-signed URLs), or the date stamp on the request is more than 15 minutes in the future. HTTP Status Code: 400 ServiceUnavailable The request has failed due to a temporary failure of the server. HTTP Status Code: 503 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 400 ValidationError The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 393 Amazon Verified Permissions API Reference Guide Document history for the Amazon Verified Permissions API Reference Guide The following table describes the documentation releases for Verified Permissions. Change Description Date Initial public release Initial public release of the Amazon Verified Permissions API Reference Guide June 13, 2023 394 Amazon Verified Permissions API Reference Guide AWS Glossary For the latest AWS terminology, see the AWS glossary in the AWS Glossary Reference. 395
amazon-verified-permissions-user-guide-001
amazon-verified-permissions-user-guide.pdf
1
User Guide Amazon Verified Permissions Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon Verified Permissions User Guide Amazon Verified Permissions: User Guide Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon. Amazon Verified Permissions Table of Contents User Guide What is Amazon Verified Permissions? .......................................................................................... 1 Authorization in Verified Permissions ...................................................................................................... 1 Cedar policy language ................................................................................................................................. 2 Benefits of Verified Permissions ................................................................................................................ 2 Accelerate application development ................................................................................................... 2 More secure applications ....................................................................................................................... 2 End-user features .................................................................................................................................... 2 Related services ............................................................................................................................................ 2 Accessing Verified Permissions .................................................................................................................. 3 Pricing for Verified Permissions ................................................................................................................ 5 Getting started with policy stores ................................................................................................. 6 Prerequisites .................................................................................................................................................. 7 Step 1: Create a PhotoFlash policy store ................................................................................................ 9 Step 2: Create a policy ................................................................................................................................ 9 Step 3: Testing a policy store .................................................................................................................. 10 Step 4: Clean up resources ...................................................................................................................... 12 Designing an authorization model ............................................................................................... 13 No single correct model ........................................................................................................................... 14 Returning errors .......................................................................................................................................... 14 Focus on resources ..................................................................................................................................... 15 Consider multi-tenancy ............................................................................................................................. 16 Comparing shared policy stores and per-tenant policy stores .................................................... 18 How to choose ...................................................................................................................................... 19 Policy stores ................................................................................................................................... 20 Creating policy stores ................................................................................................................................ 20 Creating a policy store using Rust .................................................................................................... 28 API-linked policy stores ............................................................................................................................ 33 How it works .......................................................................................................................................... 35 Considerations ....................................................................................................................................... 37 Adding ABAC .......................................................................................................................................... 38 Moving to production .......................................................................................................................... 39 Troubleshooting .................................................................................................................................... 42 Deleting policy stores ................................................................................................................................ 44 Policy store schema ....................................................................................................................... 47 iii Amazon Verified Permissions User Guide Editing schema ........................................................................................................................................... 49 Policy validation mode ................................................................................................................. 52 Policies ........................................................................................................................................... 54 Creating static policies .............................................................................................................................. 55 Editing static policies ................................................................................................................................ 57 ....................................................................................................................................................................... 59 Evaluate example context ................................................................................................................... 61 Testing policies ........................................................................................................................................... 67 Example policies ......................................................................................................................................... 69 Uses bracket notation to reference token attributes .................................................................... 70 Uses dot notation to reference attributes ....................................................................................... 70 Reflects Amazon Cognito ID token attributes ................................................................................ 71 Reflects OIDC ID token attributes ..................................................................................................... 71 Reflects Amazon Cognito access token attributes ......................................................................... 72 Reflects OIDC access token attributes .............................................................................................. 72 Policy templates and template-linked policies ........................................................................... 73 Creating policy templates ........................................................................................................................ 73 Creating template-linked policies ........................................................................................................... 75 Editing policy templates ........................................................................................................................... 77 Example template-linked policies ........................................................................................................... 79 PhotoFlash examples ........................................................................................................................... 79 DigitalPetStore examples .................................................................................................................... 80 TinyToDo examples .............................................................................................................................. 81 Identity sources ............................................................................................................................. 82 Working with Amazon Cognito identity sources ................................................................................. 83 Working with OIDC identity sources ...................................................................................................... 85 Client and audience validation ................................................................................................................ 86 Client-side authorization for JWTs ......................................................................................................... 87 Creating identity sources .......................................................................................................................... 90 Amazon Cognito identity source ....................................................................................................... 90 OIDC identity source ............................................................................................................................ 93 Editing identity sources ............................................................................................................................ 96 Amazon Cognito user pools identity source ................................................................................... 96 OpenID Connect (OIDC) identity source .......................................................................................... 98 Mapping tokens to schema ...................................................................................................................... 99 Mapping ID tokens ............................................................................................................................. 101 iv Amazon Verified Permissions User Guide Mapping access tokens ...................................................................................................................... 104 Alternative notation for Amazon Cognito colon-delimited claims ........................................... 109 Things to know about schema mapping ....................................................................................... 110 Authorize requests ....................................................................................................................... 114 API operations .......................................................................................................................................... 115 Test model ................................................................................................................................................. 116 Integrating with applications ................................................................................................................ 118 Security ........................................................................................................................................ 121 Data protection ........................................................................................................................................ 121 Data encryption .................................................................................................................................. 123 Identity and access management ......................................................................................................... 123 Audience ............................................................................................................................................... 124 Authenticating with identities ......................................................................................................... 124 Managing access using policies ....................................................................................................... 127 How Amazon Verified Permissions works with IAM .................................................................... 130 IAM policies for Verified Permissions ............................................................................................. 136 Identity-based policy examples ....................................................................................................... 138 AWS managed policies ...................................................................................................................... 141 Troubleshooting .................................................................................................................................. 144 Compliance validation ............................................................................................................................ 146 Resilience ................................................................................................................................................... 147 Monitoring ................................................................................................................................... 149 CloudTrail logs .......................................................................................................................................... 149 Verified Permissions information in CloudTrail ............................................................................ 149 Understanding Verified Permissions log file entries ................................................................... 150 Working with AWS CloudFormation .......................................................................................... 168 Verified Permissions and AWS CloudFormation templates ............................................................. 168 AWS CDK constructs ................................................................................................................................ 169 Learn more about AWS CloudFormation ............................................................................................ 169 Using AWS PrivateLink ................................................................................................................ 170 Considerations .......................................................................................................................................... 170 Create an interface endpoint ................................................................................................................ 170 Create an endpoint policy ..................................................................................................................... 171 Quotas .......................................................................................................................................... 173 Quotas for resources ............................................................................................................................... 173 Template-linked policy size example ............................................................................................. 174 v Amazon Verified Permissions User Guide Quotas for hierarchies ............................................................................................................................ 176 Quotas for operations per second ....................................................................................................... 177 Terms & concepts ........................................................................................................................ 181 Authorization model ............................................................................................................................... 182 Authorization request ............................................................................................................................. 182 Authorization response ........................................................................................................................... 182 Considered policies .................................................................................................................................. 182 Context data ............................................................................................................................................. 182 Determining policies ............................................................................................................................... 183 Entity data ................................................................................................................................................. 183 Permissions, authorization, and principals ......................................................................................... 183 Policy enforcement .................................................................................................................................. 183 Policy store ................................................................................................................................................ 183 Satisfied policies ...................................................................................................................................... 184 Differences with Cedar ............................................................................................................................ 184 Namespace definition ........................................................................................................................ 184 Policy template support ................................................................................................................... 184 Schema support .................................................................................................................................. 185 Action groups definition ................................................................................................................... 185 Entity formatting ................................................................................................................................ 185
amazon-verified-permissions-user-guide-002
amazon-verified-permissions-user-guide.pdf
2
size example ............................................................................................. 174 v Amazon Verified Permissions User Guide Quotas for hierarchies ............................................................................................................................ 176 Quotas for operations per second ....................................................................................................... 177 Terms & concepts ........................................................................................................................ 181 Authorization model ............................................................................................................................... 182 Authorization request ............................................................................................................................. 182 Authorization response ........................................................................................................................... 182 Considered policies .................................................................................................................................. 182 Context data ............................................................................................................................................. 182 Determining policies ............................................................................................................................... 183 Entity data ................................................................................................................................................. 183 Permissions, authorization, and principals ......................................................................................... 183 Policy enforcement .................................................................................................................................. 183 Policy store ................................................................................................................................................ 183 Satisfied policies ...................................................................................................................................... 184 Differences with Cedar ............................................................................................................................ 184 Namespace definition ........................................................................................................................ 184 Policy template support ................................................................................................................... 184 Schema support .................................................................................................................................. 185 Action groups definition ................................................................................................................... 185 Entity formatting ................................................................................................................................ 185 Length and size limits ....................................................................................................................... 190 Cedar v4 FAQ ............................................................................................................................... 192 What is the current state on the upgrade? ........................................................................................ 192 Do I need to do anything right now? .................................................................................................. 192 Does the upgrade of the console impact the authorization service? ............................................ 192 What are the breaking changes in Cedar v3 and Cedar v4? ........................................................... 193 When will the upgrade to Cedar v4 be complete? ........................................................................... 193 Document history ........................................................................................................................ 194 vi Amazon Verified Permissions User Guide What is Amazon Verified Permissions? Amazon Verified Permissions is a scalable, fine-grained permissions management and authorization service for custom applications built by you. Verified Permissions enables your developers to build secure applications faster by externalizing authorization and centralizing policy management and administration. Verified Permissions uses the Cedar policy language to define fine-grained permissions to protect your application's resources. For guidance and examples for setting up a policy decision point (PDP) using Verified Permissions, see Implementing a PDP by using Amazon Verified Permissions in AWS Prescriptive Guidance. Topics • Authorization in Verified Permissions • Cedar policy language • Benefits of Verified Permissions • Related services • Accessing Verified Permissions • Pricing for Verified Permissions Authorization in Verified Permissions Verified Permissions provides authorization by verifying whether a principal is allowed to perform an action on a resource in a given context in your application. Verified Permissions presumes that the principal has been previously identified and authenticated through other means, such as by using protocols like OpenID Connect, a hosted provider like Amazon Cognito, or another authentication solution. Verified Permissions is agnostic to where the principal is managed and how they were authenticated. Verified Permissions is a service that enables customers to create, maintain, and test policies in the AWS Management Console, programmatically using the Verified Permissions APIs, or through infrastructure as code solutions like AWS CloudFormation. Permissions are expressed using the Cedar policy language. The client application calls authorization APIs to evaluate the Cedar policies stored with the service and provide an access decision for whether an action is permitted. Authorization in Verified Permissions 1 Amazon Verified Permissions User Guide Cedar policy language Authorization policies in Verified Permissions are written by using the Cedar policy language. Cedar is an open source language for writing authorization policies and making authorization decisions based on those policies. When you create an application, you need to ensure that only authorized principals, human users or machines, can access the application, and can do only what they're authorized to do. Using Cedar, you can decouple your business logic from the authorization logic. In your application’s code, you preface requests made to your operations with a call to the Cedar authorization engine, asking “Is this request authorized?”. Then, the application can either perform the requested operation if the decision is “allow”, or return an error message if the decision is “deny”. Verified Permissions currently uses Cedar version 2.4. For more information about Cedar, see the following: • Cedar policy language Reference Guide • Cedar GitHub repository Benefits of Verified Permissions Accelerate application development Accelerate application development by decoupling authorization from business logic. More secure applications Verified Permissions enables developers to build more secure applications. End-user features Verified Permissions allows you to deliver richer end-user features for permissions management. Related services • Amazon Cognito – Amazon Cognito is an identity platform for web and mobile apps. It’s a user directory, an authentication server, and an authorization service for OAuth 2.0 access tokens and Cedar policy language 2 Amazon Verified Permissions User Guide AWS credentials. When you create a policy store, you have the option to build your principals and groups from an Amazon Cognito user pool. For more information, see the Amazon Cognito Developer Guide. • Amazon API Gateway – Amazon API Gateway is an AWS service for creating, publishing, maintaining, monitoring, and securing REST, HTTP, and WebSocket APIs at any scale. When you create a policy store, you have the option to build your actions and resources from an API in API Gateway. For more information about API Gateway, see the API Gateway Developer Guide. • AWS IAM Identity Center – With IAM Identity Center, you can manage sign-in security for your workforce identities, also known as workforce users. IAM Identity Center
amazon-verified-permissions-user-guide-003
amazon-verified-permissions-user-guide.pdf
3
Cognito user pool. For more information, see the Amazon Cognito Developer Guide. • Amazon API Gateway – Amazon API Gateway is an AWS service for creating, publishing, maintaining, monitoring, and securing REST, HTTP, and WebSocket APIs at any scale. When you create a policy store, you have the option to build your actions and resources from an API in API Gateway. For more information about API Gateway, see the API Gateway Developer Guide. • AWS IAM Identity Center – With IAM Identity Center, you can manage sign-in security for your workforce identities, also known as workforce users. IAM Identity Center provides one place where you can create or connect workforce users and centrally manage their access across all their AWS accounts and applications. For more information, see the AWS IAM Identity Center User Guide. Accessing Verified Permissions You can work with Amazon Verified Permissions in any of the following ways. AWS Management Console The console is a browser-based interface to manage Verified Permissions and AWS resources. For more information about accessing Verified Permissions through the console, see How to sign in to AWS in the AWS Sign-In User Guide. • Amazon Verified Permissions console AWS Command Line Tools You can use the AWS command line tools to issue commands at your system's command line to perform Verified Permissions and AWS tasks. Using the command line can be faster and more convenient than the console. The command line tools are also useful if you want to build scripts that perform AWS tasks. AWS provides two sets of command line tools: the AWS Command Line Interface (AWS CLI) and the AWS Tools for Windows PowerShell. For information about installing and using the AWS CLI, see the AWS Command Line Interface User Guide. For information about installing and using the Tools for Windows PowerShell, see the AWS Tools for Windows PowerShell User Guide. • verifiedpermissions in the AWS CLI Command Reference Accessing Verified Permissions 3 Amazon Verified Permissions User Guide • Amazon Verified Permissions in AWS Tools for Windows PowerShell AWS SDKs AWS provides SDKs (software development kits) that consist of libraries and sample code for various programming languages and platforms (Java, Python, Ruby, .NET, iOS, Android, etc.). The SDKs provide a convenient way to create programmatic access to Verified Permissions and AWS. For example, the SDKs take care of tasks such as cryptographically signing requests, managing errors, and retrying requests automatically. To learn more and download AWS SDKs, see Tools for Amazon Web Services. The following are links to documentation for Verified Permissions resources in various AWS SDKs. • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go • AWS SDK for Java • AWS SDK for JavaScript • AWS SDK for PHP • AWS SDK for Python (Boto) • AWS SDK for Ruby • AWS SDK for Rust AWS CDK constructs The AWS Cloud Development Kit (AWS CDK) is an open-source software development framework for defining cloud infrastructure in code and provisioning it through AWS CloudFormation. Constructs, or reusable cloud components, can be used to create AWS CloudFormation templates. These templates can then be used to deploy your cloud infrastructure. To learn more and download AWS CDK, see AWS Cloud Development Kit. The following are links to documentation for Verified Permissions AWS CDK resources, such as constructs. • Amazon Verified Permissions L2 CDK Construct Accessing Verified Permissions 4 Amazon Verified Permissions Verified Permissions API User Guide You can access Verified Permissions and AWS programmatically by using the Verified Permissions API, which lets you issue HTTPS requests directly to the service. When you use the API, you must include code to digitally sign requests using your credentials. • Amazon Verified Permissions API Reference Guide Pricing for Verified Permissions Verified Permissions provides tiered pricing based on the amount of authorization requests per month made by your applications to Verified Permissions. There is also pricing for policy management actions based on the amount of cURL (client URL) policy API requests per month made by your applications to Verified Permissions. For a complete list of charges and prices for Verified Permissions see Amazon Verified Permissions pricing. To see your bill, go to the Billing and Cost Management Dashboard in the AWS Billing and Cost Management console. Your bill contains links to usage reports that provide details about your bill. To learn more about AWS account billing, see the AWS Billing User Guide. If you have questions concerning AWS billing, accounts, and events, contact Support. Pricing for Verified Permissions 5 Amazon Verified Permissions User Guide Create your first Amazon Verified Permissions policy store For this tutorial, let's assume you're the developer of a photo sharing application and you are looking for a way to control what actions the users of the application can perform. You want to control who can add,
amazon-verified-permissions-user-guide-004
amazon-verified-permissions-user-guide.pdf
4
AWS Billing and Cost Management console. Your bill contains links to usage reports that provide details about your bill. To learn more about AWS account billing, see the AWS Billing User Guide. If you have questions concerning AWS billing, accounts, and events, contact Support. Pricing for Verified Permissions 5 Amazon Verified Permissions User Guide Create your first Amazon Verified Permissions policy store For this tutorial, let's assume you're the developer of a photo sharing application and you are looking for a way to control what actions the users of the application can perform. You want to control who can add, delete, or view photos and photo albums. You also want to control what actions a user can take on their account. Can they manage their account, how about the account of a friend? To control these actions you would create policies that permit or forbid these actions based on the identity of the user. Verified Permissions offers policy stores, or containers, to house these policies. In this tutorial we'll walk through creating a sample policy store using the Amazon Verified Permissions console. The console offers a few sample policy store options and we’re going to create a PhotoFlash policy store. This policy store allows principals, such as users, to perform actions, such as sharing, on resources, such as photos or albums. The following diagram illustrates the relationships between a principal, User::alice, and the actions she can take on various resources, namely her PhotoFlash account, the VactionPhoto94.jpg file, the photo album alice-favorites-album, and the user group alice-friend-group. 6 Amazon Verified Permissions User Guide Now that you have an understanding of the PhotoFlash policy store, let’s create the policy store and explore it. Prerequisites Sign up for an AWS account If you do not have an AWS account, complete the following steps to create one. To sign up for an AWS account 1. Open https://portal.aws.amazon.com/billing/signup. 2. Follow the online instructions. Part of the sign-up procedure involves receiving a phone call and entering a verification code on the phone keypad. When you sign up for an AWS account, an AWS account root user is created. The root user has access to all AWS services and resources in the account. As a security best practice, assign Prerequisites 7 Amazon Verified Permissions User Guide administrative access to a user, and use only the root user to perform tasks that require root user access. AWS sends you a confirmation email after the sign-up process is complete. At any time, you can view your current account activity and manage your account by going to https://aws.amazon.com/ and choosing My Account. Create a user with administrative access After you sign up for an AWS account, secure your AWS account root user, enable AWS IAM Identity Center, and create an administrative user so that you don't use the root user for everyday tasks. Secure your AWS account root user 1. Sign in to the AWS Management Console as the account owner by choosing Root user and entering your AWS account email address. On the next page, enter your password. For help signing in by using root user, see Signing in as the root user in the AWS Sign-In User Guide. 2. Turn on multi-factor authentication (MFA) for your root user. For instructions, see Enable a virtual MFA device for your AWS account root user (console) in the IAM User Guide. Create a user with administrative access 1. Enable IAM Identity Center. For instructions, see Enabling AWS IAM Identity Center in the AWS IAM Identity Center User Guide. 2. In IAM Identity Center, grant administrative access to a user. For a tutorial about using the IAM Identity Center directory as your identity source, see Configure user access with the default IAM Identity Center directory in the AWS IAM Identity Center User Guide. Prerequisites 8 Amazon Verified Permissions User Guide Sign in as the user with administrative access • To sign in with your IAM Identity Center user, use the sign-in URL that was sent to your email address when you created the IAM Identity Center user. For help signing in using an IAM Identity Center user, see Signing in to the AWS access portal in the AWS Sign-In User Guide. Assign access to additional users 1. In IAM Identity Center, create a permission set that follows the best practice of applying least- privilege permissions. For instructions, see Create a permission set in the AWS IAM Identity Center User Guide. 2. Assign users to a group, and then assign single sign-on access to the group. For instructions, see Add groups in the AWS IAM Identity Center User Guide. Step 1: Create a PhotoFlash policy store In the following procedure you'll create a PhotoFlash policy store using the AWS console. To create a PhotoFlash policy store 1. 2. 3. In the Verified Permissions
amazon-verified-permissions-user-guide-005
amazon-verified-permissions-user-guide.pdf
5
access to additional users 1. In IAM Identity Center, create a permission set that follows the best practice of applying least- privilege permissions. For instructions, see Create a permission set in the AWS IAM Identity Center User Guide. 2. Assign users to a group, and then assign single sign-on access to the group. For instructions, see Add groups in the AWS IAM Identity Center User Guide. Step 1: Create a PhotoFlash policy store In the following procedure you'll create a PhotoFlash policy store using the AWS console. To create a PhotoFlash policy store 1. 2. 3. In the Verified Permissions console, choose Create new policy store. For Starting options, choose Start from a sample policy store. For Sample project, choose PhotoFlash. 4. Choose Create policy store. Once you see the message "Created and configured policy store," choose Go to overview to explore your policy store. Step 2: Create a policy When you created the policy store, a default policy was created that allows users to have full control over their own accounts. This is a useful policy, but for our purposes, let’s create a more restrictive policy to explore the nuances of Verified Permissions. If you remember the diagram we Step 1: Create a PhotoFlash policy store 9 Amazon Verified Permissions User Guide looked at earlier in the tutorial, we had a principal, User::alice, who could perform an action, UpdateAlbum, on a resource, alice-favorites-album. Let's add the policy that will allow Alice, and only Alice, to manage this album. To create a policy 1. 2. In the Verified Permissions console, choose the policy store you created in step 1. In the navigation, choose Policies. 3. Choose Create policy and then choose Create static policy. 4. 5. 6. 7. For Policy effect, choose Permit. For Principals scope, choose Specific principal, then for Specify entity type, choose PhotoFlash::User, and for Specify entity identifier, enter alice. For Resources scope, choose Specific resource, then for Specify entity type, choose PhotoFlash::Album, and for Specify entity identifier, enter alice-favorites-album. For Actions scope, choose Specific set of actions, then for Action(s) this policy should apply to, select UpdateAlbum. 8. Choose Next. 9. Under Details, for Policy description - optional enter Policy allowing alice to update alice-favorites-album.. 10. Choose Create policy Now that you've created a policy you can test it in the Verified Permissions console. Step 3: Testing a policy store After creating your policy store and policy, you can test them by running a simulated authorization request using the Verified Permissions test bench. To test policy store policies 1. Open the Verified Permissions console. Choose your policy store. 2. In the navigation pane on the left, choose Test bench. 3. Choose Visual mode. 4. For Principal, do the following: Step 3: Testing a policy store 10 Amazon Verified Permissions User Guide a. For Principal taking action choose PhotoFlash::User and for Specify entity identifier, enter alice. b. Under Attributes, for Account: Entity, make sure that the PhotoFlash::Account entity is selected, and for Specify entity identifier, enter alice-account. 5. Under Resource, for Resource that principal is acting on, choose the PhotoFlash::Album resource type and for Specify entity identifier, enter alice-favorites-album. 6. For Action, choose PhotoFlash::Action::"UpdateAlbum" from the list of valid actions. 7. At the top of the page, choose Run authorization request to simulate the authorization request for the Cedar policies in the sample policy store. The test bench should display Decision: Allow indicating our policy is working as expected. The following table provides additional values for the principal, resource, and action you can test with the Verified Permissions test bench. The table includes the authorization request decision based on the static policies included with the PhotoFlash sample policy store and the policy you created in step 2. Principal value Principal Account: Entity value Resource value Resource parent value Action Authoriza tion decision PhotoFlas h::User | bob PhotoFlas h::Account | alice-account PhotoFlas h::Album | alice-fav N/A orites-album PhotoFlas h::User | alice PhotoFlas h::Account | alice-account PhotoFlas h::Photo | photo.jpeg PhotoFlas h::Account | bob-account PhotoFlas h::User | alice PhotoFlas h::Account | alice-account PhotoFlas h::Photo | photo.jpeg PhotoFlas h::Account | alice-account Deny Deny Allow PhotoFlas h::Action ::"Update Album" PhotoFlas h::Action ::"ViewPh oto" PhotoFlas h::Action ::"ViewPh oto" Step 3: Testing a policy store 11 Amazon Verified Permissions User Guide Principal value Principal Account: Entity value Resource value Resource parent value Action Authoriza tion decision PhotoFlas h::User | alice PhotoFlas h::Account | alice-account PhotoFlas h::Photo | bob-photo PhotoFlas h::Album | Bob-Vacat PhotoFlas h::Action ::"Delete Deny .jpeg ion-Album Photo" Step 4: Clean up resources After you have finished exploring your policy store, delete it. To delete a policy store 1. 2. In the Verified Permissions console, choose the policy store you created in step 1. In the navigation, choose Settings. 3. Under Delete policy store, choose Delete this policy store. 4. In the
amazon-verified-permissions-user-guide-006
amazon-verified-permissions-user-guide.pdf
6
policy store 11 Amazon Verified Permissions User Guide Principal value Principal Account: Entity value Resource value Resource parent value Action Authoriza tion decision PhotoFlas h::User | alice PhotoFlas h::Account | alice-account PhotoFlas h::Photo | bob-photo PhotoFlas h::Album | Bob-Vacat PhotoFlas h::Action ::"Delete Deny .jpeg ion-Album Photo" Step 4: Clean up resources After you have finished exploring your policy store, delete it. To delete a policy store 1. 2. In the Verified Permissions console, choose the policy store you created in step 1. In the navigation, choose Settings. 3. Under Delete policy store, choose Delete this policy store. 4. In the Delete this policy store? dialog box, enter delete, and then choose Delete. Step 4: Clean up resources 12 Amazon Verified Permissions User Guide Best practices for designing an authorization model As you prepare to use the Amazon Verified Permissions service within a software application, it can be challenging to leap immediately into writing policy statements as a first step. This would be similar to beginning development of other portions of an application by writing SQL statements or API specifications before fully deciding what the application should do. Instead, you should begin with a user experience. Then, work backwards from that experience to arrive at an implementation approach. As you do this work, you’ll find yourself asking questions such as: • What are my resources? How are they organized? For example, do files reside within a folder? • Does the organization of the resources play a part in the permissions model? • What actions can principals perform on each resource? • How do principals acquire those permissions? • Do you want your end-users to choose from predefined permissions such as “Admin”, “Operator”, or “ReadOnly”, or should they create ad-hoc policy statements? Or both? • Are roles global or scoped? For example, is an "operator" limited within a single tenant, or does "operator" means operator across the whole application? • What types of queries are necessary to render the user experience? For example, do you need to list all of the resources that a principal can access to render that user's home page? • Can users accidentally lock themselves out of their own resources? Does that need to be avoided? The end result of this exercise is referred to as an authorization model; it defines the principals, resources, actions, and how they interrelate to each other. Producing this model doesn’t require unique knowledge of Cedar or the Verified Permissions service. Instead, it is first and foremost a user experience design exercise, much like any other, and can manifest in artifacts such as interface mockups, logical diagrams, and an overall description of how permissions influence what users can do in the product. Cedar is designed to be flexible enough to meet customers at a model, rather than forcing the model to bend unnaturally to comply with a Cedar's implementation. As a result, gaining a crisp understanding of the desired user experience is the best way to arrive at an optimal model. To help answer the questions and come to an optimal model, do the following: 13 Amazon Verified Permissions User Guide • Review Cedar design patterns in the Cedar policy language Reference Guide. • Consider the best practices in the Cedar policy language Reference Guide. • Consider the best practices included on this page. Best practices • There isn't a canonical “correct” model • Return 403 forbidden errors rather than 404 not found errors • Focus on your resources beyond API operations • Multi-tenancy considerations There isn't a canonical “correct” model When you design an authorization model, there is no single, uniquely correct answer. Different applications can effectively use different authorization models for similar concepts, and this is OK. For example, consider the representation of a computer's file system. When you create a file in a Unix-like operating system, it doesn't automatically inherit permissions from the parent folder. In contrast, in many other operating systems and most online file-sharing services, files do inherit permissions from its parent folder. Both choices are valid depending upon the circumstances the application is optimizing for. The correctness of an authorization solution isn’t absolute, but should be viewed in terms of how it delivers the experience that your customers want, and whether it protects their resources in the way they expect. If your authorization model delivers on this, then it is successful. This is why beginning your design with the desired user experience is the most helpful prerequisite to the creation of an effective authorization model. Return 403 forbidden errors rather than 404 not found errors It's best to return a 403 Forbidden error to requests that include an entity, especially a resource, that doesn't correspond to any policy rather than a 404 Not found error. This provides the highest level of security because you're not exposing whether
amazon-verified-permissions-user-guide-007
amazon-verified-permissions-user-guide.pdf
7
customers want, and whether it protects their resources in the way they expect. If your authorization model delivers on this, then it is successful. This is why beginning your design with the desired user experience is the most helpful prerequisite to the creation of an effective authorization model. Return 403 forbidden errors rather than 404 not found errors It's best to return a 403 Forbidden error to requests that include an entity, especially a resource, that doesn't correspond to any policy rather than a 404 Not found error. This provides the highest level of security because you're not exposing whether an entity exists or not, just that the request didn't meet the policy conditions in any policy in the policy store. No single correct model 14 Amazon Verified Permissions User Guide Focus on your resources beyond API operations In most applications, permissions are modeled around the resources supported. For example, a file- sharing application might represent permissions as actions that can be performed on a file or a folder. This is a good, simple model that abstracts away the underlying implementation and the backend API operations. In contrast, other types of applications, particularly web services, frequently design permissions around the API operations themselves. For example, if a web service provides an API named createThing(), the authorization model might define a corresponding permission, or an action in Cedar named createThing. This works in many situations and makes it easy to understand the permissions. To invoke the createThing operation, you need the createThing action permission. Seems simple, right? You'll find that the getting started process in the Verified Permissions console includes the option to build your resources and actions directly from an API. This is a useful baseline: a direct mapping between your policy store and the API that it authorizes for. However, as you further develop your model, this API-focused approach may not be a good fit for applications with very granular authorization models because APIs are merely a proxy for what your customers are truly trying to protect: the underlying data and resources. If multiple APIs control access to the same resources, it can be difficult for administrators to reason about the paths to those resources and manage access accordingly. For example, consider a user directory that contains the members of an organization. Users can be organized into groups, and one of the security goals is to prohibit discovery of group memberships by unauthorized parties. The service managing this user directory provides two API operations: • listMembersOfGroup • listGroupMembershipsForUser Customers can use either of these operations to discover group membership. Therefore, the permissions administrator must remember to coordinate access to both operations. This is complicated further if you later choose to add a new API operation to address additional use cases, such as the following. • isUserInGroups (a new API to quickly test if a user belongs in one or more groups) Focus on resources 15 Amazon Verified Permissions User Guide From a security perspective, this API opens a third path for discovering group memberships, disrupting the carefully crafted permissions of the administrator. We recommend that you focus on the underlying data and resources and their association operations. Applying this approach to the group membership example would lead to an abstract permission, such as viewGroupMembership, which each of the three API operations must consult. API Name Permissions listMembersOfGroup requires viewGroupMembership permission on the group listGroupMembershi requires viewGroupMembership permission on the user psForUser isUserInGroups requires viewGroupMembership permission on the user By defining this one permission, the administrator successfully controls access to discovering group memberships, now and forever. As a tradeoff, each API operation must now document the possibly several permissions that it requires, and the administrator must consult this documentation when crafting permissions. This can be a valid tradeoff when necessary to meet your security requirements. Multi-tenancy considerations You might want to develop applications for use by multiple customers - businesses that consume your application, or tenants - and integrate them with Amazon Verified Permissions. Before you develop your authorization model, develop a multi-tenant strategy. You can manage the policies of your customers in one shared policy store, or assign each a per-tenant policy store. For more information, see Amazon Verified Permissions multi-tenant design considerations in AWS Prescriptive Guidance. 1. One shared policy store All tenants share a single policy store. The application sends all authorization requests to the shared policy store. 2. Per-tenant policy store Consider multi-tenancy 16 Amazon Verified Permissions User Guide Each tenant has a dedicated policy store. The application will query different policy stores for an authorization decision, depending on the tenant that makes the request. Neither strategy will have a large impact on your AWS bill. So how, then, should you design your approach? The following are common conditions that might contribute to your Verified Permissions
amazon-verified-permissions-user-guide-008
amazon-verified-permissions-user-guide.pdf
8
Permissions multi-tenant design considerations in AWS Prescriptive Guidance. 1. One shared policy store All tenants share a single policy store. The application sends all authorization requests to the shared policy store. 2. Per-tenant policy store Consider multi-tenancy 16 Amazon Verified Permissions User Guide Each tenant has a dedicated policy store. The application will query different policy stores for an authorization decision, depending on the tenant that makes the request. Neither strategy will have a large impact on your AWS bill. So how, then, should you design your approach? The following are common conditions that might contribute to your Verified Permissions multi-tenancy authorization strategy. Tenant policies isolation Isolation of the policies of each tenant from the others is important to protect tenant data. When each tenant has their own policy store, they each have their own isolated set of policies. Authorization flow You can identify a tenant making an authorization request with a policy store ID in the request, with per-tenant policy stores. With a shared policy store, all requests use the same policy store ID. Templates and schema management When your application has multiple policy stores, your policy templates and a policy store schema add a level of design and maintenance overhead in each policy store. Global policies management You might want to apply some global policies to every tenant. The level of overhead for management of global policies varies between shared and per-tenant policy store models. Tenant off-boarding Some tenants will contribute elements to your schema and policies that are specific to their case. When a tenant is no longer active with your organization and you want to remove their data, the level of effort varies with their level of isolation from other tenants. Service resource quotas Verified Permissions has resource and request-rate quotas that might influence your multi- tenancy decision. For more information about quotas, see Quotas for resources. Consider multi-tenancy 17 Amazon Verified Permissions User Guide Comparing shared policy stores and per-tenant policy stores Each consideration requires its own level of time and resource commitment in shared and per- tenant policy store models. Consideration Effort level in a shared policy store Effort level in per-tenant policy stores Tenant policies isolation Medium. Must include tenant identifiers in policies and Low. Isolation is default behavior. Tenant-specific authorization requests. policies are inaccessible to other tenants. Authorization flow Low. All queries target one policy store. Medium. Must maintain mappings between each tenant and their policy store ID. Templates and schema management Low. Must make one schema work for all tenants. High. Schemas and templates might be less complex individually, but changes require more coordination and complexity. Global policies management Low. All policies are global and can be centrally updated. High. You must add global policies to each policy store in onboarding. Replicate global policy updates between many policy stores. Tenant off-boarding High. Must identify and delete only tenant-specific policies. Low. Delete the policy store. Service resource quotas High. Tenants share resource quotas that affect policy stores like schema size, policy size per resource, and identity sources per policy store. Low. Each tenant has dedicated resource quotas. Comparing shared policy stores and per-tenant policy stores 18 Amazon Verified Permissions How to choose User Guide Each multi-tenant application is different. Carefully compare the two approaches and their considerations before making an architectural decision. If your application doesn't require tenant-specific policies and uses a single identity source, one shared policy store for all tenants is likely to be the most effective solution. This results in a simpler authorization flow and global policy management. Off-boarding a tenant using one shared policy store requires less effort because the application does not need to delete tenant-specific policies. But if your application requires many tenant-specific policies, or uses multiple identity sources, per- tenant policy stores are likely to be most effective. You can control access to tenant policies with IAM policies that grant per-tenant permissions to each policy store. Off-boarding a tenant involves deleting their policy store; in a shared-policy-store environment, you must find and delete tenant- specific policies. How to choose 19 Amazon Verified Permissions User Guide Amazon Verified Permissions policy stores A policy store is a container for policies and policy templates. In each policy store, you can create a schema that is used to validate policies added to the policy store. In addition, you can turn on policy validation. If you add a policy to a policy store with policy validation enabled, the entity types, common types, and actions defined in the policy are validated against the schema and invalid policies are rejected. Deletion protection prevents accidental deletion of a policy store. Deletion protection is enabled on all new policy stores created through the AWS Management Console. By contrast, it is disabled for all policy stores created through an API or SDK call. We recommend
amazon-verified-permissions-user-guide-009
amazon-verified-permissions-user-guide.pdf
9
you can create a schema that is used to validate policies added to the policy store. In addition, you can turn on policy validation. If you add a policy to a policy store with policy validation enabled, the entity types, common types, and actions defined in the policy are validated against the schema and invalid policies are rejected. Deletion protection prevents accidental deletion of a policy store. Deletion protection is enabled on all new policy stores created through the AWS Management Console. By contrast, it is disabled for all policy stores created through an API or SDK call. We recommend creating one policy store per application, or one policy store per tenant for multi- tenant applications. You must specify a policy store when making an authorization request. We recommend using namespaces to Cedar entities in your policy stores to prevent ambiguity. A namespace is a string prefix for a type, separated by a pair of colons (::) as a delimiter. For example MyApplicationNamespace::exampleType. Verified Permissions supports one namespace per policy store. These namespaces help keep things straight when you’re working with multiple similar applications. For example, in multi-tenant applications, using a namespace to append the name of the tenant to the types defined in the schema will make them distinct from their similar counterparts used by the other tenants. When looking at the logs for the authorization requests, you’ll be able to easily indentify the tenant that processed the authorization request. For more information, see Namespaces in the Cedar policy language Reference Guide. Topics • Creating Verified Permissions policy stores • API-linked policy stores • Deleting policy stores Creating Verified Permissions policy stores You can create a policy store using the following methods: • Follow a guided setup – You will define a resource type with valid actions and a principal type before creating your first policy. Creating policy stores 20 Amazon Verified Permissions User Guide • Set up with API Gateway and an identity source– Define your principal entities with users who sign in with an identity provider (IdP), and your actions and resource entities from an Amazon API Gateway API. We recommend this option if you want your application to authorize API requests with users’ group membership or other attributes. • Start from a sample policy store – Choose a pre-defined sample project policy store. We recommend this option if you are learning about Verified Permissions and want to view and test example policies. • Create an empty policy store – You will define the schema and all access policies yourself. We recommend this option if you are already familiar with configuring a policy store. Guided setup To create a policy store using the Guided setup configuration method The guided setup wizard leads you through the process of creating the first iteration of your policy store. You will create a schema for your first resource type, describe the actions that are applicable for that resource type, and the principal type for which you are granting permissions. You will then create your first policy. Once you've completed this wizard, you will be able to add to your policy store, extend the schema to describe other resource and principal types, and create additional policies and templates. 1. 2. 3. 4. In the Verified Permissions console, select Create new policy store. In the Starting options section, choose Guided setup. Enter a Policy store description. This text can be whatever suits your organization as a friendly reference to the function of the current policy store, for example Weather updates web application. In the Details section, type a Namespace for your schema. For more information about namespaces, see Namespace definition. 5. Choose Next. 6. On the Resource type window, type a name for your resource type. For example, currentTemperature could be a resource for the Weather updates web application. 7. (Optional) Choose Add an attribute to add resource attributes. Type the Attribute name and choose an Attribute type for each attribute of the resource. Choose whether each attribute is Required. For example, temperatureFormat could be an attribute for the currentTemperature resource and be either Fahrenheit or Celsius. To remove an attribute that has been added for the resource type, choose Remove next to the attribute. Creating policy stores 21 Amazon Verified Permissions User Guide 8. 9. In the Actions field, type the actions to be authorized for the specified resource type. To add additional actions for the resource type, choose Add an action. For example, viewTemperature could be an action in the Weather updates web application. To remove an action that has been added for the resource type, choose Remove next to the action. In the Name of the principal type field, type the name for a type of principal that will be using the specified actions for your resource type. By default,
amazon-verified-permissions-user-guide-010
amazon-verified-permissions-user-guide.pdf
10
the attribute. Creating policy stores 21 Amazon Verified Permissions User Guide 8. 9. In the Actions field, type the actions to be authorized for the specified resource type. To add additional actions for the resource type, choose Add an action. For example, viewTemperature could be an action in the Weather updates web application. To remove an action that has been added for the resource type, choose Remove next to the action. In the Name of the principal type field, type the name for a type of principal that will be using the specified actions for your resource type. By default, User is added to this field but can be replaced. 10. Choose Next. 11. On the Principal type window, choose the identity source for your principal type. • Choose Custom if the principal's ID and attributes will be provided directly by your Verified Permissions application. Choose Add an attribute to add principal attributes. Verified Permissions uses the specified attribute values when verifying policies against the schema. To remove an attribute that has been added for the principal type, choose Remove next to the attribute. • Choose Cognito User Pool if the principal's ID and attributes will be provided from an ID or access token generated by Amazon Cognito. Choose Connect user pool. Select the AWS Region and type User pool ID of the Amazon Cognito user pool to connect to. Choose Connect. For more information, see Authorization with Amazon Verified Permissions in the Amazon Cognito Developer Guide. • Choose External OIDC provider if the principal's ID and attributes will be extracted from an ID and/or Access token, generated by an external OIDC provider and add the provider and token details. 12. Choose Next. 13. In the Policy details section, type an optional Policy description for your first Cedar policy. 14. In the Principals scope field, choose the principals that will be granted permissions from the policy. • Choose Specific principal to apply the policy to a specific principal. Choose the principal in the Principal that will be permitted to take actions field and type an entity identifier for the principal. For example, user-id could be an entity identifier in the Weather updates web application. Creating policy stores 22 Amazon Verified Permissions User Guide Note If you are using Amazon Cognito, the entity identifier must be formatted as <userpool-id>|<sub>. • Choose All principals to apply the policy to all principals in your policy store. 15. In the Resources scope field, choose which resources that the specified principals will be authorized to act on. • Choose Specific resource to apply the policy to a specific resource. Choose the resource in the Resource this policy should apply to field and type an entity identifier for the resource. For example, temperature-id could be an entity identifier in the Weather updates web application. • Choose All resources to apply the policy to all resources in your policy store. 16. In the Actions scope field, choose which actions that the specified principals will be authorized to perform. • Choose Specific set of actions to apply the policy to specific actions. Select the check boxes next to the actions in the Action(s) this policy should apply to field. • Choose All actions to apply the policy to all actions in your policy store. 17. Review the policy in the Policy preview section. Choose Create policy store. Set up with API Gateway and an identity source To create a policy store using the Set up with API Gateway and an identity source configuration method The API Gateway option secures APIs with Verified Permissions policies that are designed to make authorization decisions from users’ groups, or roles. This option builds a policy store for testing authorization with identity-source groups and an API with a Lambda authorizer. The users and their groups in an IdP become either your principals (ID tokens) or your context (access tokens). The methods and paths in an API Gateway API become the actions that your policies authorize. Your application becomes the resource. As a result of this workflow, Verified Permissions creates a policy store, a Lambda function, and an API Lambda authorizer. You must assign the Lambda authorizer to your API after you finish this workflow. Creating policy stores 23 Amazon Verified Permissions User Guide 1. 2. 3. In the Verified Permissions console, select Create new policy store. In the Starting options section, choose Set up with API Gateway and an identity source and select Next. In the Import resources and actions step, under API, choose an API that will function as the model to your policy store resources and actions. a. Choose a Deployment stage from the stages configured in your API and select Import API. For more information about API stages, see Setting up a stage for a REST API in the Amazon
amazon-verified-permissions-user-guide-011
amazon-verified-permissions-user-guide.pdf
11
workflow. Creating policy stores 23 Amazon Verified Permissions User Guide 1. 2. 3. In the Verified Permissions console, select Create new policy store. In the Starting options section, choose Set up with API Gateway and an identity source and select Next. In the Import resources and actions step, under API, choose an API that will function as the model to your policy store resources and actions. a. Choose a Deployment stage from the stages configured in your API and select Import API. For more information about API stages, see Setting up a stage for a REST API in the Amazon API Gateway Developer Guide. b. Preview your Map of imported resources and actions. c. To update resources or actions, modify your API paths or methods in the API Gateway console and select Import API to see the updates. d. When you are satisfied with your choices, choose Next. 4. In Identity source, choose an Identity provider type. You can choose an Amazon Cognito user pool or an OpenID Connect (OIDC) IdP type. 5. If you chose Amazon Cognito: a. Choose a user pool in the same AWS Region and AWS account as your policy store. b. Choose the Token type to pass to API that you want to submit for authorization. Either token types contains user groups, the foundation of this API-linked authorization model. c. Under App client validation, you can limit the scope of a policy store to a subset of the Amazon Cognito app clients in a multi-tenant user pool. To require that user authenticate with one or more specified app clients in your user pool, select Only accept tokens with expected app client IDs. To accept any user who authenticates with the user pool, select Don't validate app client IDs. d. Choose Next. 6. If you chose External OIDC provider: a. In Issuer URL, enter the URL of your OIDC issuer. This is the service endpoint that provides the authorization server, signing keys, and other information about your provider, for example https://auth.example.com. Your issuer URL must host an OIDC discovery document at /.well-known/openid-configuration. Creating policy stores 24 Amazon Verified Permissions User Guide b. c. In Token type, choose the type of OIDC JWT that you want your application to submit for authorization. For more information, see Mapping identity provider tokens to schema. (optional) In Token claims - optional, choose Add a token claim, enter a name for the token, and select a value type. d. In User and group token claims, do the following: i. Enter a User claim name in token for the identity source. This is a claim, typically sub, from your ID or access token that holds the unique identifier for the entity to be evaluated. Identities from the connected OIDC IdP will be mapped to the user type in your policy store. ii. Enter a Group claim name in token for the identity source. This is a claim, typically groups, from your ID or access token that contains a list of the user's groups. Your policy store will authorize requests based on the group membership. e. In Audience validation, choose Add value and add a value that you want your policy store to accept in authorization requests. f. Choose Next. 7. If you chose Amazon Cognito, Verified Permissions queries your user pool for groups. For OIDC providers, enter group names manually. The Assign actions to groups step creates policies for your policy store that permit group members to perform actions. a. Choose or add the groups that you want to include in your policies. b. Assign actions to each of the groups that you selected. c. Choose Next. 8. In Deploy app integration, choose whether you want to manually attach the Lambda authorizer manually later or if you want Verified Permissions to do it for you now and review the steps that Verified Permissions will take to create your policy store and Lambda authorizer. 9. When you're ready to create the new resources, choose Create policy store. 10. Keep the Policy store status step open in your browser to monitor the progress of resource creation by Verified Permissions. 11. After some time, typically about an hour, or when the Deploy Lambda authorizer step shows Success, if you chose to attach the authorizer manually, configure your authorizer. Creating policy stores 25 Amazon Verified Permissions User Guide Verified Permissions will have created a Lambda function and a Lambda authorizer in your API. Choose Open API to navigate to your API. To learn how to assign a Lambda authorizer, see Use API Gateway Lambda authorizers in the Amazon API Gateway Developer Guide. a. Navigate to Authorizers for your API and note the name of the authorizer that Verified Permissions created. b. Navigate to Resources and select a top-level method in your API. c. d. e. f.
amazon-verified-permissions-user-guide-012
amazon-verified-permissions-user-guide.pdf
12
shows Success, if you chose to attach the authorizer manually, configure your authorizer. Creating policy stores 25 Amazon Verified Permissions User Guide Verified Permissions will have created a Lambda function and a Lambda authorizer in your API. Choose Open API to navigate to your API. To learn how to assign a Lambda authorizer, see Use API Gateway Lambda authorizers in the Amazon API Gateway Developer Guide. a. Navigate to Authorizers for your API and note the name of the authorizer that Verified Permissions created. b. Navigate to Resources and select a top-level method in your API. c. d. e. f. g. Select Edit under Method request settings. Set the Authorizer to be the authorizer name you noted earlier. Expand HTTP request headers, enter a Name or AUTHORIZATION, and select Required. Deploy the API stage. Save your changes. 12. Test your authorizer with a user pool token of the Token type that you selected in the Choose identity source step. For more information about user pool sign-in and retrieving tokens, see User pool authentication flow in the Amazon Cognito Developer Guide. 13. Test authentication again with a user pool token in the AUTHORIZATION header of a request to your API. 14. Examine your new policy store. Add and refine policies. Sample policy store To create a policy store using the Sample policy store configuration method 1. 2. In the Starting options section, choose Sample policy store. In the Sample project section, choose the type of sample Verified Permissions application to use. • PhotoFlash is a sample customer-facing web application that enables users to share individual photos and albums with friends. Users can set fine-grained permissions on who is allowed to view, comment on, and re-share their photos. Account owners can also create groups of friends and organize photos into albums. Creating policy stores 26 Amazon Verified Permissions User Guide • DigitalPetStore is a sample application where anyone can register and become a customer. Customers can add pets for sale, search pets, and place orders. Customers who have added a pet are recorded as the pet owner. Pet owners can update the pet's details, upload a pet image, or delete the pet listing. Customers who have placed an order are recorded as the order owner. Order owners can get details on the order or cancel it. Pet store managers have administrative access. Note The DigitalPetStore sample policy store does not include policy templates. The PhotoFlash and TinyTodo sample policy stores include policy templates. • TinyTodo is a sample application that enables users to create taks and task lists. List owners can manage and share their lists and specify who can view or edit their lists. 3. A namespace for the schema of your sample policy store is automatically generated based on the sample project you chose. 4. Choose Create policy store. Your policy store is created with policies and a schema for the sample policy store you chose. For more information on template-linked policies you can create for the sample policy stores, see Amazon Verified Permissions example template-linked policies. Empty policy store To create a policy store using the Empty policy store configuration method 1. In the Starting options section, choose Empty policy store. 2. Choose Create policy store. An empty policy store is created without a schema, which means policies are not validated. For more information about updating the schema for your policy store, see Amazon Verified Permissions policy store schema. For more information about creating policies for your policy store, see Creating Amazon Verified Permissions static policies and Creating Amazon Verified Permissions template-linked policies. Creating policy stores 27 Amazon Verified Permissions AWS CLI User Guide To create an empty policy store by using the AWS CLI. You can create a policy store by using the create-policy-store operation. Note A policy store that you create by using the AWS CLI is empty. • To add schema, see Amazon Verified Permissions policy store schema. • To add policies, see Creating Amazon Verified Permissions static policies. • To add policy templates, see Creating Amazon Verified Permissions policy templates. $ aws verifiedpermissions create-policy-store \ --validation-settings "mode=STRICT" { "arn": "arn:aws:verifiedpermissions::123456789012:policy-store/ PSEXAMPLEabcdefg111111", "createdDate": "2023-05-16T17:41:29.103459+00:00", "lastUpdatedDate": "2023-05-16T17:41:29.103459+00:00", "policyStoreId": "PSEXAMPLEabcdefg111111" } AWS SDKs You can create a policy store using the CreatePolicyStore API. For more information, see CreatePolicyStore in the Amazon Verified Permissions API Reference Guide. Implementing Amazon Verified Permissions in Rust with the AWS SDK This topic provides a practical example of implementing Amazon Verified Permissions in Rust with the AWS SDK. This example shows how to develop an authorization model that can test whether a user is able to view a photo. The sample code uses the aws-sdk-verifiedpermissions crate from the AWS SDK for Rust, which offers a robust set of tools for interacting with AWS services. Creating a policy store using Rust 28 Amazon Verified
amazon-verified-permissions-user-guide-013
amazon-verified-permissions-user-guide.pdf
13
store using the CreatePolicyStore API. For more information, see CreatePolicyStore in the Amazon Verified Permissions API Reference Guide. Implementing Amazon Verified Permissions in Rust with the AWS SDK This topic provides a practical example of implementing Amazon Verified Permissions in Rust with the AWS SDK. This example shows how to develop an authorization model that can test whether a user is able to view a photo. The sample code uses the aws-sdk-verifiedpermissions crate from the AWS SDK for Rust, which offers a robust set of tools for interacting with AWS services. Creating a policy store using Rust 28 Amazon Verified Permissions Prerequisites User Guide Before starting, ensure that you have the AWS CLI configured on your system and that you're familiar with Rust. • For instructions on installing the AWS CLI, see AWS CLI installation guide. • For instructions on configuring the AWS CLI, see Configuring settings for the AWS CLI and Configuration and credential file settings in the AWS CLI. • For more information on Rust, see rust-lang.org and the AWS SDK for Rust Developer Guide. With your environment prepared, let's explore how to implement Verified Permissions in Rust. Test the sample code The sample code does the following: • Sets up the SDK client to communicate with AWS • Creates a policy store • Defines the structure of the policy store by adding a schema • Adds a policy to check authorization requests • Sends a test authorization request to verify everything is set up correctly To test the sample code 1. Create a Rust project. 2. Replace any existing code in main.rs with the following code: use std::time::Duration; use std::thread::sleep; use aws_config::BehaviorVersion; use aws_sdk_verifiedpermissions::Client; use aws_sdk_verifiedpermissions::{ operation::{ create_policy::CreatePolicyOutput, create_policy_store::CreatePolicyStoreOutput, is_authorized::IsAuthorizedOutput, put_schema::PutSchemaOutput, }, Creating a policy store using Rust 29 Amazon Verified Permissions types::{ User Guide ActionIdentifier, EntityIdentifier, PolicyDefinition, SchemaDefinition, StaticPolicyDefinition, ValidationSettings }, }; //Function that creates a policy store in the client that's passed async fn create_policy_store(client: &Client, valid_settings: &ValidationSettings)- > CreatePolicyStoreOutput { let policy_store = client.create_policy_store().validation_settings(valid_settings.clone()).send().await; return policy_store.unwrap(); } //Function that adds a schema to the policy store in the client async fn put_schema(client: &Client, ps_id: &str, schema: &str) -> PutSchemaOutput { let schema = client.put_schema().definition(SchemaDefinition::CedarJson(schema.to_string())).policy_store_id(ps_id.to_string()).send().await; return schema.unwrap(); } //Function that creates a policy in the policy store in the client async fn create_policy(client: &Client, ps_id: &str, policy_definition:&PolicyDefinition) -> CreatePolicyOutput { let create_policy = client.create_policy().definition(policy_definition.clone()).policy_store_id(ps_id).send().await; return create_policy.unwrap(); } //Function that tests the authorization request to the policy store in the client async fn authorize(client: &Client, ps_id: &str, principal: &EntityIdentifier, action: &ActionIdentifier, resource: &EntityIdentifier) -> IsAuthorizedOutput { let is_auth = client.is_authorized().principal(principal.to_owned()).action(action.to_owned()).resource(resource.to_owned()).policy_store_id(ps_id).send().await; return is_auth.unwrap(); } #[::tokio::main] async fn main() -> Result<(), aws_sdk_verifiedpermissions::Error> { //Set up SDK client let config = aws_config::load_defaults(BehaviorVersion::latest()).await; let client = aws_sdk_verifiedpermissions::Client::new(&config); Creating a policy store using Rust 30 Amazon Verified Permissions User Guide //Create a policy store let valid_settings = ValidationSettings::builder() .mode({aws_sdk_verifiedpermissions::types::ValidationMode::Strict }) .build() .unwrap(); let policy_store = create_policy_store(&client, &valid_settings).await; println!( "Created Policy store with ID: {:?}", policy_store.policy_store_id ); //Add schema to policy store let schema= r#"{ "PhotoFlash": { "actions": { "ViewPhoto": { "appliesTo": { "context": { "type": "Record", "attributes": {} }, "principalTypes": [ "User" ], "resourceTypes": [ "Photo" ] }, "memberOf": [] } }, "entityTypes": { "Photo": { "memberOfTypes": [], "shape": { "type": "Record", "attributes": { "IsPrivate": { "type": "Boolean" } } } Creating a policy store using Rust 31 User Guide Amazon Verified Permissions }, "User": { "memberOfTypes": [], "shape": { "attributes": {}, "type": "Record" } } } } }"#; let put_schema = put_schema(&client, &policy_store.policy_store_id, schema).await; println!( "Created Schema with Namespace: {:?}", put_schema.namespaces ); //Create policy let policy_text = r#" permit ( principal in PhotoFlash::User::"alice", action == PhotoFlash::Action::"ViewPhoto", resource == PhotoFlash::Photo::"VacationPhoto94.jpg" ); "#; let policy_definition = PolicyDefinition::Static(StaticPolicyDefinition::builder().statement(policy_text).build().unwrap()); let policy = create_policy(&client, &policy_store.policy_store_id, &policy_definition).await; println!( "Created Policy with ID: {:?}", policy.policy_id ); //Break to make sure the resources are created before testing authorization sleep(Duration::new(2, 0)); //Test authorization let principal= EntityIdentifier::builder().entity_id("alice").entity_type("PhotoFlash::User").build().unwrap(); let action = ActionIdentifier::builder().action_type("PhotoFlash::Action").action_id("ViewPhoto").build().unwrap(); Creating a policy store using Rust 32 Amazon Verified Permissions let resource = User Guide EntityIdentifier::builder().entity_id("VacationPhoto94.jpg").entity_type("PhotoFlash::Photo").build().unwrap(); let auth = authorize(&client, &policy_store.policy_store_id, &principal, &action, &resource).await; println!( "Decision: {:?}", auth.decision ); println!( "Policy ID: {:?}", auth.determining_policies ); Ok(()) } 3. Run the code by entering cargo run in the terminal. If the code runs correctly, the terminal will show Decision: Allow followed by the policy ID of the determining policy. This means you've successfully created a policy store and tested it using the AWS SDK for Rust. Clean up resources After you have finished exploring your policy store, delete it. To delete a policy store You can delete a policy store by using the delete-policy-store operation, replacing PSEXAMPLEabcdefg111111 with the policy store ID you want to delete. $ aws verifiedpermissions delete-policy-store \ --policy-store-id PSEXAMPLEabcdefg111111 If successful, this command produces no output. API-linked policy stores A common use case is to use Amazon Verified Permissions to authorize user access to APIs hosted