Encryption for the Inngest SDK
Project description
Inngest Python SDK: Encryption
This package provides encryption for the Inngest Python SDK.
Usage
Setting encryption middleware on the client will turn on encryption for events and steps in all functions:
import inngest
from inngest_encryption import EncryptionMiddleware
inngest.Inngest(
name="my-app",
encryption_key="my-encryption-key",
middleware=[EncryptionMiddleware.factory("my-secret-key")],
)
When sending events or invoking functions, only the encrypted field will be encrypted:
await step.send_event(
"my-step",
inngest.Event(
data={
# Everything in this field will be encrypted.
"encrypted": {
"phone": "867-5309",
},
# Not encrypted.
"user_id": "abc123",
},
name="my-event",
),
)
await step.invoke(
"invoke",
function=child_fn_async,
data={
# Everything in this field will be encrypted.
"encrypted": {
"phone": "867-5309",
},
# Not encrypted.
"user_id": "abc123",
},
)
[!NOTE]
Only a portion of the event data is encrypted because that allows for control flow settings (e.g. concurrency key) to work. Since the Inngest server receives encrypted data, it can't perform control flow on values that are encrypted.
The entire step.run output is encrypted:
def _my_step() -> dict[str, object]:
# Encrypted when sending back to the Inngest server.
return {"msg": "hello"}
output = await step.run("my-step", _my_step)
# Decrypted within this function.
print(output)
Key rotation
When rotating the encryption key, you may still have active functions runs whose data is encrypted with the old key. To decrypt these, you can use the fallback_decryption_keys option:
inngest.Inngest(
name="my-app",
encryption_key="my-encryption-key",
middleware=[
EncryptionMiddleware.factory(
"new-secret-key",
fallback_decryption_keys=["old-secret-key"],
),
],
)
If decryption fails with the new key, the encryption middleware will fall back to the old key.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file inngest_encryption-0.1.0.tar.gz.
File metadata
- Download URL: inngest_encryption-0.1.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70bfe640a7f7e479c955dd34269e3f9c3154fa83c0a9d68b44563b2db1cf4300
|
|
| MD5 |
06fc7f7010196d40f2001aa24c714626
|
|
| BLAKE2b-256 |
09e947ac0f9960989485baafeb0a32a0796c25340a29106cb3d6f34919734048
|
Provenance
The following attestation bundles were made for inngest_encryption-0.1.0.tar.gz:
Publisher:
inngest_encryption.yml on inngest/inngest-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
inngest_encryption-0.1.0.tar.gz -
Subject digest:
70bfe640a7f7e479c955dd34269e3f9c3154fa83c0a9d68b44563b2db1cf4300 - Sigstore transparency entry: 180380994
- Sigstore integration time:
-
Permalink:
inngest/inngest-py@58a8d306c49538a8186930765f67ed7d1d920df0 -
Branch / Tag:
refs/tags/inngest_encryption@0.1.0 - Owner: https://github.com/inngest
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
inngest_encryption.yml@58a8d306c49538a8186930765f67ed7d1d920df0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file inngest_encryption-0.1.0-py3-none-any.whl.
File metadata
- Download URL: inngest_encryption-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddb8efdc602e14dc606415b2b1d333099ec0afd4efade7ec4ed971bc88c26bf9
|
|
| MD5 |
5a62eef7a2f9e7ca7d40d596bc3187e6
|
|
| BLAKE2b-256 |
d372f00f3d1f59ac994eec1a8aa7861843dc2dbd0d0fe6359c7792f68b2223c7
|
Provenance
The following attestation bundles were made for inngest_encryption-0.1.0-py3-none-any.whl:
Publisher:
inngest_encryption.yml on inngest/inngest-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
inngest_encryption-0.1.0-py3-none-any.whl -
Subject digest:
ddb8efdc602e14dc606415b2b1d333099ec0afd4efade7ec4ed971bc88c26bf9 - Sigstore transparency entry: 180380995
- Sigstore integration time:
-
Permalink:
inngest/inngest-py@58a8d306c49538a8186930765f67ed7d1d920df0 -
Branch / Tag:
refs/tags/inngest_encryption@0.1.0 - Owner: https://github.com/inngest
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
inngest_encryption.yml@58a8d306c49538a8186930765f67ed7d1d920df0 -
Trigger Event:
push
-
Statement type: