add authentication with zitadel
Some checks failed
Build and Publish / build-release (push) Failing after 1m49s
Some checks failed
Build and Publish / build-release (push) Failing after 1m49s
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
defmodule PolicyServiceWeb.ApiSpec do
|
||||
alias OpenApiSpex.{OpenApi, Info, Server}
|
||||
alias OpenApiSpex.{OpenApi, Info, Server, Components, SecurityScheme}
|
||||
alias OpenApiSpex.{Info, OpenApi, Paths, Server}
|
||||
alias PolicyServiceWeb.{Endpoint, Router}
|
||||
@behaviour OpenApi
|
||||
@@ -16,7 +16,18 @@ defmodule PolicyServiceWeb.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 for authentication"
|
||||
}
|
||||
}
|
||||
},
|
||||
security: [%{"bearerAuth" => []}]
|
||||
}
|
||||
# Discover request/response schemas from path specs
|
||||
|> OpenApiSpex.resolve_schema_modules()
|
||||
|
||||
Reference in New Issue
Block a user