From 5fa420ebb58bada1f11178d9442a380a62da892a Mon Sep 17 00:00:00 2001 From: Giuseppe Lo Presti Date: Fri, 24 May 2024 10:09:49 +0200 Subject: [PATCH] Revert "Attempt to support both OCM 1.0 and 1.1 when accessing remote shares" This cannot work, by construction we can't use basic and bearer auth. We could instead store the share type and decide accordingly, but for now Reva only remains capable to connect to OCM 1.1 systems. This reverts commit e6ab3850473989de2eb8afdb287010457e918caf. --- pkg/ocm/storage/received/ocm.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/pkg/ocm/storage/received/ocm.go b/pkg/ocm/storage/received/ocm.go index 24657342cf..89e73ef29b 100644 --- a/pkg/ocm/storage/received/ocm.go +++ b/pkg/ocm/storage/received/ocm.go @@ -155,16 +155,8 @@ func (d *driver) webdavClient(ctx context.Context, ref *provider.Reference) (*go return nil, nil, "", err } - // inject the secret as 'username' for OCM v1.0 basic auhentication: - // this is deprecated but still used by Nextcloud v28 (latest stable) at least. - parsedURL, err := url.Parse(endpoint) - if err != nil { - return nil, nil, "", err - } - parsedURL.User = url.UserPassword(secret, "") - - // and use it also as bearer authentication according to OCM v1.1+ - c := gowebdav.NewClient(parsedURL.String(), "", "") + // use the secret as bearer authentication according to OCM v1.1+ + c := gowebdav.NewClient(endpoint, "", "") c.SetHeader("Authorization", "Bearer "+secret) log := appctx.GetLogger(ctx)