sourceorrery 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. sourceorrery-0.1.1/Cargo.toml +73 -0
  2. sourceorrery-0.1.1/PKG-INFO +60 -0
  3. sourceorrery-0.1.1/README.md +34 -0
  4. sourceorrery-0.1.1/bindings/python/.gitignore +8 -0
  5. sourceorrery-0.1.1/bindings/python/Cargo.lock +1819 -0
  6. sourceorrery-0.1.1/bindings/python/Cargo.toml +55 -0
  7. sourceorrery-0.1.1/bindings/python/README.md +34 -0
  8. sourceorrery-0.1.1/bindings/python/conformance/run.py +89 -0
  9. sourceorrery-0.1.1/bindings/python/examples/get_secret.py +28 -0
  10. sourceorrery-0.1.1/bindings/python/src/lib.rs +337 -0
  11. sourceorrery-0.1.1/bindings/python/tests/conftest.py +42 -0
  12. sourceorrery-0.1.1/bindings/python/tests/test_reader.py +228 -0
  13. sourceorrery-0.1.1/crates/sourceorrery/Cargo.toml +32 -0
  14. sourceorrery-0.1.1/crates/sourceorrery/examples/conformance.rs +176 -0
  15. sourceorrery-0.1.1/crates/sourceorrery/examples/get_secret.rs +36 -0
  16. sourceorrery-0.1.1/crates/sourceorrery/src/error.rs +407 -0
  17. sourceorrery-0.1.1/crates/sourceorrery/src/lib.rs +69 -0
  18. sourceorrery-0.1.1/crates/sourceorrery/src/project.rs +156 -0
  19. sourceorrery-0.1.1/crates/sourceorrery/src/reader.rs +212 -0
  20. sourceorrery-0.1.1/crates/sourceorrery/src/unlock.rs +234 -0
  21. sourceorrery-0.1.1/crates/sourceorrery/tests/reader.rs +336 -0
  22. sourceorrery-0.1.1/crates/sourceorrery-core/Cargo.toml +23 -0
  23. sourceorrery-0.1.1/crates/sourceorrery-core/src/audit.rs +216 -0
  24. sourceorrery-0.1.1/crates/sourceorrery-core/src/error.rs +210 -0
  25. sourceorrery-0.1.1/crates/sourceorrery-core/src/identity.rs +109 -0
  26. sourceorrery-0.1.1/crates/sourceorrery-core/src/lib.rs +55 -0
  27. sourceorrery-0.1.1/crates/sourceorrery-core/src/manifest.rs +439 -0
  28. sourceorrery-0.1.1/crates/sourceorrery-core/src/policy.rs +254 -0
  29. sourceorrery-0.1.1/crates/sourceorrery-core/src/secret.rs +681 -0
  30. sourceorrery-0.1.1/crates/sourceorrery-core/src/timestamp.rs +66 -0
  31. sourceorrery-0.1.1/crates/sourceorrery-core/src/traits.rs +100 -0
  32. sourceorrery-0.1.1/crates/sourceorrery-core/src/vault.rs +82 -0
  33. sourceorrery-0.1.1/crates/sourceorrery-crypto/Cargo.toml +27 -0
  34. sourceorrery-0.1.1/crates/sourceorrery-crypto/src/aead.rs +146 -0
  35. sourceorrery-0.1.1/crates/sourceorrery-crypto/src/envelope.rs +45 -0
  36. sourceorrery-0.1.1/crates/sourceorrery-crypto/src/kdf.rs +173 -0
  37. sourceorrery-0.1.1/crates/sourceorrery-crypto/src/key.rs +99 -0
  38. sourceorrery-0.1.1/crates/sourceorrery-crypto/src/lib.rs +64 -0
  39. sourceorrery-0.1.1/crates/sourceorrery-crypto/src/mac.rs +142 -0
  40. sourceorrery-0.1.1/crates/sourceorrery-crypto/src/random.rs +37 -0
  41. sourceorrery-0.1.1/crates/sourceorrery-storage/Cargo.toml +52 -0
  42. sourceorrery-0.1.1/crates/sourceorrery-storage/src/integrity.rs +752 -0
  43. sourceorrery-0.1.1/crates/sourceorrery-storage/src/keystore.rs +172 -0
  44. sourceorrery-0.1.1/crates/sourceorrery-storage/src/lib.rs +56 -0
  45. sourceorrery-0.1.1/crates/sourceorrery-storage/src/protector.rs +103 -0
  46. sourceorrery-0.1.1/crates/sourceorrery-storage/src/registry.rs +284 -0
  47. sourceorrery-0.1.1/crates/sourceorrery-storage/src/sqlite/audit.rs +1018 -0
  48. sourceorrery-0.1.1/crates/sourceorrery-storage/src/sqlite/migrate.rs +281 -0
  49. sourceorrery-0.1.1/crates/sourceorrery-storage/src/sqlite/mod.rs +1073 -0
  50. sourceorrery-0.1.1/crates/sourceorrery-storage/src/sqlite/protectors.rs +511 -0
  51. sourceorrery-0.1.1/crates/sourceorrery-storage/src/sqlite/rows.rs +508 -0
  52. sourceorrery-0.1.1/crates/sourceorrery-storage/src/sqlite/schema.rs +265 -0
  53. sourceorrery-0.1.1/crates/sourceorrery-storage/src/sqlite/tests.rs +112 -0
  54. sourceorrery-0.1.1/crates/sourceorrery-storage/src/unlock.rs +53 -0
  55. sourceorrery-0.1.1/pyproject.toml +44 -0
  56. sourceorrery-0.1.1/python/sourceorrery/__init__.py +339 -0
  57. sourceorrery-0.1.1/python/sourceorrery/_native.pyi +47 -0
  58. sourceorrery-0.1.1/python/sourceorrery/errors.py +186 -0
  59. sourceorrery-0.1.1/python/sourceorrery/py.typed +0 -0
@@ -0,0 +1,73 @@
1
+ [workspace]
2
+ resolver = "3"
3
+ members = [
4
+ "crates/sourceorrery-core",
5
+ "crates/sourceorrery-crypto",
6
+ "crates/sourceorrery-storage",
7
+ "crates/sourceorrery-cli",
8
+ "crates/sourceorrery",
9
+ "crates/sourceorrery-ffi",
10
+ "tests/conformance",
11
+ ]
12
+ # Native extension crates build with their own toolchains (maturin, napi)
13
+ # and keep their own lock files.
14
+ exclude = ["bindings/python", "bindings/node"]
15
+
16
+ [workspace.package]
17
+ version = "0.1.1"
18
+ edition = "2024"
19
+ rust-version = "1.88"
20
+ license = "MIT OR Apache-2.0"
21
+ repository = "https://github.com/Netizine/sourceorrery"
22
+ homepage = "https://sourceorrery.ai"
23
+ authors = ["James Melvin <james@melvin.tech>"]
24
+ categories = ["command-line-utilities", "cryptography"]
25
+ keywords = ["secrets", "vault", "keyring", "security", "cli"]
26
+
27
+ [workspace.dependencies]
28
+ # internal
29
+ sourceorrery-core = { path = "crates/sourceorrery-core", version = "0.1.1" }
30
+ sourceorrery-crypto = { path = "crates/sourceorrery-crypto", version = "0.1.1" }
31
+ sourceorrery-storage = { path = "crates/sourceorrery-storage", version = "0.1.1", default-features = false }
32
+ sourceorrery = { path = "crates/sourceorrery", version = "0.1.1", default-features = false }
33
+
34
+ # shared
35
+ serde = { version = "1", features = ["derive"] }
36
+ serde_json = "1"
37
+ thiserror = "2"
38
+ zeroize = { version = "1.9", features = ["derive"] }
39
+ time = { version = "0.3", features = ["serde-well-known", "formatting", "parsing", "macros"] }
40
+ hex = "0.4"
41
+ toml = "1"
42
+ tracing = "0.1"
43
+ tempfile = "3"
44
+
45
+ [workspace.lints.rust]
46
+ unsafe_code = "forbid"
47
+ missing_debug_implementations = "warn"
48
+
49
+ [workspace.lints.clippy]
50
+ all = { level = "warn", priority = -1 }
51
+ pedantic = { level = "warn", priority = -1 }
52
+ module_name_repetitions = "allow"
53
+ doc_markdown = "allow"
54
+ # Option<Option<T>> is the documented serde idiom for "unchanged / clear / set".
55
+ option_option = "allow"
56
+ missing_errors_doc = "allow"
57
+ missing_panics_doc = "allow"
58
+ must_use_candidate = "allow"
59
+ struct_excessive_bools = "allow"
60
+
61
+ [profile.release]
62
+ lto = "thin"
63
+ codegen-units = 1
64
+ strip = "symbols"
65
+ # No `panic = "abort"`: the C ABI (sourceorrery-ffi) catches panics at the
66
+ # boundary and reports SO_STATUS_PANIC, which needs unwinding in release too.
67
+
68
+ # Argon2id is unusably slow unoptimised; keep the KDF fast in dev/test builds.
69
+ [profile.dev.package.argon2]
70
+ opt-level = 3
71
+
72
+ [profile.dev.package.blake2]
73
+ opt-level = 3
@@ -0,0 +1,60 @@
1
+ Metadata-Version: 2.4
2
+ Name: sourceorrery
3
+ Version: 0.1.1
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: Intended Audience :: Developers
6
+ Classifier: Operating System :: OS Independent
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3 :: Only
9
+ Classifier: Programming Language :: Rust
10
+ Classifier: Topic :: Security
11
+ Classifier: Typing :: Typed
12
+ Requires-Dist: pytest>=8 ; extra == 'test'
13
+ Provides-Extra: test
14
+ Summary: Read secrets from a SourceOrrery vault: secrets belong to the runtime, not the repository
15
+ Keywords: secrets,vault,keyring,security,dotenv
16
+ Home-Page: https://sourceorrery.ai
17
+ Author-email: James Melvin <james@melvin.tech>
18
+ License-Expression: MIT OR Apache-2.0
19
+ Requires-Python: >=3.11
20
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
21
+ Project-URL: Changelog, https://github.com/Netizine/sourceorrery/blob/main/CHANGELOG.md
22
+ Project-URL: Documentation, https://sourceorrery.ai/sdks/python/
23
+ Project-URL: Homepage, https://sourceorrery.ai
24
+ Project-URL: Repository, https://github.com/Netizine/sourceorrery
25
+
26
+ # sourceorrery (Python)
27
+
28
+ Read secrets from a [SourceOrrery](https://sourceorrery.ai) vault.
29
+ Secrets belong to the runtime, not the repository.
30
+
31
+ ```python
32
+ from sourceorrery import SecretReader
33
+
34
+ with SecretReader("development") as reader, reader.get("database-password") as secret:
35
+ connect(password=secret.value.expose_text())
36
+ ```
37
+
38
+ The package only reads. The vault is unlocked the way the `sourceorrery`
39
+ CLI unlocks it: OS credential store first, then `SOURCEORRERY_PASSPHRASE`,
40
+ then `SOURCEORRERY_PASSPHRASE_FILE`. Every failure is a typed exception
41
+ with a stable `code` and a `hint` that says what to do.
42
+
43
+ Documentation: <https://sourceorrery.ai/sdks/python/>. Source:
44
+ `bindings/python` in the repository.
45
+
46
+ ## Building from source
47
+
48
+ ```bash
49
+ pip install maturin
50
+ cd bindings/python
51
+ maturin develop --release # into the active virtualenv
52
+ ```
53
+
54
+ Tests read the vault created by `scripts/ci/fixture-vault.sh`:
55
+
56
+ ```bash
57
+ eval "$(bash ../../scripts/ci/fixture-vault.sh)"
58
+ python -m pytest
59
+ ```
60
+
@@ -0,0 +1,34 @@
1
+ # sourceorrery (Python)
2
+
3
+ Read secrets from a [SourceOrrery](https://sourceorrery.ai) vault.
4
+ Secrets belong to the runtime, not the repository.
5
+
6
+ ```python
7
+ from sourceorrery import SecretReader
8
+
9
+ with SecretReader("development") as reader, reader.get("database-password") as secret:
10
+ connect(password=secret.value.expose_text())
11
+ ```
12
+
13
+ The package only reads. The vault is unlocked the way the `sourceorrery`
14
+ CLI unlocks it: OS credential store first, then `SOURCEORRERY_PASSPHRASE`,
15
+ then `SOURCEORRERY_PASSPHRASE_FILE`. Every failure is a typed exception
16
+ with a stable `code` and a `hint` that says what to do.
17
+
18
+ Documentation: <https://sourceorrery.ai/sdks/python/>. Source:
19
+ `bindings/python` in the repository.
20
+
21
+ ## Building from source
22
+
23
+ ```bash
24
+ pip install maturin
25
+ cd bindings/python
26
+ maturin develop --release # into the active virtualenv
27
+ ```
28
+
29
+ Tests read the vault created by `scripts/ci/fixture-vault.sh`:
30
+
31
+ ```bash
32
+ eval "$(bash ../../scripts/ci/fixture-vault.sh)"
33
+ python -m pytest
34
+ ```
@@ -0,0 +1,8 @@
1
+ /target/
2
+ /.venv/
3
+ /dist/
4
+ *.so
5
+ *.pyd
6
+ __pycache__/
7
+ *.egg-info/
8
+ .pytest_cache/