Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 515 Bytes

api_key.md

File metadata and controls

25 lines (18 loc) · 515 Bytes

Implement Api Key Auth

  • Add package using go get github.com/bimalabs/middlewares

  • Add basic auth middleware to dics/container.go

{
    Name:  "bima:middleware:api-key",
    Scope: bima.Application,
    Build: func() (middlewares.Middleware, error) {
        return api_key.New(api_key.LocationQueries, "api", "my-api-key"), nil
    },
},
  • Available locations api_key.LocationQueries and api_key.LocationHeader

  • Add to configs/middlewares.yaml

middlewares:
    - api-key