docs(swagger): Swagger auth
This commit is contained in:
4
main.go
4
main.go
@@ -57,6 +57,9 @@ func loadEnv() error {
|
||||
|
||||
// @title LfK Document Server API
|
||||
// @description This is the API documentation for the LfK Document Server - a tool for pdf generation.
|
||||
// @securityDefinitions.apiKey ApiKeyAuth
|
||||
// @in query
|
||||
// @name key
|
||||
func main() {
|
||||
|
||||
err := loadEnv()
|
||||
@@ -76,6 +79,7 @@ func main() {
|
||||
// Swagger documentation route
|
||||
app.Get("/swagger/*", swagger.HandlerDefault)
|
||||
|
||||
// @Security ApiKeyAuth
|
||||
v1 := app.Group("/v1")
|
||||
v1.Use(keyauth.New(keyauth.Config{
|
||||
KeyLookup: "query:key",
|
||||
|
||||
Reference in New Issue
Block a user