Skip to content

Commit

Permalink
Merge pull request #5025 from kobergj/AllowWildcardsInOCMDomains
Browse files Browse the repository at this point in the history
Allow Wildcards in OCM Domains
  • Loading branch information
kobergj authored Jan 7, 2025
2 parents 1373bc2 + cfe6e13 commit 7d37996
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog/unreleased/allow-wildcard-ocm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Allow wildcards in OCM domains

When verifiying domains, allow wildcards in the domain name. This will not work when using `verify-request-hostname`

https://github.com/cs3org/reva/pull/5025
3 changes: 2 additions & 1 deletion pkg/ocm/provider/authorizer/json/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"net"
"net/url"
"os"
"regexp"
"strings"
"sync"

Expand Down Expand Up @@ -130,7 +131,7 @@ func (a *authorizer) IsProviderAllowed(ctx context.Context, pi *ocmprovider.Prov
var providerAuthorized bool
if normalizedDomain != "" {
for _, p := range a.providers {
if p.Domain == normalizedDomain {
if ok, err := regexp.MatchString(p.Domain, normalizedDomain); ok && err == nil {
providerAuthorized = true
break
}
Expand Down

0 comments on commit 7d37996

Please sign in to comment.