diff options
author | Jakob Odersky <jakob@driver.xyz> | 2018-09-05 01:44:51 -0700 |
---|---|---|
committer | Jakob Odersky <jakob@driver.xyz> | 2018-09-12 14:17:39 -0700 |
commit | 8b2cd70a7189775cb23dafbbd3670b8050dd28dc (patch) | |
tree | 1233ea038f668cf3058e82cfeb0a067283dd2cf8 /src/main/scala/xyz/driver/core/rest | |
parent | 14ece0965f077da5c03ca4e8d3ff54083b1412dc (diff) | |
download | driver-core-8b2cd70a7189775cb23dafbbd3670b8050dd28dc.tar.gz driver-core-8b2cd70a7189775cb23dafbbd3670b8050dd28dc.tar.bz2 driver-core-8b2cd70a7189775cb23dafbbd3670b8050dd28dc.zip |
Add authentication method to swagger spec
Diffstat (limited to 'src/main/scala/xyz/driver/core/rest')
-rw-r--r-- | src/main/scala/xyz/driver/core/rest/Swagger.scala | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/scala/xyz/driver/core/rest/Swagger.scala b/src/main/scala/xyz/driver/core/rest/Swagger.scala index 786e2d7..5ceac54 100644 --- a/src/main/scala/xyz/driver/core/rest/Swagger.scala +++ b/src/main/scala/xyz/driver/core/rest/Swagger.scala @@ -11,6 +11,7 @@ import com.github.swagger.akka.model._ import com.typesafe.config.Config import com.typesafe.scalalogging.Logger import io.swagger.models.Scheme +import io.swagger.models.auth.{ApiKeyAuthDefinition, In} import io.swagger.util.Json import scala.util.control.NonFatal @@ -70,6 +71,14 @@ class Swagger( } } + override val securitySchemeDefinitions = Map( + "token" -> { + val definition = new ApiKeyAuthDefinition("Authorization", In.HEADER) + definition.setDescription("Authentication token") + definition + } + ) + override val basePath: String = config.getString("swagger.basePath") override val apiDocsPath: String = config.getString("swagger.docsPath") |