Sops module
How to use
- Create gpg key on the orchestrator
inmanta@96abdaa7233f:~$ gpg --full-generate-key
-
Generate key on the dev machine (same as step above)
-
Import orchestrator key in dev keyring
# On the orchestrator
inmanta@96abdaa7233f:~$ gpg --armor --export email > orchestrator.gpg
# On the dev machine
guillaume@framework:~$ gpg --import orchestrator.gpg
- Create keyring file with sops providing fingerprint of dev key and orchestrator key. Edit it using sops binary.
guillaume@framework:/tmp/sops-test$ echo "{}" > test.yml
guillaume@framework:/tmp/sops-test$ sops --pgp 49CAF9DCDAC1643FCBDFCAB93BF8D3BC3B08C360,6F405B4881FF1DE18A4696641BCDCFE5D361E275 -e test.yml > test.encrypted.yml
guillaume@framework:/tmp/sops-test$ sops edit test.encrypted.yml
- Reference existing value in sops file in the model.
import mitogen
import files
import files::host
import sops
import std
host = std::Host(
name="localhost",
os=std::linux,
via=mitogen::Local(),
)
files::TextFile(
host=host,
path='/example/folder/a.secret',
owner='guillaume',
group='guillaume',
purged=false,
# The content of the file should be the password of user "a"
content=sops::create_decrypted_value_reference(
# The password is located in the decrypted vault file
sops::create_decrypted_file_reference(
# The vault should be decrypted with sops, which is
# installed by this reference.
sops::create_sops_binary_reference(),
# The encrypted content of the file can be extracted
# using this reference
files::create_text_file_content_reference(
"file:///example/folder/test.yml",
),
'yml',
),
"users[name=a].password",
),
)
- (Alternatively) Reference value in sops file, create it if it doesn't exist.
import mitogen
import files
import files::host
import sops
import std
host = std::Host(
name="localhost",
os=std::linux,
via=mitogen::Local(),
)
files::TextFile(
host=host,
path='/example/folder/a.secret',
owner='guillaume',
group='guillaume',
purged=false,
# The content of the file should be the password of user "a", if no password
# for user a has been defined, create one with default value "b"
content=sops::create_value_in_vault(
# The vault should be decrypted with sops, which is
# installed by this reference.
sops::create_sops_binary_reference(),
# The vault is available at this path
"file:///example/folder/test.yml",
# This is the location of the password within the vault
"users[name=a].password",
default="b",
),
)
Running tests
- Set up a new virtual environment using uv and install the dependencies.
uv venv -p 3.12
make install
- Run tests
uv run pytest tests
Metadata
Release files for inmanta-module-sops 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| inmanta_module_sops-0.3.2.tar.gz | 15.4 kB | With provenance | Details for inmanta_module_sops-0.3.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| inmanta_module_sops-0.3.2-py3-none-any.whl | Python 3 | none | any | Details for inmanta_module_sops-0.3.2-py3-none-any.whl |
Total release size: 30.5 kB
Release files / inmanta_module_sops-0.3.2.tar.gz
| Download URL | inmanta_module_sops-0.3.2.tar.gz |
|---|---|
| Size | 15.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
800c9f0d243273525c8ac780e3ac6654545453f6d4a0f83644cb3e2bc70a0c0f
|
|
BLAKE2b-256 checksum How to use checksums |
e82c131ba762a5c9f52da7ebba70b2c67c28c88e8b3c6fb5857a38ba177d0b2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 29, 2026.
Transparency logRelease files / inmanta_module_sops-0.3.2-py3-none-any.whl
| Download URL | inmanta_module_sops-0.3.2-py3-none-any.whl |
|---|---|
| Size | 15.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1502d68e7de7890fae82f779962c01880d86ae4b895a840483783f28b6e7fbb3
|
|
BLAKE2b-256 checksum How to use checksums |
363a782533a479d45c4945f50382beecfa3656a723e8d212d9fdfb89b5de5d13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 29, 2026.
Transparency logSecurity for inmanta-module-sops 0.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for inmanta_module_sops-0.3.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.