Skip to content

Commit

Permalink
Add functionality to create webdav references for OCM shares (#974)
Browse files Browse the repository at this point in the history
  • Loading branch information
ishank011 authored Jul 20, 2020
1 parent a4e3545 commit fd224e4
Show file tree
Hide file tree
Showing 19 changed files with 377 additions and 31 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/webdav-references.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Enhancement: Add functionality to create webdav references for OCM shares.

Webdav references will now be created in users' shares directory with the target
set to the original resource's location in their mesh provider.

https://github.com/cs3org/reva/pull/974
9 changes: 7 additions & 2 deletions cmd/reva/ocm-share-create.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"encoding/json"
"fmt"
"os"
"path"
"strconv"
"time"

Expand Down Expand Up @@ -122,17 +123,21 @@ func ocmShareCreateCommand() *command {
if err != nil {
return err
}
permOpaque := &types.Opaque{
opaqueObj := &types.Opaque{
Map: map[string]*types.OpaqueEntry{
"permissions": &types.OpaqueEntry{
Decoder: "json",
Value: val,
},
"name": &types.OpaqueEntry{
Decoder: "plain",
Value: []byte(path.Base(res.Info.Path)),
},
},
}

shareRequest := &ocm.CreateOCMShareRequest{
Opaque: permOpaque,
Opaque: opaqueObj,
ResourceId: res.Info.Id,
Grant: grant,
RecipientMeshProvider: providerInfo.ProviderInfo,
Expand Down
52 changes: 52 additions & 0 deletions examples/oc-phoenix/providers.demo.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@
},
"api_version": "0.0.1",
"host": "http://127.0.0.1:13001/"
},
{
"endpoint": {
"type": {
"name": "Webdav",
"description": "CERNBox Webdav API"
},
"name": "CERNBox - Webdav API",
"path": "http://127.0.0.1:13001/webdav/",
"isMonitored": true
},
"api_version": "0.0.1",
"host": "http://127.0.0.1:13001/"
}
]
},
Expand All @@ -42,6 +55,19 @@
},
"api_version": "0.0.1",
"host": "http://127.0.0.1:13001/"
},
{
"endpoint": {
"type": {
"name": "Webdav",
"description": "CESNET Webdav API"
},
"name": "CESNET - Webdav API",
"path": "http://127.0.0.1:13001/webdav/",
"isMonitored": true
},
"api_version": "0.0.1",
"host": "http://127.0.0.1:13001/"
}
]
},
Expand All @@ -65,6 +91,19 @@
},
"api_version": "0.0.1",
"host": "http://127.0.0.1:13001/"
},
{
"endpoint": {
"type": {
"name": "Webdav",
"description": "Example Webdav API"
},
"name": "Example - Webdav API",
"path": "http://127.0.0.1:13001/webdav/",
"isMonitored": true
},
"api_version": "0.0.1",
"host": "http://127.0.0.1:13001/"
}
]
},
Expand All @@ -88,6 +127,19 @@
},
"api_version": "0.0.1",
"host": "http://127.0.0.1:13001/"
},
{
"endpoint": {
"type": {
"name": "Webdav",
"description": "Test Webdav API"
},
"name": "Test - Webdav API",
"path": "http://127.0.0.1:13001/webdav/",
"isMonitored": true
},
"api_version": "0.0.1",
"host": "http://127.0.0.1:13001/"
}
]
}
Expand Down
78 changes: 78 additions & 0 deletions examples/ocm-partners/providers.demo.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@
},
"api_version": "0.0.1",
"host": "https://sciencemesh.cernbox.cern.ch/iop/"
},
{
"endpoint": {
"type": {
"name": "Webdav",
"description": "CERNBox Webdav API"
},
"name": "CERNBox - Webdav API",
"path": "https://sciencemesh.cernbox.cern.ch/iop/webdav/",
"isMonitored": true
},
"api_version": "0.0.1",
"host": "https://sciencemesh.cernbox.cern.ch/iop/"
}
]
},
Expand All @@ -42,6 +55,19 @@
},
"api_version": "0.0.1",
"host": "https://sciencemesh.cesnet.cz/iop/"
},
{
"endpoint": {
"type": {
"name": "Webdav",
"description": "CESNET Webdav API"
},
"name": "CESNET - Webdav API",
"path": "https://sciencemesh.cesnet.cz/iop/webdav/",
"isMonitored": true
},
"api_version": "0.0.1",
"host": "https://sciencemesh.cesnet.cz/iop/"
}
]
},
Expand All @@ -65,6 +91,19 @@
},
"api_version": "0.0.1",
"host": "https://sciencemesh-test.uni-muenster.de/api/"
},
{
"endpoint": {
"type": {
"name": "Webdav",
"description": "WWU Webdav API"
},
"name": "WWU - Webdav API",
"path": "https://sciencemesh-test.uni-muenster.de/api/webdav/",
"isMonitored": true
},
"api_version": "0.0.1",
"host": "https://sciencemesh-test.uni-muenster.de/api/"
}
]
},
Expand All @@ -88,6 +127,19 @@
},
"api_version": "0.0.1",
"host": "https://sciencemesh.cubbit.io/"
},
{
"endpoint": {
"type": {
"name": "Webdav",
"description": "Cubbit Webdav API"
},
"name": "Cubbit - Webdav API",
"path": "https://sciencemesh.cubbit.io/webdav/",
"isMonitored": true
},
"api_version": "0.0.1",
"host": "https://sciencemesh.cubbit.io/"
}
]
},
Expand All @@ -111,6 +163,19 @@
},
"api_version": "0.0.1",
"host": "https://cs3mesh.softwaremind.com/iop/"
},
{
"endpoint": {
"type": {
"name": "Webdav",
"description": "Ailleron Webdav API"
},
"name": "Ailleron - Webdav API",
"path": "https://cs3mesh.softwaremind.com/iop/webdav/",
"isMonitored": true
},
"api_version": "0.0.1",
"host": "https://cs3mesh.softwaremind.com/iop/"
}
]
},
Expand All @@ -134,6 +199,19 @@
},
"api_version": "0.0.1",
"host": "https://app.cs3mesh-iop.k8s.surfsara.nl/iop/"
},
{
"endpoint": {
"type": {
"name": "Webdav",
"description": "Surfsara Webdav API"
},
"name": "Surfsara - Webdav API",
"path": "https://app.cs3mesh-iop.k8s.surfsara.nl/iop/webdav/",
"isMonitored": true
},
"api_version": "0.0.1",
"host": "https://app.cs3mesh-iop.k8s.surfsara.nl/iop/"
}
]
}
Expand Down
52 changes: 52 additions & 0 deletions examples/ocmd/providers.demo.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@
},
"api_version": "0.0.1",
"host": "http://127.0.0.1:19001/"
},
{
"endpoint": {
"type": {
"name": "Webdav",
"description": "CERNBox Webdav API"
},
"name": "CERNBox - Webdav API",
"path": "http://127.0.0.1:19001/webdav/",
"isMonitored": true
},
"api_version": "0.0.1",
"host": "http://127.0.0.1:19001/"
}
]
},
Expand All @@ -42,6 +55,19 @@
},
"api_version": "0.0.1",
"host": "http://127.0.0.1:17001/"
},
{
"endpoint": {
"type": {
"name": "Webdav",
"description": "CESNET Webdav API"
},
"name": "CESNET - Webdav API",
"path": "http://127.0.0.1:17001/webdav/",
"isMonitored": true
},
"api_version": "0.0.1",
"host": "http://127.0.0.1:17001/"
}
]
},
Expand All @@ -65,6 +91,19 @@
},
"api_version": "0.0.1",
"host": "http://127.0.0.1:19001/"
},
{
"endpoint": {
"type": {
"name": "Webdav",
"description": "Example Webdav API"
},
"name": "Example - Webdav API",
"path": "http://127.0.0.1:19001/webdav/",
"isMonitored": true
},
"api_version": "0.0.1",
"host": "http://127.0.0.1:19001/"
}
]
},
Expand All @@ -88,6 +127,19 @@
},
"api_version": "0.0.1",
"host": "http://127.0.0.1:19001/"
},
{
"endpoint": {
"type": {
"name": "Webdav",
"description": "Test Webdav API"
},
"name": "Test - Webdav API",
"path": "http://127.0.0.1:19001/webdav/",
"isMonitored": true
},
"api_version": "0.0.1",
"host": "http://127.0.0.1:19001/"
}
]
}
Expand Down
13 changes: 11 additions & 2 deletions examples/standalone/standalone.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
# services to enable
[grpc.services.gateway]
commit_share_to_storage_grant = true
commit_share_to_storage_ref = true

[grpc.services.storageregistry]
[grpc.services.storageprovider]
[grpc.services.storageregistry.drivers.static]
home_provider = "/home"

[grpc.services.storageregistry.drivers.static.rules]
"/home" = "localhost:17000"
"/reva" = "localhost:18000"
"123e4567-e89b-12d3-a456-426655440000" = "localhost:18000"

[grpc.services.authprovider]
[grpc.services.authregistry]
[grpc.services.userprovider]
Expand All @@ -13,6 +23,5 @@
[grpc.services.ocmproviderauthorizer]

[http.services.datagateway]
[http.services.dataprovider]
[http.services.prometheus]
[http.services.ocmd]
14 changes: 14 additions & 0 deletions examples/standalone/storage-home.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[grpc]
address = "0.0.0.0:17000"

[grpc.services.storageprovider]
driver = "localhome"
mount_path = "/home"
mount_id = "123e4567-e89b-12d3-a456-426655440000"
data_server_url = "http://localhost:17001/data"

[http]
address = "0.0.0.0:17001"

[http.services.dataprovider]
driver = "localhome"
7 changes: 7 additions & 0 deletions examples/standalone/storage-reva.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[grpc]
address = "0.0.0.0:18000"

[grpc.services.storageprovider]
driver = "local"
mount_path = "/reva"
mount_id = "123e4567-e89b-12d3-a456-426655440000"
Loading

0 comments on commit fd224e4

Please sign in to comment.