add auth
Some checks failed
Build and Publish / build-release (push) Failing after 5s

This commit is contained in:
2026-05-15 10:21:36 -05:00
parent 3cc9e2764e
commit 141104822e
13 changed files with 314 additions and 47 deletions

View File

@@ -1,5 +1,5 @@
defmodule ProviderServiceWeb.ApiSpec do
alias OpenApiSpex.{OpenApi, Info, Server}
alias OpenApiSpex.{OpenApi, Info, Server, Components, SecurityScheme}
alias OpenApiSpex.{Info, OpenApi, Paths, Server}
alias ProviderServiceWeb.{Endpoint, Router}
@@ -17,7 +17,24 @@ defmodule ProviderServiceWeb.ApiSpec do
version: "1.0"
},
# Populate the paths from a phoenix router
paths: Paths.from_router(Router)
paths: Paths.from_router(Router),
components: %Components{
securitySchemes: %{
"bearerAuth" => %SecurityScheme{
type: "http",
scheme: "bearer",
bearerFormat: "JWT",
description: "Zitadel JWT bearer token"
},
"x-organization-id" => %SecurityScheme{
type: "apiKey",
in: "header",
name: "x-organization-id",
description: "Organization identifier"
}
}
},
security: [%{"bearerAuth" => [], "x-organization-id" => []}]
}
# Discover request/response schemas from path specs
|> OpenApiSpex.resolve_schema_modules()