vibey-bootstrap 4.0.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.
- vibey_bootstrap-4.0.0/LICENSE +22 -0
- vibey_bootstrap-4.0.0/MANIFEST.in +36 -0
- vibey_bootstrap-4.0.0/NOTICE.md +8 -0
- vibey_bootstrap-4.0.0/PKG-INFO +354 -0
- vibey_bootstrap-4.0.0/README.md +196 -0
- vibey_bootstrap-4.0.0/pyproject.toml +377 -0
- vibey_bootstrap-4.0.0/setup.cfg +4 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/__init__.py +271 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/aks/__init__.py +84 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/aks/leader_election.py +82 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/alerts/__init__.py +36 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/alerts/dispatcher.py +358 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/alerts/escalation.py +25 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/alerts/render.py +97 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/audit/__init__.py +411 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/auth/__init__.py +19 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/auth/api_key.py +18 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/auth/hmac.py +40 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/auth/webhook.py +202 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/bootstrap/__init__.py +107 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/config_refresh/__init__.py +92 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/contrib/__init__.py +1 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/contrib/scaffold.py +107 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/contrib/templates/bicep/app/main.bicep.template +2 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/contrib/templates/cicd/github/test.yml.template +12 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/contrib/templates/gitops/base/kustomization.yaml.template +4 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/contrib/templates/helm/worker/Chart.yaml.template +4 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/contrib/templates/policy/conftest/kubernetes.rego.template +7 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/contrib/templates/terraform/aks/main.tf.template +4 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/counters/__init__.py +43 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/db/__init__.py +109 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/db/migrations/__init__.py +86 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/db/outbox.py +185 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/documentdb/__init__.py +38 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/email/__init__.py +69 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/exceptions/__init__.py +108 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/failclose/__init__.py +52 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/fastapi_middleware/__init__.py +144 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/governance/__init__.py +112 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/health/__init__.py +117 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/heartbeat/__init__.py +260 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/http/__init__.py +82 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/http/_common.py +37 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/http/async_client.py +40 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/identity/__init__.py +385 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/ingress/__init__.py +41 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/ingress/classifier.py +119 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/ingress/extensions.py +42 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/ingress/magic_bytes.py +63 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/ingress/mime.py +38 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/ingress/size.py +32 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/ingress/zip_safety.py +49 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/logging/__init__.py +69 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/logging/config.py +102 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/logging/correlation.py +97 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/logging/formatter.py +78 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/logging/jsonformatter.py +87 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/logging/masking.py +170 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/logging/noise.py +53 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/metrics/__init__.py +42 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/models/__init__.py +13 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/models/exceptions.py +38 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/notify/__init__.py +25 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/notify/templates.py +281 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/notify/throttle.py +68 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/openai/__init__.py +462 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/path_safety/__init__.py +79 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/pdf_safety/__init__.py +104 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/phases/__init__.py +112 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/py.typed +2 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/ratelimit/__init__.py +137 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/repositories/__init__.py +13 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/repositories/enhanced_config_repository.py +580 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/repositories/interfaces/__init__.py +17 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/repositories/interfaces/enhanced_config_repository_interface.py +140 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/repositories/interfaces/secrets_repository_interface.py +96 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/repositories/secrets_repository.py +243 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/retry/__init__.py +170 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/sb_lock/__init__.py +128 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/scheduler/__init__.py +76 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/security/__init__.py +65 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/servicebus/__init__.py +51 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/servicebus/async_ext.py +99 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/servicebus/consumer.py +20 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/servicebus/consumer_wrapper.py +235 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/servicebus/dlq_alarm.py +85 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/servicebus/dlq_digest.py +162 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/services/__init__.py +29 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/services/application_bootstrap.py +592 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/services/bootstrap_logging.py +199 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/services/interfaces/__init__.py +21 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/services/interfaces/application_bootstrap_interface.py +58 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/services/interfaces/bootstrap_logger_interface.py +57 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/services/interfaces/telemetry_manager_interface.py +149 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/services/telemetry.py +277 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/softfail/__init__.py +146 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/subscription/__init__.py +154 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/tokens/__init__.py +95 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/tracing/__init__.py +28 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/tracing/decorators.py +235 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/tracing/latency.py +95 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/tracing/log_exception_context.py +24 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/tracing/slow_thresholds.py +47 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/tracing/timed_operation.py +29 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/transports/__init__.py +251 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/transports/_base.py +309 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/transports/adx.py +125 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/transports/blob.py +208 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/transports/builtins.py +93 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/transports/event_hubs.py +122 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/transports/file.py +251 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/transports/nosql.py +235 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/transports/panther.py +261 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/transports/sql.py +293 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/transports/sumologic.py +180 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap/validation/__init__.py +151 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap.egg-info/PKG-INFO +354 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap.egg-info/SOURCES.txt +120 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap.egg-info/dependency_links.txt +1 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap.egg-info/entry_points.txt +3 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap.egg-info/requires.txt +173 -0
- vibey_bootstrap-4.0.0/vibey_bootstrap.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 The Vizius Group
|
|
4
|
+
Copyright (c) 2026 Adam Matthew Steinberger
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Include documentation
|
|
2
|
+
include README.md
|
|
3
|
+
include LICENSE
|
|
4
|
+
include NOTICE.md
|
|
5
|
+
|
|
6
|
+
# Include package data
|
|
7
|
+
include vibey_bootstrap/py.typed
|
|
8
|
+
|
|
9
|
+
# Exclude development files
|
|
10
|
+
exclude .gitignore
|
|
11
|
+
exclude .pypirc.template
|
|
12
|
+
exclude pip.ini
|
|
13
|
+
|
|
14
|
+
# Exclude build artifacts
|
|
15
|
+
global-exclude __pycache__
|
|
16
|
+
global-exclude *.py[co]
|
|
17
|
+
global-exclude *.so
|
|
18
|
+
global-exclude .DS_Store
|
|
19
|
+
|
|
20
|
+
# Exclude test files
|
|
21
|
+
prune test
|
|
22
|
+
prune .venv
|
|
23
|
+
prune .pytest_cache
|
|
24
|
+
prune htmlcov
|
|
25
|
+
|
|
26
|
+
# Exclude CI/CD files
|
|
27
|
+
exclude azure-pipelines.yml
|
|
28
|
+
exclude .coveragerc
|
|
29
|
+
|
|
30
|
+
# Exclude archived documentation and examples
|
|
31
|
+
prune docs
|
|
32
|
+
prune examples
|
|
33
|
+
|
|
34
|
+
# Exclude VS Code and Claude settings
|
|
35
|
+
prune .vscode
|
|
36
|
+
prune .claude
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Notice
|
|
2
|
+
|
|
3
|
+
vibey-bootstrap was originally developed as TheViziusGroup/azure-bootstrap by
|
|
4
|
+
Adam Matthew Steinberger while at The Vizius Group. It is republished here as
|
|
5
|
+
adammatthewsteinberger/vibey-bootstrap with the permission of The Vizius Group
|
|
6
|
+
under the MIT License. Anyone may use, copy, modify, merge, publish, distribute,
|
|
7
|
+
sublicense, and/or sell copies of it, subject to the MIT terms in
|
|
8
|
+
[LICENSE](LICENSE).
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vibey-bootstrap
|
|
3
|
+
Version: 4.0.0
|
|
4
|
+
Summary: Production-ready Azure bootstrap library for App Configuration, Key Vault, and App Insights integration
|
|
5
|
+
Author-email: Adam Matthew Steinberger <adam@matthewsteinberger.com>
|
|
6
|
+
Maintainer-email: Adam Matthew Steinberger <adam@matthewsteinberger.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/adammatthewsteinberger/vibey-bootstrap
|
|
9
|
+
Project-URL: Repository, https://github.com/adammatthewsteinberger/vibey-bootstrap
|
|
10
|
+
Project-URL: Documentation, https://adammatthewsteinberger.github.io/vibey-bootstrap/
|
|
11
|
+
Project-URL: Issues, https://github.com/adammatthewsteinberger/vibey-bootstrap/issues
|
|
12
|
+
Keywords: azure,bootstrap,configuration,app-config,key-vault,app-insights,telemetry,azure-functions
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Classifier: Topic :: System :: Systems Administration
|
|
22
|
+
Requires-Python: >=3.11
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
License-File: NOTICE.md
|
|
26
|
+
Requires-Dist: azure-appconfiguration-provider>=1.0.0
|
|
27
|
+
Requires-Dist: azure-appconfiguration>=1.9.0
|
|
28
|
+
Requires-Dist: azure-keyvault-secrets>=4.7.0
|
|
29
|
+
Requires-Dist: azure-identity>=1.15.0
|
|
30
|
+
Requires-Dist: azure-monitor-opentelemetry>=1.2.0
|
|
31
|
+
Requires-Dist: opentelemetry-api>=1.22.0
|
|
32
|
+
Requires-Dist: azure-core>=1.38.0
|
|
33
|
+
Requires-Dist: filelock>=3.20.3
|
|
34
|
+
Requires-Dist: urllib3>=2.7.0
|
|
35
|
+
Requires-Dist: cryptography<49,>=48.0.1
|
|
36
|
+
Requires-Dist: pyjwt>=2.13.0
|
|
37
|
+
Provides-Extra: dev
|
|
38
|
+
Requires-Dist: pytest>=7.4.0; extra == "dev"
|
|
39
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
|
|
40
|
+
Requires-Dist: pytest-mock>=3.11.1; extra == "dev"
|
|
41
|
+
Requires-Dist: black>=23.7.0; extra == "dev"
|
|
42
|
+
Requires-Dist: ruff>=0.0.285; extra == "dev"
|
|
43
|
+
Requires-Dist: mypy>=1.5.0; extra == "dev"
|
|
44
|
+
Requires-Dist: isort>=5.12.0; extra == "dev"
|
|
45
|
+
Requires-Dist: bandit>=1.7.5; extra == "dev"
|
|
46
|
+
Requires-Dist: pip-audit>=2.6.0; extra == "dev"
|
|
47
|
+
Requires-Dist: build>=1.0.0; extra == "dev"
|
|
48
|
+
Provides-Extra: test
|
|
49
|
+
Requires-Dist: pytest>=7.4.0; extra == "test"
|
|
50
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == "test"
|
|
51
|
+
Requires-Dist: pytest-mock>=3.11.1; extra == "test"
|
|
52
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == "test"
|
|
53
|
+
Requires-Dist: hypothesis>=6.98; extra == "test"
|
|
54
|
+
Requires-Dist: mongomock>=4.1; extra == "test"
|
|
55
|
+
Requires-Dist: fastapi>=0.110; extra == "test"
|
|
56
|
+
Requires-Dist: httpx>=0.27; extra == "test"
|
|
57
|
+
Requires-Dist: sqlalchemy>=2.0; extra == "test"
|
|
58
|
+
Requires-Dist: alembic>=1.13; extra == "test"
|
|
59
|
+
Requires-Dist: pymongo>=4.6; extra == "test"
|
|
60
|
+
Requires-Dist: azure-eventhub>=5.11; extra == "test"
|
|
61
|
+
Requires-Dist: azure-communication-email>=1.0; extra == "test"
|
|
62
|
+
Requires-Dist: azure-storage-blob>=12.19; extra == "test"
|
|
63
|
+
Requires-Dist: apscheduler>=3.10; extra == "test"
|
|
64
|
+
Requires-Dist: tenacity>=8.0; extra == "test"
|
|
65
|
+
Requires-Dist: pypdf>=6.13.3; extra == "test"
|
|
66
|
+
Requires-Dist: starlette>=1.3.1; extra == "test"
|
|
67
|
+
Provides-Extra: docs
|
|
68
|
+
Requires-Dist: mkdocs>=1.6.1; extra == "docs"
|
|
69
|
+
Requires-Dist: mkdocs-material>=9.5.40; extra == "docs"
|
|
70
|
+
Requires-Dist: mkdocstrings[python]>=0.29.1; extra == "docs"
|
|
71
|
+
Requires-Dist: griffe>=1.5.0; extra == "docs"
|
|
72
|
+
Requires-Dist: mkdocs-gen-files>=0.5.0; extra == "docs"
|
|
73
|
+
Requires-Dist: mkdocs-literate-nav>=0.6.1; extra == "docs"
|
|
74
|
+
Requires-Dist: mkdocs-section-index>=0.3.9; extra == "docs"
|
|
75
|
+
Requires-Dist: pymdown-extensions>=10.9; extra == "docs"
|
|
76
|
+
Provides-Extra: alerts
|
|
77
|
+
Provides-Extra: health
|
|
78
|
+
Provides-Extra: fastapi
|
|
79
|
+
Requires-Dist: fastapi>=0.110; extra == "fastapi"
|
|
80
|
+
Requires-Dist: starlette>=1.3.1; extra == "fastapi"
|
|
81
|
+
Provides-Extra: heartbeat
|
|
82
|
+
Provides-Extra: config-refresh
|
|
83
|
+
Provides-Extra: servicebus
|
|
84
|
+
Requires-Dist: azure-servicebus>=7.11; extra == "servicebus"
|
|
85
|
+
Provides-Extra: openai
|
|
86
|
+
Provides-Extra: tokens
|
|
87
|
+
Provides-Extra: scheduler
|
|
88
|
+
Requires-Dist: apscheduler>=3.10; extra == "scheduler"
|
|
89
|
+
Provides-Extra: metrics
|
|
90
|
+
Provides-Extra: retry
|
|
91
|
+
Requires-Dist: tenacity>=8.0; extra == "retry"
|
|
92
|
+
Provides-Extra: ingress
|
|
93
|
+
Provides-Extra: pdf-safety
|
|
94
|
+
Requires-Dist: pypdf>=6.13.3; extra == "pdf-safety"
|
|
95
|
+
Provides-Extra: ratelimit
|
|
96
|
+
Provides-Extra: notify
|
|
97
|
+
Provides-Extra: subscription
|
|
98
|
+
Provides-Extra: identity
|
|
99
|
+
Provides-Extra: auth
|
|
100
|
+
Provides-Extra: sb-lock
|
|
101
|
+
Provides-Extra: audit
|
|
102
|
+
Provides-Extra: failclose
|
|
103
|
+
Provides-Extra: transports
|
|
104
|
+
Provides-Extra: sumologic
|
|
105
|
+
Requires-Dist: requests>=2.32.0; extra == "sumologic"
|
|
106
|
+
Provides-Extra: panther
|
|
107
|
+
Requires-Dist: requests>=2.32.0; extra == "panther"
|
|
108
|
+
Provides-Extra: bloblog
|
|
109
|
+
Requires-Dist: azure-storage-blob>=12.19; extra == "bloblog"
|
|
110
|
+
Provides-Extra: sqllog
|
|
111
|
+
Requires-Dist: sqlalchemy>=2.0; extra == "sqllog"
|
|
112
|
+
Provides-Extra: nosqllog
|
|
113
|
+
Requires-Dist: pymongo>=4.6; extra == "nosqllog"
|
|
114
|
+
Provides-Extra: nosqllog-cosmos
|
|
115
|
+
Requires-Dist: azure-cosmos>=4.5; extra == "nosqllog-cosmos"
|
|
116
|
+
Provides-Extra: adxlog
|
|
117
|
+
Requires-Dist: azure-kusto-ingest>=4.0; extra == "adxlog"
|
|
118
|
+
Requires-Dist: azure-kusto-data>=4.0; extra == "adxlog"
|
|
119
|
+
Provides-Extra: eventhubslog
|
|
120
|
+
Requires-Dist: azure-eventhub>=5.11; extra == "eventhubslog"
|
|
121
|
+
Provides-Extra: logging-all
|
|
122
|
+
Requires-Dist: requests>=2.32.0; extra == "logging-all"
|
|
123
|
+
Requires-Dist: azure-storage-blob>=12.19; extra == "logging-all"
|
|
124
|
+
Requires-Dist: sqlalchemy>=2.0; extra == "logging-all"
|
|
125
|
+
Requires-Dist: pymongo>=4.6; extra == "logging-all"
|
|
126
|
+
Requires-Dist: azure-kusto-ingest>=4.0; extra == "logging-all"
|
|
127
|
+
Requires-Dist: azure-kusto-data>=4.0; extra == "logging-all"
|
|
128
|
+
Requires-Dist: azure-eventhub>=5.11; extra == "logging-all"
|
|
129
|
+
Provides-Extra: db
|
|
130
|
+
Requires-Dist: sqlalchemy>=2.0; extra == "db"
|
|
131
|
+
Requires-Dist: alembic>=1.13; extra == "db"
|
|
132
|
+
Provides-Extra: documentdb
|
|
133
|
+
Requires-Dist: pymongo>=4.6; extra == "documentdb"
|
|
134
|
+
Provides-Extra: email
|
|
135
|
+
Requires-Dist: azure-communication-email>=1.0; extra == "email"
|
|
136
|
+
Provides-Extra: http
|
|
137
|
+
Requires-Dist: requests>=2.32.0; extra == "http"
|
|
138
|
+
Provides-Extra: http-async
|
|
139
|
+
Requires-Dist: httpx>=0.27; extra == "http-async"
|
|
140
|
+
Provides-Extra: governance
|
|
141
|
+
Provides-Extra: aks
|
|
142
|
+
Provides-Extra: all
|
|
143
|
+
Requires-Dist: fastapi>=0.110; extra == "all"
|
|
144
|
+
Requires-Dist: starlette>=1.3.1; extra == "all"
|
|
145
|
+
Requires-Dist: azure-servicebus>=7.11; extra == "all"
|
|
146
|
+
Requires-Dist: apscheduler>=3.10; extra == "all"
|
|
147
|
+
Requires-Dist: requests>=2.32.0; extra == "all"
|
|
148
|
+
Requires-Dist: azure-storage-blob>=12.19; extra == "all"
|
|
149
|
+
Requires-Dist: sqlalchemy>=2.0; extra == "all"
|
|
150
|
+
Requires-Dist: alembic>=1.13; extra == "all"
|
|
151
|
+
Requires-Dist: pymongo>=4.6; extra == "all"
|
|
152
|
+
Requires-Dist: azure-communication-email>=1.0; extra == "all"
|
|
153
|
+
Requires-Dist: azure-kusto-ingest>=4.0; extra == "all"
|
|
154
|
+
Requires-Dist: azure-kusto-data>=4.0; extra == "all"
|
|
155
|
+
Requires-Dist: azure-eventhub>=5.11; extra == "all"
|
|
156
|
+
Requires-Dist: httpx>=0.27; extra == "all"
|
|
157
|
+
Dynamic: license-file
|
|
158
|
+
|
|
159
|
+
# vibey-bootstrap
|
|
160
|
+
|
|
161
|
+
> The cross-cutting layer for Azure Functions, FastAPI services, and AKS workers.
|
|
162
|
+
> One call bootstraps logging → App Configuration + Key Vault → Application Insights
|
|
163
|
+
> and hands you a populated `os.environ`. Everything past that (alerts, tracing,
|
|
164
|
+
> Service Bus, ten log transports, a scaffold CLI) is opt-in via pip extras.
|
|
165
|
+
> Used across 17+ Azure Functions repos at Vizius.
|
|
166
|
+
|
|
167
|
+
Formerly **azure-bootstrap** — see [NOTICE.md](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/NOTICE.md).
|
|
168
|
+
|
|
169
|
+
[](https://pypi.org/project/vibey-bootstrap/)
|
|
170
|
+
[](https://pypi.org/project/vibey-bootstrap/)
|
|
171
|
+
[](https://pypi.org/project/vibey-bootstrap/)
|
|
172
|
+
[](https://github.com/adammatthewsteinberger/vibey-bootstrap/actions/workflows/ci-cd.yml)
|
|
173
|
+
[](https://adammatthewsteinberger.github.io/vibey-bootstrap/)
|
|
174
|
+
[](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/LICENSE)
|
|
175
|
+
|
|
176
|
+
## Why
|
|
177
|
+
|
|
178
|
+
Every Azure app hits the same startup deadlock: you need logging to report
|
|
179
|
+
config loading, but App Insights logging needs config to initialize. Most repos
|
|
180
|
+
solve it with a copy-pasted `src/infrastructure/` folder that drifts. This
|
|
181
|
+
library is that folder, done once, tested, and versioned.
|
|
182
|
+
|
|
183
|
+
The **four-phase bootstrap** breaks the cycle:
|
|
184
|
+
|
|
185
|
+
1. **Console logging** — works immediately, before anything loads.
|
|
186
|
+
2. **Telemetry from env** — App Insights if `APPLICATIONINSIGHTS_CONNECTION_STRING` is already set.
|
|
187
|
+
3. **Configuration** — Azure App Configuration + Key Vault references → `os.environ`.
|
|
188
|
+
Local values (`local.settings.json`, your shell) always win; nothing is overwritten.
|
|
189
|
+
4. **Telemetry upgrade** — if the connection string only arrived via config, upgrade now.
|
|
190
|
+
|
|
191
|
+
Guarantees: the v1 API surface is preserved byte-identical across v2, v3, and v4
|
|
192
|
+
(v4 changes only the distribution and import name — see
|
|
193
|
+
[MIGRATING-TO-V4.md](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/MIGRATING-TO-V4.md)); every
|
|
194
|
+
extra is opt-in and most are stdlib-only; log transports never block, never raise,
|
|
195
|
+
and use a bounded buffer. `USE_MOCK_BOOTSTRAP=true` runs everything without Azure.
|
|
196
|
+
|
|
197
|
+
## Quick start
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
pip install vibey-bootstrap
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
```python
|
|
204
|
+
import os
|
|
205
|
+
from vibey_bootstrap import initialize_application, get_bootstrap_logger
|
|
206
|
+
|
|
207
|
+
logger = get_bootstrap_logger(__name__) # usable before bootstrap completes
|
|
208
|
+
config_repo = initialize_application() # runs all four phases
|
|
209
|
+
|
|
210
|
+
db_host = os.getenv("DATABASE_HOST") # App Config + Key Vault values are in os.environ
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Requires Python 3.11+. Falls back to plain environment variables when App
|
|
214
|
+
Configuration is not configured, so the same code runs locally and in Azure.
|
|
215
|
+
|
|
216
|
+
## Worked example: production-grade logging in four lines
|
|
217
|
+
|
|
218
|
+
```python
|
|
219
|
+
from vibey_bootstrap.alerts import install_global_exception_hooks, register_dispatcher
|
|
220
|
+
from vibey_bootstrap.bootstrap import ensure_bootstrap
|
|
221
|
+
from vibey_bootstrap.logging import configure_logging
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
def my_email_sender(recipients, subject, html_body):
|
|
225
|
+
... # any callable with this signature (Graph, SendGrid, ACS)
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
configure_logging()
|
|
229
|
+
install_global_exception_hooks()
|
|
230
|
+
ensure_bootstrap()
|
|
231
|
+
register_dispatcher(my_email_sender, recipients=["dev-alerts@example.com"])
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
After this, every line emitted through stdlib `logging` carries a correlation
|
|
235
|
+
ID, extra fields render as greppable `key=repr(value)` pairs, noisy third-party
|
|
236
|
+
loggers are silenced, and uncaught exceptions fire CRITICAL alerts with dedup,
|
|
237
|
+
rate-limiting, and escalation. Runnable version:
|
|
238
|
+
[examples/01_quickstart.py](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/examples/01_quickstart.py).
|
|
239
|
+
|
|
240
|
+
## What's in the box
|
|
241
|
+
|
|
242
|
+
| Layer | Install | You get |
|
|
243
|
+
| --- | --- | --- |
|
|
244
|
+
| **v1 core** | `vibey-bootstrap` | Four-phase bootstrap, `EnhancedConfigRepository`, `TelemetryManager` |
|
|
245
|
+
| **v2 Tier 1** (always on, stdlib) | `vibey-bootstrap` | Structured logging, correlation IDs, masking, `@traced`, counters, error vocabulary, soft-fail, phases, validation, path safety, fail-close env helpers |
|
|
246
|
+
| **v2 Tier 2/3** (opt-in) | `[alerts]`, `[fastapi]`, `[servicebus]`, `[retry]`, … | Tiered alerts, FastAPI middleware, health probes, heartbeat, Service Bus consumer + DLQ, webhook auth, ingress hardening, HMAC tokens, AI usage tracker |
|
|
247
|
+
| **v3** (opt-in) | `[logging-all]`, `[db]`, `[email]`, `[http]`, `[aks]`, … | Ten log transports, SQLAlchemy + outbox, ACS email, hardened HTTP client, DocumentDB factory, AKS runtime helpers, governance, `vibey-bootstrap` scaffold CLI |
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
# Common combinations
|
|
251
|
+
pip install 'vibey-bootstrap[alerts,fastapi,health]'
|
|
252
|
+
pip install 'vibey-bootstrap[servicebus,sb-lock,retry,heartbeat]'
|
|
253
|
+
pip install 'vibey-bootstrap[all]'
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
The full extras matrix (40+ extras, what each pulls in, when you need it) is in
|
|
257
|
+
the [Usage Guide](https://adammatthewsteinberger.github.io/vibey-bootstrap/usage/#1-installation-extras).
|
|
258
|
+
|
|
259
|
+
<details>
|
|
260
|
+
<summary>Feature inventory by release</summary>
|
|
261
|
+
|
|
262
|
+
**v2** — structured logging (`ExtraFieldsFormatter`, `correlation_scope`,
|
|
263
|
+
secret/email/control-char masking, noisy-logger silencing) · `@traced` with
|
|
264
|
+
latency histograms and slow-budget alerts · `alert_dev_team` with WARN / ERROR /
|
|
265
|
+
CRITICAL, dedup + rate-limit + escalation, `install_global_exception_hooks` ·
|
|
266
|
+
`PipelineError` → `UnrecoverableError` / `TransientError` with `is_unrecoverable`,
|
|
267
|
+
soft-fail and per-phase guards · 4-gate attachment classifier (extension → MIME →
|
|
268
|
+
size → magic bytes), zip-bomb defense, PDF action stripping, filename sanitizer +
|
|
269
|
+
root confinement · Service Bus `handle_message` with dead-letter-vs-abandon
|
|
270
|
+
routing and `lock_for_process` · `install_graph_webhook_route` with validation
|
|
271
|
+
handshake, clientState verification, dedup, rate limit · AI usage tracker (tokens
|
|
272
|
+
+ cost, sliding windows, soft TPM cap) · health probes, FastAPI middleware,
|
|
273
|
+
heartbeat + consumer watchdog, dynamic log-level refresh, DLQ digest with
|
|
274
|
+
HMAC-signed resubmit tokens, `/api/metrics` aggregator.
|
|
275
|
+
|
|
276
|
+
**v3** — ten logging transports (console, App Insights, Sumo Logic, Panther, file,
|
|
277
|
+
blob, SQL, NoSQL, ADX, Event Hubs; all share `_BufferedShipper` guarantees) ·
|
|
278
|
+
SQLAlchemy session factory, Alembic helpers, transactional outbox · `AcsEmailSender`
|
|
279
|
+
· hardened sync `requests` session + optional async `httpx` · Mongo/Cosmos client
|
|
280
|
+
factory from env · AKS `build_info`, SIGTERM handlers, leader-election stub ·
|
|
281
|
+
budget guard + usage tracking hooks · `vibey-bootstrap list|scaffold` for
|
|
282
|
+
Terraform/Bicep/Helm/GitOps/CI/policy templates.
|
|
283
|
+
|
|
284
|
+
Every entry is cataloged by tier in the
|
|
285
|
+
[CHANGELOG](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/CHANGELOG.md).
|
|
286
|
+
|
|
287
|
+
</details>
|
|
288
|
+
|
|
289
|
+
## Examples
|
|
290
|
+
|
|
291
|
+
[examples/](https://github.com/adammatthewsteinberger/vibey-bootstrap/tree/main/examples/)
|
|
292
|
+
holds 46 numbered single-concept files plus 3 end-to-end app templates. Every
|
|
293
|
+
file runs with `USE_MOCK_BOOTSTRAP=true` and ends with an `# ── Expected output ──`
|
|
294
|
+
block. Start with:
|
|
295
|
+
|
|
296
|
+
| File | Concept |
|
|
297
|
+
| --- | --- |
|
|
298
|
+
| [01_quickstart.py](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/examples/01_quickstart.py) | 30-second setup |
|
|
299
|
+
| [03_correlation_scope.py](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/examples/03_correlation_scope.py) | Correlation IDs across nested calls |
|
|
300
|
+
| [09_soft_fail.py](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/examples/09_soft_fail.py) | Degraded-result pattern |
|
|
301
|
+
| [21_consumer_wrapper.py](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/examples/21_consumer_wrapper.py) | Service Bus handler |
|
|
302
|
+
| [39_v3_transports.py](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/examples/39_v3_transports.py) | All ten log sinks |
|
|
303
|
+
| [e2e_azure_function.py](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/examples/e2e_azure_function.py) | Full Azure Function |
|
|
304
|
+
| [e2e_fastapi_pipeline.py](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/examples/e2e_fastapi_pipeline.py) | Full FastAPI app |
|
|
305
|
+
| [e2e_aks_sb_worker.py](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/examples/e2e_aks_sb_worker.py) | Full AKS Service Bus consumer |
|
|
306
|
+
|
|
307
|
+
Reading order and per-example extras:
|
|
308
|
+
[examples/README.md](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/examples/README.md).
|
|
309
|
+
|
|
310
|
+
## Docs & links
|
|
311
|
+
|
|
312
|
+
- **[Documentation site](https://adammatthewsteinberger.github.io/vibey-bootstrap/)** — usage guide, migration guides, generated API reference for all 45 public packages
|
|
313
|
+
- **[Usage Guide](https://adammatthewsteinberger.github.io/vibey-bootstrap/usage/)** — installation & extras matrix, every subpackage, three end-to-end recipes, TypeScript/Next.js integration
|
|
314
|
+
- **[API Reference](https://adammatthewsteinberger.github.io/vibey-bootstrap/reference/)** — rendered from docstrings and signatures on every push
|
|
315
|
+
- **[CHANGELOG](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/CHANGELOG.md)** · **[v1 → v2](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/MIGRATING-FROM-V1.md)** · **[v2 → v3](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/MIGRATING-TO-V3.md)** (additive) · **[v3 → v4](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/MIGRATING-TO-V4.md)** (rename only; pin `vibey-bootstrap>=4,<5`)
|
|
316
|
+
- **[PyPI](https://pypi.org/project/vibey-bootstrap/)** · **[Issues](https://github.com/adammatthewsteinberger/vibey-bootstrap/issues)** · **[Security policy](https://github.com/adammatthewsteinberger/vibey-bootstrap/security/policy)**
|
|
317
|
+
|
|
318
|
+
## Related projects
|
|
319
|
+
|
|
320
|
+
Part of the same open-source family — MIT, on PyPI:
|
|
321
|
+
|
|
322
|
+
- **[claudeloop](https://github.com/adammatthewsteinberger/claudeloop)** · **[codexloop](https://github.com/adammatthewsteinberger/codexloop)** · **[cursorloop](https://github.com/adammatthewsteinberger/cursorloop)** · **[agyloop](https://github.com/adammatthewsteinberger/agyloop)** — autonomous coding-session runners with the same contract, different vendor
|
|
323
|
+
- **[vibey](https://github.com/adammatthewsteinberger/vibey)** — six-phase queue conductor over the loop runners
|
|
324
|
+
- **[vibey-skills](https://github.com/adammatthewsteinberger/vibey-skills)** — Claude Code plugin marketplace: 18 plugins / 71 Agent Skills (includes a plugin for this library)
|
|
325
|
+
- **[engineering-influence-skills](https://github.com/adammatthewsteinberger/engineering-influence-skills)** — Claude Code plugin marketplace for the content pipeline
|
|
326
|
+
- **[homebrew-tap](https://github.com/adammatthewsteinberger/homebrew-tap)** — `brew tap adammatthewsteinberger/tap`
|
|
327
|
+
- **[clippy-pet](https://github.com/adammatthewsteinberger/clippy-pet)** — the fun one
|
|
328
|
+
|
|
329
|
+
## Contributing
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
git clone https://github.com/adammatthewsteinberger/vibey-bootstrap
|
|
333
|
+
cd vibey-bootstrap
|
|
334
|
+
python -m venv .venv && source .venv/bin/activate
|
|
335
|
+
pip install -e ".[dev,test,all]"
|
|
336
|
+
pytest -m "not integration" # unit suite with coverage
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
Branch from `develop`, Conventional Commits, PRs need green CI (unit + integration
|
|
340
|
+
+ docs build). Coverage floor is 85% (90% for new code). Details in
|
|
341
|
+
[CONTRIBUTING.md](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/CONTRIBUTING.md);
|
|
342
|
+
AI-assistant context lives in
|
|
343
|
+
[CLAUDE.md](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/CLAUDE.md).
|
|
344
|
+
|
|
345
|
+
## License & attribution
|
|
346
|
+
|
|
347
|
+
MIT — see [LICENSE](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/LICENSE). Originally developed as
|
|
348
|
+
TheViziusGroup/azure-bootstrap while at The Vizius Group; republished here as
|
|
349
|
+
adammatthewsteinberger/vibey-bootstrap with The Vizius Group's permission — see
|
|
350
|
+
[NOTICE.md](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/NOTICE.md).
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
Built by [Adam Matthew Steinberger](https://hire.adam.matthewsteinberger.com) · [more open source](https://hire.adam.matthewsteinberger.com/open-source)
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# vibey-bootstrap
|
|
2
|
+
|
|
3
|
+
> The cross-cutting layer for Azure Functions, FastAPI services, and AKS workers.
|
|
4
|
+
> One call bootstraps logging → App Configuration + Key Vault → Application Insights
|
|
5
|
+
> and hands you a populated `os.environ`. Everything past that (alerts, tracing,
|
|
6
|
+
> Service Bus, ten log transports, a scaffold CLI) is opt-in via pip extras.
|
|
7
|
+
> Used across 17+ Azure Functions repos at Vizius.
|
|
8
|
+
|
|
9
|
+
Formerly **azure-bootstrap** — see [NOTICE.md](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/NOTICE.md).
|
|
10
|
+
|
|
11
|
+
[](https://pypi.org/project/vibey-bootstrap/)
|
|
12
|
+
[](https://pypi.org/project/vibey-bootstrap/)
|
|
13
|
+
[](https://pypi.org/project/vibey-bootstrap/)
|
|
14
|
+
[](https://github.com/adammatthewsteinberger/vibey-bootstrap/actions/workflows/ci-cd.yml)
|
|
15
|
+
[](https://adammatthewsteinberger.github.io/vibey-bootstrap/)
|
|
16
|
+
[](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/LICENSE)
|
|
17
|
+
|
|
18
|
+
## Why
|
|
19
|
+
|
|
20
|
+
Every Azure app hits the same startup deadlock: you need logging to report
|
|
21
|
+
config loading, but App Insights logging needs config to initialize. Most repos
|
|
22
|
+
solve it with a copy-pasted `src/infrastructure/` folder that drifts. This
|
|
23
|
+
library is that folder, done once, tested, and versioned.
|
|
24
|
+
|
|
25
|
+
The **four-phase bootstrap** breaks the cycle:
|
|
26
|
+
|
|
27
|
+
1. **Console logging** — works immediately, before anything loads.
|
|
28
|
+
2. **Telemetry from env** — App Insights if `APPLICATIONINSIGHTS_CONNECTION_STRING` is already set.
|
|
29
|
+
3. **Configuration** — Azure App Configuration + Key Vault references → `os.environ`.
|
|
30
|
+
Local values (`local.settings.json`, your shell) always win; nothing is overwritten.
|
|
31
|
+
4. **Telemetry upgrade** — if the connection string only arrived via config, upgrade now.
|
|
32
|
+
|
|
33
|
+
Guarantees: the v1 API surface is preserved byte-identical across v2, v3, and v4
|
|
34
|
+
(v4 changes only the distribution and import name — see
|
|
35
|
+
[MIGRATING-TO-V4.md](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/MIGRATING-TO-V4.md)); every
|
|
36
|
+
extra is opt-in and most are stdlib-only; log transports never block, never raise,
|
|
37
|
+
and use a bounded buffer. `USE_MOCK_BOOTSTRAP=true` runs everything without Azure.
|
|
38
|
+
|
|
39
|
+
## Quick start
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install vibey-bootstrap
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
import os
|
|
47
|
+
from vibey_bootstrap import initialize_application, get_bootstrap_logger
|
|
48
|
+
|
|
49
|
+
logger = get_bootstrap_logger(__name__) # usable before bootstrap completes
|
|
50
|
+
config_repo = initialize_application() # runs all four phases
|
|
51
|
+
|
|
52
|
+
db_host = os.getenv("DATABASE_HOST") # App Config + Key Vault values are in os.environ
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Requires Python 3.11+. Falls back to plain environment variables when App
|
|
56
|
+
Configuration is not configured, so the same code runs locally and in Azure.
|
|
57
|
+
|
|
58
|
+
## Worked example: production-grade logging in four lines
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
from vibey_bootstrap.alerts import install_global_exception_hooks, register_dispatcher
|
|
62
|
+
from vibey_bootstrap.bootstrap import ensure_bootstrap
|
|
63
|
+
from vibey_bootstrap.logging import configure_logging
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def my_email_sender(recipients, subject, html_body):
|
|
67
|
+
... # any callable with this signature (Graph, SendGrid, ACS)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
configure_logging()
|
|
71
|
+
install_global_exception_hooks()
|
|
72
|
+
ensure_bootstrap()
|
|
73
|
+
register_dispatcher(my_email_sender, recipients=["dev-alerts@example.com"])
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
After this, every line emitted through stdlib `logging` carries a correlation
|
|
77
|
+
ID, extra fields render as greppable `key=repr(value)` pairs, noisy third-party
|
|
78
|
+
loggers are silenced, and uncaught exceptions fire CRITICAL alerts with dedup,
|
|
79
|
+
rate-limiting, and escalation. Runnable version:
|
|
80
|
+
[examples/01_quickstart.py](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/examples/01_quickstart.py).
|
|
81
|
+
|
|
82
|
+
## What's in the box
|
|
83
|
+
|
|
84
|
+
| Layer | Install | You get |
|
|
85
|
+
| --- | --- | --- |
|
|
86
|
+
| **v1 core** | `vibey-bootstrap` | Four-phase bootstrap, `EnhancedConfigRepository`, `TelemetryManager` |
|
|
87
|
+
| **v2 Tier 1** (always on, stdlib) | `vibey-bootstrap` | Structured logging, correlation IDs, masking, `@traced`, counters, error vocabulary, soft-fail, phases, validation, path safety, fail-close env helpers |
|
|
88
|
+
| **v2 Tier 2/3** (opt-in) | `[alerts]`, `[fastapi]`, `[servicebus]`, `[retry]`, … | Tiered alerts, FastAPI middleware, health probes, heartbeat, Service Bus consumer + DLQ, webhook auth, ingress hardening, HMAC tokens, AI usage tracker |
|
|
89
|
+
| **v3** (opt-in) | `[logging-all]`, `[db]`, `[email]`, `[http]`, `[aks]`, … | Ten log transports, SQLAlchemy + outbox, ACS email, hardened HTTP client, DocumentDB factory, AKS runtime helpers, governance, `vibey-bootstrap` scaffold CLI |
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Common combinations
|
|
93
|
+
pip install 'vibey-bootstrap[alerts,fastapi,health]'
|
|
94
|
+
pip install 'vibey-bootstrap[servicebus,sb-lock,retry,heartbeat]'
|
|
95
|
+
pip install 'vibey-bootstrap[all]'
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The full extras matrix (40+ extras, what each pulls in, when you need it) is in
|
|
99
|
+
the [Usage Guide](https://adammatthewsteinberger.github.io/vibey-bootstrap/usage/#1-installation-extras).
|
|
100
|
+
|
|
101
|
+
<details>
|
|
102
|
+
<summary>Feature inventory by release</summary>
|
|
103
|
+
|
|
104
|
+
**v2** — structured logging (`ExtraFieldsFormatter`, `correlation_scope`,
|
|
105
|
+
secret/email/control-char masking, noisy-logger silencing) · `@traced` with
|
|
106
|
+
latency histograms and slow-budget alerts · `alert_dev_team` with WARN / ERROR /
|
|
107
|
+
CRITICAL, dedup + rate-limit + escalation, `install_global_exception_hooks` ·
|
|
108
|
+
`PipelineError` → `UnrecoverableError` / `TransientError` with `is_unrecoverable`,
|
|
109
|
+
soft-fail and per-phase guards · 4-gate attachment classifier (extension → MIME →
|
|
110
|
+
size → magic bytes), zip-bomb defense, PDF action stripping, filename sanitizer +
|
|
111
|
+
root confinement · Service Bus `handle_message` with dead-letter-vs-abandon
|
|
112
|
+
routing and `lock_for_process` · `install_graph_webhook_route` with validation
|
|
113
|
+
handshake, clientState verification, dedup, rate limit · AI usage tracker (tokens
|
|
114
|
+
+ cost, sliding windows, soft TPM cap) · health probes, FastAPI middleware,
|
|
115
|
+
heartbeat + consumer watchdog, dynamic log-level refresh, DLQ digest with
|
|
116
|
+
HMAC-signed resubmit tokens, `/api/metrics` aggregator.
|
|
117
|
+
|
|
118
|
+
**v3** — ten logging transports (console, App Insights, Sumo Logic, Panther, file,
|
|
119
|
+
blob, SQL, NoSQL, ADX, Event Hubs; all share `_BufferedShipper` guarantees) ·
|
|
120
|
+
SQLAlchemy session factory, Alembic helpers, transactional outbox · `AcsEmailSender`
|
|
121
|
+
· hardened sync `requests` session + optional async `httpx` · Mongo/Cosmos client
|
|
122
|
+
factory from env · AKS `build_info`, SIGTERM handlers, leader-election stub ·
|
|
123
|
+
budget guard + usage tracking hooks · `vibey-bootstrap list|scaffold` for
|
|
124
|
+
Terraform/Bicep/Helm/GitOps/CI/policy templates.
|
|
125
|
+
|
|
126
|
+
Every entry is cataloged by tier in the
|
|
127
|
+
[CHANGELOG](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/CHANGELOG.md).
|
|
128
|
+
|
|
129
|
+
</details>
|
|
130
|
+
|
|
131
|
+
## Examples
|
|
132
|
+
|
|
133
|
+
[examples/](https://github.com/adammatthewsteinberger/vibey-bootstrap/tree/main/examples/)
|
|
134
|
+
holds 46 numbered single-concept files plus 3 end-to-end app templates. Every
|
|
135
|
+
file runs with `USE_MOCK_BOOTSTRAP=true` and ends with an `# ── Expected output ──`
|
|
136
|
+
block. Start with:
|
|
137
|
+
|
|
138
|
+
| File | Concept |
|
|
139
|
+
| --- | --- |
|
|
140
|
+
| [01_quickstart.py](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/examples/01_quickstart.py) | 30-second setup |
|
|
141
|
+
| [03_correlation_scope.py](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/examples/03_correlation_scope.py) | Correlation IDs across nested calls |
|
|
142
|
+
| [09_soft_fail.py](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/examples/09_soft_fail.py) | Degraded-result pattern |
|
|
143
|
+
| [21_consumer_wrapper.py](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/examples/21_consumer_wrapper.py) | Service Bus handler |
|
|
144
|
+
| [39_v3_transports.py](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/examples/39_v3_transports.py) | All ten log sinks |
|
|
145
|
+
| [e2e_azure_function.py](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/examples/e2e_azure_function.py) | Full Azure Function |
|
|
146
|
+
| [e2e_fastapi_pipeline.py](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/examples/e2e_fastapi_pipeline.py) | Full FastAPI app |
|
|
147
|
+
| [e2e_aks_sb_worker.py](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/examples/e2e_aks_sb_worker.py) | Full AKS Service Bus consumer |
|
|
148
|
+
|
|
149
|
+
Reading order and per-example extras:
|
|
150
|
+
[examples/README.md](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/examples/README.md).
|
|
151
|
+
|
|
152
|
+
## Docs & links
|
|
153
|
+
|
|
154
|
+
- **[Documentation site](https://adammatthewsteinberger.github.io/vibey-bootstrap/)** — usage guide, migration guides, generated API reference for all 45 public packages
|
|
155
|
+
- **[Usage Guide](https://adammatthewsteinberger.github.io/vibey-bootstrap/usage/)** — installation & extras matrix, every subpackage, three end-to-end recipes, TypeScript/Next.js integration
|
|
156
|
+
- **[API Reference](https://adammatthewsteinberger.github.io/vibey-bootstrap/reference/)** — rendered from docstrings and signatures on every push
|
|
157
|
+
- **[CHANGELOG](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/CHANGELOG.md)** · **[v1 → v2](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/MIGRATING-FROM-V1.md)** · **[v2 → v3](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/MIGRATING-TO-V3.md)** (additive) · **[v3 → v4](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/MIGRATING-TO-V4.md)** (rename only; pin `vibey-bootstrap>=4,<5`)
|
|
158
|
+
- **[PyPI](https://pypi.org/project/vibey-bootstrap/)** · **[Issues](https://github.com/adammatthewsteinberger/vibey-bootstrap/issues)** · **[Security policy](https://github.com/adammatthewsteinberger/vibey-bootstrap/security/policy)**
|
|
159
|
+
|
|
160
|
+
## Related projects
|
|
161
|
+
|
|
162
|
+
Part of the same open-source family — MIT, on PyPI:
|
|
163
|
+
|
|
164
|
+
- **[claudeloop](https://github.com/adammatthewsteinberger/claudeloop)** · **[codexloop](https://github.com/adammatthewsteinberger/codexloop)** · **[cursorloop](https://github.com/adammatthewsteinberger/cursorloop)** · **[agyloop](https://github.com/adammatthewsteinberger/agyloop)** — autonomous coding-session runners with the same contract, different vendor
|
|
165
|
+
- **[vibey](https://github.com/adammatthewsteinberger/vibey)** — six-phase queue conductor over the loop runners
|
|
166
|
+
- **[vibey-skills](https://github.com/adammatthewsteinberger/vibey-skills)** — Claude Code plugin marketplace: 18 plugins / 71 Agent Skills (includes a plugin for this library)
|
|
167
|
+
- **[engineering-influence-skills](https://github.com/adammatthewsteinberger/engineering-influence-skills)** — Claude Code plugin marketplace for the content pipeline
|
|
168
|
+
- **[homebrew-tap](https://github.com/adammatthewsteinberger/homebrew-tap)** — `brew tap adammatthewsteinberger/tap`
|
|
169
|
+
- **[clippy-pet](https://github.com/adammatthewsteinberger/clippy-pet)** — the fun one
|
|
170
|
+
|
|
171
|
+
## Contributing
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
git clone https://github.com/adammatthewsteinberger/vibey-bootstrap
|
|
175
|
+
cd vibey-bootstrap
|
|
176
|
+
python -m venv .venv && source .venv/bin/activate
|
|
177
|
+
pip install -e ".[dev,test,all]"
|
|
178
|
+
pytest -m "not integration" # unit suite with coverage
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Branch from `develop`, Conventional Commits, PRs need green CI (unit + integration
|
|
182
|
+
+ docs build). Coverage floor is 85% (90% for new code). Details in
|
|
183
|
+
[CONTRIBUTING.md](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/CONTRIBUTING.md);
|
|
184
|
+
AI-assistant context lives in
|
|
185
|
+
[CLAUDE.md](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/CLAUDE.md).
|
|
186
|
+
|
|
187
|
+
## License & attribution
|
|
188
|
+
|
|
189
|
+
MIT — see [LICENSE](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/LICENSE). Originally developed as
|
|
190
|
+
TheViziusGroup/azure-bootstrap while at The Vizius Group; republished here as
|
|
191
|
+
adammatthewsteinberger/vibey-bootstrap with The Vizius Group's permission — see
|
|
192
|
+
[NOTICE.md](https://github.com/adammatthewsteinberger/vibey-bootstrap/blob/main/NOTICE.md).
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
Built by [Adam Matthew Steinberger](https://hire.adam.matthewsteinberger.com) · [more open source](https://hire.adam.matthewsteinberger.com/open-source)
|