4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-09-06 13:44:09 +00:00

Update vendor

This commit is contained in:
Wim
2017-06-06 00:01:05 +02:00
parent 2eecaccd1c
commit 3a183cb218
49 changed files with 534 additions and 1421 deletions

View File

@@ -32,7 +32,7 @@ type (
}
// KeyAuthValidator defines a function to validate KeyAuth credentials.
KeyAuthValidator func(string, echo.Context) bool
KeyAuthValidator func(string, echo.Context) (bool, error)
keyExtractor func(echo.Context) (string, error)
)
@@ -94,7 +94,10 @@ func KeyAuthWithConfig(config KeyAuthConfig) echo.MiddlewareFunc {
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, err.Error())
}
if config.Validator(key, c) {
valid, err := config.Validator(key, c)
if err != nil {
return err
} else if valid {
return next(c)
}