temporarily vendor from fork
Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
committed by
Florian Schade
parent
8ee17e7f27
commit
01b9521d09
+5
-1
@@ -104,7 +104,11 @@ func normalizeDomain(d string) (string, error) {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return u.Host, nil
|
||||
normalizedDomain := u.Hostname()
|
||||
if port := u.Port(); port != "" {
|
||||
normalizedDomain += ":" + port
|
||||
}
|
||||
return normalizedDomain, nil
|
||||
}
|
||||
|
||||
func (a *authorizer) GetInfoByDomain(_ context.Context, domain string) (*ocmprovider.ProviderInfo, error) {
|
||||
|
||||
+91
-2
@@ -381,8 +381,97 @@ func receivedShareEqual(ref *ocm.ShareReference, s *ocm.ReceivedShare) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *mgr) UpdateShare(ctx context.Context, user *userpb.User, ref *ocm.ShareReference, f ...*ocm.UpdateOCMShareRequest_UpdateField) (*ocm.Share, error) {
|
||||
return nil, errtypes.NotSupported("not yet implemented")
|
||||
// UpdateShare updates the share with the given fields.
|
||||
func (m *mgr) UpdateShare(ctx context.Context, user *userpb.User, ref *ocm.ShareReference, fields ...*ocm.UpdateOCMShareRequest_UpdateField) (*ocm.Share, error) {
|
||||
m.Lock()
|
||||
defer m.Unlock()
|
||||
if err := m.load(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, s := range m.model.Shares {
|
||||
if sharesEqual(ref, s) {
|
||||
if utils.UserEqual(user.Id, s.Owner) || utils.UserEqual(user.Id, s.Creator) {
|
||||
|
||||
for _, f := range fields {
|
||||
if exp := f.GetExpiration(); exp != nil {
|
||||
s.Expiration = exp
|
||||
}
|
||||
if am := f.GetAccessMethods(); am != nil {
|
||||
var (
|
||||
webdavOptions *ocm.WebDAVAccessMethod
|
||||
webappOptions *ocm.WebappAccessMethod
|
||||
transferOptions *ocm.TransferAccessMethod
|
||||
// TODO: *AccessMethod_GenericOptions
|
||||
|
||||
newWebdavOptions *ocm.WebDAVAccessMethod
|
||||
newWebappOptions *ocm.WebappAccessMethod
|
||||
newTransferOptions *ocm.TransferAccessMethod
|
||||
// TODO: *AccessMethod_GenericOptions
|
||||
)
|
||||
|
||||
for _, sm := range s.GetAccessMethods() {
|
||||
webdavOptions = sm.GetWebdavOptions()
|
||||
webappOptions = sm.GetWebappOptions()
|
||||
transferOptions = sm.GetTransferOptions()
|
||||
}
|
||||
|
||||
newWebdavOptions = am.GetWebdavOptions()
|
||||
newWebappOptions = am.GetWebappOptions()
|
||||
newTransferOptions = am.GetTransferOptions()
|
||||
|
||||
newAccesMethods := []*ocm.AccessMethod{}
|
||||
|
||||
if newWebdavOptions != nil {
|
||||
newAccesMethods = append(newAccesMethods, &ocm.AccessMethod{
|
||||
Term: &ocm.AccessMethod_WebdavOptions{
|
||||
WebdavOptions: newWebdavOptions,
|
||||
},
|
||||
})
|
||||
} else if webdavOptions != nil {
|
||||
newAccesMethods = append(newAccesMethods, &ocm.AccessMethod{
|
||||
Term: &ocm.AccessMethod_WebdavOptions{
|
||||
WebdavOptions: webdavOptions,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
if newWebappOptions != nil {
|
||||
newAccesMethods = append(newAccesMethods, &ocm.AccessMethod{
|
||||
Term: &ocm.AccessMethod_WebappOptions{
|
||||
WebappOptions: newWebappOptions,
|
||||
},
|
||||
})
|
||||
} else if webappOptions != nil {
|
||||
newAccesMethods = append(newAccesMethods, &ocm.AccessMethod{
|
||||
Term: &ocm.AccessMethod_WebappOptions{
|
||||
WebappOptions: webappOptions,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
if newTransferOptions != nil {
|
||||
newAccesMethods = append(newAccesMethods, &ocm.AccessMethod{
|
||||
Term: &ocm.AccessMethod_TransferOptions{
|
||||
TransferOptions: newTransferOptions,
|
||||
},
|
||||
})
|
||||
} else if transferOptions != nil {
|
||||
newAccesMethods = append(newAccesMethods, &ocm.AccessMethod{
|
||||
Term: &ocm.AccessMethod_TransferOptions{
|
||||
TransferOptions: transferOptions,
|
||||
},
|
||||
})
|
||||
}
|
||||
s.AccessMethods = newAccesMethods
|
||||
}
|
||||
}
|
||||
|
||||
return s, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil, errtypes.NotFound(ref.String())
|
||||
}
|
||||
|
||||
func (m *mgr) ListShares(ctx context.Context, user *userpb.User, filters []*ocm.ListOCMSharesRequest_Filter) ([]*ocm.Share, error) {
|
||||
|
||||
Vendored
+2
-1
@@ -367,7 +367,7 @@ github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1
|
||||
github.com/cs3org/go-cs3apis/cs3/storage/registry/v1beta1
|
||||
github.com/cs3org/go-cs3apis/cs3/tx/v1beta1
|
||||
github.com/cs3org/go-cs3apis/cs3/types/v1beta1
|
||||
# github.com/cs3org/reva/v2 v2.23.1-0.20240905133054-2de6ff31c4e3
|
||||
# github.com/cs3org/reva/v2 v2.23.1-0.20240905133054-2de6ff31c4e3 => github.com/dragonchaser/reva/v2 v2.4.1-0.20240906050800-d68d37964295
|
||||
## explicit; go 1.21
|
||||
github.com/cs3org/reva/v2/cmd/revad/internal/grace
|
||||
github.com/cs3org/reva/v2/cmd/revad/runtime
|
||||
@@ -2437,3 +2437,4 @@ stash.kopano.io/kgol/rndm
|
||||
# github.com/egirna/icap-client => github.com/fschade/icap-client v0.0.0-20240802074440-aade4a234387
|
||||
# github.com/unrolled/secure => github.com/DeepDiver1975/secure v0.0.0-20240611112133-abc838fb797c
|
||||
# github.com/go-micro/plugins/v4/store/nats-js-kv => github.com/kobergj/plugins/v4/store/nats-js-kv v0.0.0-20240807130109-f62bb67e8c90
|
||||
# github.com/cs3org/reva/v2 => github.com/dragonchaser/reva/v2 v2.4.1-0.20240906050800-d68d37964295
|
||||
|
||||
Reference in New Issue
Block a user