envilder 0.1.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.
- envilder-0.1.0/.gitignore +389 -0
- envilder-0.1.0/PKG-INFO +166 -0
- envilder-0.1.0/README.md +132 -0
- envilder-0.1.0/envilder/__init__.py +29 -0
- envilder-0.1.0/envilder/application/__init__.py +7 -0
- envilder-0.1.0/envilder/application/envilder_client.py +28 -0
- envilder-0.1.0/envilder/application/map_file_parser.py +60 -0
- envilder-0.1.0/envilder/domain/__init__.py +13 -0
- envilder-0.1.0/envilder/domain/envilder_options.py +12 -0
- envilder-0.1.0/envilder/domain/map_file_config.py +12 -0
- envilder-0.1.0/envilder/domain/parsed_map_file.py +11 -0
- envilder-0.1.0/envilder/domain/ports/__init__.py +5 -0
- envilder-0.1.0/envilder/domain/ports/secret_provider.py +7 -0
- envilder-0.1.0/envilder/domain/secret_provider_type.py +6 -0
- envilder-0.1.0/envilder/infrastructure/__init__.py +15 -0
- envilder-0.1.0/envilder/infrastructure/aws/__init__.py +5 -0
- envilder-0.1.0/envilder/infrastructure/aws/aws_ssm_secret_provider.py +30 -0
- envilder-0.1.0/envilder/infrastructure/azure/__init__.py +5 -0
- envilder-0.1.0/envilder/infrastructure/azure/azure_key_vault_secret_provider.py +24 -0
- envilder-0.1.0/envilder/infrastructure/secret_provider_factory.py +96 -0
- envilder-0.1.0/envilder/py.typed +0 -0
- envilder-0.1.0/pyproject.toml +73 -0
- envilder-0.1.0/uv.lock +1149 -0
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
## Ignore Visual Studio temporary files, build results, and
|
|
2
|
+
## files generated by popular Visual Studio add-ons.
|
|
3
|
+
##
|
|
4
|
+
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
|
5
|
+
|
|
6
|
+
# User-specific files
|
|
7
|
+
*.rsuser
|
|
8
|
+
*.suo
|
|
9
|
+
*.user
|
|
10
|
+
*.userosscache
|
|
11
|
+
*.sln.docstates
|
|
12
|
+
|
|
13
|
+
#env with credentials
|
|
14
|
+
.env
|
|
15
|
+
|
|
16
|
+
# User-specific files (MonoDevelop/Xamarin Studio)
|
|
17
|
+
*.userprefs
|
|
18
|
+
|
|
19
|
+
# Mono auto generated files
|
|
20
|
+
mono_crash.*
|
|
21
|
+
|
|
22
|
+
# Build results
|
|
23
|
+
[Dd]ebug/
|
|
24
|
+
[Dd]ebugPublic/
|
|
25
|
+
[Rr]elease/
|
|
26
|
+
[Rr]eleases/
|
|
27
|
+
x64/
|
|
28
|
+
x86/
|
|
29
|
+
[Aa][Rr][Mm]/
|
|
30
|
+
[Aa][Rr][Mm]64/
|
|
31
|
+
bld/
|
|
32
|
+
[Bb]in/
|
|
33
|
+
[Oo]bj/
|
|
34
|
+
[Ll]og/
|
|
35
|
+
[Ll]ogs/
|
|
36
|
+
|
|
37
|
+
# Visual Studio 2015/2017 cache/options directory
|
|
38
|
+
.vs/
|
|
39
|
+
# Uncomment if you have tasks that create the project's static files in wwwroot
|
|
40
|
+
#wwwroot/
|
|
41
|
+
|
|
42
|
+
# Visual Studio 2017 auto generated files
|
|
43
|
+
Generated\ Files/
|
|
44
|
+
|
|
45
|
+
# MSTest test Results
|
|
46
|
+
[Tt]est[Rr]esult*/
|
|
47
|
+
[Bb]uild[Ll]og.*
|
|
48
|
+
|
|
49
|
+
# NUnit
|
|
50
|
+
*.VisualState.xml
|
|
51
|
+
TestResult.xml
|
|
52
|
+
nunit-*.xml
|
|
53
|
+
|
|
54
|
+
# Build Results of an ATL Project
|
|
55
|
+
[Dd]ebugPS/
|
|
56
|
+
[Rr]eleasePS/
|
|
57
|
+
dlldata.c
|
|
58
|
+
|
|
59
|
+
# Benchmark Results
|
|
60
|
+
BenchmarkDotNet.Artifacts/
|
|
61
|
+
|
|
62
|
+
# .NET Core
|
|
63
|
+
project.lock.json
|
|
64
|
+
project.fragment.lock.json
|
|
65
|
+
artifacts/
|
|
66
|
+
|
|
67
|
+
# StyleCop
|
|
68
|
+
StyleCopReport.xml
|
|
69
|
+
|
|
70
|
+
# Files built by Visual Studio
|
|
71
|
+
*_i.c
|
|
72
|
+
*_p.c
|
|
73
|
+
*_h.h
|
|
74
|
+
*.ilk
|
|
75
|
+
*.meta
|
|
76
|
+
*.obj
|
|
77
|
+
*.iobj
|
|
78
|
+
*.pch
|
|
79
|
+
*.pdb
|
|
80
|
+
*.ipdb
|
|
81
|
+
*.pgc
|
|
82
|
+
*.pgd
|
|
83
|
+
*.rsp
|
|
84
|
+
*.sbr
|
|
85
|
+
*.tlb
|
|
86
|
+
*.tli
|
|
87
|
+
*.tlh
|
|
88
|
+
*.tmp
|
|
89
|
+
*.tmp_proj
|
|
90
|
+
*_wpftmp.csproj
|
|
91
|
+
*.log
|
|
92
|
+
*.vspscc
|
|
93
|
+
*.vssscc
|
|
94
|
+
.builds
|
|
95
|
+
*.pidb
|
|
96
|
+
*.svclog
|
|
97
|
+
*.scc
|
|
98
|
+
|
|
99
|
+
# Chutzpah Test files
|
|
100
|
+
_Chutzpah*
|
|
101
|
+
|
|
102
|
+
# Visual C++ cache files
|
|
103
|
+
ipch/
|
|
104
|
+
*.aps
|
|
105
|
+
*.ncb
|
|
106
|
+
*.opendb
|
|
107
|
+
*.opensdf
|
|
108
|
+
*.sdf
|
|
109
|
+
*.cachefile
|
|
110
|
+
*.VC.db
|
|
111
|
+
*.VC.VC.opendb
|
|
112
|
+
|
|
113
|
+
# Visual Studio profiler
|
|
114
|
+
*.psess
|
|
115
|
+
*.vsp
|
|
116
|
+
*.vspx
|
|
117
|
+
*.sap
|
|
118
|
+
|
|
119
|
+
# Visual Studio Trace Files
|
|
120
|
+
*.e2e
|
|
121
|
+
|
|
122
|
+
# TFS 2012 Local Workspace
|
|
123
|
+
$tf/
|
|
124
|
+
|
|
125
|
+
# Guidance Automation Toolkit
|
|
126
|
+
*.gpState
|
|
127
|
+
|
|
128
|
+
# ReSharper is a .NET coding add-in
|
|
129
|
+
_ReSharper*/
|
|
130
|
+
*.[Rr]e[Ss]harper
|
|
131
|
+
*.DotSettings.user
|
|
132
|
+
|
|
133
|
+
# TeamCity is a build add-in
|
|
134
|
+
_TeamCity*
|
|
135
|
+
|
|
136
|
+
# DotCover is a Code Coverage Tool
|
|
137
|
+
*.dotCover
|
|
138
|
+
|
|
139
|
+
# AxoCover is a Code Coverage Tool
|
|
140
|
+
.axoCover/*
|
|
141
|
+
!.axoCover/settings.json
|
|
142
|
+
|
|
143
|
+
# Visual Studio code coverage results
|
|
144
|
+
*.coverage
|
|
145
|
+
*.coveragexml
|
|
146
|
+
|
|
147
|
+
# NCrunch
|
|
148
|
+
_NCrunch_*
|
|
149
|
+
.*crunch*.local.xml
|
|
150
|
+
nCrunchTemp_*
|
|
151
|
+
|
|
152
|
+
# MightyMoose
|
|
153
|
+
*.mm.*
|
|
154
|
+
AutoTest.Net/
|
|
155
|
+
|
|
156
|
+
# Web workbench (sass)
|
|
157
|
+
.sass-cache/
|
|
158
|
+
|
|
159
|
+
# Installshield output folder
|
|
160
|
+
[Ee]xpress/
|
|
161
|
+
|
|
162
|
+
# DocProject is a documentation generator add-in
|
|
163
|
+
DocProject/buildhelp/
|
|
164
|
+
DocProject/Help/*.HxT
|
|
165
|
+
DocProject/Help/*.HxC
|
|
166
|
+
DocProject/Help/*.hhc
|
|
167
|
+
DocProject/Help/*.hhk
|
|
168
|
+
DocProject/Help/*.hhp
|
|
169
|
+
DocProject/Help/Html2
|
|
170
|
+
DocProject/Help/html
|
|
171
|
+
|
|
172
|
+
# Click-Once directory
|
|
173
|
+
publish/
|
|
174
|
+
lib/
|
|
175
|
+
dit/
|
|
176
|
+
/package/
|
|
177
|
+
envilder-*.tgz
|
|
178
|
+
|
|
179
|
+
# GitHub Action compiled files - only track the bundle
|
|
180
|
+
github-action/dist/
|
|
181
|
+
!github-action/dist/index.js
|
|
182
|
+
|
|
183
|
+
# Publish Web Output
|
|
184
|
+
*.[Pp]ublish.xml
|
|
185
|
+
*.azurePubxml
|
|
186
|
+
# Note: Comment the next line if you want to checkin your web deploy settings,
|
|
187
|
+
# but database connection strings (with potential passwords) will be unencrypted
|
|
188
|
+
*.pubxml
|
|
189
|
+
*.publishproj
|
|
190
|
+
|
|
191
|
+
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
|
192
|
+
# checkin your Azure Web App publish settings, but sensitive information contained
|
|
193
|
+
# in these scripts will be unencrypted
|
|
194
|
+
PublishScripts/
|
|
195
|
+
|
|
196
|
+
# NuGet Packages
|
|
197
|
+
*.nupkg
|
|
198
|
+
# NuGet Symbol Packages
|
|
199
|
+
*.snupkg
|
|
200
|
+
# The packages folder can be ignored because of Package Restore
|
|
201
|
+
**/[Pp]ackages/*
|
|
202
|
+
# except build/, which is used as an MSBuild target.
|
|
203
|
+
!**/[Pp]ackages/build/
|
|
204
|
+
# Uncomment if necessary however generally it will be regenerated when needed
|
|
205
|
+
#!**/[Pp]ackages/repositories.config
|
|
206
|
+
# NuGet v3's project.json files produces more ignorable files
|
|
207
|
+
*.nuget.props
|
|
208
|
+
*.nuget.targets
|
|
209
|
+
|
|
210
|
+
# Microsoft Azure Build Output
|
|
211
|
+
csx/
|
|
212
|
+
*.build.csdef
|
|
213
|
+
|
|
214
|
+
# Microsoft Azure Emulator
|
|
215
|
+
ecf/
|
|
216
|
+
rcf/
|
|
217
|
+
|
|
218
|
+
# Windows Store app package directories and files
|
|
219
|
+
AppPackages/
|
|
220
|
+
BundleArtifacts/
|
|
221
|
+
Package.StoreAssociation.xml
|
|
222
|
+
_pkginfo.txt
|
|
223
|
+
*.appx
|
|
224
|
+
*.appxbundle
|
|
225
|
+
*.appxupload
|
|
226
|
+
|
|
227
|
+
# Visual Studio cache files
|
|
228
|
+
# files ending in .cache can be ignored
|
|
229
|
+
*.[Cc]ache
|
|
230
|
+
# but keep track of directories ending in .cache
|
|
231
|
+
!?*.[Cc]ache/
|
|
232
|
+
|
|
233
|
+
# Others
|
|
234
|
+
ClientBin/
|
|
235
|
+
~$*
|
|
236
|
+
*~
|
|
237
|
+
*.dbmdl
|
|
238
|
+
*.dbproj.schemaview
|
|
239
|
+
*.jfm
|
|
240
|
+
*.pfx
|
|
241
|
+
*.publishsettings
|
|
242
|
+
orleans.codegen.cs
|
|
243
|
+
|
|
244
|
+
# Including strong name files can present a security risk
|
|
245
|
+
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
|
246
|
+
#*.snk
|
|
247
|
+
|
|
248
|
+
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
|
249
|
+
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
|
250
|
+
#bower_components/
|
|
251
|
+
|
|
252
|
+
# RIA/Silverlight projects
|
|
253
|
+
Generated_Code/
|
|
254
|
+
|
|
255
|
+
# Backup & report files from converting an old project file
|
|
256
|
+
# to a newer Visual Studio version. Backup files are not needed,
|
|
257
|
+
# because we have git ;-)
|
|
258
|
+
_UpgradeReport_Files/
|
|
259
|
+
Backup*/
|
|
260
|
+
UpgradeLog*.XML
|
|
261
|
+
UpgradeLog*.htm
|
|
262
|
+
ServiceFabricBackup/
|
|
263
|
+
*.rptproj.bak
|
|
264
|
+
|
|
265
|
+
# SQL Server files
|
|
266
|
+
*.mdf
|
|
267
|
+
*.ldf
|
|
268
|
+
*.ndf
|
|
269
|
+
|
|
270
|
+
# Business Intelligence projects
|
|
271
|
+
*.rdl.data
|
|
272
|
+
*.bim.layout
|
|
273
|
+
*.bim_*.settings
|
|
274
|
+
*.rptproj.rsuser
|
|
275
|
+
*- [Bb]ackup.rdl
|
|
276
|
+
*- [Bb]ackup ([0-9]).rdl
|
|
277
|
+
*- [Bb]ackup ([0-9][0-9]).rdl
|
|
278
|
+
|
|
279
|
+
# Microsoft Fakes
|
|
280
|
+
FakesAssemblies/
|
|
281
|
+
|
|
282
|
+
# GhostDoc plugin setting file
|
|
283
|
+
*.GhostDoc.xml
|
|
284
|
+
|
|
285
|
+
# Node.js Tools for Visual Studio
|
|
286
|
+
.ntvs_analysis.dat
|
|
287
|
+
node_modules/
|
|
288
|
+
|
|
289
|
+
# Visual Studio 6 build log
|
|
290
|
+
*.plg
|
|
291
|
+
|
|
292
|
+
# Visual Studio 6 workspace options file
|
|
293
|
+
*.opt
|
|
294
|
+
|
|
295
|
+
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
|
296
|
+
*.vbw
|
|
297
|
+
|
|
298
|
+
# Visual Studio LightSwitch build output
|
|
299
|
+
**/*.HTMLClient/GeneratedArtifacts
|
|
300
|
+
**/*.DesktopClient/GeneratedArtifacts
|
|
301
|
+
**/*.DesktopClient/ModelManifest.xml
|
|
302
|
+
**/*.Server/GeneratedArtifacts
|
|
303
|
+
**/*.Server/ModelManifest.xml
|
|
304
|
+
_Pvt_Extensions
|
|
305
|
+
|
|
306
|
+
# Paket dependency manager
|
|
307
|
+
.paket/paket.exe
|
|
308
|
+
paket-files/
|
|
309
|
+
|
|
310
|
+
# FAKE - F# Make
|
|
311
|
+
.fake/
|
|
312
|
+
|
|
313
|
+
# CodeRush personal settings
|
|
314
|
+
.cr/personal
|
|
315
|
+
|
|
316
|
+
# Python Tools for Visual Studio (PTVS)
|
|
317
|
+
__pycache__/
|
|
318
|
+
*.pyc
|
|
319
|
+
|
|
320
|
+
# Cake - Uncomment if you are using it
|
|
321
|
+
# tools/**
|
|
322
|
+
# !tools/packages.config
|
|
323
|
+
|
|
324
|
+
# Tabs Studio
|
|
325
|
+
*.tss
|
|
326
|
+
|
|
327
|
+
# Telerik's JustMock configuration file
|
|
328
|
+
*.jmconfig
|
|
329
|
+
|
|
330
|
+
# BizTalk build output
|
|
331
|
+
*.btp.cs
|
|
332
|
+
*.btm.cs
|
|
333
|
+
*.odx.cs
|
|
334
|
+
*.xsd.cs
|
|
335
|
+
|
|
336
|
+
# OpenCover UI analysis results
|
|
337
|
+
OpenCover/
|
|
338
|
+
|
|
339
|
+
# Azure Stream Analytics local run output
|
|
340
|
+
ASALocalRun/
|
|
341
|
+
|
|
342
|
+
# MSBuild Binary and Structured Log
|
|
343
|
+
*.binlog
|
|
344
|
+
|
|
345
|
+
# NVidia Nsight GPU debugger configuration file
|
|
346
|
+
*.nvuser
|
|
347
|
+
|
|
348
|
+
# MFractors (Xamarin productivity tool) working folder
|
|
349
|
+
.mfractor/
|
|
350
|
+
|
|
351
|
+
# Local History for Visual Studio
|
|
352
|
+
.localhistory/
|
|
353
|
+
|
|
354
|
+
# BeatPulse healthcheck temp database
|
|
355
|
+
healthchecksdb
|
|
356
|
+
|
|
357
|
+
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
|
358
|
+
MigrationBackup/
|
|
359
|
+
|
|
360
|
+
# Ionide (cross platform F# VS Code tools) working folder
|
|
361
|
+
.ionide/
|
|
362
|
+
|
|
363
|
+
.DS_Store
|
|
364
|
+
.vs
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
coverage
|
|
368
|
+
coveragereport
|
|
369
|
+
*.cobertura.xml
|
|
370
|
+
changed_files.txt
|
|
371
|
+
|
|
372
|
+
# python venv
|
|
373
|
+
*venv/
|
|
374
|
+
deactivate/
|
|
375
|
+
|
|
376
|
+
# draw io
|
|
377
|
+
*.drawio.bkp
|
|
378
|
+
*.drawio.dtmp
|
|
379
|
+
|
|
380
|
+
# Rider
|
|
381
|
+
.idea/
|
|
382
|
+
|
|
383
|
+
# Playwright test results
|
|
384
|
+
.playwright-mcp/
|
|
385
|
+
|
|
386
|
+
dist/
|
|
387
|
+
|
|
388
|
+
# Astro
|
|
389
|
+
.astro/
|
envilder-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: envilder
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Securely load environment variables from AWS SSM Parameter Store or Azure Key Vault.
|
|
5
|
+
Project-URL: Homepage, https://github.com/macalbert/envilder
|
|
6
|
+
Project-URL: Repository, https://github.com/macalbert/envilder
|
|
7
|
+
Project-URL: Documentation, https://github.com/macalbert/envilder/tree/main/src/sdks/python
|
|
8
|
+
Project-URL: Issues, https://github.com/macalbert/envilder/issues
|
|
9
|
+
Author: macalbert
|
|
10
|
+
License: MIT
|
|
11
|
+
Keywords: aws,azure,envilder,environment,keyvault,secrets,ssm
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Typing :: Typed
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Requires-Dist: azure-identity>=1.14
|
|
23
|
+
Requires-Dist: azure-keyvault-secrets>=4.7
|
|
24
|
+
Requires-Dist: boto3>=1.26
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: black>=24.0; extra == 'dev'
|
|
27
|
+
Requires-Dist: boto3-stubs[ssm]>=1.26; extra == 'dev'
|
|
28
|
+
Requires-Dist: isort>=5.13; extra == 'dev'
|
|
29
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
31
|
+
Requires-Dist: requests>=2.31; extra == 'dev'
|
|
32
|
+
Requires-Dist: testcontainers[localstack]>=4.0; extra == 'dev'
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
# Envilder Python SDK
|
|
36
|
+
|
|
37
|
+
Securely load environment variables from **AWS SSM Parameter Store** or **Azure Key Vault** directly into your Python application.
|
|
38
|
+
Zero vendor lock-in — secrets stay in your cloud.
|
|
39
|
+
|
|
40
|
+
Part of the [Envilder](https://github.com/macalbert/envilder) project.
|
|
41
|
+
|
|
42
|
+
## Prerequisites
|
|
43
|
+
|
|
44
|
+
- Python 3.10+
|
|
45
|
+
- **AWS provider**: AWS credentials configured (CLI, environment variables, or IAM role)
|
|
46
|
+
- **Azure provider**: Azure credentials via `az login`, managed identity, or environment variables
|
|
47
|
+
|
|
48
|
+
## Install
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install envilder
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Quick Start
|
|
55
|
+
|
|
56
|
+
### Direct usage
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
from envilder import (
|
|
60
|
+
EnvilderClient,
|
|
61
|
+
MapFileParser,
|
|
62
|
+
SecretProviderFactory,
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
json_content = open('secrets-map.json').read()
|
|
66
|
+
map_file = MapFileParser().parse(json_content)
|
|
67
|
+
provider = SecretProviderFactory.create(map_file.config)
|
|
68
|
+
client = EnvilderClient(provider)
|
|
69
|
+
secrets = client.resolve_secrets(map_file)
|
|
70
|
+
|
|
71
|
+
print(secrets['DB_PASSWORD'])
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Inject into environment
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
EnvilderClient.inject_into_environment(secrets)
|
|
78
|
+
|
|
79
|
+
import os
|
|
80
|
+
print(os.environ['DB_PASSWORD'])
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### With runtime overrides (EnvilderOptions)
|
|
84
|
+
|
|
85
|
+
Override the map file's `$config` at runtime — useful for switching providers per environment:
|
|
86
|
+
|
|
87
|
+
```python
|
|
88
|
+
from envilder import EnvilderOptions, SecretProviderType
|
|
89
|
+
|
|
90
|
+
options = EnvilderOptions(
|
|
91
|
+
provider=SecretProviderType.AZURE,
|
|
92
|
+
vault_url='https://my-vault.vault.azure.net',
|
|
93
|
+
)
|
|
94
|
+
provider = SecretProviderFactory.create(map_file.config, options)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Map File Format
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"$config": {
|
|
102
|
+
"provider": "aws",
|
|
103
|
+
"profile": "my-profile"
|
|
104
|
+
},
|
|
105
|
+
"DB_PASSWORD": "/app/prod/db-password",
|
|
106
|
+
"API_KEY": "/app/prod/api-key"
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Supported providers: `aws` (default), `azure`.
|
|
111
|
+
|
|
112
|
+
For Azure, add `vaultUrl`:
|
|
113
|
+
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"$config": {
|
|
117
|
+
"provider": "azure",
|
|
118
|
+
"vaultUrl": "https://my-vault.vault.azure.net"
|
|
119
|
+
},
|
|
120
|
+
"DB_PASSWORD": "db-password",
|
|
121
|
+
"API_KEY": "api-key"
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## License
|
|
126
|
+
|
|
127
|
+
MIT
|
|
128
|
+
|
|
129
|
+
## Development
|
|
130
|
+
|
|
131
|
+
### Setup
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# From the repo root
|
|
135
|
+
make install-sdk-python
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Quality checks
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
make check-sdk-python # black + isort + mypy (no changes)
|
|
142
|
+
make format-sdk-python # auto-format
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Running tests
|
|
146
|
+
|
|
147
|
+
Unit tests run without any external dependencies:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
cd tests/sdks/python
|
|
151
|
+
python -m pytest -v -m "not acceptance"
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Acceptance tests require **Docker** and a **LocalStack auth token**:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
export LOCALSTACK_AUTH_TOKEN=<your-token>
|
|
158
|
+
cd tests/sdks/python
|
|
159
|
+
python -m pytest -v -m acceptance
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
All tests:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
make test-sdk-python
|
|
166
|
+
```
|
envilder-0.1.0/README.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# Envilder Python SDK
|
|
2
|
+
|
|
3
|
+
Securely load environment variables from **AWS SSM Parameter Store** or **Azure Key Vault** directly into your Python application.
|
|
4
|
+
Zero vendor lock-in — secrets stay in your cloud.
|
|
5
|
+
|
|
6
|
+
Part of the [Envilder](https://github.com/macalbert/envilder) project.
|
|
7
|
+
|
|
8
|
+
## Prerequisites
|
|
9
|
+
|
|
10
|
+
- Python 3.10+
|
|
11
|
+
- **AWS provider**: AWS credentials configured (CLI, environment variables, or IAM role)
|
|
12
|
+
- **Azure provider**: Azure credentials via `az login`, managed identity, or environment variables
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install envilder
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
### Direct usage
|
|
23
|
+
|
|
24
|
+
```python
|
|
25
|
+
from envilder import (
|
|
26
|
+
EnvilderClient,
|
|
27
|
+
MapFileParser,
|
|
28
|
+
SecretProviderFactory,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
json_content = open('secrets-map.json').read()
|
|
32
|
+
map_file = MapFileParser().parse(json_content)
|
|
33
|
+
provider = SecretProviderFactory.create(map_file.config)
|
|
34
|
+
client = EnvilderClient(provider)
|
|
35
|
+
secrets = client.resolve_secrets(map_file)
|
|
36
|
+
|
|
37
|
+
print(secrets['DB_PASSWORD'])
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Inject into environment
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
EnvilderClient.inject_into_environment(secrets)
|
|
44
|
+
|
|
45
|
+
import os
|
|
46
|
+
print(os.environ['DB_PASSWORD'])
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### With runtime overrides (EnvilderOptions)
|
|
50
|
+
|
|
51
|
+
Override the map file's `$config` at runtime — useful for switching providers per environment:
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
from envilder import EnvilderOptions, SecretProviderType
|
|
55
|
+
|
|
56
|
+
options = EnvilderOptions(
|
|
57
|
+
provider=SecretProviderType.AZURE,
|
|
58
|
+
vault_url='https://my-vault.vault.azure.net',
|
|
59
|
+
)
|
|
60
|
+
provider = SecretProviderFactory.create(map_file.config, options)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Map File Format
|
|
64
|
+
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"$config": {
|
|
68
|
+
"provider": "aws",
|
|
69
|
+
"profile": "my-profile"
|
|
70
|
+
},
|
|
71
|
+
"DB_PASSWORD": "/app/prod/db-password",
|
|
72
|
+
"API_KEY": "/app/prod/api-key"
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Supported providers: `aws` (default), `azure`.
|
|
77
|
+
|
|
78
|
+
For Azure, add `vaultUrl`:
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"$config": {
|
|
83
|
+
"provider": "azure",
|
|
84
|
+
"vaultUrl": "https://my-vault.vault.azure.net"
|
|
85
|
+
},
|
|
86
|
+
"DB_PASSWORD": "db-password",
|
|
87
|
+
"API_KEY": "api-key"
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
MIT
|
|
94
|
+
|
|
95
|
+
## Development
|
|
96
|
+
|
|
97
|
+
### Setup
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# From the repo root
|
|
101
|
+
make install-sdk-python
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Quality checks
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
make check-sdk-python # black + isort + mypy (no changes)
|
|
108
|
+
make format-sdk-python # auto-format
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Running tests
|
|
112
|
+
|
|
113
|
+
Unit tests run without any external dependencies:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
cd tests/sdks/python
|
|
117
|
+
python -m pytest -v -m "not acceptance"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Acceptance tests require **Docker** and a **LocalStack auth token**:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
export LOCALSTACK_AUTH_TOKEN=<your-token>
|
|
124
|
+
cd tests/sdks/python
|
|
125
|
+
python -m pytest -v -m acceptance
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
All tests:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
make test-sdk-python
|
|
132
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from envilder.application.envilder_client import EnvilderClient
|
|
2
|
+
from envilder.application.map_file_parser import MapFileParser
|
|
3
|
+
from envilder.domain.envilder_options import EnvilderOptions
|
|
4
|
+
from envilder.domain.map_file_config import MapFileConfig
|
|
5
|
+
from envilder.domain.parsed_map_file import ParsedMapFile
|
|
6
|
+
from envilder.domain.ports.secret_provider import ISecretProvider
|
|
7
|
+
from envilder.domain.secret_provider_type import SecretProviderType
|
|
8
|
+
from envilder.infrastructure.aws.aws_ssm_secret_provider import (
|
|
9
|
+
AwsSsmSecretProvider,
|
|
10
|
+
)
|
|
11
|
+
from envilder.infrastructure.azure.azure_key_vault_secret_provider import (
|
|
12
|
+
AzureKeyVaultSecretProvider,
|
|
13
|
+
)
|
|
14
|
+
from envilder.infrastructure.secret_provider_factory import (
|
|
15
|
+
SecretProviderFactory,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
__all__ = [
|
|
19
|
+
"AwsSsmSecretProvider",
|
|
20
|
+
"AzureKeyVaultSecretProvider",
|
|
21
|
+
"EnvilderClient",
|
|
22
|
+
"EnvilderOptions",
|
|
23
|
+
"ISecretProvider",
|
|
24
|
+
"MapFileConfig",
|
|
25
|
+
"MapFileParser",
|
|
26
|
+
"ParsedMapFile",
|
|
27
|
+
"SecretProviderFactory",
|
|
28
|
+
"SecretProviderType",
|
|
29
|
+
]
|