KeyAuthWithConfig returns an KeyAuth middleware or panics if configuration is invalid. For first valid key it calls the next handler. For invalid key, it sends "401 - Unauthorized" response. For missing key, it sends "400 - Bad Request" response.
(config KeyAuthConfig)
| 131 | // For invalid key, it sends "401 - Unauthorized" response. |
| 132 | // For missing key, it sends "400 - Bad Request" response. |
| 133 | func KeyAuthWithConfig(config KeyAuthConfig) echo.MiddlewareFunc { |
| 134 | return toMiddlewareOrPanic(config) |
| 135 | } |
| 136 | |
| 137 | // ToMiddleware converts KeyAuthConfig to middleware or returns an error for invalid configuration |
| 138 | func (config KeyAuthConfig) ToMiddleware() (echo.MiddlewareFunc, error) { |
searching dependent graphs…