Skip to content

Commit

Permalink
Merge pull request #9587 from rhafer/issue/9554
Browse files Browse the repository at this point in the history
bump go-cs3apis and reva to latest master
  • Loading branch information
micbar authored Jul 11, 2024
2 parents 10ce8db + e30be75 commit 4e0ecd1
Show file tree
Hide file tree
Showing 186 changed files with 41,057 additions and 23,968 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ require (
github.com/blevesearch/bleve/v2 v2.4.0
github.com/cenkalti/backoff v2.2.1+incompatible
github.com/coreos/go-oidc/v3 v3.10.0
github.com/cs3org/go-cs3apis v0.0.0-20231023073225-7748710e0781
github.com/cs3org/reva/v2 v2.21.0
github.com/cs3org/go-cs3apis v0.0.0-20240425114016-d2cb31692b4e
github.com/cs3org/reva/v2 v2.21.1-0.20240711153523-f9083e96d2ea
github.com/dhowden/tag v0.0.0-20230630033851-978a0926ee25
github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e
github.com/egirna/icap-client v0.1.1
Expand Down
10 changes: 4 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1023,10 +1023,10 @@ github.com/crewjam/httperr v0.2.0 h1:b2BfXR8U3AlIHwNeFFvZ+BV1LFvKLlzMjzaTnZMybNo
github.com/crewjam/httperr v0.2.0/go.mod h1:Jlz+Sg/XqBQhyMjdDiC+GNNRzZTD7x39Gu3pglZ5oH4=
github.com/crewjam/saml v0.4.14 h1:g9FBNx62osKusnFzs3QTN5L9CVA/Egfgm+stJShzw/c=
github.com/crewjam/saml v0.4.14/go.mod h1:UVSZCf18jJkk6GpWNVqcyQJMD5HsRugBPf4I1nl2mME=
github.com/cs3org/go-cs3apis v0.0.0-20231023073225-7748710e0781 h1:BUdwkIlf8IS2FasrrPg8gGPHQPOrQ18MS1Oew2tmGtY=
github.com/cs3org/go-cs3apis v0.0.0-20231023073225-7748710e0781/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
github.com/cs3org/reva/v2 v2.21.0 h1:TLmWaU4BTIsi2FQtB8SxMKDT46ql28Do1Vc7IVWSAsE=
github.com/cs3org/reva/v2 v2.21.0/go.mod h1:Rb2XnhpGKnH7k6WBFZlMygbyBxW6ma09Z4Uk+ro0v+A=
github.com/cs3org/go-cs3apis v0.0.0-20240425114016-d2cb31692b4e h1:Cm2l8m2riLa79eh7V2wHd1Ra7wR3TbngmeLZBJ9MxTU=
github.com/cs3org/go-cs3apis v0.0.0-20240425114016-d2cb31692b4e/go.mod h1:yyP8PRo0EZou3nSH7H4qjlzQwaydPeIRNgX50npQHpE=
github.com/cs3org/reva/v2 v2.21.1-0.20240711153523-f9083e96d2ea h1:fMT9FvEsfR+OLS4SWNNkxgUrCtgAuJABRTK+f+VRETk=
github.com/cs3org/reva/v2 v2.21.1-0.20240711153523-f9083e96d2ea/go.mod h1:+5pteFc4ymQnhYG2cOtg/jzaIZKgxrgIeH0D4fuC6gA=
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
Expand Down Expand Up @@ -2423,7 +2423,6 @@ golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190415081028-16da32be82c5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down Expand Up @@ -2759,7 +2758,6 @@ google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCID
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
Expand Down
4 changes: 2 additions & 2 deletions services/activitylog/pkg/service/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func WithResource(ref *provider.Reference, addSpace bool) ActivityOption {
}

vars["resource"] = Resource{
ID: storagespace.FormatResourceID(*info.GetId()),
ID: storagespace.FormatResourceID(info.GetId()),
Name: info.GetName(),
}

Expand Down Expand Up @@ -111,7 +111,7 @@ func WithTrashedResource(ref *provider.Reference, rid *provider.ResourceId) Acti
if item.GetKey() == rid.GetOpaqueId() {

vars["resource"] = Resource{
ID: storagespace.FormatResourceID(*rid),
ID: storagespace.FormatResourceID(rid),
Name: filepath.Base(item.GetRef().GetPath()),
}

Expand Down
12 changes: 6 additions & 6 deletions services/activitylog/pkg/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (a *ActivitylogService) AddActivityTrashed(resourceID *provider.ResourceId,
}

// store activity on trashed item
if err := a.storeActivity(storagespace.FormatResourceID(*resourceID), eventID, 0, timestamp); err != nil {
if err := a.storeActivity(storagespace.FormatResourceID(resourceID), eventID, 0, timestamp); err != nil {
return fmt.Errorf("could not store activity: %w", err)
}

Expand All @@ -183,7 +183,7 @@ func (a *ActivitylogService) AddSpaceActivity(spaceID *provider.StorageSpaceId,
return fmt.Errorf("could not parse space id: %w", err)
}
rid.OpaqueId = rid.GetSpaceId()
return a.storeActivity(storagespace.FormatResourceID(rid), eventID, 0, timestamp)
return a.storeActivity(storagespace.FormatResourceID(&rid), eventID, 0, timestamp)

}

Expand Down Expand Up @@ -218,7 +218,7 @@ func (a *ActivitylogService) RemoveActivities(rid *provider.ResourceId, toDelete
}

return a.store.Write(&microstore.Record{
Key: storagespace.FormatResourceID(*rid),
Key: storagespace.FormatResourceID(rid),
Value: b,
})
}
Expand All @@ -232,11 +232,11 @@ func (a *ActivitylogService) RemoveResource(rid *provider.ResourceId) error {
a.lock.Lock()
defer a.lock.Unlock()

return a.store.Delete(storagespace.FormatResourceID(*rid))
return a.store.Delete(storagespace.FormatResourceID(rid))
}

func (a *ActivitylogService) activities(rid *provider.ResourceId) ([]RawActivity, error) {
resourceID := storagespace.FormatResourceID(*rid)
resourceID := storagespace.FormatResourceID(rid)

records, err := a.store.Read(resourceID)
if err != nil && err != microstore.ErrNotFound {
Expand Down Expand Up @@ -269,7 +269,7 @@ func (a *ActivitylogService) addActivity(initRef *provider.Reference, eventID st
return fmt.Errorf("could not get resource info: %w", err)
}

if err := a.storeActivity(storagespace.FormatResourceID(*info.GetId()), eventID, depth, timestamp); err != nil {
if err := a.storeActivity(storagespace.FormatResourceID(info.GetId()), eventID, depth, timestamp); err != nil {
return fmt.Errorf("could not store activity: %w", err)
}

Expand Down
4 changes: 2 additions & 2 deletions services/audit/pkg/service/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ var testCases = []struct {
require.Equal(t, "", ev.ItemType) // not implemented atm
require.Equal(t, "", ev.ExpirationDate) // no expiration for shares
require.Equal(t, false, ev.SharePass)
require.Equal(t, "get_quota:true stat:true ", ev.Permissions)
require.Equal(t, "get_quota:true stat:true", ev.Permissions)
require.Equal(t, "group", ev.ShareType)
require.Equal(t, "beshared-groupid", ev.ShareWith)
require.Equal(t, "sharing-userid", ev.ShareOwner)
Expand Down Expand Up @@ -142,7 +142,7 @@ var testCases = []struct {
require.Equal(t, "", ev.ItemType) // not implemented atm
require.Equal(t, "2001-09-20T15:33:20Z", ev.ExpirationDate)
require.Equal(t, true, ev.SharePass)
require.Equal(t, "stat:true ", ev.Permissions)
require.Equal(t, "stat:true", ev.Permissions)
require.Equal(t, "link", ev.ShareType)
require.Equal(t, "", ev.ShareWith) // not filled on links
require.Equal(t, "sharing-userid", ev.ShareOwner)
Expand Down
15 changes: 12 additions & 3 deletions services/audit/pkg/types/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package types

import (
"fmt"
"strings"
"time"

"github.com/cs3org/reva/v2/pkg/events"
Expand Down Expand Up @@ -81,7 +82,7 @@ func LinkCreated(ev events.LinkCreated) AuditEventShareCreated {
ShareType: typ,
ExpirationDate: formatTime(ev.Expiration),
SharePass: ev.PasswordProtected,
Permissions: ev.Permissions.String(),
Permissions: normalizeString(ev.Permissions.GetPermissions().String()),
ShareToken: ev.Token,

// NOTE: those values are not in the event and can therefore not be filled at the moment
Expand All @@ -99,7 +100,7 @@ func ShareUpdated(ev events.ShareUpdated) AuditEventShareUpdated {
ShareOwner: uid,
ShareWith: with,
ShareType: typ,
Permissions: ev.Permissions.Permissions.String(),
Permissions: normalizeString(ev.Permissions.GetPermissions().String()),

// NOTE: those values are not in the event and can therefore not be filled at the moment
ItemType: "",
Expand All @@ -119,7 +120,7 @@ func LinkUpdated(ev events.LinkUpdated) AuditEventShareUpdated {
ShareOwner: uid,
ShareWith: with,
ShareType: typ,
Permissions: ev.Permissions.Permissions.String(),
Permissions: normalizeString(ev.Permissions.GetPermissions().String()),
ExpirationDate: formatTime(ev.Expiration),
SharePass: ev.PasswordProtected,
ShareToken: ev.Token,
Expand Down Expand Up @@ -555,3 +556,11 @@ func updateType(u string) string {
return ""
}
}

// normalizeString tries to create a somewhat stable string
// from a prototext string. The prototext strings are unstable
// on purpose an insert additional spaces randomly.
// See: https://protobuf.dev/reference/go/faq/#unstable-text
func normalizeString(str string) string {
return strings.Join(strings.Fields(str), " ")
}
6 changes: 3 additions & 3 deletions services/clientlog/pkg/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ func processFileEvent(ctx context.Context, ref *provider.Reference, gwc gateway.
}

data := FileEvent{
ParentItemID: storagespace.FormatResourceID(*info.GetParentId()),
ItemID: storagespace.FormatResourceID(*info.GetId()),
ParentItemID: storagespace.FormatResourceID(info.GetParentId()),
ItemID: storagespace.FormatResourceID(info.GetId()),
SpaceID: storagespace.FormatStorageID(info.GetSpace().GetRoot().GetStorageId(), info.GetSpace().GetRoot().GetSpaceId()),
InitiatorID: initiatorid,
Etag: info.GetEtag(),
Expand Down Expand Up @@ -233,7 +233,7 @@ func processItemTrashedEvent(ctx context.Context, ref *provider.Reference, gwc g
if item.GetKey() == itemID.GetOpaqueId() {

data := FileEvent{
ItemID: storagespace.FormatResourceID(*itemID),
ItemID: storagespace.FormatResourceID(itemID),
// TODO: check with web if parentID is needed
// ParentItemID: storagespace.FormatResourceID(*item.GetRef().GetResourceId()),
SpaceID: storagespace.FormatStorageID(itemID.GetStorageId(), itemID.GetSpaceId()),
Expand Down
Loading

0 comments on commit 4e0ecd1

Please sign in to comment.