Skip to content

Commit 7d37996

Browse files
authored
Merge pull request #5025 from kobergj/AllowWildcardsInOCMDomains
Allow Wildcards in OCM Domains
2 parents 1373bc2 + cfe6e13 commit 7d37996

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Enhancement: Allow wildcards in OCM domains
2+
3+
When verifiying domains, allow wildcards in the domain name. This will not work when using `verify-request-hostname`
4+
5+
https://github.com/cs3org/reva/pull/5025

pkg/ocm/provider/authorizer/json/json.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"net"
2525
"net/url"
2626
"os"
27+
"regexp"
2728
"strings"
2829
"sync"
2930

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

0 commit comments

Comments
 (0)