mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
81e34d84de
* [MISC] Validate all sections of ACLs on startup This change ensure that all sections of the `access_control` key are validated on startup. * Change error format to clearly identify values
20 lines
362 B
Go
20 lines
362 B
Go
package authorization
|
|
|
|
import "regexp"
|
|
|
|
func isPathMatching(path string, pathRegexps []string) bool {
|
|
// If there is no regexp patterns, it means that we match any path.
|
|
if len(pathRegexps) == 0 {
|
|
return true
|
|
}
|
|
|
|
for _, pathRegexp := range pathRegexps {
|
|
match, _ := regexp.MatchString(pathRegexp, path)
|
|
if match {
|
|
return true
|
|
}
|
|
}
|
|
|
|
return false
|
|
}
|