improvement: format docs and change wording

This commit is contained in:
Scott Wilson
2024-10-03 13:31:53 -07:00
parent 0b24cc8631
commit 2c93561a3b
+26 -28
View File
@@ -30,13 +30,13 @@ sequenceDiagram
## Concept ## Concept
At a high-level, Infisical generates a KMS key when requested, returning the `keyId` to the requester. This `keyId` can then be used At a high-level, Infisical generates a KMS key when requested, returning the `keyId` to the client. This `keyId` can then be used
to perform cryptographic operations such as encrypting and decrypting data. to perform cryptographic operations such as encrypting and decrypting data.
To be more specific: To be more specific:
1. The client requests to create a key using the `/api/v1/kms/keys` endpoint. 1. The client requests to create a key using the `/api/v1/kms/keys` endpoint.
2. Infisical generates a KMS key and returns the `keyId` to the requester. 2. Infisical generates a KMS key and returns the `keyId` to the client.
3. The client requests to encrypt `plaintext` data (base64 encoded) with the specified `keyId` using the `/api/v1/kms/keys/<key-id>/encrypt` endpoint. 3. The client requests to encrypt `plaintext` data (base64 encoded) with the specified `keyId` using the `/api/v1/kms/keys/<key-id>/encrypt` endpoint.
4. Infisical returns the encrypted data or `ciphertext` (base64 encoded). 4. Infisical returns the encrypted data or `ciphertext` (base64 encoded).
3. The client requests to decrypt the `ciphertext` data with the original `keyId` using the `/api/v1/kms/keys/<key-id>/decrypt` endpoint. 3. The client requests to decrypt the `ciphertext` data with the original `keyId` using the `/api/v1/kms/keys/<key-id>/decrypt` endpoint.
@@ -137,21 +137,20 @@ In the following steps, we'll explore how to generate a cryptographic key and en
```bash Request ```bash Request
curl --request POST \ curl --request POST \
--url https://app.infisical.com/api/v1/kms/keys/ --url https://app.infisical.com/api/v1/kms/keys/<key-id>/encrypt \
<key-id>/encrypt \ --header 'Content-Type: application/json' \
--header 'Content-Type: application/json' \ --data '{
--data '{ "plaintext": "lUFHM5Ggwo6TOfpuN1S==" // base64 encoded plaintext
"plaintext": "lUFHM5Ggwo6TOfpuN1S==" // base64 encoded plaintext }'
}' ```
```
### Sample response ### Sample response
```bash Response ```bash Response
{ {
"ciphertext": "HwFHwSFHwlMF6TOfp==" // base64 encoded ciphertext "ciphertext": "HwFHwSFHwlMF6TOfp==" // base64 encoded ciphertext
} }
``` ```
</Step> </Step>
</Steps> </Steps>
</Tab> </Tab>
@@ -193,21 +192,20 @@ In the following steps, we'll explore how to decrypt data.
```bash Request ```bash Request
curl --request POST \ curl --request POST \
--url https://app.infisical.com/api/v1/kms/keys/ --url https://app.infisical.com/api/v1/kms/keys/<key-id>/decrypt \
<key-id>/decrypt \ --header 'Content-Type: application/json' \
--header 'Content-Type: application/json' \ --data '{
--data '{ "ciphertext": "HwFHwSFHwlMF6TOfp==" // base64 encoded ciphertext
"ciphertext": "HwFHwSFHwlMF6TOfp==" // base64 encoded ciphertext }'
}' ```
```
### Sample response ### Sample response
```bash Response ```bash Response
{ {
"plaintext": "lUFHM5Ggwo6TOfpuN1S==" // base64 encoded plaintext "plaintext": "lUFHM5Ggwo6TOfpuN1S==" // base64 encoded plaintext
} }
``` ```
</Step> </Step>
</Steps> </Steps>