Skip to content

Commit

Permalink
Move authenticate inside baklava routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof Palcowski committed Apr 9, 2024
1 parent f65ed1e commit 7c5452e
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,22 @@ object BaklavaRoutes {
def routes(config: com.typesafe.config.Config): Route = {
implicit val internalConfig: BaklavaRoutes.Config = BaklavaRoutes.Config(config)
if (internalConfig.enabled)
authenticateBasic("docs", basicAuthOpt) { _ =>
pathPrefix("docs") {
pathPrefix("docs") {
authenticateBasic("docs", basicAuthOpt) { _ =>
pathSingleSlash {
getFromFile(s"${internalConfig.fileSystemPath}/simple/index.html")
} ~ getFromDirectory(s"${internalConfig.fileSystemPath}/simple")
} ~ path("openapi") {
}
} ~ path("openapi") {
authenticateBasic("docs", basicAuthOpt) { _ =>
complete(openApiFileContent)
} ~ pathPrefix("swagger-ui") {
}
} ~ pathPrefix("swagger-ui") {
authenticateBasic("docs", basicAuthOpt) { _ =>
swaggerWebJar
} ~ pathPrefix("swagger") {
}
} ~ pathPrefix("swagger") {
authenticateBasic("docs", basicAuthOpt) { _ =>
get(complete(swaggerRedirectHttpResponse))
}
}
Expand Down

0 comments on commit 7c5452e

Please sign in to comment.