Repository navigation
Commit dc2d23e
Use authenticated crypto for encryption, drop restricted_imports, TP release flow
Encryption (breaking change, documented):
- encrypt() now uses Fernet (AES-128-CBC + HMAC-SHA256) with a 256-bit key;
any Unicode source round-trips losslessly (plaintext is UTF-8)
- New generate_key() helper; keys resolve via key= > CODESAFE_KEY env >
built-in default (public, obfuscation-grade, documented)
- Files written by encrypt_to_file() are self-describing: # codesafe:v2:<token>
- Legacy pre-0.0.6 Base64 Caesar payloads remain fully decryptable/runnable
via decrypt()/decrypt_to_file()/run(); legacy mapping still honored there
- encrypt() no longer accepts the Caesar mapping parameter (TypeError)
safe_eval:
- Restricted imports parameter removed (redundant with the blanket import ban)
- Results are serialized with cloudpickle: lambdas and dynamically created
classes can now be returned; generators/modules still raise a clear
RuntimeError (instead of the old misleading EvaluationTimeoutError)
CI/release:
- Tests run on 3.8/3.9 via ubuntu-22.04 (not available on ubuntu-latest/24.04,
which is why those jobs failed at setup); deps installed directly
- Publish workflow uses PyPI Trusted Publishing (OIDC, id-token: write);
no stored API tokens; distributions carry PEP 740 provenance attestations
- README gains a provenance badge linked to the PyPI security tab
Docs:
- New SECURITY.md (private reporting instructions, supported versions,
published advisories)
- SECURITY_AUDIT.md dropped; its content now lives in the README
(Security Advisory + Security Limitations & Notes sections)
- v0.0.5 changelog now carries a prominent warning about the second,
known sandbox-escape issue (allow_attributes=True, fixed in 0.0.6)
- _ = backwards-compatible positional legacy mapping for decrypt-time calls
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>1 parent 3ba2bb1 commit dc2d23e
10 files changed
Lines changed: 470 additions & 305 deletions
File tree
- .github/workflows
- codesafe
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
12 | 20 | | |
13 | 21 | | |
14 | 22 | | |
| |||
34 | 42 | | |
35 | 43 | | |
36 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
37 | 48 | | |
38 | 49 | | |
39 | | - | |
40 | | - | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
18 | 24 | | |
19 | 25 | | |
20 | 26 | | |
| |||
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
31 | 45 | | |
32 | 46 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
This file was deleted.
0 commit comments