feat(op): allow double star globs (#507)

Related to https://github.com/zitadel/zitadel/issues/5110
This commit is contained in:
Tim Möhlmann 2024-01-05 17:30:17 +02:00 committed by GitHub
parent dce79a73fb
commit c37ca25220
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 374 additions and 2 deletions

View file

@ -7,10 +7,10 @@ import (
"net"
"net/http"
"net/url"
"path"
"strings"
"time"
"github.com/bmatcuk/doublestar/v4"
httphelper "github.com/zitadel/oidc/v3/pkg/http"
"github.com/zitadel/oidc/v3/pkg/oidc"
str "github.com/zitadel/oidc/v3/pkg/strings"
@ -283,7 +283,7 @@ func checkURIAgainstRedirects(client Client, uri string) error {
}
if globClient, ok := client.(HasRedirectGlobs); ok {
for _, uriGlob := range globClient.RedirectURIGlobs() {
isMatch, err := path.Match(uriGlob, uri)
isMatch, err := doublestar.Match(uriGlob, uri)
if err != nil {
return oidc.ErrServerError().WithParent(err)
}