Skip to content

Commit

Permalink
Revert "Attempt to support both OCM 1.0 and 1.1 when accessing remote…
Browse files Browse the repository at this point in the history
… 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 e6ab385.
  • Loading branch information
glpatcern committed May 24, 2024
1 parent e6ab385 commit 40b17a3
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions pkg/ocm/storage/received/ocm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 40b17a3

Please sign in to comment.