Skip to content

Commit

Permalink
Merge pull request #4590 from owncloud/3-fixes
Browse files Browse the repository at this point in the history
[full-ci] add web url to graph api and update reva
  • Loading branch information
micbar authored Sep 15, 2022
2 parents 810159c + e092da5 commit 5c94bf8
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 20 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/add-web-url.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Add webURL to space root

Add the web url to the space root on the graphAPI.

https://github.com/owncloud/ocis/pull/4588
5 changes: 5 additions & 0 deletions changelog/unreleased/update-reva-rc1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Update reva

TBD

https://github.com/owncloud/ocis/pull/4588
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/blevesearch/bleve_index_api v1.0.3
github.com/coreos/go-oidc/v3 v3.4.0
github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d
github.com/cs3org/reva/v2 v2.10.1-0.20220914095102-44dc469bd48b
github.com/cs3org/reva/v2 v2.10.1-0.20220915095422-4b099c09a66c
github.com/disintegration/imaging v1.6.2
github.com/ggwhite/go-masker v1.0.9
github.com/go-chi/chi/v5 v5.0.7
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,10 @@ github.com/crewjam/saml v0.4.6 h1:XCUFPkQSJLvzyl4cW9OvpWUbRf0gE7VUpU8ZnilbeM4=
github.com/crewjam/saml v0.4.6/go.mod h1:ZBOXnNPFzB3CgOkRm7Nd6IVdkG+l/wF+0ZXLqD96t1A=
github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d h1:toyZ7IsXlUdEPZ/IG8fg7hbM8HcLPY0bkX4FKBmgLVI=
github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
github.com/cs3org/reva/v2 v2.10.1-0.20220914095102-44dc469bd48b h1:mRtQad2TBNE970FYntYSZJJp+Ol0fzcICf/n/UmHb1g=
github.com/cs3org/reva/v2 v2.10.1-0.20220914095102-44dc469bd48b/go.mod h1:+BYVpRV8g1hL8wF3+3BunL9BKPsXVyJYmH8COxq/V7Y=
github.com/cs3org/reva/v2 v2.10.1-0.20220915071600-3358dc72a980 h1:siIHxgMHWCxERsHPYwHL7Pno27URyqjV2np9Mh1U84g=
github.com/cs3org/reva/v2 v2.10.1-0.20220915071600-3358dc72a980/go.mod h1:+BYVpRV8g1hL8wF3+3BunL9BKPsXVyJYmH8COxq/V7Y=
github.com/cs3org/reva/v2 v2.10.1-0.20220915095422-4b099c09a66c h1:pvbsnSl5WpS6PkSR4glwR8OJGrRdZASajAJtNwp9E+Y=
github.com/cs3org/reva/v2 v2.10.1-0.20220915095422-4b099c09a66c/go.mod h1:+BYVpRV8g1hL8wF3+3BunL9BKPsXVyJYmH8COxq/V7Y=
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI=
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY=
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
Expand Down
18 changes: 12 additions & 6 deletions services/graph/pkg/service/v0/drives.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,6 @@ func (g Graph) cs3StorageSpaceToDrive(ctx context.Context, baseURL *url.URL, spa
Id: libregraph.PtrString(spaceID),
Name: &space.Name,
//"createdDateTime": "string (timestamp)", // TODO read from StorageSpace ... needs Opaque for now
//"description": "string", // TODO read from StorageSpace ... needs Opaque for now
DriveType: &space.SpaceType,
Root: &libregraph.DriveItem{
Id: libregraph.PtrString(storagespace.FormatResourceID(spaceRid)),
Expand Down Expand Up @@ -572,15 +571,23 @@ func (g Graph) cs3StorageSpaceToDrive(ctx context.Context, baseURL *url.URL, spa
}

if baseURL != nil {
// TODO read from StorageSpace ... needs Opaque for now
// TODO how do we build the url?
// for now: read from request
webDavURL := *baseURL
webDavURL.Path = path.Join(webDavURL.Path, spaceID)
drive.Root.WebDavUrl = libregraph.PtrString(webDavURL.String())
}

// TODO The public space has no owner ... should we even show it?
webURL, err := url.Parse(g.config.Commons.OcisURL)
if err != nil {
g.logger.Error().
Err(err).
Str("url", g.config.Commons.OcisURL).
Msg("failed to parse base url")
return nil, err
}

webURL.Path = path.Join(webURL.Path, "f", storagespace.FormatResourceID(spaceRid))
drive.WebUrl = libregraph.PtrString(webURL.String())

if space.Owner != nil && space.Owner.Id != nil {
drive.Owner = &libregraph.IdentitySet{
User: &libregraph.Identity{
Expand All @@ -604,7 +611,6 @@ func (g Graph) cs3StorageSpaceToDrive(ctx context.Context, baseURL *url.URL, spa
Total: &t,
}
}
// FIXME use coowner from https://github.com/owncloud/open-graph-api

return drive, nil
}
Expand Down
12 changes: 9 additions & 3 deletions services/graph/pkg/service/v0/graph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
libregraph "github.com/owncloud/libre-graph-api-go"
"github.com/owncloud/ocis/v2/ocis-pkg/shared"
"github.com/owncloud/ocis/v2/services/graph/mocks"
"github.com/owncloud/ocis/v2/services/graph/pkg/config"
"github.com/owncloud/ocis/v2/services/graph/pkg/config/defaults"
Expand All @@ -39,6 +40,8 @@ var _ = Describe("Graph", func() {
cfg = defaults.FullDefaultConfig()
cfg.Identity.LDAP.CACert = "" // skip the startup checks, we don't use LDAP at all in this tests
cfg.TokenManager.JWTSecret = "loremipsum"
cfg.Commons = &shared.Commons{}
cfg.Commons.OcisURL = "https://ocis.test"

gatewayClient = &mocks.GatewayClient{}
eventsPublisher = mocks.Publisher{}
Expand Down Expand Up @@ -108,7 +111,8 @@ var _ = Describe("Graph", func() {
"root":{
"id":"pro-1$sameID",
"webDavUrl":"https://localhost:9200/dav/spaces/pro-1$sameID"
}
},
"webUrl": "https://ocis.test/f/pro-1$sameID"
}
]
}
Expand Down Expand Up @@ -178,7 +182,8 @@ var _ = Describe("Graph", func() {
"eTag":"101112131415",
"id":"pro-1$asameID",
"webDavUrl":"https://localhost:9200/dav/spaces/pro-1$asameID"
}
},
"webUrl": "https://ocis.test/f/pro-1$asameID"
},
{
"driveAlias":"bspacetype/bspacename",
Expand All @@ -189,7 +194,8 @@ var _ = Describe("Graph", func() {
"eTag":"123456789",
"id":"pro-1$bsameID",
"webDavUrl":"https://localhost:9200/dav/spaces/pro-1$bsameID"
}
},
"webUrl": "https://ocis.test/f/pro-1$bsameID"
}
]
}
Expand Down
7 changes: 0 additions & 7 deletions tests/acceptance/expected-failures-API-on-OCIS-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,6 @@ cannot share a folder with create permission
- [apiTrashbin/trashbinSharingToShares.feature:212](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinSharingToShares.feature#L212)
- [apiTrashbin/trashbinSharingToShares.feature:236](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinSharingToShares.feature#L236)


#### [oc:privatelink property not returned in webdav responses](https://github.com/owncloud/product/issues/262)

- [apiWebdavProperties2/getFileProperties.feature:306](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties2/getFileProperties.feature#L306)
- [apiWebdavProperties2/getFileProperties.feature:307](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties2/getFileProperties.feature#L307)
- [apiWebdavProperties2/getFileProperties.feature:312](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties2/getFileProperties.feature#L312)

#### [changing user quota gives ocs status 103 / Cannot set quota](https://github.com/owncloud/product/issues/247)

- [apiShareOperationsToShares2/uploadToShare.feature:210](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/uploadToShare.feature#L210)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ Other free text and markdown formatting can be used elsewhere in the document if
- [webUIPrivateLinks/accessingPrivateLinks.feature:9](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIPrivateLinks/accessingPrivateLinks.feature#L9)
- [webUIPrivateLinks/accessingPrivateLinks.feature:17](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIPrivateLinks/accessingPrivateLinks.feature#L17)
- [webUIPrivateLinks/accessingPrivateLinks.feature:25](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIPrivateLinks/accessingPrivateLinks.feature#L25)
- [webUIPrivateLinks/accessingPrivateLinks.feature:35](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIPrivateLinks/accessingPrivateLinks.feature#L35)

### [Share additional info](https://github.com/owncloud/ocis/issues/1253)
- [webUISharingInternalUsersShareWithPage/shareWithUsers.feature:140](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalUsersShareWithPage/shareWithUsers.feature#L140)
Expand Down

0 comments on commit 5c94bf8

Please sign in to comment.