From 2f727fc050a596458f6d96406a513e8bb053002a Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Thu, 9 Dec 2021 19:36:07 +0530 Subject: [PATCH] Parse URL path to determine file name (#2346) --- .../unreleased/fix-content-disposition.md | 3 +- .../auth/manager/oidcmapping/_index.md | 66 +++++++++++++++++++ internal/http/services/owncloud/ocdav/get.go | 2 +- 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 docs/content/en/docs/config/packages/auth/manager/oidcmapping/_index.md diff --git a/changelog/unreleased/fix-content-disposition.md b/changelog/unreleased/fix-content-disposition.md index 58f126a7ac..da3822ceb1 100644 --- a/changelog/unreleased/fix-content-disposition.md +++ b/changelog/unreleased/fix-content-disposition.md @@ -2,4 +2,5 @@ Bugfix: Fix content disposition header for public links files https://github.com/cs3org/reva/pull/2303 https://github.com/cs3org/reva/pull/2297 -https://github.com/cs3org/reva/pull/2332 \ No newline at end of file +https://github.com/cs3org/reva/pull/2332 +https://github.com/cs3org/reva/pull/2346 \ No newline at end of file diff --git a/docs/content/en/docs/config/packages/auth/manager/oidcmapping/_index.md b/docs/content/en/docs/config/packages/auth/manager/oidcmapping/_index.md new file mode 100644 index 0000000000..a7309eb3e1 --- /dev/null +++ b/docs/content/en/docs/config/packages/auth/manager/oidcmapping/_index.md @@ -0,0 +1,66 @@ +--- +title: "oidcmapping" +linkTitle: "oidcmapping" +weight: 10 +description: > + Configuration for the oidcmapping service +--- + +# _struct: config_ + +{{% dir name="insecure" type="bool" default=false %}} +Whether to skip certificate checks when sending requests. [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/auth/manager/oidcmapping/oidcmapping.go#L57) +{{< highlight toml >}} +[auth.manager.oidcmapping] +insecure = false +{{< /highlight >}} +{{% /dir %}} + +{{% dir name="issuer" type="string" default="" %}} +The issuer of the OIDC token. [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/auth/manager/oidcmapping/oidcmapping.go#L58) +{{< highlight toml >}} +[auth.manager.oidcmapping] +issuer = "" +{{< /highlight >}} +{{% /dir %}} + +{{% dir name="id_claim" type="string" default="sub" %}} +The claim containing the ID of the user. [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/auth/manager/oidcmapping/oidcmapping.go#L59) +{{< highlight toml >}} +[auth.manager.oidcmapping] +id_claim = "sub" +{{< /highlight >}} +{{% /dir %}} + +{{% dir name="uid_claim" type="string" default="" %}} +The claim containing the UID of the user. [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/auth/manager/oidcmapping/oidcmapping.go#L60) +{{< highlight toml >}} +[auth.manager.oidcmapping] +uid_claim = "" +{{< /highlight >}} +{{% /dir %}} + +{{% dir name="gid_claim" type="string" default="" %}} +The claim containing the GID of the user. [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/auth/manager/oidcmapping/oidcmapping.go#L61) +{{< highlight toml >}} +[auth.manager.oidcmapping] +gid_claim = "" +{{< /highlight >}} +{{% /dir %}} + +{{% dir name="userprovidersvc" type="string" default="" %}} +The endpoint at which the GRPC userprovider is exposed. [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/auth/manager/oidcmapping/oidcmapping.go#L62) +{{< highlight toml >}} +[auth.manager.oidcmapping] +userprovidersvc = "" +{{< /highlight >}} +{{% /dir %}} + +{{% dir name="usersmapping" type="string" default="" %}} + The OIDC users mapping file path [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/auth/manager/oidcmapping/oidcmapping.go#L63) +{{< highlight toml >}} +[auth.manager.oidcmapping] +usersmapping = "" +{{< /highlight >}} +{{% /dir %}} + diff --git a/internal/http/services/owncloud/ocdav/get.go b/internal/http/services/owncloud/ocdav/get.go index a812365846..b93230ab51 100644 --- a/internal/http/services/owncloud/ocdav/get.go +++ b/internal/http/services/owncloud/ocdav/get.go @@ -125,7 +125,7 @@ func (s *svc) handleGet(ctx context.Context, w http.ResponseWriter, r *http.Requ w.Header().Set(HeaderContentType, info.MimeType) w.Header().Set(HeaderContentDisposistion, "attachment; filename*=UTF-8''"+ - path.Base(r.RequestURI)+"; filename=\""+path.Base(r.RequestURI)+"\"") + path.Base(r.URL.Path)+"; filename=\""+path.Base(r.URL.Path)+"\"") w.Header().Set(HeaderETag, info.Etag) w.Header().Set(HeaderOCFileID, resourceid.OwnCloudResourceIDWrap(info.Id)) w.Header().Set(HeaderOCETag, info.Etag)