Add tests for skip auth functionality

This commit is contained in:
Nick Meves
2020-10-07 10:13:41 -07:00
parent 183cb124a4
commit cfd3de807c
2 changed files with 254 additions and 21 deletions
+1 -1
View File
@@ -286,7 +286,7 @@ func buildSignInMessage(opts *options.Options) string {
// SkipAuthRegex option (paths only support) or newer SkipAuthRoutes option
// (method=path support)
func buildRoutesAllowlist(opts *options.Options) ([]*allowedRoute, error) {
var routes []*allowedRoute
routes := make([]*allowedRoute, 0, len(opts.SkipAuthRegex)+len(opts.SkipAuthRoutes))
for _, path := range opts.SkipAuthRegex {
compiledRegex, err := regexp.Compile(path)