vaultconfig 0.2.0__tar.gz → 0.3.0__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 (132) hide show
  1. vaultconfig-0.3.0/.codecrate.toml +14 -0
  2. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/.github/workflows/pre-commit.yml +2 -0
  3. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/.github/workflows/tests.yml +1 -1
  4. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/.gitignore +2 -0
  5. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/.pre-commit-config.yaml +19 -18
  6. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/.ruff.toml +1 -1
  7. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/LICENSE +1 -1
  8. vaultconfig-0.3.0/MANIFEST.in +7 -0
  9. vaultconfig-0.3.0/PKG-INFO +160 -0
  10. vaultconfig-0.3.0/README.md +121 -0
  11. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/docs/Makefile +2 -2
  12. vaultconfig-0.3.0/docs/api.md +76 -0
  13. vaultconfig-0.3.0/docs/architecture.md +195 -0
  14. vaultconfig-0.3.0/docs/changelog.md +37 -0
  15. vaultconfig-0.3.0/docs/cli.md +113 -0
  16. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/docs/conf.py +7 -1
  17. vaultconfig-0.3.0/docs/examples.md +75 -0
  18. vaultconfig-0.3.0/docs/index.md +53 -0
  19. vaultconfig-0.3.0/docs/installation.md +57 -0
  20. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/docs/make.bat +2 -1
  21. vaultconfig-0.3.0/docs/make.py +61 -0
  22. vaultconfig-0.3.0/docs/quickstart.md +96 -0
  23. vaultconfig-0.3.0/docs/requirements.txt +2 -0
  24. vaultconfig-0.3.0/docs/secrets.md +143 -0
  25. vaultconfig-0.3.0/docs/security.md +86 -0
  26. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/ini_config/example.py +5 -8
  27. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/toml_config/example_advanced.py +0 -6
  28. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/pyproject.toml +20 -4
  29. vaultconfig-0.3.0/requirements-test.txt +2 -0
  30. vaultconfig-0.3.0/tests/test_cli.py +1311 -0
  31. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/tests/test_config.py +373 -3
  32. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/tests/test_crypt.py +80 -5
  33. vaultconfig-0.3.0/tests/test_env_export.py +226 -0
  34. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/tests/test_formats.py +40 -0
  35. vaultconfig-0.3.0/tests/test_io.py +210 -0
  36. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/tests/test_obscure.py +35 -0
  37. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/tests/test_schema.py +130 -0
  38. vaultconfig-0.3.0/tests/test_secrets_envelope.py +208 -0
  39. vaultconfig-0.3.0/tests/test_secrets_file.py +217 -0
  40. vaultconfig-0.3.0/tests/test_secrets_keyring.py +163 -0
  41. vaultconfig-0.3.0/vaultconfig/__init__.py +72 -0
  42. vaultconfig-0.3.0/vaultconfig/_version.py +24 -0
  43. vaultconfig-0.3.0/vaultconfig/cli.py +2123 -0
  44. vaultconfig-0.3.0/vaultconfig/config.py +634 -0
  45. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/vaultconfig/crypt.py +32 -11
  46. vaultconfig-0.3.0/vaultconfig/env_export.py +190 -0
  47. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/vaultconfig/exceptions.py +0 -16
  48. vaultconfig-0.3.0/vaultconfig/formats/__init__.py +54 -0
  49. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/vaultconfig/formats/base.py +4 -5
  50. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/vaultconfig/formats/yaml_format.py +6 -2
  51. vaultconfig-0.3.0/vaultconfig/io.py +116 -0
  52. vaultconfig-0.3.0/vaultconfig/py.typed +0 -0
  53. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/vaultconfig/schema.py +62 -18
  54. vaultconfig-0.3.0/vaultconfig/secrets/__init__.py +27 -0
  55. vaultconfig-0.3.0/vaultconfig/secrets/api.py +12 -0
  56. vaultconfig-0.3.0/vaultconfig/secrets/crypto.py +85 -0
  57. vaultconfig-0.3.0/vaultconfig/secrets/encrypted_file.py +155 -0
  58. vaultconfig-0.3.0/vaultconfig/secrets/envelope.py +227 -0
  59. vaultconfig-0.3.0/vaultconfig/secrets/errors.py +30 -0
  60. vaultconfig-0.3.0/vaultconfig/secrets/fileio.py +258 -0
  61. vaultconfig-0.3.0/vaultconfig/secrets/keyring_store.py +123 -0
  62. vaultconfig-0.3.0/vaultconfig.egg-info/PKG-INFO +160 -0
  63. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/vaultconfig.egg-info/SOURCES.txt +31 -9
  64. vaultconfig-0.3.0/vaultconfig.egg-info/requires.txt +34 -0
  65. vaultconfig-0.3.0/vaultconfig.egg-info/scm_file_list.json +141 -0
  66. vaultconfig-0.3.0/vaultconfig.egg-info/scm_version.json +8 -0
  67. vaultconfig-0.2.0/PKG-INFO +0 -537
  68. vaultconfig-0.2.0/README.md +0 -492
  69. vaultconfig-0.2.0/docs/api.rst +0 -389
  70. vaultconfig-0.2.0/docs/cli.rst +0 -518
  71. vaultconfig-0.2.0/docs/examples.rst +0 -803
  72. vaultconfig-0.2.0/docs/index.rst +0 -75
  73. vaultconfig-0.2.0/docs/installation.rst +0 -193
  74. vaultconfig-0.2.0/docs/make.py +0 -83
  75. vaultconfig-0.2.0/docs/quickstart.rst +0 -383
  76. vaultconfig-0.2.0/docs/requirements.txt +0 -3
  77. vaultconfig-0.2.0/docs/security.rst +0 -504
  78. vaultconfig-0.2.0/examples/_update_examples.sh +0 -11
  79. vaultconfig-0.2.0/requirements-test.txt +0 -11
  80. vaultconfig-0.2.0/tests/test_cli.py +0 -342
  81. vaultconfig-0.2.0/vaultconfig/__init__.py +0 -60
  82. vaultconfig-0.2.0/vaultconfig/_version.py +0 -34
  83. vaultconfig-0.2.0/vaultconfig/cli.py +0 -400
  84. vaultconfig-0.2.0/vaultconfig/config.py +0 -496
  85. vaultconfig-0.2.0/vaultconfig/formats/__init__.py +0 -10
  86. vaultconfig-0.2.0/vaultconfig.egg-info/PKG-INFO +0 -537
  87. vaultconfig-0.2.0/vaultconfig.egg-info/requires.txt +0 -17
  88. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/.coveragerc +0 -0
  89. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/.github/pytest.ini +0 -0
  90. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/.github/workflows/codecov.yml +0 -0
  91. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/.github/workflows/python-publish.yml +0 -0
  92. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/.prettierrc.yml +0 -0
  93. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/.readthedocs.yaml +0 -0
  94. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/README.md +0 -0
  95. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/custom_cipher_key_example.py +0 -0
  96. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/ini_config/README.md +0 -0
  97. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/ini_config/environments.ini +0 -0
  98. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/ini_config/example_default_section.py +0 -0
  99. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/ini_config/hosts_config.ini +0 -0
  100. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/ini_config/invalid_database.ini +0 -0
  101. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/ini_config/obscured_database.ini +0 -0
  102. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/ini_config/valid_database.ini +0 -0
  103. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/toml_config/README.md +0 -0
  104. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/toml_config/app_config.toml +0 -0
  105. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/toml_config/environments.toml +0 -0
  106. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/toml_config/example.py +0 -0
  107. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/toml_config/invalid_database.toml +0 -0
  108. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/toml_config/nested_config.toml +0 -0
  109. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/toml_config/obscured_database.toml +0 -0
  110. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/toml_config/types_demo.toml +0 -0
  111. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/toml_config/valid_database.toml +0 -0
  112. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/yaml_config/README.md +0 -0
  113. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/yaml_config/app_config.yaml +0 -0
  114. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/yaml_config/environments.yaml +0 -0
  115. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/yaml_config/example.py +0 -0
  116. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/yaml_config/example_advanced.py +0 -0
  117. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/yaml_config/invalid_database.yaml +0 -0
  118. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/yaml_config/nested_config.yaml +0 -0
  119. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/yaml_config/obscured_database.yaml +0 -0
  120. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/yaml_config/types_demo.yaml +0 -0
  121. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/examples/yaml_config/valid_database.yaml +0 -0
  122. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/setup.cfg +0 -0
  123. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/setup.py +0 -0
  124. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/tests/__init__.py +0 -0
  125. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/tests/conftest.py +0 -0
  126. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/tests/test_obscure_custom_keys.py +0 -0
  127. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/vaultconfig/formats/ini_format.py +0 -0
  128. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/vaultconfig/formats/toml_format.py +0 -0
  129. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/vaultconfig/obscure.py +0 -0
  130. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/vaultconfig.egg-info/dependency_links.txt +0 -0
  131. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/vaultconfig.egg-info/entry_points.txt +0 -0
  132. {vaultconfig-0.2.0 → vaultconfig-0.3.0}/vaultconfig.egg-info/top_level.txt +0 -0
@@ -0,0 +1,14 @@
1
+ [codecrate]
2
+ output = "context_vaultconfig.md"
3
+ keep_docstrings = true
4
+ dedupe = true
5
+ respect_gitignore = true
6
+ # exclude = ["*/.venv/*", "integration_tests", "examples", "docs"]
7
+ gitignore_allow = ["vaultconfig/_version.py"]
8
+ exclude = ["*/.venv/*", "integration_tests", "todo.md"]
9
+ include = ["**/*.py", "**/*.toml", "**/*.rst", "**/*.md", "**/*.typed", "**/*.js", "**/*.css", "**/*.html"]
10
+ split_max_chars = 0
11
+ manifest = false
12
+ layout = "full"
13
+ profile = "portable-agent"
14
+ emit_standalone_unpacker = true
@@ -10,4 +10,6 @@ jobs:
10
10
  steps:
11
11
  - uses: actions/checkout@v3
12
12
  - uses: actions/setup-python@v3
13
+ - name: Install Ruff
14
+ run: python -m pip install "ruff>=0.1.0"
13
15
  - uses: pre-commit/action@v3.0.1
@@ -6,7 +6,7 @@ jobs:
6
6
  strategy:
7
7
  matrix:
8
8
  os: [ubuntu-latest, windows-latest, macos-latest]
9
- python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
9
+ python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
10
10
  steps:
11
11
  - uses: actions/checkout@master
12
12
  - name: Setup Python
@@ -206,3 +206,5 @@ marimo/_static/
206
206
  marimo/_lsp/
207
207
  __marimo__/
208
208
  vaultconfig/_version.py
209
+ context_vaultconfig*
210
+ todo.md
@@ -12,21 +12,32 @@ exclude: |
12
12
  # Don't bother non-technical authors with formatting issues in docs
13
13
  readme/.*\.(rst|md)$|
14
14
  # Ignore build and dist directories in addons
15
- /build/|/dist/|/dev/|/notebooks/
15
+ /build/|/dist/|/dev/|/notnebooks/
16
16
  # You don't usually want a bot to modify your legal texts
17
17
  (LICENSE.*|COPYING.*)|
18
18
  default_language_version:
19
19
  python: python3
20
- node: "16.17.0"
21
20
  repos:
22
- - repo: https://github.com/astral-sh/ruff-pre-commit
23
- rev: v0.6.8
21
+ - repo: local
24
22
  hooks:
25
- - id: ruff
26
- args: [--fix, --exit-non-zero-on-fix, --config=.ruff.toml]
23
+ - id: ruff-check
24
+ name: ruff check
25
+ entry:
26
+ ruff check --fix --exit-non-zero-on-fix --config=.ruff.toml --force-exclude
27
+ language: system
28
+ types_or: [python, pyi]
27
29
  - id: ruff-format
30
+ name: ruff format
31
+ entry: ruff format --force-exclude
32
+ language: system
33
+ types_or: [python, pyi]
34
+ - repo: https://github.com/asottile/pyupgrade
35
+ rev: v3.21.2
36
+ hooks:
37
+ - id: pyupgrade
38
+ args: [--py310-plus]
28
39
  - repo: https://github.com/pre-commit/pre-commit-hooks
29
- rev: v4.6.0
40
+ rev: v6.0.0
30
41
  hooks:
31
42
  - id: check-toml
32
43
  - id: check-yaml
@@ -37,8 +48,6 @@ repos:
37
48
  - id: mixed-line-ending
38
49
  args: ["--fix=lf"]
39
50
  - id: debug-statements
40
- - id: fix-encoding-pragma
41
- args: ["--remove"]
42
51
  - id: check-case-conflict
43
52
  - id: check-docstring-first
44
53
  - id: check-executables-have-shebangs
@@ -46,7 +55,7 @@ repos:
46
55
  # exclude files where underlines are not distinguishable from merge conflicts
47
56
  exclude: /README\.rst$|^docs/.*\.rst$
48
57
  - repo: https://github.com/pre-commit/mirrors-prettier
49
- rev: v2.7.1
58
+ rev: v4.0.0-alpha.8
50
59
  hooks:
51
60
  - id: prettier
52
61
  name: prettier (with plugin-xml)
@@ -56,11 +65,3 @@ repos:
56
65
  args:
57
66
  - --plugin=@prettier/plugin-xml
58
67
  files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
59
- - repo: https://github.com/pre-commit/mirrors-eslint
60
- rev: v8.24.0
61
- hooks:
62
- - id: eslint
63
- verbose: true
64
- args:
65
- - --color
66
- - --fix
@@ -1,5 +1,5 @@
1
1
 
2
- target-version = "py39"
2
+ target-version = "py310"
3
3
  fix = true
4
4
 
5
5
  [lint]
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 Holger
3
+ Copyright (c) 2025 Holger Nahrstaedt
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1,7 @@
1
+ prune .archledger
2
+ exclude .archledger.toml
3
+ prune .ledger
4
+ global-exclude .repairledger/*
5
+ global-exclude repairledger.toml VAULTCONFIG_V0_3_0_AGENT_HANDOFF.md plan.md plan.revision.md *:Zone.Identifier
6
+ exclude ARCHITECTURE.md
7
+ recursive-include docs *.md
@@ -0,0 +1,160 @@
1
+ Metadata-Version: 2.4
2
+ Name: vaultconfig
3
+ Version: 0.3.0
4
+ Summary: Secure configuration management library with encryption support for Python
5
+ Author-email: Holger Nahrstaedt <nahrstaedt@gmail.com>
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: click>=8.0.0
11
+ Requires-Dist: rich>=13.0.0
12
+ Requires-Dist: cryptography>=41.0.0
13
+ Requires-Dist: PyNaCl>=1.5.0
14
+ Requires-Dist: tomli>=1.2.0; python_version < "3.11"
15
+ Requires-Dist: tomli-w>=1.0.0
16
+ Requires-Dist: pydantic>=2.0.0
17
+ Provides-Extra: keyring
18
+ Requires-Dist: keyring<27,>=25; extra == "keyring"
19
+ Provides-Extra: yaml
20
+ Requires-Dist: PyYAML>=6.0; extra == "yaml"
21
+ Provides-Extra: docs
22
+ Requires-Dist: sphinx>=7.0.0; extra == "docs"
23
+ Requires-Dist: sphinx-rtd-theme>=1.3.0; extra == "docs"
24
+ Requires-Dist: sphinx-autodoc-typehints>=1.24.0; extra == "docs"
25
+ Requires-Dist: myst-parser>=2.0.0; extra == "docs"
26
+ Requires-Dist: Pillow>=9.0; extra == "docs"
27
+ Provides-Extra: dev
28
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
29
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
30
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
31
+ Requires-Dist: mypy>=1.0; extra == "dev"
32
+ Requires-Dist: pre-commit>=3.0; extra == "dev"
33
+ Requires-Dist: build>=1.0; extra == "dev"
34
+ Requires-Dist: twine>=5.0; extra == "dev"
35
+ Requires-Dist: PyYAML>=6.0; extra == "dev"
36
+ Requires-Dist: types-PyYAML>=6.0; extra == "dev"
37
+ Requires-Dist: tomli>=1.2.0; extra == "dev"
38
+ Dynamic: license-file
39
+
40
+ [![PyPI - Version](https://img.shields.io/pypi/v/vaultconfig)](https://pypi.org/project/vaultconfig/)
41
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/vaultconfig)
42
+ [![codecov](https://codecov.io/gh/holgern/vaultconfig/graph/badge.svg?token=iCHXwbjAXG)](https://codecov.io/gh/holgern/vaultconfig)
43
+
44
+ # VaultConfig
45
+
46
+ VaultConfig manages application configuration files and provides separate APIs for
47
+ storing secrets. It supports TOML and INI directly, with optional YAML support, schema
48
+ validation, a command-line interface, and authenticated encryption for configuration
49
+ files.
50
+
51
+ ## Features
52
+
53
+ - Manage named TOML, INI, or optional YAML configurations.
54
+ - Validate configuration data with Pydantic-backed schemas.
55
+ - Explicitly obscure schema-marked values or values passed to the CLI with `--obscure`.
56
+ Obscuring is not encryption.
57
+ - Read and write configuration files protected by authenticated encryption using the V1
58
+ configuration-encryption format.
59
+ - Store opaque secrets separately with a passphrase-protected `FileVault` or an optional
60
+ OS-backed `KeyringVault`.
61
+
62
+ ## Installation
63
+
64
+ VaultConfig requires Python 3.10 or later.
65
+
66
+ ```bash
67
+ pip install vaultconfig
68
+ pip install 'vaultconfig[yaml]' # Optional YAML format support
69
+ pip install 'vaultconfig[keyring]' # Optional KeyringVault integration
70
+ ```
71
+
72
+ For development, tests, and documentation:
73
+
74
+ ```bash
75
+ pip install -e '.[dev,docs,yaml,keyring]'
76
+ ```
77
+
78
+ See [installation](docs/installation.md) for the extras and [secrets](docs/secrets.md)
79
+ for keyring requirements.
80
+
81
+ ## Configuration quick start
82
+
83
+ ```python
84
+ from pathlib import Path
85
+ from vaultconfig import ConfigManager
86
+
87
+ manager = ConfigManager(config_dir=Path("./app-config"), format="toml")
88
+ manager.add_config("database", {"host": "localhost", "port": 5432})
89
+
90
+ entry = manager.get_config("database")
91
+ if entry is not None:
92
+ print(entry.get("host"))
93
+ ```
94
+
95
+ A value is obscured only when a schema marks it sensitive or the caller explicitly
96
+ requests obscuring. Do not put credentials in an unencrypted configuration file. For the
97
+ CLI, use `vaultconfig set --obscure`; for application secrets, prefer the dedicated
98
+ secret-storage API.
99
+
100
+ ## CLI quick start
101
+
102
+ ```bash
103
+ vaultconfig init --config-dir ./app-config --format toml
104
+ vaultconfig set --config-dir ./app-config --create database host=localhost port=5432
105
+ vaultconfig get --config-dir ./app-config database host
106
+ ```
107
+
108
+ `init` creates a configuration directory. It does not enable persistent encryption. See
109
+ [CLI reference](docs/cli.md) for encryption commands, option aliases, format detection,
110
+ and environment export.
111
+
112
+ ## Dedicated secret storage
113
+
114
+ ```python
115
+ from getpass import getpass
116
+ from pathlib import Path
117
+ from vaultconfig.secrets import FileVault
118
+
119
+ vault = FileVault(Path.home() / ".local/share/myapp/credentials.vault")
120
+ # Run once when creating a new vault. This refuses to overwrite an existing file.
121
+ vault.initialize(getpass("Choose a vault passphrase: "))
122
+
123
+ with vault.open(getpass("Unlock the vault: ")) as store:
124
+ store.set_secret("service-token", "value supplied by your application")
125
+ ```
126
+
127
+ `FileVault` is included in the normal installation. `KeyringVault` requires the
128
+ `keyring` extra and an accepted, configured native OS keyring. Neither backend makes
129
+ secrets safe from code or processes that can access them while the application is
130
+ running. See [secrets](docs/secrets.md) and [security guide](docs/security.md).
131
+
132
+ ## Security boundaries
133
+
134
+ Password obscuring is reversible concealment for casual viewing, not encryption. The
135
+ default key is part of the package; a custom obscuring key does not turn this feature
136
+ into secret storage. Configuration-file encryption and the V2 `FileVault` format are
137
+ separate formats and APIs. VaultConfig does not automatically migrate values between
138
+ them.
139
+
140
+ See [security guide](docs/security.md) for the threat model, password handling, file
141
+ permissions, and recovery limits.
142
+
143
+ ## Documentation
144
+
145
+ - [quick start](docs/quickstart.md)
146
+ - [CLI reference](docs/cli.md)
147
+ - [API reference](docs/api.md)
148
+ - [secrets](docs/secrets.md)
149
+ - [examples](docs/examples.md)
150
+
151
+ ## Development
152
+
153
+ ```bash
154
+ pip install -e '.[dev,docs,yaml,keyring]'
155
+ pytest
156
+ ruff check .
157
+ ruff format --check .
158
+ ```
159
+
160
+ The project is licensed under the MIT License. See [LICENSE](LICENSE).
@@ -0,0 +1,121 @@
1
+ [![PyPI - Version](https://img.shields.io/pypi/v/vaultconfig)](https://pypi.org/project/vaultconfig/)
2
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/vaultconfig)
3
+ [![codecov](https://codecov.io/gh/holgern/vaultconfig/graph/badge.svg?token=iCHXwbjAXG)](https://codecov.io/gh/holgern/vaultconfig)
4
+
5
+ # VaultConfig
6
+
7
+ VaultConfig manages application configuration files and provides separate APIs for
8
+ storing secrets. It supports TOML and INI directly, with optional YAML support, schema
9
+ validation, a command-line interface, and authenticated encryption for configuration
10
+ files.
11
+
12
+ ## Features
13
+
14
+ - Manage named TOML, INI, or optional YAML configurations.
15
+ - Validate configuration data with Pydantic-backed schemas.
16
+ - Explicitly obscure schema-marked values or values passed to the CLI with `--obscure`.
17
+ Obscuring is not encryption.
18
+ - Read and write configuration files protected by authenticated encryption using the V1
19
+ configuration-encryption format.
20
+ - Store opaque secrets separately with a passphrase-protected `FileVault` or an optional
21
+ OS-backed `KeyringVault`.
22
+
23
+ ## Installation
24
+
25
+ VaultConfig requires Python 3.10 or later.
26
+
27
+ ```bash
28
+ pip install vaultconfig
29
+ pip install 'vaultconfig[yaml]' # Optional YAML format support
30
+ pip install 'vaultconfig[keyring]' # Optional KeyringVault integration
31
+ ```
32
+
33
+ For development, tests, and documentation:
34
+
35
+ ```bash
36
+ pip install -e '.[dev,docs,yaml,keyring]'
37
+ ```
38
+
39
+ See [installation](docs/installation.md) for the extras and [secrets](docs/secrets.md)
40
+ for keyring requirements.
41
+
42
+ ## Configuration quick start
43
+
44
+ ```python
45
+ from pathlib import Path
46
+ from vaultconfig import ConfigManager
47
+
48
+ manager = ConfigManager(config_dir=Path("./app-config"), format="toml")
49
+ manager.add_config("database", {"host": "localhost", "port": 5432})
50
+
51
+ entry = manager.get_config("database")
52
+ if entry is not None:
53
+ print(entry.get("host"))
54
+ ```
55
+
56
+ A value is obscured only when a schema marks it sensitive or the caller explicitly
57
+ requests obscuring. Do not put credentials in an unencrypted configuration file. For the
58
+ CLI, use `vaultconfig set --obscure`; for application secrets, prefer the dedicated
59
+ secret-storage API.
60
+
61
+ ## CLI quick start
62
+
63
+ ```bash
64
+ vaultconfig init --config-dir ./app-config --format toml
65
+ vaultconfig set --config-dir ./app-config --create database host=localhost port=5432
66
+ vaultconfig get --config-dir ./app-config database host
67
+ ```
68
+
69
+ `init` creates a configuration directory. It does not enable persistent encryption. See
70
+ [CLI reference](docs/cli.md) for encryption commands, option aliases, format detection,
71
+ and environment export.
72
+
73
+ ## Dedicated secret storage
74
+
75
+ ```python
76
+ from getpass import getpass
77
+ from pathlib import Path
78
+ from vaultconfig.secrets import FileVault
79
+
80
+ vault = FileVault(Path.home() / ".local/share/myapp/credentials.vault")
81
+ # Run once when creating a new vault. This refuses to overwrite an existing file.
82
+ vault.initialize(getpass("Choose a vault passphrase: "))
83
+
84
+ with vault.open(getpass("Unlock the vault: ")) as store:
85
+ store.set_secret("service-token", "value supplied by your application")
86
+ ```
87
+
88
+ `FileVault` is included in the normal installation. `KeyringVault` requires the
89
+ `keyring` extra and an accepted, configured native OS keyring. Neither backend makes
90
+ secrets safe from code or processes that can access them while the application is
91
+ running. See [secrets](docs/secrets.md) and [security guide](docs/security.md).
92
+
93
+ ## Security boundaries
94
+
95
+ Password obscuring is reversible concealment for casual viewing, not encryption. The
96
+ default key is part of the package; a custom obscuring key does not turn this feature
97
+ into secret storage. Configuration-file encryption and the V2 `FileVault` format are
98
+ separate formats and APIs. VaultConfig does not automatically migrate values between
99
+ them.
100
+
101
+ See [security guide](docs/security.md) for the threat model, password handling, file
102
+ permissions, and recovery limits.
103
+
104
+ ## Documentation
105
+
106
+ - [quick start](docs/quickstart.md)
107
+ - [CLI reference](docs/cli.md)
108
+ - [API reference](docs/api.md)
109
+ - [secrets](docs/secrets.md)
110
+ - [examples](docs/examples.md)
111
+
112
+ ## Development
113
+
114
+ ```bash
115
+ pip install -e '.[dev,docs,yaml,keyring]'
116
+ pytest
117
+ ruff check .
118
+ ruff format --check .
119
+ ```
120
+
121
+ The project is licensed under the MIT License. See [LICENSE](LICENSE).
@@ -2,10 +2,10 @@
2
2
  #
3
3
 
4
4
  # You can set these variables from the command line.
5
- SPHINXOPTS =
5
+ SPHINXOPTS = -n -W --keep-going
6
6
  SPHINXBUILD = sphinx-build
7
7
  PAPER =
8
- BUILDDIR = build
8
+ BUILDDIR = _build
9
9
 
10
10
  # Internal variables.
11
11
  PAPEROPT_a4 = -D latex_paper_size=a4
@@ -0,0 +1,76 @@
1
+ # API reference
2
+
3
+ ## Configuration API
4
+
5
+ ```{autoclass} vaultconfig.ConfigManager
6
+ :members:
7
+ :show-inheritance:
8
+ ```
9
+
10
+ ```{autoclass} vaultconfig.ConfigEntry
11
+ :members:
12
+ :show-inheritance:
13
+ ```
14
+
15
+ ## Schema API
16
+
17
+ ```{autoclass} vaultconfig.ConfigSchema
18
+ :members:
19
+ :show-inheritance:
20
+ ```
21
+
22
+ ```{autoclass} vaultconfig.FieldDef
23
+ :members:
24
+ :show-inheritance:
25
+ ```
26
+
27
+ ```{autofunction} vaultconfig.create_simple_schema
28
+
29
+ ```
30
+
31
+ ## Secret-storage API
32
+
33
+ The public secret-storage classes and protocol are documented in {doc}`secrets`.
34
+
35
+ ```{autoclass} vaultconfig.secrets.FileVault
36
+ :members:
37
+ :show-inheritance:
38
+ ```
39
+
40
+ ```{autoclass} vaultconfig.secrets.KeyringVault
41
+ :members:
42
+ :show-inheritance:
43
+ ```
44
+
45
+ ```{autoclass} vaultconfig.secrets.SecretStore
46
+ :members:
47
+ :show-inheritance:
48
+ ```
49
+
50
+ ## Encryption and obscuring
51
+
52
+ ```{automodule} vaultconfig.crypt
53
+ :members:
54
+ :undoc-members:
55
+ ```
56
+
57
+ ```{automodule} vaultconfig.obscure
58
+ :members:
59
+ :undoc-members:
60
+ ```
61
+
62
+ ## Migration from 0.2.x
63
+
64
+ The 0.3 line adds the separate `vaultconfig.secrets` API. Existing V1 configuration
65
+ encryption remains a distinct format; VaultConfig does not convert V1 files to V2 secret
66
+ vaults automatically.
67
+
68
+ `vaultconfig init` creates a directory. Its `--format` option applies to that invocation
69
+ and is not saved as a directory setting. If automation previously passed
70
+ `init --encrypt`, remove that option and choose an explicit configuration-encryption
71
+ operation such as `create --encrypted` or `encrypt set`.
72
+
73
+ The `ConfigManager` API remains available. Review the command-specific help when
74
+ updating scripts because directory option aliases differ by command. The `run` command
75
+ supports both `--uppercase` and `--no-uppercase`; the default environment-variable
76
+ prefix is empty.