Commit Graph

11 Commits

Author SHA1 Message Date
b3f3068f8d auth-fixes (#3)
## Summary

Resolve `{ENV_VAR}` placeholders in the OpenAPI spec before serving it. Replace the monolithic `x-introspect-url` extension with composable `x-server-url` + individual `x-*-path` fields so auth endpoints are configurable per-environment without hardcoding.

## Changes

- **`openapi_first/app.py`** — add `_resolve_spec_env_vars()` that replaces `{ENV_VAR}` patterns (e.g. `{AUTH_SERVER}`) with the corresponding OS environment variable before returning the spec JSON. Called in `__init__` after spec load.
- **`openapi_first/security.py`** — build the introspection URL dynamically from `x-server-url` + `x-introspect-path` extensions on the `bearerAuth` security scheme, instead of reading a single `x-introspect-url`.

## Migration

Existing specs using `x-introspect-url: "https://auth.example.com/introspect"` must switch to the new extension format:

```yaml
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      x-server-url: "{AUTH_SERVER}"
      x-login-path: "/login"
      x-register-path: "/register"
      x-logout-path: "/logout"
      x-me-path: "/me"
      x-introspect-path: "/introspect"

Reviewed-on: #3
Co-authored-by: Vishesh 'ironeagle' Bangotra <aetoskia@gmail.com>
Co-committed-by: Vishesh 'ironeagle' Bangotra <aetoskia@gmail.com>
2026-07-19 14:47:02 +00:00
7d075b3904 bumped up version
All checks were successful
continuous-integration/drone Build is passing
2026-07-17 12:52:51 +05:30
d4b64d630a cors fixes 2026-06-16 17:50:36 +05:30
8299445b68 cors fixes 2026-06-16 16:52:01 +05:30
514f6e5f7c code gen 2026-06-16 04:14:14 +05:30
29c1579f40 v0.0.4 — Documents and packages OpenAPI-first application templates, adds multi-template CLI scaffolding, and enforces package-bound documentation generation.
All checks were successful
continuous-integration/drone/tag Build is passing
2026-01-11 21:44:11 +05:30
72b5be6976 docs, cli: enforce package-bound docs, add template scaffolding, and document CLI usage
- Restrict mkdocstrings generation to real Python packages (require __init__.py)
- Add explicit documentation section for CLI scaffolding and templates
- Generalize CLI to support multiple templates with dynamic discovery
- Package templates correctly for importlib.resources access
- Add fully documented health_app template (app entry point and handlers)
- Fix setuptools package-data configuration for bundled templates

These changes make documentation import-safe, clarify package boundaries,
and provide a deterministic, OpenAPI-first scaffolding workflow via CLI.
2026-01-11 19:26:21 +05:30
6180443327 v0.0.3 — Introduces an OpenAPI-first HTTP client, updates documentation and templates to use operationId-based calls, and adds httpx as a client-side dependency.
All checks were successful
continuous-integration/drone/tag Build is passing
2026-01-11 18:43:04 +05:30
7b4583f305 feat(templates): add CRUD and model CRUD app scaffolds; bump version to 0.0.2
All checks were successful
continuous-integration/drone/tag Build is passing
- add OpenAPI-first CRUD app template with in-memory mock data
- add model-based CRUD app template with Pydantic layer
- include end-to-end tests for both templates
- document explicit runtime status handling in routes
- add Pydantic dependency for model_app support
2026-01-10 18:07:01 +05:30
571a11a1c7 feat(cli): add bundled health app scaffold and init command
- ship OpenAPI-first health check template as package data
- add CLI to copy scaffold into new project directories
- include OpenAPI spec, routes, and bootstrap example
- enable fast startup for OpenAPI-first services
2026-01-10 17:39:33 +05:30
3d1cdcba4c added toml file 2026-01-10 17:22:03 +05:30