chore: encryption example for gen docs#40
Conversation
Greptile SummaryThis PR adds a new documentation example (
Confidence Score: 4/5Not safe to merge as-is — the example fails with ImportError on startup due to non-existent SDK symbols. Three P1 findings: examples/docs/encryption.py — all three P1 issues are concentrated here. Important Files Changed
Prompt To Fix All With AIThis is a comment left during a code review.
Path: examples/docs/encryption.py
Line: 14-22
Comment:
**`EncryptionKey` and `EncryptionAlgorithm` don't exist in `s2_sdk`**
Both symbols are imported here but are absent from `s2_sdk/__init__.py` and `_types.py`. Running the script will raise `ImportError: cannot import name 'EncryptionKey' from 's2_sdk'` before any code executes. The correct equivalent types already in the SDK are: `Encryption` (the enum — with `.AEGIS_256` / `.AES_256_GCM` values) and plain `bytes | str` for the key value passed directly to `basin.stream()`.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: examples/docs/encryption.py
Line: 36-44
Comment:
**`EncryptionAlgorithm` referenced but should be `Encryption`**
`EncryptionAlgorithm.AEGIS_256` and `EncryptionAlgorithm.AES_256_GCM` will fail at runtime (the `ImportError` above is the first failure; this is what you'd fix next). The existing `Encryption` enum in `_types.py` already has `Encryption.AEGIS_256` and `Encryption.AES_256_GCM`; `BasinConfig.stream_cipher` is typed as `Encryption | None`.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: examples/docs/encryption.py
Line: 57-59
Comment:
**`EncryptionKey(...)` wrapper doesn't exist — pass the key directly**
`S2Basin.stream()` accepts `encryption_key: bytes | str | None` as a plain parameter; there is no `EncryptionKey` wrapper class in the SDK. The value from the environment variable should be passed directly to the `encryption_key` keyword argument.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "chore: encryption example for gen docs" | Re-trigger Greptile |
No description provided.