Skip to content

Use JWT auth middleware with configuration option

Description

The service should be able to use the Authentication middleware from Golib with a configuration option.

Authentication must be enabled by default, unless disabled explicitly with ENV variable configuration.

If authentication is enabled, the auth middleware must be attached to all services endpoints except Health check and OpenAPI swagger.

Example config settings:

type Auth struct {
  Enabled bool default:true
  JwkURL string
  RefreshInterval time.Duration default: 1h
}