feat(ocis): bump reva

Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
jkoberg
2025-01-09 14:24:40 +01:00
parent 1e4d635fb4
commit 1801c4054d
6 changed files with 35 additions and 4 deletions
+17
View File
@@ -0,0 +1,17 @@
package events
import (
"encoding/json"
)
// SendEmailsEvent instructs the notification service to send grouped emails
type SendEmailsEvent struct {
Interval string
}
// Unmarshal to fulfill umarshaller interface
func (SendEmailsEvent) Unmarshal(v []byte) (interface{}, error) {
e := SendEmailsEvent{}
err := json.Unmarshal(v, &e)
return e, err
}
@@ -114,9 +114,22 @@ func (a *authorizer) GetInfoByDomain(_ context.Context, domain string) (*ocmprov
return nil, err
}
for _, p := range a.providers {
// we can exit early if this an exact match
if strings.Contains(p.Domain, normalizedDomain) {
return p, nil
}
// check if the domain matches a regex
if ok, err := regexp.MatchString(p.Domain, normalizedDomain); ok && err == nil {
// overwrite wildcards with the actual domain
for i, s := range p.Services {
s.Endpoint.Path = strings.ReplaceAll(s.Endpoint.Path, p.Domain, normalizedDomain)
s.Host = strings.ReplaceAll(s.Host, p.Domain, normalizedDomain)
p.Services[i] = s
}
p.Domain = normalizedDomain
return p, nil
}
}
return nil, errtypes.NotFound(domain)
}