Skip to content

Implement a file-based secrets manager#49

Merged
mepeltier merged 8 commits intomainfrom
feature/7
Feb 17, 2026
Merged

Implement a file-based secrets manager#49
mepeltier merged 8 commits intomainfrom
feature/7

Conversation

@dbluhm
Copy link
Member

@dbluhm dbluhm commented Feb 15, 2026

Addresses #7. This is a simple secrets manager that uses a .jsonl file and expects callbacks for serializing and deserializing the keys for storing and loading SecretKey instances from that file.

This PR also creates a new directory for examples instead of having just a single example.py file. The examples are now run by CI to help prevent them from growing stale.

A few various other fixes and updates.

Add a file-based secrets manager that persists secrets to a JSONL file
with in-memory caching and auto-save on program exit via atexit. Supports
atomic writes using temp file + rename pattern.

Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Add support for JsonWebKey2020 verification method type to AuthlibKey,
allowing use of JWK-formatted keys in DID documents.

Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Export FileBasedSecretsManager and InMemorySecretsManager from the
crypto backend package for easier access.

Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Add an example demonstrating use of FileBasedSecretsManager with the
authlib crypto backend. Shows key generation, did:jwk creation, pack/unpack
round-trip, and re-loading secrets from file.

Also adds pytest collector to run example scripts as tests.

Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Rename wrapper parameter to enc_message in CryptoService methods for
clarity. Also fix typo in SecretsManager docstring.

Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Move example scripts to examples/ directory and add packaging example.
Remove root-level example.py in favor of organized examples.

Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Add step to run example scripts as tests in CI to prevent examples
from growing stale.

Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
@dbluhm dbluhm requested a review from mepeltier February 15, 2026 22:24
Copy link
Contributor

@mepeltier mepeltier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mepeltier mepeltier merged commit 8e82476 into main Feb 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments