Skip to content

Commit

Permalink
update go-cs3api, refactor graph
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
  • Loading branch information
butonic committed Jun 15, 2021
1 parent f7b43cc commit c446fed
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 46 deletions.
2 changes: 1 addition & 1 deletion accounts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
contrib.go.opencensus.io/exporter/zipkin v0.1.2
github.com/asim/go-micro/plugins/client/grpc/v3 v3.0.0-20210408173139-0d57213d3f5c
github.com/asim/go-micro/v3 v3.5.1-0.20210217182006-0f0ace1a44a9
github.com/cs3org/go-cs3apis v0.0.0-20210507060801-f176760d55f4
github.com/cs3org/go-cs3apis v0.0.0-20210614143420-5ee2eb1e7887
github.com/cs3org/reva v1.7.1-0.20210507160327-e2c3841d0dbc
github.com/go-chi/chi v4.1.2+incompatible
github.com/go-chi/render v1.0.1
Expand Down
5 changes: 2 additions & 3 deletions graph/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
contrib.go.opencensus.io/exporter/ocagent v0.7.0
contrib.go.opencensus.io/exporter/zipkin v0.1.2
github.com/asim/go-micro/v3 v3.5.1-0.20210217182006-0f0ace1a44a9
github.com/cs3org/go-cs3apis v0.0.0-20210527092509-2b828e94ed4c
github.com/cs3org/go-cs3apis v0.0.0-20210614143420-5ee2eb1e7887
github.com/cs3org/reva v1.7.1-0.20210507160327-e2c3841d0dbc
github.com/deepmap/oapi-codegen v1.6.1
github.com/go-chi/chi v4.1.2+incompatible
Expand All @@ -28,8 +28,7 @@ require (
)

replace (
github.com/cs3org/go-cs3apis => github.com/butonic/go-cs3apis v0.0.0-20210608111428-0b2c079174c9
github.com/cs3org/reva => github.com/butonic/reva v0.0.0-20210609104920-931c7f1b5850
github.com/cs3org/reva => ../../reva
github.com/owncloud/ocis/ocis-pkg => ../ocis-pkg
github.com/owncloud/ocis/store => ../store
// taken from https://github.com/asim/go-micro/blob/master/plugins/registry/etcd/go.mod#L14-L16
Expand Down
22 changes: 22 additions & 0 deletions graph/pkg/middleware/forwardtoken.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package middleware

import (
"net/http"

"github.com/cs3org/reva/pkg/token"
"github.com/owncloud/ocis/ocis-pkg/account"
"google.golang.org/grpc/metadata"
)

// ForwardToken provides a middleware that adds a received x-access-token to the outgoung context
func ForwardToken(opts ...account.Option) func(http.Handler) http.Handler {
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
t := r.Header.Get(token.TokenHeader)

ctx := metadata.AppendToOutgoingContext(r.Context(), token.TokenHeader, t)

next.ServeHTTP(w, r.WithContext(ctx))
})
}
}
23 changes: 5 additions & 18 deletions graph/pkg/service/v0/drives.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ import (
"time"

"github.com/go-chi/render"
"google.golang.org/grpc/metadata"

cs3rpc "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1"
storageprovider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
types "github.com/cs3org/go-cs3apis/cs3/types/v1beta1"
"github.com/cs3org/reva/pkg/token"

msgraph "github.com/owncloud/ocis/graph/pkg/openapi/v0"
opengraph "github.com/owncloud/ocis/graph/pkg/openapi/v0"
Expand All @@ -31,15 +29,6 @@ func (g Graph) GetDrives(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusInternalServerError)
return
}
// TODO refactor this: forward the token to the next service
t := r.Header.Get("x-access-token")
if t == "" {
g.logger.Error().Msg("no access token provided in request")
w.WriteHeader(http.StatusForbidden)
return
}
ctx = token.ContextSetToken(ctx, t)
ctx = metadata.AppendToOutgoingContext(ctx, "x-access-token", t)

req := &storageprovider.ListStorageSpacesRequest{

Expand Down Expand Up @@ -84,9 +73,9 @@ func (g Graph) GetDrives(w http.ResponseWriter, r *http.Request) {
render.JSON(w, r, &listResponse{Value: files})
}

// GetRootDriveChildren implements the Service interface.
func (g Graph) GetRootDriveChildren(w http.ResponseWriter, r *http.Request) {
g.logger.Info().Msgf("Calling GetRootDriveChildren")
// GetPersonalDriveChildren implements the Service interface.
func (g Graph) GetPersonalDriveChildren(w http.ResponseWriter, r *http.Request) {
g.logger.Debug().Msgf("Calling GetPersonalDriveChildren")

ctx := r.Context()

Expand All @@ -99,8 +88,6 @@ func (g Graph) GetRootDriveChildren(w http.ResponseWriter, r *http.Request) {
return
}

g.logger.Info().Msgf("provides access token %v", ctx)

req := &storageprovider.ListContainerRequest{Ref: &storageprovider.Reference{Path: fn}}

res, err := client.ListContainer(ctx, req)
Expand Down Expand Up @@ -134,7 +121,7 @@ func cs3ResourceToDriveItem(res *storageprovider.ResourceInfo) (*msgraph.DriveIt
*size = int64(res.Size) // uint64 -> int :boom:
name := strings.TrimPrefix(res.Path, "/home/")

id := res.Id.StorageId + "!" + res.Id.NodeId
id := res.Id.StorageId + "!" + res.Id.OpaqueId

driveItem := &msgraph.DriveItem{
BaseItem: msgraph.BaseItem{
Expand Down Expand Up @@ -175,7 +162,7 @@ func formatDriveItems(mds []*storageprovider.ResourceInfo) ([]*msgraph.DriveItem
}

func cs3StorageSpaceToDrive(baseUrl *url.URL, space *storageprovider.StorageSpace) (*msgraph.Drive, error) {
rootId := space.Root.StorageId + "!" + space.Root.NodeId
rootId := space.Root.StorageId + "!" + space.Root.OpaqueId
drive := &msgraph.Drive{
BaseItem: msgraph.BaseItem{
Entity: msgraph.Entity{
Expand Down
13 changes: 10 additions & 3 deletions graph/pkg/service/v0/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import (
"net/http"

"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
chim "github.com/go-chi/chi/middleware"
"github.com/owncloud/ocis/graph/pkg/middleware"
"github.com/owncloud/ocis/ocis-pkg/account"
ocism "github.com/owncloud/ocis/ocis-pkg/middleware"
)

// Service defines the extension handlers.
Expand All @@ -29,12 +32,16 @@ func NewService(opts ...Option) Service {
}

m.Route(options.Config.HTTP.Root, func(r chi.Router) {
r.Use(middleware.StripSlashes)
r.Use(chim.StripSlashes)
r.Use(ocism.ExtractAccountUUID(
account.JWTSecret(options.Config.JWTSecret)),
)
r.Use(middleware.ForwardToken())
r.Route("/v1.0", func(r chi.Router) {
r.Route("/me", func(r chi.Router) {
r.Get("/", svc.GetMe)
r.Get("/drives", svc.GetDrives)
r.Get("/drive/root/children", svc.GetRootDriveChildren)
r.Get("/drive/root/children", svc.GetPersonalDriveChildren)
})
r.Route("/users", func(r chi.Router) {
r.Get("/", svc.GetUsers)
Expand Down
2 changes: 1 addition & 1 deletion ocis-pkg/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/asim/go-micro/plugins/wrapper/trace/opencensus/v3 v3.0.0-20210408173139-0d57213d3f5c
github.com/asim/go-micro/v3 v3.5.1-0.20210217182006-0f0ace1a44a9
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/cs3org/go-cs3apis v0.0.0-20210507060801-f176760d55f4
github.com/cs3org/go-cs3apis v0.0.0-20210614143420-5ee2eb1e7887
github.com/cs3org/reva v1.7.1-0.20210507160327-e2c3841d0dbc
github.com/go-chi/chi v4.1.2+incompatible
github.com/iancoleman/strcase v0.1.3
Expand Down
5 changes: 2 additions & 3 deletions ocis/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ require (
github.com/owncloud/ocis/thumbnails v0.0.0-20210413063522-955bd60edf33
github.com/owncloud/ocis/web v0.0.0-20210413063522-955bd60edf33
github.com/owncloud/ocis/webdav v0.0.0-20210413063522-955bd60edf33
github.com/rs/zerolog v1.22.0
github.com/rs/zerolog v1.23.0
github.com/spf13/cobra v1.1.3
github.com/spf13/viper v1.7.1
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect
Expand All @@ -42,8 +42,7 @@ require (
)

replace (
github.com/cs3org/go-cs3apis => github.com/butonic/go-cs3apis v0.0.0-20210608111428-0b2c079174c9
github.com/cs3org/reva => github.com/butonic/reva v0.0.0-20210609104920-931c7f1b5850
github.com/cs3org/reva => ../../reva
github.com/gomodule/redigo => github.com/gomodule/redigo v1.8.2
github.com/oleiade/reflections => github.com/oleiade/reflections v1.0.1
github.com/owncloud/ocis/accounts => ../accounts
Expand Down
23 changes: 14 additions & 9 deletions ocis/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,6 @@ github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc h1:biVzkmvwrH8
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s=
github.com/butonic/go-cs3apis v0.0.0-20210608111428-0b2c079174c9 h1:q2UFrmiIZwdFOislnGjUWlyqIpttjBRIB6K3QOUmZkY=
github.com/butonic/go-cs3apis v0.0.0-20210608111428-0b2c079174c9/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
github.com/butonic/reva v0.0.0-20210609104920-931c7f1b5850 h1:nYc4RJys9EeduVoPveRWjWXyTW961fyKlBsy3eePw6A=
github.com/butonic/reva v0.0.0-20210609104920-931c7f1b5850/go.mod h1:0jhnbVL7XTHUTYmsenx2DBXetFyg0iC3UlPEDuuNVi8=
github.com/c-bata/go-prompt v0.2.5/go.mod h1:vFnjEGDIIA/Lib7giyE4E9c50Lvl8j0S+7FVlAwDAVw=
github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
Expand Down Expand Up @@ -289,8 +285,9 @@ github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f h1:JOrtw2xFKzlg+cbHpyrpLDmnN1HqhBfnX7WDiW7eG2c=
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd/v22 v22.1.0 h1:kq/SbG2BCKLkDKkjQf5OWwKWUKj1lgs3lFI4PxnR5lg=
github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI=
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/couchbase/ghistogram v0.1.0/go.mod h1:s1Jhy76zqfEecpNWJfWUiKZookAFaiGOEoyzgHt9i7k=
Expand All @@ -312,6 +309,10 @@ github.com/crewjam/httperr v0.2.0/go.mod h1:Jlz+Sg/XqBQhyMjdDiC+GNNRzZTD7x39Gu3p
github.com/crewjam/saml v0.4.0 h1:gvSlboe4BO1APaU2eDdsbql3itRat310Q5qs2Seim2k=
github.com/crewjam/saml v0.4.0/go.mod h1:geQUbAAwmTKNJFDzoXaTssZHY26O89PHIm3K3YWjWnI=
github.com/cs3org/cato v0.0.0-20200828125504-e418fc54dd5e/go.mod h1:XJEZ3/EQuI3BXTp/6DUzFr850vlxq11I6satRtz0YQ4=
github.com/cs3org/go-cs3apis v0.0.0-20210507060801-f176760d55f4/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
github.com/cs3org/go-cs3apis v0.0.0-20210527092509-2b828e94ed4c/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
github.com/cs3org/go-cs3apis v0.0.0-20210614143420-5ee2eb1e7887 h1:X5Se3M/kbh9w6LZQvyLS7djAGKcWGzmaY6IOa7Talpk=
github.com/cs3org/go-cs3apis v0.0.0-20210614143420-5ee2eb1e7887/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
github.com/cucumber/godog v0.8.1/go.mod h1:vSh3r/lM+psC1BPXvdkSEuNjmXfpVqrMGYAElF6hxnA=
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
github.com/cznic/b v0.0.0-20181122101859-a26611c4d92d h1:SwD98825d6bdB+pEuTxWOXiSjBrHdOl/UVp75eI7JT8=
Expand Down Expand Up @@ -349,6 +350,7 @@ github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v0.0.0-20180713052910-9f541cc9db5d/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
Expand Down Expand Up @@ -756,6 +758,7 @@ github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6Wezm
github.com/gobwas/ws v1.0.3/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4=
github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gofrs/uuid v3.1.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gofrs/uuid v3.3.0+incompatible h1:8K4tyRfvU1CYPgJsveYFQMhpFd/wXNM7iK6rR7UHz84=
Expand Down Expand Up @@ -1166,8 +1169,8 @@ github.com/miekg/dns v1.1.27 h1:aEH/kqUzUxGJ/UHcEKdJY+ugH6WEzsEBBSPa8zuy1aM=
github.com/miekg/dns v1.1.27/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
github.com/minio/md5-simd v1.1.0 h1:QPfiOqlZH+Cj9teu0t9b1nTBfPbyTl16Of5MeuShdK4=
github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw=
github.com/minio/minio-go/v7 v7.0.10 h1:1oUKe4EOPUEhw2qnPQaPsJ0lmVTYLFu03SiItauXs94=
github.com/minio/minio-go/v7 v7.0.10/go.mod h1:td4gW1ldOsj1PbSNS+WYK43j+P1XVhX/8W8awaYlBFo=
github.com/minio/minio-go/v7 v7.0.11 h1:7utSkCtMQPYYB1UB8FR3d0QSiOWE6F/JYXon29imYek=
github.com/minio/minio-go/v7 v7.0.11/go.mod h1:WoyW+ySKAKjY98B9+7ZbI8z8S3jaxaisdcvj9TGlazA=
github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU=
github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM=
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
Expand Down Expand Up @@ -1450,8 +1453,9 @@ github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OK
github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc=
github.com/rs/zerolog v1.18.0/go.mod h1:9nvC1axdVrAHcu/s9taAVfBuIdTZLVQmKQyvrUjF5+I=
github.com/rs/zerolog v1.21.0/go.mod h1:ZPhntP/xmq1nnND05hhpAh2QMhSsA4UN3MGZ6O2J3hM=
github.com/rs/zerolog v1.22.0 h1:XrVUjV4K+izZpKXZHlPrYQiDtmdGiCylnT4i43AAWxg=
github.com/rs/zerolog v1.22.0/go.mod h1:ZPhntP/xmq1nnND05hhpAh2QMhSsA4UN3MGZ6O2J3hM=
github.com/rs/zerolog v1.23.0 h1:UskrK+saS9P9Y789yNNulYKdARjPZuS35B8gJF2x60g=
github.com/rs/zerolog v1.23.0/go.mod h1:6c7hFfxPOy7TacJc4Fcdi24/J0NKYGzjG8FWRI916Qo=
github.com/rubenv/sql-migrate v0.0.0-20190212093014-1007f53448d7/go.mod h1:WS0rl9eEliYI8DPnr3TOwz4439pay+qNgzJoVya/DmY=
github.com/russellhaering/goxmldsig v0.0.0-20180430223755-7acd5e4a6ef7 h1:J4AOUcOh/t1XbQcJfkEqhzgvMJ2tDxdCVvmHxW5QXao=
github.com/russellhaering/goxmldsig v0.0.0-20180430223755-7acd5e4a6ef7/go.mod h1:Oz4y6ImuOQZxynhbSXk7btjEfNBtGlj2dcaOvXl2FSM=
Expand Down Expand Up @@ -1523,8 +1527,9 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/skratchdot/open-golang v0.0.0-20160302144031-75fb7ed4208c/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
Expand Down
4 changes: 1 addition & 3 deletions ocs/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
contrib.go.opencensus.io/exporter/zipkin v0.1.2
github.com/asim/go-micro/plugins/client/grpc/v3 v3.0.0-20210408173139-0d57213d3f5c
github.com/asim/go-micro/v3 v3.5.1-0.20210217182006-0f0ace1a44a9
github.com/cs3org/go-cs3apis v0.0.0-20210507060801-f176760d55f4
github.com/cs3org/go-cs3apis v0.0.0-20210614143420-5ee2eb1e7887
github.com/cs3org/reva v1.7.1-0.20210507160327-e2c3841d0dbc
github.com/go-chi/chi v4.1.2+incompatible
github.com/go-chi/render v1.0.1
Expand Down Expand Up @@ -42,6 +42,4 @@ replace (
// taken from https://github.com/asim/go-micro/blob/master/plugins/registry/etcd/go.mod#L14-L16
go.etcd.io/etcd/api/v3 => go.etcd.io/etcd/api/v3 v3.0.0-20210204162551-dae29bb719dd
go.etcd.io/etcd/pkg/v3 => go.etcd.io/etcd/pkg/v3 v3.0.0-20210204162551-dae29bb719dd
// latest version compatible with etcd
google.golang.org/grpc => google.golang.org/grpc v1.29.1
)
6 changes: 3 additions & 3 deletions ocs/pkg/service/v0/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ func (o Ocs) DeleteUser(w http.ResponseWriter, r *http.Request) {
}

statResp, err := gwc.Stat(ctx, &provider.StatRequest{
Ref: &provider.Reference{Path: homeResp.Ref.Path},
Ref: &provider.Reference{Path: homeResp.Path},
})

if err != nil {
Expand All @@ -414,7 +414,7 @@ func (o Ocs) DeleteUser(w http.ResponseWriter, r *http.Request) {
return
}

delReq := &provider.DeleteRequest{Ref: statResp.Info.Id}
delReq := &provider.DeleteRequest{Ref: &provider.Reference{ResourceId: statResp.Info.Id}}

delResp, err := gwc.Delete(ctx, delReq)
if err != nil {
Expand All @@ -430,7 +430,7 @@ func (o Ocs) DeleteUser(w http.ResponseWriter, r *http.Request) {
return
}

req := &gateway.PurgeRecycleRequest{Ref: homeResp.Ref}
req := &gateway.PurgeRecycleRequest{Ref: &provider.Reference{Path: homeResp.Path}}

purgeRecycleResponse, err := gwc.PurgeRecycle(ctx, req)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion proxy/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/asim/go-micro/plugins/client/grpc/v3 v3.0.0-20210408173139-0d57213d3f5c
github.com/asim/go-micro/v3 v3.5.1-0.20210217182006-0f0ace1a44a9
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/cs3org/go-cs3apis v0.0.0-20210507060801-f176760d55f4
github.com/cs3org/go-cs3apis v0.0.0-20210614143420-5ee2eb1e7887
github.com/cs3org/reva v1.7.1-0.20210507160327-e2c3841d0dbc
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/justinas/alice v1.2.0
Expand Down
2 changes: 1 addition & 1 deletion thumbnails/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
contrib.go.opencensus.io/exporter/ocagent v0.7.0
contrib.go.opencensus.io/exporter/zipkin v0.1.2
github.com/asim/go-micro/v3 v3.5.1-0.20210217182006-0f0ace1a44a9
github.com/cs3org/go-cs3apis v0.0.0-20210507060801-f176760d55f4
github.com/cs3org/go-cs3apis v0.0.0-20210614143420-5ee2eb1e7887
github.com/cs3org/reva v1.7.1-0.20210507160327-e2c3841d0dbc
github.com/disintegration/imaging v1.6.2
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
Expand Down

0 comments on commit c446fed

Please sign in to comment.