localsecretvault 0.5.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.
- localsecretvault-0.5.0/PKG-INFO +389 -0
- localsecretvault-0.5.0/README.md +372 -0
- localsecretvault-0.5.0/local_vault/__init__.py +11 -0
- localsecretvault-0.5.0/local_vault/__main__.py +29 -0
- localsecretvault-0.5.0/local_vault/api.py +160 -0
- localsecretvault-0.5.0/local_vault/cli.py +161 -0
- localsecretvault-0.5.0/local_vault/client.py +84 -0
- localsecretvault-0.5.0/local_vault/commands.py +808 -0
- localsecretvault-0.5.0/local_vault/constants.py +12 -0
- localsecretvault-0.5.0/local_vault/crypto.py +133 -0
- localsecretvault-0.5.0/local_vault/env_parser.py +114 -0
- localsecretvault-0.5.0/local_vault/errors.py +2 -0
- localsecretvault-0.5.0/local_vault/server.py +313 -0
- localsecretvault-0.5.0/local_vault/storage.py +26 -0
- localsecretvault-0.5.0/local_vault/time_utils.py +16 -0
- localsecretvault-0.5.0/localsecretvault/__init__.py +11 -0
- localsecretvault-0.5.0/localsecretvault.egg-info/PKG-INFO +389 -0
- localsecretvault-0.5.0/localsecretvault.egg-info/SOURCES.txt +22 -0
- localsecretvault-0.5.0/localsecretvault.egg-info/dependency_links.txt +1 -0
- localsecretvault-0.5.0/localsecretvault.egg-info/entry_points.txt +3 -0
- localsecretvault-0.5.0/localsecretvault.egg-info/requires.txt +1 -0
- localsecretvault-0.5.0/localsecretvault.egg-info/top_level.txt +2 -0
- localsecretvault-0.5.0/pyproject.toml +43 -0
- localsecretvault-0.5.0/setup.cfg +4 -0
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: localsecretvault
|
|
3
|
+
Version: 0.5.0
|
|
4
|
+
Summary: Local encrypted secrets vault for development workflows.
|
|
5
|
+
Author: Aria Sharifian
|
|
6
|
+
Keywords: secrets,vault,env,environment,local-development
|
|
7
|
+
Classifier: Development Status :: 3 - Alpha
|
|
8
|
+
Classifier: Environment :: Console
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Topic :: Security
|
|
13
|
+
Classifier: Topic :: Software Development
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
Requires-Dist: cryptography>=42
|
|
17
|
+
|
|
18
|
+
# Local Secret Vault
|
|
19
|
+
|
|
20
|
+
Local Secret Vault is a small local encrypted secrets vault for development workflows.
|
|
21
|
+
|
|
22
|
+
It lets you store secrets locally, unlock them for a limited time, and run commands with those secrets injected as environment variables.
|
|
23
|
+
|
|
24
|
+
## Current MVP features
|
|
25
|
+
|
|
26
|
+
- Encrypted local vault file
|
|
27
|
+
- Master password protection
|
|
28
|
+
- Timed unlock
|
|
29
|
+
- Local in-memory server while unlocked
|
|
30
|
+
- Store, list, rename, and delete secrets
|
|
31
|
+
- Import `.env` style content
|
|
32
|
+
- Run commands with secrets injected into the environment
|
|
33
|
+
- Export secrets to clipboard as `.env` text
|
|
34
|
+
- Python helper API for loading secrets into Python apps
|
|
35
|
+
- Windows executable build
|
|
36
|
+
|
|
37
|
+
## Recommended Windows setup
|
|
38
|
+
|
|
39
|
+
Download the release archive and extract it.
|
|
40
|
+
|
|
41
|
+
After extracting, copy `vault.exe` to a stable folder.
|
|
42
|
+
|
|
43
|
+
Recommended folder:
|
|
44
|
+
|
|
45
|
+
```powershell
|
|
46
|
+
mkdir $HOME\local-secret-vault
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
```powershell
|
|
50
|
+
copy .\vault.exe $HOME\local-secret-vault\vault.exe
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Then use the app from there:
|
|
54
|
+
|
|
55
|
+
```powershell
|
|
56
|
+
cd $HOME\local-secret-vault
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
```powershell
|
|
60
|
+
.\vault.exe --help
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Do not keep running `vault.exe` directly from Downloads. The app starts a temporary local background process while unlocked, so using a stable folder gives a cleaner Windows experience.
|
|
64
|
+
|
|
65
|
+
## Initialize a vault
|
|
66
|
+
|
|
67
|
+
```powershell
|
|
68
|
+
.\vault.exe init
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
You will be asked to create a master password.
|
|
72
|
+
|
|
73
|
+
Important:
|
|
74
|
+
|
|
75
|
+
If you forget the master password, your secrets cannot be recovered.
|
|
76
|
+
|
|
77
|
+
## Unlock the vault
|
|
78
|
+
|
|
79
|
+
```powershell
|
|
80
|
+
.\vault.exe unlock --hours 8
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The vault stays unlocked for the selected number of hours.
|
|
84
|
+
|
|
85
|
+
While unlocked, secrets are kept in memory by a local background process.
|
|
86
|
+
|
|
87
|
+
## Check status
|
|
88
|
+
|
|
89
|
+
```powershell
|
|
90
|
+
.\vault.exe status
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Add a secret
|
|
94
|
+
|
|
95
|
+
```powershell
|
|
96
|
+
.\vault.exe set API_KEY_DEV
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The secret value is hidden while typing.
|
|
100
|
+
|
|
101
|
+
## List secret names
|
|
102
|
+
|
|
103
|
+
```powershell
|
|
104
|
+
.\vault.exe list
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Only secret names are printed. Secret values are not printed.
|
|
108
|
+
|
|
109
|
+
## Import `.env` content
|
|
110
|
+
|
|
111
|
+
```powershell
|
|
112
|
+
.\vault.exe import-env --suffix DEV
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Paste `.env` style content:
|
|
116
|
+
|
|
117
|
+
```text
|
|
118
|
+
API_KEY=example-key
|
|
119
|
+
DATABASE_URL=postgres://example
|
|
120
|
+
REDIS_URL=redis://localhost:6379
|
|
121
|
+
END
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
The final `END` line tells the vault you are done pasting.
|
|
125
|
+
|
|
126
|
+
With `--suffix DEV`, these become:
|
|
127
|
+
|
|
128
|
+
```text
|
|
129
|
+
API_KEY_DEV
|
|
130
|
+
DATABASE_URL_DEV
|
|
131
|
+
REDIS_URL_DEV
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Import without saving
|
|
135
|
+
|
|
136
|
+
Use dry-run to preview names before storing anything:
|
|
137
|
+
|
|
138
|
+
```powershell
|
|
139
|
+
.\vault.exe import-env --suffix DEV --dry-run
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Overwrite existing secrets during import
|
|
143
|
+
|
|
144
|
+
```powershell
|
|
145
|
+
.\vault.exe import-env --suffix DEV --overwrite
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Run an app with secrets loaded
|
|
149
|
+
|
|
150
|
+
```powershell
|
|
151
|
+
.\vault.exe run --suffix DEV -- python app.py
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
This loads matching secrets into the child process environment.
|
|
155
|
+
|
|
156
|
+
Example mapping:
|
|
157
|
+
|
|
158
|
+
```text
|
|
159
|
+
API_KEY_DEV -> API_KEY
|
|
160
|
+
DATABASE_URL_DEV -> DATABASE_URL
|
|
161
|
+
REDIS_URL_DEV -> REDIS_URL
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Inside Python:
|
|
165
|
+
|
|
166
|
+
```python
|
|
167
|
+
import os
|
|
168
|
+
|
|
169
|
+
api_key = os.environ["API_KEY"]
|
|
170
|
+
database_url = os.environ["DATABASE_URL"]
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Secret values are not printed by the vault.
|
|
174
|
+
|
|
175
|
+
## Use from Python
|
|
176
|
+
|
|
177
|
+
You can also use Local Secret Vault from another Python project.
|
|
178
|
+
|
|
179
|
+
Install the package:
|
|
180
|
+
|
|
181
|
+
```powershell
|
|
182
|
+
pip install localsecretvault
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Then unlock the vault first:
|
|
186
|
+
|
|
187
|
+
```powershell
|
|
188
|
+
vault unlock --hours 8
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
In your Python app:
|
|
192
|
+
|
|
193
|
+
```python
|
|
194
|
+
from localsecretvault import load_secrets
|
|
195
|
+
|
|
196
|
+
load_secrets(suffix="DEV")
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Example mapping:
|
|
200
|
+
|
|
201
|
+
```text
|
|
202
|
+
API_KEY_DEV -> os.environ["API_KEY"]
|
|
203
|
+
DATABASE_URL_DEV -> os.environ["DATABASE_URL"]
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
You can also read one secret directly:
|
|
207
|
+
|
|
208
|
+
```python
|
|
209
|
+
from localsecretvault import get_secret
|
|
210
|
+
|
|
211
|
+
api_key = get_secret("API_KEY_DEV")
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Or list secret names:
|
|
215
|
+
|
|
216
|
+
```python
|
|
217
|
+
from localsecretvault import list_secret_names
|
|
218
|
+
|
|
219
|
+
names = list_secret_names(suffix="DEV")
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
The vault must already be unlocked before using these helpers.
|
|
223
|
+
|
|
224
|
+
## Export secrets to clipboard
|
|
225
|
+
|
|
226
|
+
To copy all secrets to clipboard as `.env` text:
|
|
227
|
+
|
|
228
|
+
```powershell
|
|
229
|
+
.\vault.exe export
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
To copy only secrets with a suffix:
|
|
233
|
+
|
|
234
|
+
```powershell
|
|
235
|
+
.\vault.exe export --suffix DEV
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
The export command:
|
|
239
|
+
|
|
240
|
+
- requires the vault to be unlocked
|
|
241
|
+
- shows secret names only
|
|
242
|
+
- asks you to type `EXPORT`
|
|
243
|
+
- copies secret values to clipboard
|
|
244
|
+
- does not print secret values in the terminal
|
|
245
|
+
|
|
246
|
+
Example exported format:
|
|
247
|
+
|
|
248
|
+
```text
|
|
249
|
+
API_KEY_DEV=actual-secret-value
|
|
250
|
+
DATABASE_URL_DEV=actual-secret-value
|
|
251
|
+
REDIS_URL_DEV=actual-secret-value
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Save the exported content somewhere else.
|
|
255
|
+
|
|
256
|
+
## Rename a secret
|
|
257
|
+
|
|
258
|
+
```powershell
|
|
259
|
+
.\vault.exe rename OLD_NAME NEW_NAME
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
To overwrite the target name if it already exists:
|
|
263
|
+
|
|
264
|
+
```powershell
|
|
265
|
+
.\vault.exe rename OLD_NAME NEW_NAME --overwrite
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
## Delete a secret
|
|
269
|
+
|
|
270
|
+
```powershell
|
|
271
|
+
.\vault.exe delete API_KEY_DEV
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
You will be asked to confirm before deletion.
|
|
275
|
+
|
|
276
|
+
## Change master password
|
|
277
|
+
|
|
278
|
+
First lock the vault:
|
|
279
|
+
|
|
280
|
+
```powershell
|
|
281
|
+
.\vault.exe lock
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Then run:
|
|
285
|
+
|
|
286
|
+
```powershell
|
|
287
|
+
.\vault.exe change-password
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
## Lock the vault
|
|
291
|
+
|
|
292
|
+
```powershell
|
|
293
|
+
.\vault.exe lock
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
This stops the local background process and removes the temporary server state.
|
|
297
|
+
|
|
298
|
+
## Daily usage
|
|
299
|
+
|
|
300
|
+
Typical daily flow:
|
|
301
|
+
|
|
302
|
+
```powershell
|
|
303
|
+
cd $HOME\local-secret-vault
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
```powershell
|
|
307
|
+
.\vault.exe unlock --hours 8
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
```powershell
|
|
311
|
+
.\vault.exe run --suffix DEV -- python app.py
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
When finished:
|
|
315
|
+
|
|
316
|
+
```powershell
|
|
317
|
+
.\vault.exe lock
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
## Where data is stored
|
|
321
|
+
|
|
322
|
+
By default, the encrypted vault is stored under:
|
|
323
|
+
|
|
324
|
+
```text
|
|
325
|
+
C:\Users\<YourUser>\.local-secrets
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
The main encrypted vault file is:
|
|
329
|
+
|
|
330
|
+
```text
|
|
331
|
+
C:\Users\<YourUser>\.local-secrets\vault.json
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
The vault file is encrypted. Do not edit it manually.
|
|
335
|
+
|
|
336
|
+
## Environment variable
|
|
337
|
+
|
|
338
|
+
You can override the vault storage location with:
|
|
339
|
+
|
|
340
|
+
```powershell
|
|
341
|
+
$env:LOCAL_SECRET_VAULT_HOME = "C:\path\to\vault-folder"
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
Most users do not need this.
|
|
345
|
+
|
|
346
|
+
## Security notes
|
|
347
|
+
|
|
348
|
+
- Secrets are encrypted on disk.
|
|
349
|
+
- Secrets are decrypted only while the vault is unlocked.
|
|
350
|
+
- While unlocked, secrets are available to the local vault process.
|
|
351
|
+
- `vault run` passes selected secrets only to the command you run.
|
|
352
|
+
- Python helpers load selected secrets into the current Python process.
|
|
353
|
+
- `vault export` copies decrypted secrets to the clipboard.
|
|
354
|
+
- Clipboard content may be visible to other apps while it remains in the clipboard.
|
|
355
|
+
- Lock the vault when finished.
|
|
356
|
+
|
|
357
|
+
## Build from source
|
|
358
|
+
|
|
359
|
+
Install dependencies in a virtual environment, then run:
|
|
360
|
+
|
|
361
|
+
```powershell
|
|
362
|
+
.\build.ps1
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
The built executable will be created at:
|
|
366
|
+
|
|
367
|
+
```text
|
|
368
|
+
dist\vault.exe
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
## Build Python package from source
|
|
372
|
+
|
|
373
|
+
Install build tools:
|
|
374
|
+
|
|
375
|
+
```powershell
|
|
376
|
+
python -m pip install build
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
Build the wheel and source distribution:
|
|
380
|
+
|
|
381
|
+
```powershell
|
|
382
|
+
python -m build
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
The Python package files will be created in:
|
|
386
|
+
|
|
387
|
+
```text
|
|
388
|
+
dist
|
|
389
|
+
```
|