Skip to content

Commit

Permalink
Merge branch 'upsmaster' into spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Nov 29, 2024
2 parents 2e13342 + 4820f8c commit 62ec6e9
Show file tree
Hide file tree
Showing 36 changed files with 435 additions and 549 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

# Ignore builds
cmd/revad/revad
cmd/revad/revad-ceph
cmd/revad/revad.pid
cmd/reva/reva
cmd/revad/main/main
Expand Down
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @labkode @glpatcern @diocas @jessejeens
* @glpatcern @diocas @jessegeens
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ gaia:

.PHONY: cernbox-revad
cernbox-revad: gaia
gaia build --with github.com/cernbox/reva-plugins --with github.com/cs3org/reva=$(shell pwd) -o ./cmd/revad/revad
gaia build --with github.com/cernbox/reva-plugins --with github.com/cs3org/reva=$(shell pwd) --debug -o ./cmd/revad/revad

.PHONY: cernbox-revad-ceph
cernbox-revad-ceph: cernbox-revad
gaia build --tags ceph --with github.com/cernbox/reva-plugins --with github.com/cs3org/reva=$(shell pwd) --debug -o ./cmd/revad/revad-ceph

.PHONY: revad-ceph
revad-ceph:
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,9 @@ Reva is distributed under [Apache 2.0 license](https://github.com/cs3org/reva/bl

## Logo

Reva logo's have been designed and contributed to the project by Eamon Maguire.
Reva logo's have been designed and contributed to the project by Eamonn Maguire.

## History
This project was initially conceived and brought to life by Hugo Gonzalez Labrador (@labkode) in 2017.
Since its roots, Reva has evolved and expanded thanks to the passion and commitment of
dozens of remarkable individual contributors. [Learn more](https://reva.link/about/).
3 changes: 3 additions & 0 deletions changelog/unreleased/ceph-refactoring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Enhancement: cephfs refactoring + make home layout configurable

https://github.com/cs3org/reva/pull/4911
5 changes: 5 additions & 0 deletions changelog/unreleased/change-project-ownership.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: @labkode steps down as project owner

Hugo (@labkode) steps down as project owner of Reva.

https://github.com/cs3org/reva/pull/4937
3 changes: 3 additions & 0 deletions changelog/unreleased/enhance-ceph.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Enhancement: Refactor Ceph code

https://github.com/cs3org/reva/pull/4824
6 changes: 6 additions & 0 deletions changelog/unreleased/eos-grpc-token-access.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Enhancement: access to EOS via tokens over gRPC

As a guest account, accessing a file shared with you relies on a token that is generated on behalf of the resource owner. This method, GenerateToken, has now been implemented in the EOS gRPC client. Additionally, the HTTP client now takes tokens into account.


https://github.com/cs3org/reva/pull/4934
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-eosgrpc-stat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: fixed tree metadata following fix in EOS

The treecount is now populated from the EOS response.

https://github.com/cs3org/reva/pull/4931
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-fav-grpc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: make removal of favourites work

Currently, removing a folder from your favourites is broken, because the handleFavAttr method is only called in SetAttr, not in UnsetAttr. This change fixes this.

https://github.com/cs3org/reva/pull/4930
3 changes: 3 additions & 0 deletions changelog/unreleased/log-home.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Enhancement: improved logging on createHome

https://github.com/cs3org/reva/pull/4970
5 changes: 5 additions & 0 deletions changelog/unreleased/parse-favs-grpc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: handle parsing of favs over gRPC

To store user favorites, the key `user.http://owncloud.org/ns/favorite` maps to a list of users, in the format `u:username=1`. Right now, extracting the "correct" user doesn't happen in gRPC, while it is implemented in the EOS binary client. This feature has now been moved to the higher-level call in eosfs.

https://github.com/cs3org/reva/pull/4973
3 changes: 3 additions & 0 deletions changelog/unreleased/publink-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Bugfix: public links: return error when owner could not be resolved

https://github.com/cs3org/reva/pull/4907
7 changes: 7 additions & 0 deletions changelog/unreleased/undo-gw-refactoring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Bugfix: revert 'make home layout configurable'

Partial revert of #4911, to be re-added after
more testing and configuration validation. The
eoshome vs eos storage drivers are to be adapted.

https://github.com/cs3org/reva/pull/4939
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module github.com/cs3org/reva

require (
bou.ke/monkey v1.0.2
github.com/BurntSushi/toml v1.3.2
github.com/CiscoM31/godata v1.0.8
github.com/Masterminds/sprig v2.22.0+incompatible
Expand Down Expand Up @@ -32,15 +31,15 @@ require (
github.com/gomodule/redigo v1.9.2
github.com/google/uuid v1.6.0
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.0
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1
github.com/jedib0t/go-pretty v4.3.0+incompatible
github.com/jt-nti/gproto v0.0.0-20210304092907-23e645af1351
github.com/juliangruber/go-intersect v1.1.0
github.com/mattn/go-sqlite3 v1.14.22
github.com/mattn/go-sqlite3 v1.14.24
github.com/maxymania/go-system v0.0.0-20170110133659-647cc364bf0b
github.com/mileusna/useragent v1.3.4
github.com/mitchellh/mapstructure v1.5.0
github.com/nats-io/nats.go v1.33.1
github.com/nats-io/nats.go v1.37.0
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.30.0
github.com/owncloud/libre-graph-api-go v1.0.5-0.20240425090020-dba6d1507c38
Expand All @@ -59,7 +58,7 @@ require (
golang.org/x/crypto v0.23.0
golang.org/x/oauth2 v0.20.0
golang.org/x/sync v0.7.0
golang.org/x/sys v0.20.0
golang.org/x/sys v0.27.0
golang.org/x/term v0.20.0
google.golang.org/genproto v0.0.0-20240314234333-6e1732d8331c
google.golang.org/grpc v1.65.0
Expand Down Expand Up @@ -94,6 +93,7 @@ require (
github.com/gocraft/dbr/v2 v2.7.2 // indirect
github.com/golang/glog v1.2.1 // indirect
github.com/google/flatbuffers v2.0.8+incompatible // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
Expand Down
18 changes: 8 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
bou.ke/monkey v1.0.2 h1:kWcnsrCNUatbxncxR/ThdYqbytgOIArtYWqcQLQzKLI=
bou.ke/monkey v1.0.2/go.mod h1:OqickVX3tNx6t33n1xvtTtu85YN5s6cKwVug+oHMaIA=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
Expand Down Expand Up @@ -1165,8 +1163,8 @@ github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI=
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8=
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.0 h1:f4tggROQKKcnh4eItay6z/HbHLqghBxS8g7pyMhmDio=
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.0/go.mod h1:hKAkSgNkL0FII46ZkJcpVEAai4KV+swlIWCKfekd1pA=
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 h1:qnpSQwGEnkcRpTqNOIR6bJbR0gAorgP9CSALpRcKoAA=
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1/go.mod h1:lXGCsh6c22WGtjr+qGHj1otzZpV/1kwTMAqkwZsnWRU=
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 h1:pRhl55Yx1eC7BZ1N+BBWwnKaMyD8uC+34TLdndZMAKk=
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0/go.mod h1:XKMd7iuf/RGPSMJ/U4HP0zS2Z9Fh8Ps9a+6X26m/tmI=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
Expand Down Expand Up @@ -1301,8 +1299,8 @@ github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A
github.com/mattn/go-sqlite3 v1.14.7/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
github.com/mattn/go-sqlite3 v1.14.24 h1:tpSp2G2KyMnnQu99ngJ47EIkWVmliIizyZBfPrBWDRM=
github.com/mattn/go-sqlite3 v1.14.24/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
github.com/mattn/go-tty v0.0.3/go.mod h1:ihxohKRERHTVzN+aSVRwACLCeqIoZAWpoICkkvrWyR0=
github.com/mattn/go-tty v0.0.5 h1:s09uXI7yDbXzzTTfw3zonKFzwGkyYlgU3OMjqA0ddz4=
github.com/mattn/go-tty v0.0.5/go.mod h1:u5GGXBtZU6RQoKV8gY5W6UhMudbR5vXnUe7j3pxse28=
Expand Down Expand Up @@ -1342,8 +1340,8 @@ github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5Vgl
github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU=
github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k=
github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w=
github.com/nats-io/nats.go v1.33.1 h1:8TxLZZ/seeEfR97qV0/Bl939tpDnt2Z2fK3HkPypj70=
github.com/nats-io/nats.go v1.33.1/go.mod h1:Ubdu4Nh9exXdSz0RVWRFBbRfrbSxOYd26oF0wkWclB8=
github.com/nats-io/nats.go v1.37.0 h1:07rauXbVnnJvv1gfIyghFEo6lUcYRY0WXc3x7x0vUxE=
github.com/nats-io/nats.go v1.37.0/go.mod h1:Ubdu4Nh9exXdSz0RVWRFBbRfrbSxOYd26oF0wkWclB8=
github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
github.com/nats-io/nkeys v0.4.7 h1:RwNJbbIdYCoClSDNY7QVKZlyb/wfT6ugvFCiKy6vDvI=
Expand Down Expand Up @@ -1910,8 +1908,8 @@ golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
Expand Down
2 changes: 1 addition & 1 deletion internal/grpc/services/gateway/authprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func (s *svc) Authenticate(ctx context.Context, req *gateway.AuthenticateRequest

if createHomeRes.Status.Code != rpc.Code_CODE_OK {
err := status.NewErrorFromCode(createHomeRes.Status.Code, "gateway")
log.Err(err).Msg("error calling Createhome")
log.Err(err).Any("response", createHomeRes).Msg("return from CreateHome")
return &gateway.AuthenticateResponse{
Status: status.NewInternal(ctx, err, "error creating user home"),
}, nil
Expand Down
3 changes: 2 additions & 1 deletion internal/grpc/services/gateway/storageprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,15 @@ func (s *svc) CreateHome(ctx context.Context, req *provider.CreateHomeRequest) (
home := s.getHome(ctx)
c, err := s.findByPath(ctx, home)
if err != nil {
log.Err(err).Str("home", home).Msg("gateway: error finding home on storage provider")
return &provider.CreateHomeResponse{
Status: status.NewStatusFromErrType(ctx, "error finding home", err),
}, nil
}

res, err := c.CreateHome(ctx, req)
if err != nil {
log.Err(err).Msg("gateway: error creating home on storage provider")
log.Err(err).Str("home", home).Msg("gateway: error creating home on storage provider")
return &provider.CreateHomeResponse{
Status: status.NewInternal(ctx, err, "error calling CreateHome"),
}, nil
Expand Down
1 change: 0 additions & 1 deletion internal/http/services/datagateway/datagateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ func (s *svc) doPut(w http.ResponseWriter, r *http.Request) {
return
}
httpReq.Header = r.Header

httpRes, err := httpClient.Do(httpReq)
if err != nil {
log.Err(err).Msg("error doing PUT request to data service")
Expand Down
1 change: 1 addition & 0 deletions internal/http/services/owncloud/ocdav/propfind.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ func (s *svc) getResourceInfos(ctx context.Context, w http.ResponseWriter, r *ht
Ref: ref,
ArbitraryMetadataKeys: metadataKeys,
}

res, err := client.Stat(ctx, req)
if err != nil {
log.Error().Err(err).Interface("req", req).Msg("error sending a grpc stat request")
Expand Down
4 changes: 2 additions & 2 deletions internal/http/services/owncloud/ocdav/proppatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func (s *svc) handleProppatch(ctx context.Context, w http.ResponseWriter, r *htt
HandleErrorStatus(&log, w, res.Status)
return nil, nil, false
}
if key == "http://owncloud.org/ns/favorite" {
if key == _propOcFavorite {
statRes, err := c.Stat(ctx, &provider.StatRequest{Ref: ref})
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
Expand Down Expand Up @@ -269,7 +269,7 @@ func (s *svc) handleProppatch(ctx context.Context, w http.ResponseWriter, r *htt
acceptedProps = append(acceptedProps, propNameXML)
delete(sreq.ArbitraryMetadata.Metadata, key)

if key == "http://owncloud.org/ns/favorite" {
if key == _propOcFavorite {
statRes, err := c.Stat(ctx, &provider.StatRequest{Ref: ref})
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
Expand Down
10 changes: 5 additions & 5 deletions pkg/auth/manager/ldap/ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (am *mgr) Authenticate(ctx context.Context, clientID, clientSecret string)
log := appctx.GetLogger(ctx)
l, err := utils.GetLDAPConnection(&am.c.LDAPConn)
if err != nil {
return nil, nil, err
return nil, nil, errors.Wrap(err, "error creating ldap connection")
}
defer l.Close()

Expand All @@ -139,10 +139,10 @@ func (am *mgr) Authenticate(ctx context.Context, clientID, clientSecret string)

sr, err := l.Search(searchRequest)
if err != nil {
return nil, nil, err
return nil, nil, errors.Wrapf(err, "error searching. seachrequest = %+v", searchRequest)
}

log.Trace().Interface("entries", sr.Entries).Send()
log.Debug().Interface("entries", sr.Entries).Send()
if len(sr.Entries) != 1 {
return nil, nil, errtypes.NotFound(clientID)
}
Expand All @@ -153,7 +153,7 @@ func (am *mgr) Authenticate(ctx context.Context, clientID, clientSecret string)
err = l.Bind(userdn, clientSecret)
if err != nil {
log.Debug().Err(err).Interface("userdn", userdn).Msg("bind with user credentials failed")
return nil, nil, err
return nil, nil, errors.Wrapf(err, "error binding with user credentials for user %s", userdn)
}

userID := &user.UserId{
Expand Down Expand Up @@ -193,7 +193,7 @@ func (am *mgr) Authenticate(ctx context.Context, clientID, clientSecret string)
u := &user.User{
Id: userID,
// TODO add more claims from the StandardClaims, eg EmailVerified
Username: sr.Entries[0].GetEqualFoldAttributeValue(am.c.Schema.CN),
Username: sr.Entries[0].GetEqualFoldAttributeValue(am.c.Schema.UID),
// TODO groups
Groups: getGroupsResp.Groups,
Mail: sr.Entries[0].GetEqualFoldAttributeValue(am.c.Schema.Mail),
Expand Down
3 changes: 3 additions & 0 deletions pkg/auth/manager/publicshares/publicshares.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ func (m *manager) Authenticate(ctx context.Context, token, secret string) (*user
if err != nil {
return nil, nil, err
}
if getUserResponse.Status.Code != rpcv1beta1.Code_CODE_OK {
return nil, nil, errtypes.NotFound(getUserResponse.Status.Message)
}

share := publicShareResponse.GetShare()
role := authpb.Role_ROLE_VIEWER
Expand Down
Loading

0 comments on commit 62ec6e9

Please sign in to comment.