feat: bump reva to latest
This commit is contained in:
1 parent
a970a9d675
commit
837fff3ab6
9 files changed
+52
-32
No files matched your search
@@ -3,4 +3,5 @@ Enhancement: Bump Reva version
|
||||
bumped reva version
|
||||
|
||||
https://github.com/owncloud/ocis/pull/12051
|
||||
https://github.com/owncloud/ocis/pull/12087
|
||||
|
||||
@@ -64,7 +64,7 @@ require (
|
||||
github.com/open-policy-agent/opa v1.12.3
|
||||
github.com/orcaman/concurrent-map v1.0.0
|
||||
github.com/owncloud/libre-graph-api-go v1.0.5-0.20260216101009-eeac018af245
|
||||
github.com/owncloud/reva/v2 v2.0.0-20260223124048-61ee39d95d5f
|
||||
github.com/owncloud/reva/v2 v2.0.0-20260304131727-ce3149532498
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/pkg/xattr v0.4.12
|
||||
github.com/prometheus/client_golang v1.23.2
|
||||
|
||||
@@ -742,8 +742,8 @@ github.com/orcaman/concurrent-map v1.0.0 h1:I/2A2XPCb4IuQWcQhBhSwGfiuybl/J0ev9HD
|
||||
github.com/orcaman/concurrent-map v1.0.0/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI=
|
||||
github.com/owncloud/libre-graph-api-go v1.0.5-0.20260216101009-eeac018af245 h1:JRidLTAKhnvyLMRtVtSF4lhBa0NSAOs6fof+d6JnKII=
|
||||
github.com/owncloud/libre-graph-api-go v1.0.5-0.20260216101009-eeac018af245/go.mod h1:z61VMGAJRtR1nbgXWiNoCkxUXP1B3Je9rMuJbnGd+Og=
|
||||
github.com/owncloud/reva/v2 v2.0.0-20260223124048-61ee39d95d5f h1:M935ztFcjtRbP3ns8Fgb2XL5jalNd3sXYMUXf0kAwTQ=
|
||||
github.com/owncloud/reva/v2 v2.0.0-20260223124048-61ee39d95d5f/go.mod h1:+rCy6oGYb2/qs5gmQa8y/pHARw634vB73MZGDY2SBIQ=
|
||||
github.com/owncloud/reva/v2 v2.0.0-20260304131727-ce3149532498 h1:ozyudPff1XLWSeTDW4ajT1tCoSQf18cFQRxtLWFCNbk=
|
||||
github.com/owncloud/reva/v2 v2.0.0-20260304131727-ce3149532498/go.mod h1:+rCy6oGYb2/qs5gmQa8y/pHARw634vB73MZGDY2SBIQ=
|
||||
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw=
|
||||
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0=
|
||||
github.com/pablodz/inotifywaitgo v0.0.9 h1:njquRbBU7fuwIe5rEvtaniVBjwWzcpdUVptSgzFqZsw=
|
||||
|
||||
Generated
Vendored
+23
-15
@@ -27,6 +27,7 @@ import (
|
||||
"strings"
|
||||
|
||||
appregistry "github.com/cs3org/go-cs3apis/cs3/app/registry/v1beta1"
|
||||
"github.com/owncloud/reva/v2/pkg/app/registry/micro"
|
||||
providerv1beta1 "github.com/cs3org/go-cs3apis/cs3/auth/provider/v1beta1"
|
||||
gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1"
|
||||
rpc "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1"
|
||||
@@ -403,23 +404,30 @@ func (s *svc) handleOpen(openMode int) http.HandlerFunc {
|
||||
|
||||
appName := r.Form.Get("app_name")
|
||||
if appName == "" {
|
||||
apps, err := client.GetAppProviders(ctx, &appregistry.GetAppProvidersRequest{
|
||||
ResourceInfo: statRes.Info,
|
||||
defRes, err := client.GetDefaultAppProviderForMimeType(ctx, &appregistry.GetDefaultAppProviderForMimeTypeRequest{
|
||||
MimeType: statRes.Info.MimeType,
|
||||
})
|
||||
if err != nil {
|
||||
writeError(w, r, appErrorServerError, "error getting app providers", err)
|
||||
return
|
||||
if err == nil && defRes.Status.Code == rpc.Code_CODE_OK && defRes.Provider != nil {
|
||||
appName = defRes.Provider.Name
|
||||
} else {
|
||||
apps, err := client.GetAppProviders(ctx, &appregistry.GetAppProvidersRequest{
|
||||
ResourceInfo: statRes.Info,
|
||||
})
|
||||
if err != nil {
|
||||
writeError(w, r, appErrorServerError, "error getting app providers", err)
|
||||
return
|
||||
}
|
||||
if apps.Status.Code != rpc.Code_CODE_OK {
|
||||
writeError(w, r, appErrorServerError, "error getting app providers", nil)
|
||||
return
|
||||
}
|
||||
if len(apps.Providers) == 0 {
|
||||
writeError(w, r, appErrorProviderNotFound, "no app providers found", nil)
|
||||
return
|
||||
}
|
||||
micro.SortByPriorityThenName(apps.Providers)
|
||||
appName = apps.Providers[0].Name
|
||||
}
|
||||
if apps.Status.Code != rpc.Code_CODE_OK {
|
||||
writeError(w, r, appErrorServerError, "error getting app providers", nil)
|
||||
return
|
||||
}
|
||||
if len(apps.Providers) == 0 {
|
||||
writeError(w, r, appErrorProviderNotFound, "no app providers found", nil)
|
||||
return
|
||||
}
|
||||
|
||||
appName = apps.Providers[0].Name
|
||||
}
|
||||
|
||||
openReq := gateway.OpenInAppRequest{
|
||||
|
||||
+17
-12
@@ -20,11 +20,13 @@ package micro
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sort"
|
||||
"strconv"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
registrypb "github.com/cs3org/go-cs3apis/cs3/app/registry/v1beta1"
|
||||
typesv1beta1 "github.com/cs3org/go-cs3apis/cs3/types/v1beta1"
|
||||
"github.com/owncloud/reva/v2/pkg/app"
|
||||
@@ -222,7 +224,7 @@ func (m *manager) updateProvidersFromMicroRegistry() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
sortByPriority(lst)
|
||||
SortByPriorityThenName(lst)
|
||||
for _, outer := range lst {
|
||||
for _, inner := range outer.MimeTypes {
|
||||
ma[inner] = append(ma[inner], outer)
|
||||
@@ -245,7 +247,8 @@ func equalsProviderInfo(p1, p2 *registrypb.ProviderInfo) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func getPriority(p *registrypb.ProviderInfo) string {
|
||||
// GetPriority extracts priority from ProviderInfo.Opaque, returns defaultPriority ("0") if not set.
|
||||
func GetPriority(p *registrypb.ProviderInfo) string {
|
||||
if p.Opaque != nil && len(p.Opaque.Map) != 0 {
|
||||
if priority, ok := p.Opaque.Map["priority"]; ok {
|
||||
return string(priority.GetValue())
|
||||
@@ -254,12 +257,14 @@ func getPriority(p *registrypb.ProviderInfo) string {
|
||||
return defaultPriority
|
||||
}
|
||||
|
||||
func sortByPriority(providers []*registrypb.ProviderInfo) {
|
||||
less := func(i, j int) bool {
|
||||
prioI, _ := strconv.ParseInt(getPriority(providers[i]), 10, 64)
|
||||
prioJ, _ := strconv.ParseInt(getPriority(providers[j]), 10, 64)
|
||||
return prioI < prioJ
|
||||
}
|
||||
|
||||
sort.Slice(providers, less)
|
||||
// SortByPriorityThenName sorts providers by priority (lower first), then by Name. Used by micro registry and HTTP appprovider.
|
||||
func SortByPriorityThenName(providers []*registrypb.ProviderInfo) {
|
||||
sort.Slice(providers, func(i, j int) bool {
|
||||
pi, _ := strconv.ParseInt(GetPriority(providers[i]), 10, 64)
|
||||
pj, _ := strconv.ParseInt(GetPriority(providers[j]), 10, 64)
|
||||
if pi != pj {
|
||||
return pi < pj
|
||||
}
|
||||
return strings.ToLower(providers[i].Name) < strings.ToLower(providers[j].Name)
|
||||
})
|
||||
}
|
||||
+1
-1
@@ -184,10 +184,10 @@ type UploadReady struct {
|
||||
ExecutingUser *user.User
|
||||
ImpersonatingUser *user.User
|
||||
FileRef *provider.Reference
|
||||
ResourceID *provider.ResourceId
|
||||
Timestamp *types.Timestamp
|
||||
Failed bool
|
||||
IsVersion bool
|
||||
// add reference here? We could use it to inform client pp is finished
|
||||
}
|
||||
|
||||
// Unmarshal to fulfill umarshaller interface
|
||||
|
||||
+1
@@ -504,6 +504,7 @@ func (t *Tree) assimilate(item scanItem) error {
|
||||
t.PublishEvent(events.UploadReady{
|
||||
SpaceOwner: user,
|
||||
FileRef: ref,
|
||||
ResourceID: ref.ResourceId,
|
||||
Timestamp: utils.TSNow(),
|
||||
})
|
||||
}
|
||||
|
||||
Generated
Vendored
+5
@@ -394,6 +394,11 @@ func (fs *Decomposedfs) Postprocessing(ch <-chan events.Event) {
|
||||
},
|
||||
Path: utils.MakeRelativePath(filepath.Join(session.Dir(), session.Filename())),
|
||||
},
|
||||
ResourceID: &provider.ResourceId{
|
||||
StorageId: session.ProviderID(),
|
||||
SpaceId: session.SpaceID(),
|
||||
OpaqueId: session.NodeID(),
|
||||
},
|
||||
Timestamp: utils.TimeToTS(now),
|
||||
SpaceOwner: n.SpaceOwnerOrManager(ctx),
|
||||
IsVersion: isVersion,
|
||||
|
||||
Vendored
+1
-1
@@ -1316,7 +1316,7 @@ github.com/orcaman/concurrent-map
|
||||
# github.com/owncloud/libre-graph-api-go v1.0.5-0.20260216101009-eeac018af245
|
||||
## explicit; go 1.18
|
||||
github.com/owncloud/libre-graph-api-go
|
||||
# github.com/owncloud/reva/v2 v2.0.0-20260223124048-61ee39d95d5f
|
||||
# github.com/owncloud/reva/v2 v2.0.0-20260304131727-ce3149532498
|
||||
## explicit; go 1.24.0
|
||||
github.com/owncloud/reva/v2/cmd/revad/internal/grace
|
||||
github.com/owncloud/reva/v2/cmd/revad/runtime
|
||||
|
||||
Reference in new issue
Block a user