svc-infra 0.1.621__tar.gz → 0.1.623__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.
Potentially problematic release.
This version of svc-infra might be problematic. Click here for more details.
- {svc_infra-0.1.621 → svc_infra-0.1.623}/PKG-INFO +16 -16
- {svc_infra-0.1.621 → svc_infra-0.1.623}/README.md +15 -15
- {svc_infra-0.1.621 → svc_infra-0.1.623}/pyproject.toml +2 -2
- svc_infra-0.1.623/src/svc_infra/cli/cmds/docs/docs_cmds.py +189 -0
- svc_infra-0.1.621/src/svc_infra/cli/cmds/docs/docs_cmds.py +0 -266
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/apf_payments/README.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/apf_payments/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/apf_payments/alembic.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/apf_payments/models.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/apf_payments/provider/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/apf_payments/provider/aiydan.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/apf_payments/provider/base.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/apf_payments/provider/registry.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/apf_payments/provider/stripe.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/apf_payments/schemas.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/apf_payments/service.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/apf_payments/settings.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/apf_payments/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/apf_payments/router.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/apf_payments/setup.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/auth/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/auth/_cookies.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/auth/add.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/auth/gaurd.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/auth/mfa/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/auth/mfa/models.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/auth/mfa/pre_auth.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/auth/mfa/router.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/auth/mfa/security.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/auth/mfa/utils.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/auth/mfa/verify.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/auth/policy.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/auth/providers.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/auth/routers/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/auth/routers/account.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/auth/routers/apikey_router.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/auth/routers/oauth_router.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/auth/routers/session_router.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/auth/security.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/auth/sender.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/auth/settings.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/auth/state.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/cache/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/cache/add.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/db/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/db/http.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/db/nosql/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/db/nosql/mongo/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/db/nosql/mongo/add.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/db/nosql/mongo/crud_router.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/db/nosql/mongo/health.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/db/sql/README.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/db/sql/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/db/sql/add.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/db/sql/crud_router.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/db/sql/health.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/db/sql/session.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/db/sql/users.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/dependencies/ratelimit.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/docs/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/docs/add.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/docs/landing.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/docs/scoped.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/dual/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/dual/dualize.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/dual/protected.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/dual/public.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/dual/router.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/dual/utils.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/dx.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/ease.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/http/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/http/concurrency.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/http/conditional.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/http/deprecation.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/middleware/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/middleware/debug.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/middleware/errors/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/middleware/errors/catchall.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/middleware/errors/exceptions.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/middleware/errors/handlers.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/middleware/idempotency.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/middleware/idempotency_store.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/middleware/optimistic_lock.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/middleware/ratelimit.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/middleware/ratelimit_store.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/middleware/request_id.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/middleware/request_size_limit.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/openapi/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/openapi/apply.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/openapi/conventions.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/openapi/models.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/openapi/mutators.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/openapi/pipeline.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/openapi/responses.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/openapi/security.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/ops/add.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/pagination.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/paths/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/paths/auth.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/paths/generic.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/paths/prefix.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/paths/user.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/routers/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/routers/ping.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/setup.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/tenancy/add.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/api/fastapi/tenancy/context.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/app/README.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/app/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/app/env.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/app/logging/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/app/logging/add.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/app/logging/filter.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/app/logging/formats.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/app/root.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/billing/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/billing/models.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/billing/service.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/bundled_docs/README.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/bundled_docs/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/bundled_docs/getting-started.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cache/README.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cache/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cache/backend.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cache/decorators.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cache/demo.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cache/keys.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cache/recache.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cache/resources.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cache/tags.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cache/ttl.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cache/utils.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/__main__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/cmds/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/cmds/db/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/cmds/db/nosql/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/cmds/db/nosql/mongo/README.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/cmds/db/nosql/mongo/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/cmds/db/nosql/mongo/mongo_cmds.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/cmds/db/nosql/mongo/mongo_scaffold_cmds.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/cmds/db/sql/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/cmds/db/sql/alembic_cmds.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/cmds/db/sql/sql_export_cmds.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/cmds/db/sql/sql_scaffold_cmds.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/cmds/dx/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/cmds/dx/dx_cmds.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/cmds/help.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/cmds/jobs/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/cmds/jobs/jobs_cmds.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/cmds/obs/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/cmds/obs/obs_cmds.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/cmds/sdk/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/cmds/sdk/sdk_cmds.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/foundation/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/foundation/runner.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/cli/foundation/typer_bootstrap.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/data/add.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/data/backup.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/data/erasure.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/data/fixtures.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/data/retention.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/crud_schema.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/inbox.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/nosql/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/nosql/base.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/nosql/constants.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/nosql/core.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/nosql/indexes.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/nosql/management.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/nosql/mongo/README.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/nosql/mongo/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/nosql/mongo/client.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/nosql/mongo/settings.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/nosql/mongo/templates/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/nosql/mongo/templates/documents.py.tmpl +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/nosql/mongo/templates/resources.py.tmpl +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/nosql/mongo/templates/schemas.py.tmpl +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/nosql/repository.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/nosql/resource.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/nosql/scaffold.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/nosql/service.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/nosql/service_with_hooks.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/nosql/types.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/nosql/utils.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/outbox.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/README.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/apikey.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/authref.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/base.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/constants.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/core.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/management.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/repository.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/resource.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/scaffold.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/service.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/service_with_hooks.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/templates/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/templates/models_schemas/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/templates/models_schemas/auth/models.py.tmpl +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/templates/models_schemas/auth/schemas.py.tmpl +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/templates/models_schemas/entity/models.py.tmpl +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/templates/models_schemas/entity/schemas.py.tmpl +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/templates/setup/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/templates/setup/alembic.ini.tmpl +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/templates/setup/env_async.py.tmpl +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/templates/setup/env_sync.py.tmpl +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/templates/setup/script.py.mako.tmpl +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/tenant.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/types.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/uniq.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/uniq_hooks.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/utils.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/sql/versioning.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/db/utils.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/acceptance-matrix.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/acceptance.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/adr/0002-background-jobs-and-scheduling.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/adr/0003-webhooks-framework.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/adr/0004-tenancy-model.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/adr/0005-data-lifecycle.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/adr/0006-ops-slos-and-metrics.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/adr/0007-docs-and-sdks.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/adr/0008-billing-primitives.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/adr/0009-acceptance-harness.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/api.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/auth.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/cache.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/cli.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/contributing.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/data-lifecycle.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/database.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/docs-and-sdks.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/environment.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/idempotency.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/jobs.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/observability.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/ops.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/rate-limiting.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/repo-review.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/security.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/tenancy.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623/src/svc_infra}/docs/webhooks.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/dx/add.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/dx/changelog.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/dx/checks.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/jobs/builtins/outbox_processor.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/jobs/builtins/webhook_delivery.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/jobs/easy.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/jobs/loader.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/jobs/queue.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/jobs/redis_queue.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/jobs/scheduler.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/jobs/worker.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/mcp/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/mcp/svc_infra_mcp.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/README.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/add.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/cloud_dash.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/grafana/dashboards/http-overview.json +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/metrics/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/metrics/asgi.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/metrics/base.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/metrics/http.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/metrics/sqlalchemy.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/metrics.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/providers/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/providers/compose_cloud/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/providers/compose_cloud/templates/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/providers/compose_cloud/templates/agent.yaml.tmpl +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/providers/compose_cloud/templates/docker-compose.cloud.yml.tmpl +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/providers/grafana/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/providers/grafana/dashboards/00_overview.json +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/providers/grafana/dashboards/10_http.json +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/providers/grafana/dashboards/20_db.json +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/providers/grafana/dashboards/30_runtime.json +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/providers/grafana/dashboards/40_clients.json +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/providers/grafana/dashboards/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/providers/grafana/templates/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/providers/grafana/templates/docker-compose.yml.tmpl +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/providers/grafana/templates/prometheus.yml.tmpl +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/providers/grafana/templates/provisioning/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/providers/grafana/templates/provisioning/dashboards.yml +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/providers/grafana/templates/provisioning/datasource.yml +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/settings.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/templates/grafana_dashboard.json +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/templates/prometheus_rules.yml +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/templates/sidecars/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/templates/sidecars/compose/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/templates/sidecars/compose/agent.yaml +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/templates/sidecars/compose/docker-compose.yml +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/templates/sidecars/fly/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/templates/sidecars/fly/agent.yaml +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/templates/sidecars/fly/fly.toml.fragment +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/templates/sidecars/k8s/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/templates/sidecars/k8s/configmap.yaml +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/templates/sidecars/k8s/deployment.yaml +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/templates/sidecars/railway/Dockerfile +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/templates/sidecars/railway/README.md +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/templates/sidecars/railway/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/obs/templates/sidecars/railway/agent.yaml +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/py.typed +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/security/add.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/security/audit.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/security/audit_service.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/security/headers.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/security/hibp.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/security/jwt_rotation.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/security/lockout.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/security/models.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/security/org_invites.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/security/passwords.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/security/permissions.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/security/session.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/security/signed_cookies.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/utils.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/webhooks/__init__.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/webhooks/add.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/webhooks/fastapi.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/webhooks/router.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/webhooks/service.py +0 -0
- {svc_infra-0.1.621 → svc_infra-0.1.623}/src/svc_infra/webhooks/signing.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: svc-infra
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.623
|
|
4
4
|
Summary: Infrastructure for building and deploying prod-ready services
|
|
5
5
|
License: MIT
|
|
6
6
|
Keywords: fastapi,sqlalchemy,alembic,auth,infra,async,pydantic
|
|
@@ -77,7 +77,7 @@ Description-Content-Type: text/markdown
|
|
|
77
77
|
# svc-infra
|
|
78
78
|
|
|
79
79
|
[](https://pypi.org/project/svc-infra/)
|
|
80
|
-
[](docs/)
|
|
80
|
+
[](src/svc_infra/docs/)
|
|
81
81
|
|
|
82
82
|
svc-infra packages the shared building blocks we use to ship production FastAPI services fast—HTTP APIs with secure auth, durable persistence, background execution, cache, observability, and webhook plumbing that all share the same batteries-included defaults.
|
|
83
83
|
|
|
@@ -85,17 +85,17 @@ svc-infra packages the shared building blocks we use to ship production FastAPI
|
|
|
85
85
|
|
|
86
86
|
| Helper | What it covers | Guide |
|
|
87
87
|
| --- | --- | --- |
|
|
88
|
-
| API | FastAPI bootstrap, envelopes, middleware, docs wiring | [FastAPI guide](docs/api.md) |
|
|
89
|
-
| Auth | Sessions, OAuth/OIDC, MFA, SMTP delivery | [Auth settings](docs/auth.md) |
|
|
90
|
-
| Database | SQL + Mongo wiring, Alembic helpers, inbox/outbox patterns | [Database guide](docs/database.md) |
|
|
91
|
-
| Jobs | JobQueue, scheduler, CLI worker | [Jobs quickstart](docs/jobs.md) |
|
|
92
|
-
| Cache | cashews decorators, namespace management, TTL helpers | [Cache guide](docs/cache.md) |
|
|
93
|
-
| Observability | Prometheus middleware, Grafana automation, OTEL hooks | [Observability guide](docs/observability.md) |
|
|
94
|
-
| Ops | Probes, breaker, SLOs & dashboards | [SLOs & Ops](docs/ops.md) |
|
|
95
|
-
| Webhooks | Subscription store, signing, retry worker | [Webhooks framework](docs/webhooks.md) |
|
|
96
|
-
| Security | Password policy, lockout, signed cookies, headers | [Security hardening](docs/security.md) |
|
|
97
|
-
| Contributing | Dev setup and quality gates | [Contributing guide](docs/contributing.md) |
|
|
98
|
-
| Data Lifecycle | Fixtures, retention, erasure, backups | [Data lifecycle](docs/data-lifecycle.md) |
|
|
88
|
+
| API | FastAPI bootstrap, envelopes, middleware, docs wiring | [FastAPI guide](src/svc_infra/docs/api.md) |
|
|
89
|
+
| Auth | Sessions, OAuth/OIDC, MFA, SMTP delivery | [Auth settings](src/svc_infra/docs/auth.md) |
|
|
90
|
+
| Database | SQL + Mongo wiring, Alembic helpers, inbox/outbox patterns | [Database guide](src/svc_infra/docs/database.md) |
|
|
91
|
+
| Jobs | JobQueue, scheduler, CLI worker | [Jobs quickstart](src/svc_infra/docs/jobs.md) |
|
|
92
|
+
| Cache | cashews decorators, namespace management, TTL helpers | [Cache guide](src/svc_infra/docs/cache.md) |
|
|
93
|
+
| Observability | Prometheus middleware, Grafana automation, OTEL hooks | [Observability guide](src/svc_infra/docs/observability.md) |
|
|
94
|
+
| Ops | Probes, breaker, SLOs & dashboards | [SLOs & Ops](src/svc_infra/docs/ops.md) |
|
|
95
|
+
| Webhooks | Subscription store, signing, retry worker | [Webhooks framework](src/svc_infra/docs/webhooks.md) |
|
|
96
|
+
| Security | Password policy, lockout, signed cookies, headers | [Security hardening](src/svc_infra/docs/security.md) |
|
|
97
|
+
| Contributing | Dev setup and quality gates | [Contributing guide](src/svc_infra/docs/contributing.md) |
|
|
98
|
+
| Data Lifecycle | Fixtures, retention, erasure, backups | [Data lifecycle](src/svc_infra/docs/data-lifecycle.md) |
|
|
99
99
|
|
|
100
100
|
## Minimal FastAPI bootstrap
|
|
101
101
|
|
|
@@ -123,9 +123,9 @@ async def handle_webhook(payload = Depends(require_signature(lambda: ["current",
|
|
|
123
123
|
- **API** – toggle logging/observability and docs exposure with `ENABLE_LOGGING`, `LOG_LEVEL`, `LOG_FORMAT`, `ENABLE_OBS`, `METRICS_PATH`, `OBS_SKIP_PATHS`, and `CORS_ALLOW_ORIGINS`. 【F:src/svc_infra/api/fastapi/ease.py†L67-L111】【F:src/svc_infra/api/fastapi/setup.py†L47-L88】
|
|
124
124
|
- **Auth** – configure JWT secrets, SMTP, cookies, and policy using the `AUTH_…` settings family (e.g., `AUTH_JWT__SECRET`, `AUTH_SMTP_HOST`, `AUTH_SESSION_COOKIE_SECURE`). 【F:src/svc_infra/api/fastapi/auth/settings.py†L23-L91】
|
|
125
125
|
- **Database** – set connection URLs or components via `SQL_URL`/`SQL_URL_FILE`, `DB_DIALECT`, `DB_HOST`, `DB_USER`, `DB_PASSWORD`, plus Mongo knobs like `MONGO_URL`, `MONGO_DB`, and `MONGO_URL_FILE`. 【F:src/svc_infra/api/fastapi/db/sql/add.py†L55-L114】【F:src/svc_infra/db/sql/utils.py†L85-L206】【F:src/svc_infra/db/nosql/mongo/settings.py†L9-L13】【F:src/svc_infra/db/nosql/utils.py†L56-L113】
|
|
126
|
-
- **Jobs** – choose the queue backend with `JOBS_DRIVER` and provide Redis via `REDIS_URL`; interval schedules can be declared with `JOBS_SCHEDULE_JSON`. 【F:src/svc_infra/jobs/easy.py†L11-L27】【F:docs/jobs.md†L11-L48】
|
|
126
|
+
- **Jobs** – choose the queue backend with `JOBS_DRIVER` and provide Redis via `REDIS_URL`; interval schedules can be declared with `JOBS_SCHEDULE_JSON`. 【F:src/svc_infra/jobs/easy.py†L11-L27】【F:src/svc_infra/docs/jobs.md†L11-L48】
|
|
127
127
|
- **Cache** – namespace keys and lifetimes through `CACHE_PREFIX`, `CACHE_VERSION`, and TTL overrides `CACHE_TTL_DEFAULT`, `CACHE_TTL_SHORT`, `CACHE_TTL_LONG`. 【F:src/svc_infra/cache/README.md†L20-L173】【F:src/svc_infra/cache/ttl.py†L26-L55】
|
|
128
128
|
- **Observability** – turn metrics on/off or adjust scrape paths with `ENABLE_OBS`, `METRICS_PATH`, `OBS_SKIP_PATHS`, and Prometheus/Grafana flags like `SVC_INFRA_DISABLE_PROMETHEUS`, `SVC_INFRA_RATE_WINDOW`, `SVC_INFRA_DASHBOARD_REFRESH`, `SVC_INFRA_DASHBOARD_RANGE`. 【F:src/svc_infra/api/fastapi/ease.py†L67-L111】【F:src/svc_infra/obs/metrics/asgi.py†L49-L206】【F:src/svc_infra/obs/cloud_dash.py†L85-L108】
|
|
129
|
-
- **Webhooks** – reuse the jobs envs (`JOBS_DRIVER`, `REDIS_URL`) for the delivery worker and queue configuration. 【F:docs/webhooks.md†L32-L53】
|
|
130
|
-
- **Security** – enforce password policy, MFA, and rotation with auth prefixes such as `AUTH_PASSWORD_MIN_LENGTH`, `AUTH_PASSWORD_REQUIRE_SYMBOL`, `AUTH_JWT__SECRET`, and `AUTH_JWT__OLD_SECRETS`. 【F:docs/security.md†L24-L70】
|
|
129
|
+
- **Webhooks** – reuse the jobs envs (`JOBS_DRIVER`, `REDIS_URL`) for the delivery worker and queue configuration. 【F:src/svc_infra/docs/webhooks.md†L32-L53】
|
|
130
|
+
- **Security** – enforce password policy, MFA, and rotation with auth prefixes such as `AUTH_PASSWORD_MIN_LENGTH`, `AUTH_PASSWORD_REQUIRE_SYMBOL`, `AUTH_JWT__SECRET`, and `AUTH_JWT__OLD_SECRETS`. 【F:src/svc_infra/docs/security.md†L24-L70】
|
|
131
131
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# svc-infra
|
|
2
2
|
|
|
3
3
|
[](https://pypi.org/project/svc-infra/)
|
|
4
|
-
[](docs/)
|
|
4
|
+
[](src/svc_infra/docs/)
|
|
5
5
|
|
|
6
6
|
svc-infra packages the shared building blocks we use to ship production FastAPI services fast—HTTP APIs with secure auth, durable persistence, background execution, cache, observability, and webhook plumbing that all share the same batteries-included defaults.
|
|
7
7
|
|
|
@@ -9,17 +9,17 @@ svc-infra packages the shared building blocks we use to ship production FastAPI
|
|
|
9
9
|
|
|
10
10
|
| Helper | What it covers | Guide |
|
|
11
11
|
| --- | --- | --- |
|
|
12
|
-
| API | FastAPI bootstrap, envelopes, middleware, docs wiring | [FastAPI guide](docs/api.md) |
|
|
13
|
-
| Auth | Sessions, OAuth/OIDC, MFA, SMTP delivery | [Auth settings](docs/auth.md) |
|
|
14
|
-
| Database | SQL + Mongo wiring, Alembic helpers, inbox/outbox patterns | [Database guide](docs/database.md) |
|
|
15
|
-
| Jobs | JobQueue, scheduler, CLI worker | [Jobs quickstart](docs/jobs.md) |
|
|
16
|
-
| Cache | cashews decorators, namespace management, TTL helpers | [Cache guide](docs/cache.md) |
|
|
17
|
-
| Observability | Prometheus middleware, Grafana automation, OTEL hooks | [Observability guide](docs/observability.md) |
|
|
18
|
-
| Ops | Probes, breaker, SLOs & dashboards | [SLOs & Ops](docs/ops.md) |
|
|
19
|
-
| Webhooks | Subscription store, signing, retry worker | [Webhooks framework](docs/webhooks.md) |
|
|
20
|
-
| Security | Password policy, lockout, signed cookies, headers | [Security hardening](docs/security.md) |
|
|
21
|
-
| Contributing | Dev setup and quality gates | [Contributing guide](docs/contributing.md) |
|
|
22
|
-
| Data Lifecycle | Fixtures, retention, erasure, backups | [Data lifecycle](docs/data-lifecycle.md) |
|
|
12
|
+
| API | FastAPI bootstrap, envelopes, middleware, docs wiring | [FastAPI guide](src/svc_infra/docs/api.md) |
|
|
13
|
+
| Auth | Sessions, OAuth/OIDC, MFA, SMTP delivery | [Auth settings](src/svc_infra/docs/auth.md) |
|
|
14
|
+
| Database | SQL + Mongo wiring, Alembic helpers, inbox/outbox patterns | [Database guide](src/svc_infra/docs/database.md) |
|
|
15
|
+
| Jobs | JobQueue, scheduler, CLI worker | [Jobs quickstart](src/svc_infra/docs/jobs.md) |
|
|
16
|
+
| Cache | cashews decorators, namespace management, TTL helpers | [Cache guide](src/svc_infra/docs/cache.md) |
|
|
17
|
+
| Observability | Prometheus middleware, Grafana automation, OTEL hooks | [Observability guide](src/svc_infra/docs/observability.md) |
|
|
18
|
+
| Ops | Probes, breaker, SLOs & dashboards | [SLOs & Ops](src/svc_infra/docs/ops.md) |
|
|
19
|
+
| Webhooks | Subscription store, signing, retry worker | [Webhooks framework](src/svc_infra/docs/webhooks.md) |
|
|
20
|
+
| Security | Password policy, lockout, signed cookies, headers | [Security hardening](src/svc_infra/docs/security.md) |
|
|
21
|
+
| Contributing | Dev setup and quality gates | [Contributing guide](src/svc_infra/docs/contributing.md) |
|
|
22
|
+
| Data Lifecycle | Fixtures, retention, erasure, backups | [Data lifecycle](src/svc_infra/docs/data-lifecycle.md) |
|
|
23
23
|
|
|
24
24
|
## Minimal FastAPI bootstrap
|
|
25
25
|
|
|
@@ -47,8 +47,8 @@ async def handle_webhook(payload = Depends(require_signature(lambda: ["current",
|
|
|
47
47
|
- **API** – toggle logging/observability and docs exposure with `ENABLE_LOGGING`, `LOG_LEVEL`, `LOG_FORMAT`, `ENABLE_OBS`, `METRICS_PATH`, `OBS_SKIP_PATHS`, and `CORS_ALLOW_ORIGINS`. 【F:src/svc_infra/api/fastapi/ease.py†L67-L111】【F:src/svc_infra/api/fastapi/setup.py†L47-L88】
|
|
48
48
|
- **Auth** – configure JWT secrets, SMTP, cookies, and policy using the `AUTH_…` settings family (e.g., `AUTH_JWT__SECRET`, `AUTH_SMTP_HOST`, `AUTH_SESSION_COOKIE_SECURE`). 【F:src/svc_infra/api/fastapi/auth/settings.py†L23-L91】
|
|
49
49
|
- **Database** – set connection URLs or components via `SQL_URL`/`SQL_URL_FILE`, `DB_DIALECT`, `DB_HOST`, `DB_USER`, `DB_PASSWORD`, plus Mongo knobs like `MONGO_URL`, `MONGO_DB`, and `MONGO_URL_FILE`. 【F:src/svc_infra/api/fastapi/db/sql/add.py†L55-L114】【F:src/svc_infra/db/sql/utils.py†L85-L206】【F:src/svc_infra/db/nosql/mongo/settings.py†L9-L13】【F:src/svc_infra/db/nosql/utils.py†L56-L113】
|
|
50
|
-
- **Jobs** – choose the queue backend with `JOBS_DRIVER` and provide Redis via `REDIS_URL`; interval schedules can be declared with `JOBS_SCHEDULE_JSON`. 【F:src/svc_infra/jobs/easy.py†L11-L27】【F:docs/jobs.md†L11-L48】
|
|
50
|
+
- **Jobs** – choose the queue backend with `JOBS_DRIVER` and provide Redis via `REDIS_URL`; interval schedules can be declared with `JOBS_SCHEDULE_JSON`. 【F:src/svc_infra/jobs/easy.py†L11-L27】【F:src/svc_infra/docs/jobs.md†L11-L48】
|
|
51
51
|
- **Cache** – namespace keys and lifetimes through `CACHE_PREFIX`, `CACHE_VERSION`, and TTL overrides `CACHE_TTL_DEFAULT`, `CACHE_TTL_SHORT`, `CACHE_TTL_LONG`. 【F:src/svc_infra/cache/README.md†L20-L173】【F:src/svc_infra/cache/ttl.py†L26-L55】
|
|
52
52
|
- **Observability** – turn metrics on/off or adjust scrape paths with `ENABLE_OBS`, `METRICS_PATH`, `OBS_SKIP_PATHS`, and Prometheus/Grafana flags like `SVC_INFRA_DISABLE_PROMETHEUS`, `SVC_INFRA_RATE_WINDOW`, `SVC_INFRA_DASHBOARD_REFRESH`, `SVC_INFRA_DASHBOARD_RANGE`. 【F:src/svc_infra/api/fastapi/ease.py†L67-L111】【F:src/svc_infra/obs/metrics/asgi.py†L49-L206】【F:src/svc_infra/obs/cloud_dash.py†L85-L108】
|
|
53
|
-
- **Webhooks** – reuse the jobs envs (`JOBS_DRIVER`, `REDIS_URL`) for the delivery worker and queue configuration. 【F:docs/webhooks.md†L32-L53】
|
|
54
|
-
- **Security** – enforce password policy, MFA, and rotation with auth prefixes such as `AUTH_PASSWORD_MIN_LENGTH`, `AUTH_PASSWORD_REQUIRE_SYMBOL`, `AUTH_JWT__SECRET`, and `AUTH_JWT__OLD_SECRETS`. 【F:docs/security.md†L24-L70】
|
|
53
|
+
- **Webhooks** – reuse the jobs envs (`JOBS_DRIVER`, `REDIS_URL`) for the delivery worker and queue configuration. 【F:src/svc_infra/docs/webhooks.md†L32-L53】
|
|
54
|
+
- **Security** – enforce password policy, MFA, and rotation with auth prefixes such as `AUTH_PASSWORD_MIN_LENGTH`, `AUTH_PASSWORD_REQUIRE_SYMBOL`, `AUTH_JWT__SECRET`, and `AUTH_JWT__OLD_SECRETS`. 【F:src/svc_infra/docs/security.md†L24-L70】
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "svc-infra"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.623"
|
|
4
4
|
description = "Infrastructure for building and deploying prod-ready services"
|
|
5
5
|
authors = ["Ali Khatami <aliikhatami94@gmail.com>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -13,7 +13,7 @@ include = [
|
|
|
13
13
|
"src/svc_infra/obs/templates/**/*",
|
|
14
14
|
"src/svc_infra/obs/grafana/templates/**/*",
|
|
15
15
|
"src/svc_infra/obs/grafana/dashboards/**/*",
|
|
16
|
-
"docs/**/*"
|
|
16
|
+
"src/svc_infra/docs/**/*"
|
|
17
17
|
]
|
|
18
18
|
|
|
19
19
|
classifiers = [
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
from importlib.resources import as_file
|
|
5
|
+
from importlib.resources import files as pkg_files
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import Dict, List
|
|
8
|
+
|
|
9
|
+
import click
|
|
10
|
+
import typer
|
|
11
|
+
from typer.core import TyperGroup
|
|
12
|
+
|
|
13
|
+
from svc_infra.app.root import resolve_project_root
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _norm(name: str) -> str:
|
|
17
|
+
return name.strip().lower().replace(" ", "-").replace("_", "-")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _discover_fs_topics(docs_dir: Path) -> Dict[str, Path]:
|
|
21
|
+
topics: Dict[str, Path] = {}
|
|
22
|
+
if docs_dir.exists() and docs_dir.is_dir():
|
|
23
|
+
for p in sorted(docs_dir.glob("*.md")):
|
|
24
|
+
if p.is_file():
|
|
25
|
+
topics[_norm(p.stem)] = p
|
|
26
|
+
return topics
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _discover_pkg_topics() -> Dict[str, Path]:
|
|
30
|
+
"""
|
|
31
|
+
Discover docs shipped inside the installed package at svc_infra/docs/*,
|
|
32
|
+
using importlib.resources so this works for wheels, sdists, and zipped wheels.
|
|
33
|
+
"""
|
|
34
|
+
topics: Dict[str, Path] = {}
|
|
35
|
+
try:
|
|
36
|
+
docs_root = pkg_files("svc_infra").joinpath("docs")
|
|
37
|
+
# docs_root is a Traversable; it may be inside a zip. Iterate safely.
|
|
38
|
+
for entry in docs_root.iterdir():
|
|
39
|
+
if entry.name.endswith(".md"):
|
|
40
|
+
# materialize to a real tempfile path if needed
|
|
41
|
+
with as_file(entry) as concrete:
|
|
42
|
+
p = Path(concrete)
|
|
43
|
+
if p.exists() and p.is_file():
|
|
44
|
+
topics[_norm(p.stem)] = p
|
|
45
|
+
except Exception:
|
|
46
|
+
# If the package has no docs directory, just return empty.
|
|
47
|
+
pass
|
|
48
|
+
return topics
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _resolve_docs_dir(ctx: click.Context) -> Path | None:
|
|
52
|
+
"""
|
|
53
|
+
Optional override precedence:
|
|
54
|
+
1) --docs-dir CLI option
|
|
55
|
+
2) SVC_INFRA_DOCS_DIR env var
|
|
56
|
+
3) *Only when working inside the svc-infra repo itself*: repo-root /docs
|
|
57
|
+
"""
|
|
58
|
+
# 1) CLI option on this or parent contexts
|
|
59
|
+
current: click.Context | None = ctx
|
|
60
|
+
while current is not None:
|
|
61
|
+
docs_dir_opt = (current.params or {}).get("docs_dir")
|
|
62
|
+
if docs_dir_opt:
|
|
63
|
+
path = docs_dir_opt if isinstance(docs_dir_opt, Path) else Path(docs_dir_opt)
|
|
64
|
+
path = path.expanduser()
|
|
65
|
+
if path.exists():
|
|
66
|
+
return path
|
|
67
|
+
current = current.parent
|
|
68
|
+
|
|
69
|
+
# 2) Env var
|
|
70
|
+
env_dir = os.getenv("SVC_INFRA_DOCS_DIR")
|
|
71
|
+
if env_dir:
|
|
72
|
+
p = Path(env_dir).expanduser()
|
|
73
|
+
if p.exists():
|
|
74
|
+
return p
|
|
75
|
+
|
|
76
|
+
# 3) In-repo convenience (so `svc-infra docs` works inside this repo)
|
|
77
|
+
try:
|
|
78
|
+
root = resolve_project_root()
|
|
79
|
+
proj_docs = root / "docs"
|
|
80
|
+
if proj_docs.exists():
|
|
81
|
+
return proj_docs
|
|
82
|
+
except Exception:
|
|
83
|
+
pass
|
|
84
|
+
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
class DocsGroup(TyperGroup):
|
|
89
|
+
def list_commands(self, ctx: click.Context) -> List[str]:
|
|
90
|
+
names: List[str] = list(super().list_commands(ctx) or [])
|
|
91
|
+
dir_to_use = _resolve_docs_dir(ctx)
|
|
92
|
+
fs = _discover_fs_topics(dir_to_use) if dir_to_use else {}
|
|
93
|
+
pkg = _discover_pkg_topics()
|
|
94
|
+
names.extend(fs.keys())
|
|
95
|
+
names.extend([k for k in pkg.keys() if k not in fs])
|
|
96
|
+
return sorted(set(names))
|
|
97
|
+
|
|
98
|
+
def get_command(self, ctx: click.Context, name: str) -> click.Command | None:
|
|
99
|
+
cmd = super().get_command(ctx, name)
|
|
100
|
+
if cmd is not None:
|
|
101
|
+
return cmd
|
|
102
|
+
|
|
103
|
+
key = _norm(name)
|
|
104
|
+
|
|
105
|
+
dir_to_use = _resolve_docs_dir(ctx)
|
|
106
|
+
fs = _discover_fs_topics(dir_to_use) if dir_to_use else {}
|
|
107
|
+
if key in fs:
|
|
108
|
+
file_path = fs[key]
|
|
109
|
+
|
|
110
|
+
@click.command(name=name)
|
|
111
|
+
def _show_fs() -> None:
|
|
112
|
+
click.echo(file_path.read_text(encoding="utf-8", errors="replace"))
|
|
113
|
+
|
|
114
|
+
return _show_fs
|
|
115
|
+
|
|
116
|
+
pkg = _discover_pkg_topics()
|
|
117
|
+
if key in pkg:
|
|
118
|
+
file_path = pkg[key]
|
|
119
|
+
|
|
120
|
+
@click.command(name=name)
|
|
121
|
+
def _show_pkg() -> None:
|
|
122
|
+
click.echo(file_path.read_text(encoding="utf-8", errors="replace"))
|
|
123
|
+
|
|
124
|
+
return _show_pkg
|
|
125
|
+
|
|
126
|
+
return None
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def register(app: typer.Typer) -> None:
|
|
130
|
+
docs_app = typer.Typer(no_args_is_help=True, add_completion=False, cls=DocsGroup)
|
|
131
|
+
|
|
132
|
+
@docs_app.callback(invoke_without_command=True)
|
|
133
|
+
def _docs_options(
|
|
134
|
+
docs_dir: Path | None = typer.Option(
|
|
135
|
+
None,
|
|
136
|
+
"--docs-dir",
|
|
137
|
+
help="Path to a docs directory to read from (overrides packaged docs)",
|
|
138
|
+
),
|
|
139
|
+
topic: str | None = typer.Option(None, "--topic", help="Topic to show directly"),
|
|
140
|
+
) -> None:
|
|
141
|
+
if topic:
|
|
142
|
+
key = _norm(topic)
|
|
143
|
+
ctx = click.get_current_context()
|
|
144
|
+
dir_to_use = _resolve_docs_dir(ctx)
|
|
145
|
+
fs = _discover_fs_topics(dir_to_use) if dir_to_use else {}
|
|
146
|
+
if key in fs:
|
|
147
|
+
typer.echo(fs[key].read_text(encoding="utf-8", errors="replace"))
|
|
148
|
+
raise typer.Exit(code=0)
|
|
149
|
+
pkg = _discover_pkg_topics()
|
|
150
|
+
if key in pkg:
|
|
151
|
+
typer.echo(pkg[key].read_text(encoding="utf-8", errors="replace"))
|
|
152
|
+
raise typer.Exit(code=0)
|
|
153
|
+
raise typer.BadParameter(f"Unknown topic: {topic}")
|
|
154
|
+
|
|
155
|
+
@docs_app.command("list", help="List available documentation topics")
|
|
156
|
+
def list_topics() -> None:
|
|
157
|
+
ctx = click.get_current_context()
|
|
158
|
+
dir_to_use = _resolve_docs_dir(ctx)
|
|
159
|
+
fs = _discover_fs_topics(dir_to_use) if dir_to_use else {}
|
|
160
|
+
pkg = _discover_pkg_topics()
|
|
161
|
+
|
|
162
|
+
def _print(name: str, path: Path) -> None:
|
|
163
|
+
try:
|
|
164
|
+
typer.echo(f"{name}\t{path}")
|
|
165
|
+
except Exception:
|
|
166
|
+
typer.echo(name)
|
|
167
|
+
|
|
168
|
+
for name, path in fs.items():
|
|
169
|
+
_print(name, path)
|
|
170
|
+
for name, path in pkg.items():
|
|
171
|
+
if name not in fs:
|
|
172
|
+
_print(name, path)
|
|
173
|
+
|
|
174
|
+
@docs_app.command("show", help="Show docs for a topic (alternative to dynamic subcommand)")
|
|
175
|
+
def show(topic: str) -> None:
|
|
176
|
+
key = _norm(topic)
|
|
177
|
+
ctx = click.get_current_context()
|
|
178
|
+
dir_to_use = _resolve_docs_dir(ctx)
|
|
179
|
+
fs = _discover_fs_topics(dir_to_use) if dir_to_use else {}
|
|
180
|
+
if key in fs:
|
|
181
|
+
typer.echo(fs[key].read_text(encoding="utf-8", errors="replace"))
|
|
182
|
+
return
|
|
183
|
+
pkg = _discover_pkg_topics()
|
|
184
|
+
if key in pkg:
|
|
185
|
+
typer.echo(pkg[key].read_text(encoding="utf-8", errors="replace"))
|
|
186
|
+
return
|
|
187
|
+
raise typer.BadParameter(f"Unknown topic: {topic}")
|
|
188
|
+
|
|
189
|
+
app.add_typer(docs_app, name="docs")
|
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import importlib.util
|
|
4
|
-
import os
|
|
5
|
-
import sys
|
|
6
|
-
from importlib.metadata import PackageNotFoundError, distribution
|
|
7
|
-
from pathlib import Path
|
|
8
|
-
from typing import Dict, List
|
|
9
|
-
|
|
10
|
-
import click
|
|
11
|
-
import typer
|
|
12
|
-
from typer.core import TyperGroup
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def _norm(name: str) -> str:
|
|
16
|
-
"""Normalize a topic name for stable CLI commands.
|
|
17
|
-
|
|
18
|
-
- Lowercase
|
|
19
|
-
- Replace spaces and underscores with hyphens
|
|
20
|
-
- Strip leading/trailing whitespace
|
|
21
|
-
"""
|
|
22
|
-
return name.strip().lower().replace(" ", "-").replace("_", "-")
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
def _discover_fs_topics(docs_dir: Path) -> Dict[str, Path]:
|
|
26
|
-
topics: Dict[str, Path] = {}
|
|
27
|
-
if docs_dir.exists() and docs_dir.is_dir():
|
|
28
|
-
for p in sorted(docs_dir.glob("*.md")):
|
|
29
|
-
if p.is_file():
|
|
30
|
-
topics[_norm(p.stem)] = p
|
|
31
|
-
return topics
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
def _discover_pkg_topics() -> Dict[str, Path]:
|
|
35
|
-
"""Discover docs packaged under 'docs/' in the installed distribution.
|
|
36
|
-
|
|
37
|
-
Works in external projects without a local docs/ by inspecting the wheel
|
|
38
|
-
metadata and, as a fallback, searching for a top-level docs/ next to the
|
|
39
|
-
installed package directory in site-packages.
|
|
40
|
-
"""
|
|
41
|
-
topics: Dict[str, Path] = {}
|
|
42
|
-
|
|
43
|
-
# 1) Prefer distribution metadata (RECORD) for both hyphen/underscore names
|
|
44
|
-
dist = None
|
|
45
|
-
for name in ("svc-infra", "svc_infra"):
|
|
46
|
-
try:
|
|
47
|
-
dist = distribution(name)
|
|
48
|
-
break
|
|
49
|
-
except PackageNotFoundError:
|
|
50
|
-
dist = None
|
|
51
|
-
|
|
52
|
-
if dist is not None:
|
|
53
|
-
files = getattr(dist, "files", None) or []
|
|
54
|
-
for f in files:
|
|
55
|
-
s = str(f)
|
|
56
|
-
if not s.startswith("docs/") or not s.endswith(".md"):
|
|
57
|
-
continue
|
|
58
|
-
topic_name = _norm(Path(s).stem)
|
|
59
|
-
try:
|
|
60
|
-
abs_path = Path(dist.locate_file(f))
|
|
61
|
-
if abs_path.exists() and abs_path.is_file():
|
|
62
|
-
topics[topic_name] = abs_path
|
|
63
|
-
except Exception:
|
|
64
|
-
# Best effort; continue to next
|
|
65
|
-
continue
|
|
66
|
-
|
|
67
|
-
# 2) Fallback: site-packages sibling 'docs/' directory (and repo-root docs in editable installs)
|
|
68
|
-
try:
|
|
69
|
-
spec = importlib.util.find_spec("svc_infra")
|
|
70
|
-
if spec and spec.submodule_search_locations:
|
|
71
|
-
pkg_dir = Path(next(iter(spec.submodule_search_locations)))
|
|
72
|
-
candidates = [
|
|
73
|
-
pkg_dir.parent / "docs", # site-packages/docs OR src/docs
|
|
74
|
-
pkg_dir / "docs", # site-packages/svc_infra/docs OR src/svc_infra/docs
|
|
75
|
-
pkg_dir.parent.parent
|
|
76
|
-
/ "docs", # repo-root/docs when running editable from repo (src/svc_infra → ../../docs)
|
|
77
|
-
]
|
|
78
|
-
for candidate in candidates:
|
|
79
|
-
if candidate.exists() and candidate.is_dir():
|
|
80
|
-
for p in sorted(candidate.glob("*.md")):
|
|
81
|
-
if p.is_file():
|
|
82
|
-
topics.setdefault(_norm(p.stem), p)
|
|
83
|
-
# If one candidate had docs, that's sufficient
|
|
84
|
-
if any(k for k in topics):
|
|
85
|
-
break
|
|
86
|
-
except Exception:
|
|
87
|
-
# Optional fallback only
|
|
88
|
-
pass
|
|
89
|
-
|
|
90
|
-
# 3) Last-resort: scan sys.path entries that look like site-/dist-packages for a top-level docs/
|
|
91
|
-
# directory containing markdown files. This covers non-standard installs/editable modes.
|
|
92
|
-
try:
|
|
93
|
-
if not topics:
|
|
94
|
-
for entry in sys.path:
|
|
95
|
-
try:
|
|
96
|
-
if not entry or ("site-packages" not in entry and "dist-packages" not in entry):
|
|
97
|
-
continue
|
|
98
|
-
docs_dir = Path(entry) / "docs"
|
|
99
|
-
if docs_dir.exists() and docs_dir.is_dir():
|
|
100
|
-
found = _discover_fs_topics(docs_dir)
|
|
101
|
-
if found:
|
|
102
|
-
# Merge but do not override anything already found
|
|
103
|
-
for k, v in found.items():
|
|
104
|
-
topics.setdefault(k, v)
|
|
105
|
-
# If we found one valid docs dir, it's enough
|
|
106
|
-
break
|
|
107
|
-
except Exception:
|
|
108
|
-
continue
|
|
109
|
-
except Exception:
|
|
110
|
-
pass
|
|
111
|
-
|
|
112
|
-
# 4) Parse dist-info/RECORD or egg-info/SOURCES.txt to enumerate docs if available
|
|
113
|
-
try:
|
|
114
|
-
if not topics:
|
|
115
|
-
spec = importlib.util.find_spec("svc_infra")
|
|
116
|
-
base_dir: Path | None = None
|
|
117
|
-
if spec and spec.submodule_search_locations:
|
|
118
|
-
base_dir = Path(next(iter(spec.submodule_search_locations))).parent
|
|
119
|
-
# Fallback to first site-packages on sys.path
|
|
120
|
-
if base_dir is None:
|
|
121
|
-
for entry in sys.path:
|
|
122
|
-
if entry and "site-packages" in entry:
|
|
123
|
-
base_dir = Path(entry)
|
|
124
|
-
break
|
|
125
|
-
if base_dir and base_dir.exists():
|
|
126
|
-
# Check for both hyphen and underscore dist-info names
|
|
127
|
-
candidates = list(base_dir.glob("svc_infra-*.dist-info")) + list(
|
|
128
|
-
base_dir.glob("svc-infra-*.dist-info")
|
|
129
|
-
)
|
|
130
|
-
for di in candidates:
|
|
131
|
-
record = di / "RECORD"
|
|
132
|
-
if record.exists():
|
|
133
|
-
try:
|
|
134
|
-
for line in record.read_text(
|
|
135
|
-
encoding="utf-8", errors="ignore"
|
|
136
|
-
).splitlines():
|
|
137
|
-
rel = line.split(",", 1)[0]
|
|
138
|
-
if rel.startswith("docs/") and rel.endswith(".md"):
|
|
139
|
-
abs_p = base_dir / rel
|
|
140
|
-
if abs_p.exists() and abs_p.is_file():
|
|
141
|
-
topics.setdefault(_norm(Path(rel).stem), abs_p)
|
|
142
|
-
except Exception:
|
|
143
|
-
continue
|
|
144
|
-
# egg-info fallback
|
|
145
|
-
if not topics:
|
|
146
|
-
egg_candidates = list(base_dir.glob("svc_infra-*.egg-info")) + list(
|
|
147
|
-
base_dir.glob("svc-infra-*.egg-info")
|
|
148
|
-
)
|
|
149
|
-
for ei in egg_candidates:
|
|
150
|
-
sources = ei / "SOURCES.txt"
|
|
151
|
-
if sources.exists():
|
|
152
|
-
try:
|
|
153
|
-
for rel in sources.read_text(
|
|
154
|
-
encoding="utf-8", errors="ignore"
|
|
155
|
-
).splitlines():
|
|
156
|
-
rel = rel.strip()
|
|
157
|
-
if rel.startswith("docs/") and rel.endswith(".md"):
|
|
158
|
-
abs_p = base_dir / rel
|
|
159
|
-
if abs_p.exists() and abs_p.is_file():
|
|
160
|
-
topics.setdefault(_norm(Path(rel).stem), abs_p)
|
|
161
|
-
except Exception:
|
|
162
|
-
continue
|
|
163
|
-
except Exception:
|
|
164
|
-
pass
|
|
165
|
-
|
|
166
|
-
# 5) Deep fallback: recursively search site-packages/dist-packages for any 'docs' folder
|
|
167
|
-
# containing markdown files (limited depth to keep overhead reasonable).
|
|
168
|
-
try:
|
|
169
|
-
if not topics:
|
|
170
|
-
for entry in sys.path:
|
|
171
|
-
if not entry or ("site-packages" not in entry and "dist-packages" not in entry):
|
|
172
|
-
continue
|
|
173
|
-
base = Path(entry)
|
|
174
|
-
if not base.exists() or not base.is_dir():
|
|
175
|
-
continue
|
|
176
|
-
base_parts = len(base.parts)
|
|
177
|
-
for root, dirs, files in os.walk(base):
|
|
178
|
-
root_path = Path(root)
|
|
179
|
-
# Limit search depth to avoid expensive scans
|
|
180
|
-
if len(root_path.parts) - base_parts > 4:
|
|
181
|
-
# prune
|
|
182
|
-
dirs[:] = []
|
|
183
|
-
continue
|
|
184
|
-
if root_path.name == "docs":
|
|
185
|
-
for p in sorted(root_path.glob("*.md")):
|
|
186
|
-
if p.is_file():
|
|
187
|
-
topics.setdefault(_norm(p.stem), p)
|
|
188
|
-
# do not break; there might be multiple doc dirs
|
|
189
|
-
except Exception:
|
|
190
|
-
pass
|
|
191
|
-
|
|
192
|
-
return topics
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
def _resolve_docs_dir(ctx: click.Context) -> Path | None:
|
|
196
|
-
# Deprecated: we no longer read docs from arbitrary paths or env.
|
|
197
|
-
# All docs are sourced from the packaged svc-infra distribution only.
|
|
198
|
-
return None
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
class DocsGroup(TyperGroup):
|
|
202
|
-
def list_commands(self, ctx: click.Context) -> List[str]:
|
|
203
|
-
names: List[str] = list(super().list_commands(ctx) or [])
|
|
204
|
-
pkg = _discover_pkg_topics()
|
|
205
|
-
names.extend([k for k in pkg.keys()])
|
|
206
|
-
# Deduplicate and sort
|
|
207
|
-
return sorted({*names})
|
|
208
|
-
|
|
209
|
-
def get_command(self, ctx: click.Context, name: str) -> click.Command | None:
|
|
210
|
-
# Built-ins first (e.g., list, show)
|
|
211
|
-
cmd = super().get_command(ctx, name)
|
|
212
|
-
if cmd is not None:
|
|
213
|
-
return cmd
|
|
214
|
-
|
|
215
|
-
# Packaged topics only
|
|
216
|
-
pkg = _discover_pkg_topics()
|
|
217
|
-
if name in pkg:
|
|
218
|
-
file_path = pkg[name]
|
|
219
|
-
|
|
220
|
-
@click.command(name=name)
|
|
221
|
-
def _show_pkg() -> None:
|
|
222
|
-
click.echo(file_path.read_text(encoding="utf-8", errors="replace"))
|
|
223
|
-
|
|
224
|
-
return _show_pkg
|
|
225
|
-
|
|
226
|
-
return None
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
def register(app: typer.Typer) -> None:
|
|
230
|
-
"""Register the `docs` command group with dynamic topic subcommands."""
|
|
231
|
-
|
|
232
|
-
docs_app = typer.Typer(no_args_is_help=True, add_completion=False, cls=DocsGroup)
|
|
233
|
-
|
|
234
|
-
@docs_app.callback(invoke_without_command=True)
|
|
235
|
-
def _docs_options(
|
|
236
|
-
topic: str | None = typer.Option(None, "--topic", help="Topic to show directly"),
|
|
237
|
-
) -> None:
|
|
238
|
-
"""Support --topic at group level (packaged docs only)."""
|
|
239
|
-
if topic:
|
|
240
|
-
pkg = _discover_pkg_topics()
|
|
241
|
-
if topic in pkg:
|
|
242
|
-
typer.echo(pkg[topic].read_text(encoding="utf-8", errors="replace"))
|
|
243
|
-
raise typer.Exit(code=0)
|
|
244
|
-
raise typer.BadParameter(f"Unknown topic: {topic}")
|
|
245
|
-
|
|
246
|
-
@docs_app.command("list", help="List available documentation topics")
|
|
247
|
-
def list_topics() -> None:
|
|
248
|
-
pkg = _discover_pkg_topics()
|
|
249
|
-
|
|
250
|
-
# Print packaged topics only
|
|
251
|
-
def _print(name: str, path: Path) -> None:
|
|
252
|
-
typer.echo(f"{name}\t{path}")
|
|
253
|
-
|
|
254
|
-
for name, path in pkg.items():
|
|
255
|
-
_print(name, path)
|
|
256
|
-
|
|
257
|
-
# Also support a generic "show" command
|
|
258
|
-
@docs_app.command("show", help="Show docs for a topic (alternative to dynamic subcommand)")
|
|
259
|
-
def show(topic: str) -> None:
|
|
260
|
-
pkg = _discover_pkg_topics()
|
|
261
|
-
if topic in pkg:
|
|
262
|
-
typer.echo(pkg[topic].read_text(encoding="utf-8", errors="replace"))
|
|
263
|
-
return
|
|
264
|
-
raise typer.BadParameter(f"Unknown topic: {topic}")
|
|
265
|
-
|
|
266
|
-
app.add_typer(docs_app, name="docs")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|