Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add bulk decryption API /v1/key/bulk/decrypt #210

Merged
merged 1 commit into from Mar 22, 2022
Merged

Conversation

aead
Copy link
Member

@aead aead commented Mar 22, 2022

This commit adds a new bulk API:

/v1/key/bulk/decrypt

Now, a client can request the corresponding
plaintext / context pairs for multiple
ciphertext / context pairs in a single call.

Before, a client had to send each plaintext / context
pair to the server using the /v1/key/decrypt API.

The new bulk API expects an array of ciphertext / context
pairs. Each context is still optional but must match
the context used during encryption:

[
  {
    "ciphertext": "...",
    "context":"..."
  },
  {
    "ciphertext":"..."
  },
  {
    "ciphertext":"...",
    "context":"..."
  }
]

It will respond either with an array of plaintexts
or the first decryption error. It only returns
plaintexts if and only if it decrypted
all ciphertexts successfully.

[
  {
    "plaintext": "...",
  },
  {
    "plaintext":"..."
  },
  {
    "plaintext":"...",
  }
]

At the moment, the /v1/key/bulk/decrypt API limits
the number of ciphertext / context pairs to 1000
within a single API call.

@aead aead added this to the Bulk APIs milestone Mar 22, 2022
This commit adds a new bulk API:
```
/v1/key/bulk/decrypt
```

Now, a client can request the corresponding
plaintext / context pairs for multiple
ciphertext / context pairs in a single call.

Before, a client had to send each plaintext / context
pair to the server using the `/v1/key/decrypt` API.

The new bulk API expects an array of ciphertext / context
pairs. Each context is still optional but must match
the context used during encryption:
```json
[
  {
    "ciphertext": "...",
    "context":"..."
  },
  {
    "ciphertext":"..."
  },
  {
    "ciphertext":"...",
    "context":"..."
  }
]
```

It will respond either with an array of plaintexts
or the first decryption error. It only returns
plaintexts if and only if it decrypted
all ciphertexts successfully.
```json
[
  {
    "plaintext": "...",
  },
  {
    "plaintext":"..."
  },
  {
    "plaintext":"...",
  }
]
```

At the moment, the `/v1/key/bulk/decrypt` API limits
the number of ciphertext / context pairs to `1000`
within a single API call.

Signed-off-by: Andreas Auernhammer <hi@aead.dev>
@harshavardhana harshavardhana merged commit c99624b into master Mar 22, 2022
@harshavardhana harshavardhana deleted the bulk-decrypt branch March 22, 2022 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants