@@ -87,9 +87,9 @@ type EfssShare struct {
87
87
Name string `json:"name" validate:"required"`
88
88
Token string `json:"token"`
89
89
ResourceID struct {
90
- OpaqueID string `json:"opaque_id"`
90
+ OpaqueID string `json:"opaque_id" validate:"required" `
91
91
} `json:"resource_id" validate:"required"`
92
- ResourceType string `json:"resource_type"`
92
+ ResourceType string `json:"resource_type" validate:"omitempty" `
93
93
RemoteShareID string `json:"remote_share_id" validate:"required"`
94
94
Protocols struct {
95
95
WebDAV struct {
@@ -181,7 +181,7 @@ func (sm *Manager) efssShareToOcm(resp *EfssShare) *ocm.Share {
181
181
// Parse the JSON struct returned by the PHP SM app into an OCM share object
182
182
183
183
// first generate the map of access methods, assuming WebDAV is always present
184
- var am = make ([]* ocm.AccessMethod , 1 , 3 )
184
+ var am = make ([]* ocm.AccessMethod , 0 , 3 )
185
185
am = append (am , share .NewWebDavAccessMethod (conversions .RoleFromOCSPermissions (
186
186
conversions .Permissions (resp .Protocols .WebDAV .Permissions )).CS3ResourcePermissions ()))
187
187
if resp .Protocols .WebApp .ViewMode != "" {
@@ -203,7 +203,10 @@ func (sm *Manager) efssShareToOcm(resp *EfssShare) *ocm.Share {
203
203
Grantee : & provider.Grantee {
204
204
Type : provider .GranteeType_GRANTEE_TYPE_USER ,
205
205
Id : & provider.Grantee_UserId {
206
- UserId : resp .Grantee .ID ,
206
+ UserId : & userpb.UserId {
207
+ OpaqueId : resp .Grantee .ID .OpaqueId ,
208
+ Idp : resp .Grantee .ID .Idp ,
209
+ },
207
210
},
208
211
},
209
212
Owner : & userpb.UserId {
@@ -322,7 +325,7 @@ func efssReceivedShareToOcm(resp *ReceivedEfssShare) *ocm.ReceivedShare {
322
325
// Parse the JSON struct returned by the PHP SM app into an OCM received share object
323
326
324
327
// first generate the map of protocols, assuming WebDAV is always present
325
- var proto = make ([]* ocm.Protocol , 1 , 3 )
328
+ var proto = make ([]* ocm.Protocol , 0 , 3 )
326
329
proto = append (proto , share .NewWebDAVProtocol (resp .Share .Protocols .WebDAV .URI , resp .Share .Token , & ocm.SharePermissions {
327
330
Permissions : conversions .RoleFromOCSPermissions (conversions .Permissions (resp .Share .Protocols .WebDAV .Permissions )).CS3ResourcePermissions (),
328
331
}))
@@ -344,7 +347,10 @@ func efssReceivedShareToOcm(resp *ReceivedEfssShare) *ocm.ReceivedShare {
344
347
RemoteShareId : resp .Share .RemoteShareID , // sic, see https://github.com/cs3org/reva/pull/3852#discussion_r1189681465
345
348
Grantee : & provider.Grantee {
346
349
Id : & provider.Grantee_UserId {
347
- UserId : resp .Share .Grantee .ID ,
350
+ UserId : & userpb.UserId {
351
+ OpaqueId : resp .Share .Grantee .ID .OpaqueId ,
352
+ Idp : resp .Share .Grantee .ID .Idp ,
353
+ },
348
354
},
349
355
},
350
356
Owner : resp .Share .Owner .Id ,
0 commit comments