From b09bc344da8081726996d56aee2d0334ee580b30 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Thu, 5 May 2022 15:20:09 +0200 Subject: [PATCH 01/13] idp: configure clients in the idp configuration instead of the templated file --- .../idp/assets/identifier-registration.yaml | 44 -------------- extensions/idp/pkg/config/config.go | 21 +++++-- .../idp/pkg/config/defaults/defaultconfig.go | 58 ++++++++++++++++++- extensions/idp/pkg/service/v0/service.go | 58 +++++++++++-------- 4 files changed, 107 insertions(+), 74 deletions(-) delete mode 100644 extensions/idp/assets/identifier-registration.yaml diff --git a/extensions/idp/assets/identifier-registration.yaml b/extensions/idp/assets/identifier-registration.yaml deleted file mode 100644 index f843aa217c..0000000000 --- a/extensions/idp/assets/identifier-registration.yaml +++ /dev/null @@ -1,44 +0,0 @@ ---- -# OpenID Connect client registry. -clients: - - id: web - name: ownCloud web app - trusted: yes - redirect_uris: - - {{OCIS_URL}}/ - - {{OCIS_URL}}/oidc-callback.html - - {{OCIS_URL}}/oidc-silent-redirect.html - origins: - - {{OCIS_URL}} - - - id: ocis-explorer.js - name: oCIS Graph Explorer - trusted: yes - redirect_uris: - - {{OCIS_URL}}/graph-explorer/ - origins: - - {{OCIS_URL}} - - - - id: xdXOt13JKxym1B1QcEncf2XDkLAexMBFwiT9j6EfhhHFJhs2KM9jbjTmf8JBXE69 - secret: UBntmLjC2yYCeHwsyj73Uwo9TAaecAetRwMw0xYcvNL9yRdLSUi0hUAHfvCHFeFh - name: ownCloud desktop app - application_type: native - redirect_uris: - - http://127.0.0.1 - - http://localhost - - - id: e4rAsNUSIUs0lF4nbv9FmCeUkTlV9GdgTLDH1b5uie7syb90SzEVrbN7HIpmWJeD - secret: dInFYGV33xKzhbRmpqQltYNdfLdJIfJ9L5ISoKhNoT9qZftpdWSP71VrpGR9pmoD - name: ownCloud Android app - application_type: native - redirect_uris: - - oc://android.owncloud.com - - - id: mxd5OQDk6es5LzOzRvidJNfXLUZS2oN3oUFeXPP8LpPrhx3UroJFduGEYIBOxkY1 - secret: KFeFWWEZO9TkisIQzR3fo7hfiMXlOpaqP8CFuTbSHzV1TUuGECglPxpiVKJfOXIx - name: ownCloud iOS app - application_type: native - redirect_uris: - - oc://ios.owncloud.com - - oc.ios://ios.owncloud.com diff --git a/extensions/idp/pkg/config/config.go b/extensions/idp/pkg/config/config.go index ab6a90c1a4..ef60c68989 100644 --- a/extensions/idp/pkg/config/config.go +++ b/extensions/idp/pkg/config/config.go @@ -18,9 +18,10 @@ type Config struct { HTTP HTTP `yaml:"http"` - Asset Asset `yaml:"asset"` - IDP Settings `yaml:"idp"` - Ldap Ldap `yaml:"ldap"` + Asset Asset `yaml:"asset"` + IDP Settings `yaml:"idp"` + Clients []Client `yaml:"clients"` + Ldap Ldap `yaml:"ldap"` Context context.Context `yaml:"-"` } @@ -51,6 +52,16 @@ type Asset struct { Path string `yaml:"asset" env:"IDP_ASSET_PATH"` } +type Client struct { + ID string `yaml:"id"` + Name string `yaml:"name"` + Trusted bool `yaml:"trusted"` + Secret string `yaml:"secret"` + RedirectURIs []string `yaml:"redirect_uris"` + Origins []string `yaml:"origins"` + ApplicationType string `yaml:"application_type"` +} + type Settings struct { // don't change the order of elements in this struct // it needs to match github.com/libregraph/lico/bootstrap.Settings @@ -80,8 +91,8 @@ type Settings struct { Listen string IdentifierClientDisabled bool `yaml:"identifier_client_disabled" env:"IDP_DISABLE_IDENTIFIER_WEBAPP"` - IdentifierClientPath string `yaml:"identifier_client_path" env:"IDP_IDENTIFIER_CLIENT_PATH"` - IdentifierRegistrationConf string `yaml:"identifier_registration_conf" env:"IDP_IDENTIFIER_REGISTRATION_CONF"` + IdentifierClientPath string `yaml:"-"` + IdentifierRegistrationConf string `yaml:"-"` IdentifierScopesConf string `yaml:"identifier_scopes_conf" env:"IDP_IDENTIFIER_SCOPES_CONF"` IdentifierDefaultBannerLogo string IdentifierDefaultSignInPageText string diff --git a/extensions/idp/pkg/config/defaults/defaultconfig.go b/extensions/idp/pkg/config/defaults/defaultconfig.go index 7da2ba8908..1e119b408f 100644 --- a/extensions/idp/pkg/config/defaults/defaultconfig.go +++ b/extensions/idp/pkg/config/defaults/defaultconfig.go @@ -31,7 +31,6 @@ func DefaultConfig() *config.Config { Service: config.Service{ Name: "idp", }, - Asset: config.Asset{}, IDP: config.Settings{ Iss: "https://localhost:9200", IdentityManager: "ldap", @@ -49,7 +48,7 @@ func DefaultConfig() *config.Config { Listen: "", IdentifierClientDisabled: true, IdentifierClientPath: path.Join(defaults.BaseDataPath(), "idp"), - IdentifierRegistrationConf: path.Join(defaults.BaseDataPath(), "idp", "identifier-registration.yaml"), + IdentifierRegistrationConf: path.Join(defaults.BaseDataPath(), "idp", "tmp", "identifier-registration.yaml"), IdentifierScopesConf: "", IdentifierDefaultBannerLogo: "", IdentifierDefaultSignInPageText: "", @@ -65,6 +64,61 @@ func DefaultConfig() *config.Config { RefreshTokenDurationSeconds: 60 * 60 * 24 * 365 * 3, // 1 year DyamicClientSecretDurationSeconds: 0, }, + Clients: []config.Client{ + { + ID: "web", + Name: "ownCloud Web app", + Trusted: true, + RedirectURIs: []string{ + "{{OCIS_URL}}/", + "{{OCIS_URL}}/oidc-callback.html", + "{{OCIS_URL}}/oidc-silent-redirect.html", + }, + Origins: []string{ + "{{OCIS_URL}}", + }, + }, + { + ID: "ocis-explorer.js", + Name: "oCIS Graph Explorer", + Trusted: true, + RedirectURIs: []string{ + "{{OCIS_URL}}/graph-explorer/", + }, + Origins: []string{ + "{{OCIS_URL}}", + }, + }, + { + ID: "xdXOt13JKxym1B1QcEncf2XDkLAexMBFwiT9j6EfhhHFJhs2KM9jbjTmf8JBXE69", + Secret: "UBntmLjC2yYCeHwsyj73Uwo9TAaecAetRwMw0xYcvNL9yRdLSUi0hUAHfvCHFeFh", + Name: "ownCloud desktop app", + ApplicationType: "native", + RedirectURIs: []string{ + "http://127.0.0.1", + "http://localhost", + }, + }, + { + ID: "e4rAsNUSIUs0lF4nbv9FmCeUkTlV9GdgTLDH1b5uie7syb90SzEVrbN7HIpmWJeD", + Secret: "dInFYGV33xKzhbRmpqQltYNdfLdJIfJ9L5ISoKhNoT9qZftpdWSP71VrpGR9pmoD", + Name: "ownCloud Android app", + ApplicationType: "native", + RedirectURIs: []string{ + "oc://android.owncloud.com", + }, + }, + { + ID: "mxd5OQDk6es5LzOzRvidJNfXLUZS2oN3oUFeXPP8LpPrhx3UroJFduGEYIBOxkY1", + Secret: "KFeFWWEZO9TkisIQzR3fo7hfiMXlOpaqP8CFuTbSHzV1TUuGECglPxpiVKJfOXIx", + Name: "ownCloud iOS app", + ApplicationType: "native", + RedirectURIs: []string{ + "oc://ios.owncloud.com", + "oc.ios://ios.owncloud.com", + }, + }, + }, Ldap: config.Ldap{ URI: "ldaps://localhost:9235", TLSCACert: path.Join(defaults.BaseDataPath(), "idm", "ldap.crt"), diff --git a/extensions/idp/pkg/service/v0/service.go b/extensions/idp/pkg/service/v0/service.go index 51e9969e3c..4d221482b2 100644 --- a/extensions/idp/pkg/service/v0/service.go +++ b/extensions/idp/pkg/service/v0/service.go @@ -24,6 +24,7 @@ import ( "github.com/owncloud/ocis/v2/extensions/idp/pkg/middleware" "github.com/owncloud/ocis/v2/ocis-pkg/ldap" "github.com/owncloud/ocis/v2/ocis-pkg/log" + "gopkg.in/yaml.v2" "stash.kopano.io/kgol/rndm" ) @@ -54,7 +55,11 @@ func NewService(opts ...Option) Service { logger.Fatal().Err(err).Msg("could not initialize env vars") } - if err := createConfigsIfNotExist(assetVFS, options.Config.IDP.IdentifierRegistrationConf, options.Config.IDP.Iss); err != nil { + if err := createTemporaryClientsConfig( + options.Config.IDP.IdentifierRegistrationConf, + options.Config.IDP.Iss, + options.Config.Clients, + ); err != nil { logger.Fatal().Err(err).Msg("could not create default config") } @@ -88,7 +93,11 @@ func NewService(opts ...Option) Service { return svc } -func createConfigsIfNotExist(assets http.FileSystem, filePath, ocisURL string) error { +type temporaryClientConfig struct { + Clients []config.Client `yaml:"clients"` +} + +func createTemporaryClientsConfig(filePath, ocisURL string, clients []config.Client) error { folder := path.Dir(filePath) if _, err := os.Stat(folder); os.IsNotExist(err) { @@ -97,33 +106,36 @@ func createConfigsIfNotExist(assets http.FileSystem, filePath, ocisURL string) e } } - if _, err := os.Stat(filePath); os.IsNotExist(err) { - defaultConf, err := assets.Open("/identifier-registration.yaml") - if err != nil { - return err + for i, client := range clients { + + for i, entry := range client.RedirectURIs { + client.RedirectURIs[i] = strings.ReplaceAll(entry, "{{OCIS_URL}}", strings.TrimRight(ocisURL, "/")) } - - defer defaultConf.Close() - - confOnDisk, err := os.Create(filePath) - if err != nil { - return err + for i, entry := range client.Origins { + client.Origins[i] = strings.ReplaceAll(entry, "{{OCIS_URL}}", strings.TrimRight(ocisURL, "/")) } + clients[i] = client + } - defer confOnDisk.Close() + c := temporaryClientConfig{ + Clients: clients, + } - conf, err := ioutil.ReadAll(defaultConf) - if err != nil { - return err - } + conf, err := yaml.Marshal(c) + if err != nil { + return err + } - // replace placeholder {{OCIS_URL}} with https://localhost:9200 / correct host - conf = []byte(strings.ReplaceAll(string(conf), "{{OCIS_URL}}", strings.TrimRight(ocisURL, "/"))) + confOnDisk, err := os.Create(filePath) + if err != nil { + return err + } - err = ioutil.WriteFile(filePath, conf, 0600) - if err != nil { - return err - } + defer confOnDisk.Close() + + err = ioutil.WriteFile(filePath, conf, 0600) + if err != nil { + return err } return nil From 9dae458cdcf3a1750cd9f0e32d585bae1186e7d1 Mon Sep 17 00:00:00 2001 From: Pascal Wengerter Date: Thu, 5 May 2022 09:31:08 +0200 Subject: [PATCH 02/13] Extend shares in web sidebar in CI --- .../acceptance/expected-failures-webUI-on-OCIS-storage.md | 3 --- tests/config/drone/ocis-config.json | 7 ++++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/acceptance/expected-failures-webUI-on-OCIS-storage.md b/tests/acceptance/expected-failures-webUI-on-OCIS-storage.md index a3b29737e6..f0249bba61 100644 --- a/tests/acceptance/expected-failures-webUI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-webUI-on-OCIS-storage.md @@ -247,9 +247,6 @@ Other free text and markdown formatting can be used elsewhere in the document if - [webUIResharing2/reshareUsers.feature:72](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIResharing2/reshareUsers.feature#L72) - [webUIResharing2/reshareUsers.feature:73](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIResharing2/reshareUsers.feature#L73) -### [Regression during ocis 2.0.0-beta](https://github.com/owncloud/ocis/issues/3627) -- [webUISharingInternalGroups/shareWithGroups.feature:19](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalGroups/shareWithGroups.feature#L19) - ### [Different share permissions provides varying roles in oc10 and ocis](https://github.com/owncloud/ocis/issues/1277) - [webUISharingInternalGroups/shareWithGroups.feature:166](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalGroups/shareWithGroups.feature#L166) - [webUISharingInternalGroups/shareWithGroups.feature:180](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalGroups/shareWithGroups.feature#L180) diff --git a/tests/config/drone/ocis-config.json b/tests/config/drone/ocis-config.json index eefe2050a5..b70b20d728 100644 --- a/tests/config/drone/ocis-config.json +++ b/tests/config/drone/ocis-config.json @@ -10,7 +10,12 @@ "scope": "openid profile email" }, "options": { - "displayResourcesLazy": false + "displayResourcesLazy": false, + "sidebar": { + "shares": { + "showAllOnLoad": true + } + } }, "apps": [ "files", From 6b259f6637b0aa9ff191fe13f1a107afe063edc2 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Fri, 22 Apr 2022 11:13:10 +0200 Subject: [PATCH 03/13] add tumbnails proxy route for /dav and /webdav --- extensions/proxy/pkg/config/defaults/defaultconfig.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/extensions/proxy/pkg/config/defaults/defaultconfig.go b/extensions/proxy/pkg/config/defaults/defaultconfig.go index ec1bd9af8e..d43dda36fb 100644 --- a/extensions/proxy/pkg/config/defaults/defaultconfig.go +++ b/extensions/proxy/pkg/config/defaults/defaultconfig.go @@ -106,6 +106,16 @@ func DefaultPolicies() []config.Policy { Endpoint: "/remote.php/dav/", Backend: "http://localhost:9115", // TODO use registry? }, + { + Type: config.QueryRoute, + Endpoint: "/dav/?preview=1", + Backend: "http://localhost:9115", + }, + { + Type: config.QueryRoute, + Endpoint: "/webdav/?preview=1", + Backend: "http://localhost:9115", + }, { Endpoint: "/remote.php/", Service: "ocdav", From 79970b08129cc38fb74166a5df60c757b62a428f Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Fri, 22 Apr 2022 11:13:34 +0200 Subject: [PATCH 04/13] add omitempty to proxy routes to slim down configuration example --- extensions/proxy/pkg/config/config.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/extensions/proxy/pkg/config/config.go b/extensions/proxy/pkg/config/config.go index a8c394f36c..c0d6ea4e8d 100644 --- a/extensions/proxy/pkg/config/config.go +++ b/extensions/proxy/pkg/config/config.go @@ -45,15 +45,15 @@ type Policy struct { // Route defines forwarding routes type Route struct { - Type RouteType `yaml:"type"` + Type RouteType `yaml:"type,omitempty"` // Method optionally limits the route to this HTTP method - Method string `yaml:"method"` - Endpoint string `yaml:"endpoint"` + Method string `yaml:"method,omitempty"` + Endpoint string `yaml:"endpoint,omitempty"` // Backend is a static URL to forward the request to - Backend string `yaml:"backend"` + Backend string `yaml:"backend,omitempty"` // Service name to look up in the registry - Service string `yaml:"service"` - ApacheVHost bool `yaml:"apache_vhost"` + Service string `yaml:"service,omitempty"` + ApacheVHost bool `yaml:"apache_vhost,omitempty"` } // RouteType defines the type of a route From 9db5216bc40466894fa1d7ac47acbacf165ddee9 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Fri, 22 Apr 2022 11:19:28 +0200 Subject: [PATCH 05/13] add route handler for all possible webdav urls --- extensions/webdav/pkg/service/v0/service.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/extensions/webdav/pkg/service/v0/service.go b/extensions/webdav/pkg/service/v0/service.go index 43d9929b70..844a252d8b 100644 --- a/extensions/webdav/pkg/service/v0/service.go +++ b/extensions/webdav/pkg/service/v0/service.go @@ -78,6 +78,21 @@ func NewService(opts ...Option) (Service, error) { r.Get("/remote.php/dav/public-files/{token}/*", svc.PublicThumbnail) r.Head("/remote.php/dav/public-files/{token}/*", svc.PublicThumbnailHead) + r.Get("/remote.php/webdav/spaces/{id}/*", svc.SpacesThumbnail) + r.Get("/remote.php/webdav/files/{id}/*", svc.Thumbnail) + r.Get("/remote.php/webdav/public-files/{token}/*", svc.PublicThumbnail) + r.Head("/remote.php/webdav/public-files/{token}/*", svc.PublicThumbnailHead) + + r.Get("/dav/spaces/{id}/*", svc.SpacesThumbnail) + r.Get("/dav/files/{id}/*", svc.Thumbnail) + r.Get("/dav/public-files/{token}/*", svc.PublicThumbnail) + r.Head("/dav/public-files/{token}/*", svc.PublicThumbnailHead) + + r.Get("/webdav/spaces/{id}/*", svc.SpacesThumbnail) + r.Get("/webdav/files/{id}/*", svc.Thumbnail) + r.Get("/webdav/public-files/{token}/*", svc.PublicThumbnail) + r.Head("/webdav/public-files/{token}/*", svc.PublicThumbnailHead) + // r.MethodFunc("REPORT", "/remote.php/dav/files/{id}/*", svc.Search) // This is a workaround for the go-chi concurrent map read write issue. From a04c5c2f6f0df0c61138454e30907171685c6afa Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Fri, 22 Apr 2022 16:31:33 +0200 Subject: [PATCH 06/13] implement thumbnails also for webdav and non remote.php routes --- extensions/proxy/pkg/middleware/basic_auth.go | 1 + extensions/webdav/pkg/constants/constants.go | 8 ++ .../webdav/pkg/dav/requests/thumbnail.go | 43 ++----- extensions/webdav/pkg/service/v0/service.go | 107 +++++++++++++++--- 4 files changed, 111 insertions(+), 48 deletions(-) create mode 100644 extensions/webdav/pkg/constants/constants.go diff --git a/extensions/proxy/pkg/middleware/basic_auth.go b/extensions/proxy/pkg/middleware/basic_auth.go index 425fc4ca0a..4b810ae279 100644 --- a/extensions/proxy/pkg/middleware/basic_auth.go +++ b/extensions/proxy/pkg/middleware/basic_auth.go @@ -115,6 +115,7 @@ func (m basicAuth) isPublicLink(req *http.Request) bool { } publicPaths := []string{ + "/dav/public-files/", "/remote.php/dav/public-files/", "/remote.php/ocs/apps/files_sharing/api/v1/tokeninfo/unprotected", "/ocs/v1.php/cloud/capabilities", diff --git a/extensions/webdav/pkg/constants/constants.go b/extensions/webdav/pkg/constants/constants.go new file mode 100644 index 0000000000..3456ab8309 --- /dev/null +++ b/extensions/webdav/pkg/constants/constants.go @@ -0,0 +1,8 @@ +package constants + +type contextKey int + +const ( + ContextKeyID contextKey = iota + ContextKeyPath +) diff --git a/extensions/webdav/pkg/dav/requests/thumbnail.go b/extensions/webdav/pkg/dav/requests/thumbnail.go index 48b80ad488..ccb6016d3b 100644 --- a/extensions/webdav/pkg/dav/requests/thumbnail.go +++ b/extensions/webdav/pkg/dav/requests/thumbnail.go @@ -7,9 +7,10 @@ import ( "net/url" "path/filepath" "strconv" - "strings" "github.com/go-chi/chi/v5" + + "github.com/owncloud/ocis/extensions/webdav/pkg/constants" ) const ( @@ -39,12 +40,16 @@ type ThumbnailRequest struct { // ParseThumbnailRequest extracts all required parameters from a http request. func ParseThumbnailRequest(r *http.Request) (*ThumbnailRequest, error) { - fp, id, err := extractFilePath(r) - if err != nil { - return nil, err - } - q := r.URL.Query() + ctx := r.Context() + fp := ctx.Value(constants.ContextKeyPath).(string) + if fp == "" { + return nil, errors.New("invalid file path") + } + + id := ctx.Value(constants.ContextKeyID).(string) + + q := r.URL.Query() width, height, err := parseDimensions(q) if err != nil { return nil, err @@ -61,32 +66,6 @@ func ParseThumbnailRequest(r *http.Request) (*ThumbnailRequest, error) { }, nil } -// the url looks as followed -// -// /remote.php/dav/files// -// -// User and filepath are dynamic and filepath can contain slashes -// So using the URLParam function is not possible. -func extractFilePath(r *http.Request) (string, string, error) { - id := chi.URLParam(r, "id") - id, err := url.QueryUnescape(id) - if err != nil { - return "", "", errors.New("could not unescape user") - } - if id != "" { - parts := strings.SplitN(r.URL.Path, id, 2) - return parts[1], id, nil - } - - // This is for public links - token := chi.URLParam(r, "token") - if token != "" { - parts := strings.SplitN(r.URL.Path, token, 2) - return parts[1], "", nil - } - return "", "", errors.New("could not extract file path") -} - func parseDimensions(q url.Values) (int64, int64, error) { width, err := parseDimension(q.Get("x"), "width", DefaultWidth) if err != nil { diff --git a/extensions/webdav/pkg/service/v0/service.go b/extensions/webdav/pkg/service/v0/service.go index 844a252d8b..9e1e38882a 100644 --- a/extensions/webdav/pkg/service/v0/service.go +++ b/extensions/webdav/pkg/service/v0/service.go @@ -1,9 +1,14 @@ package svc import ( + "context" "encoding/xml" "io" "net/http" +<<<<<<< HEAD +======= + "net/url" +>>>>>>> 60f1081e8 (implement thumbnails also for webdav and non remote.php routes) "path" "path/filepath" "strings" @@ -11,6 +16,7 @@ import ( gatewayv1beta1 "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1" userv1beta1 "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" rpcv1beta1 "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1" + revactx "github.com/cs3org/reva/v2/pkg/ctx" "github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool" "github.com/cs3org/reva/v2/pkg/storage/utils/templates" "github.com/go-chi/render" @@ -21,11 +27,19 @@ import ( "github.com/owncloud/ocis/v2/ocis-pkg/service/grpc" "github.com/go-chi/chi/v5" +<<<<<<< HEAD "github.com/owncloud/ocis/v2/extensions/webdav/pkg/config" "github.com/owncloud/ocis/v2/extensions/webdav/pkg/dav/requests" thumbnailsmsg "github.com/owncloud/ocis/v2/protogen/gen/ocis/messages/thumbnails/v0" searchsvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/search/v0" thumbnailssvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/thumbnails/v0" +======= + "github.com/owncloud/ocis/extensions/webdav/pkg/config" + "github.com/owncloud/ocis/extensions/webdav/pkg/constants" + "github.com/owncloud/ocis/extensions/webdav/pkg/dav/requests" + thumbnailsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/thumbnails/v0" + thumbnailssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/thumbnails/v0" +>>>>>>> 60f1081e8 (implement thumbnails also for webdav and non remote.php routes) ) const ( @@ -73,26 +87,30 @@ func NewService(opts ...Option) (Service, error) { } m.Route(options.Config.HTTP.Root, func(r chi.Router) { - r.Get("/remote.php/dav/spaces/{id}/*", svc.SpacesThumbnail) - r.Get("/remote.php/dav/files/{id}/*", svc.Thumbnail) - r.Get("/remote.php/dav/public-files/{token}/*", svc.PublicThumbnail) - r.Head("/remote.php/dav/public-files/{token}/*", svc.PublicThumbnailHead) - r.Get("/remote.php/webdav/spaces/{id}/*", svc.SpacesThumbnail) - r.Get("/remote.php/webdav/files/{id}/*", svc.Thumbnail) - r.Get("/remote.php/webdav/public-files/{token}/*", svc.PublicThumbnail) - r.Head("/remote.php/webdav/public-files/{token}/*", svc.PublicThumbnailHead) + r.Group(func(r chi.Router) { + r.Use(svc.DavContext()) - r.Get("/dav/spaces/{id}/*", svc.SpacesThumbnail) - r.Get("/dav/files/{id}/*", svc.Thumbnail) - r.Get("/dav/public-files/{token}/*", svc.PublicThumbnail) - r.Head("/dav/public-files/{token}/*", svc.PublicThumbnailHead) + r.Get("/remote.php/dav/spaces/{id}/*", svc.SpacesThumbnail) + r.Get("/dav/spaces/{id}/*", svc.SpacesThumbnail) - r.Get("/webdav/spaces/{id}/*", svc.SpacesThumbnail) - r.Get("/webdav/files/{id}/*", svc.Thumbnail) - r.Get("/webdav/public-files/{token}/*", svc.PublicThumbnail) - r.Head("/webdav/public-files/{token}/*", svc.PublicThumbnailHead) + r.Get("/remote.php/dav/files/{id}/*", svc.Thumbnail) + r.Get("/dav/files/{id}/*", svc.Thumbnail) + r.Head("/remote.php/dav/public-files/{token}/*", svc.PublicThumbnailHead) + r.Head("/dav/public-files/{token}/*", svc.PublicThumbnailHead) + + r.Get("/remote.php/dav/public-files/{token}/*", svc.PublicThumbnail) + r.Get("/dav/public-files/{token}/*", svc.PublicThumbnail) + }) + + r.Group(func(r chi.Router) { + r.Use(svc.WebdavContext()) + + r.Get("/remote.php/webdav/*", svc.Thumbnail) + r.Get("/webdav/*", svc.Thumbnail) + }) + // r.MethodFunc("REPORT", "/remote.php/dav/files/{id}/*", svc.Search) // This is a workaround for the go-chi concurrent map read write issue. @@ -129,6 +147,63 @@ func (g Webdav) ServeHTTP(w http.ResponseWriter, r *http.Request) { g.mux.ServeHTTP(w, r) } +func (g Webdav) DavContext() func(next http.Handler) http.Handler { + return func(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + id := chi.URLParam(r, "id") + id, err := url.QueryUnescape(id) + if err == nil && id != "" { + ctx = context.WithValue(ctx, constants.ContextKeyID, id) + } + + filePath := r.URL.Path + if id != "" { + filePath = strings.TrimPrefix(filePath, path.Join("/remote.php/dav/spaces", id)+"/") + filePath = strings.TrimPrefix(filePath, path.Join("/dav/spaces", id)+"/") + + filePath = strings.TrimPrefix(filePath, path.Join("/remote.php/dav/files", id)+"/") + filePath = strings.TrimPrefix(filePath, path.Join("/dav/files", id)+"/") + } + + // token for public links + token := chi.URLParam(r, "token") + + if token != "" { + filePath = strings.TrimPrefix(filePath, path.Join("/remote.php/dav/public-files", token)+"/") + filePath = strings.TrimPrefix(filePath, path.Join("/dav/public-files", token)+"/") + } + ctx = context.WithValue(ctx, constants.ContextKeyPath, filePath) + + next.ServeHTTP(w, r.WithContext(ctx)) + + }) + } +} + +func (g Webdav) WebdavContext() func(next http.Handler) http.Handler { + return func(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + u, ok := revactx.ContextGetUser(r.Context()) + if ok { + if u.Id == nil || u.Id.OpaqueId != "" { + ctx = context.WithValue(ctx, constants.ContextKeyID, u.Id.OpaqueId) + } + } + + filePath := r.URL.Path + filePath = strings.TrimPrefix(filePath, "/remote.php/webdav/") + filePath = strings.TrimPrefix(filePath, "/webdav/") + ctx = context.WithValue(ctx, constants.ContextKeyPath, filePath) + + next.ServeHTTP(w, r.WithContext(ctx)) + }) + } +} + // SpacesThumbnail is the endpoint for retrieving thumbnails inside of spaces. func (g Webdav) SpacesThumbnail(w http.ResponseWriter, r *http.Request) { tr, err := requests.ParseThumbnailRequest(r) From ea9cbb8c2d0fb7ed9d3a5ac00eb663c45871c197 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Tue, 26 Apr 2022 14:07:15 +0200 Subject: [PATCH 07/13] return 404 for /remote.php/webdav and /webdav/ previews --- extensions/webdav/pkg/service/v0/service.go | 32 ++++----------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/extensions/webdav/pkg/service/v0/service.go b/extensions/webdav/pkg/service/v0/service.go index 9e1e38882a..c99afb87fb 100644 --- a/extensions/webdav/pkg/service/v0/service.go +++ b/extensions/webdav/pkg/service/v0/service.go @@ -16,7 +16,6 @@ import ( gatewayv1beta1 "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1" userv1beta1 "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" rpcv1beta1 "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1" - revactx "github.com/cs3org/reva/v2/pkg/ctx" "github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool" "github.com/cs3org/reva/v2/pkg/storage/utils/templates" "github.com/go-chi/render" @@ -105,10 +104,11 @@ func NewService(opts ...Option) (Service, error) { }) r.Group(func(r chi.Router) { - r.Use(svc.WebdavContext()) - - r.Get("/remote.php/webdav/*", svc.Thumbnail) - r.Get("/webdav/*", svc.Thumbnail) + // currently not implemented + // If we implement this endpoint, we need to get the user from the access token. + // We decided against doing it, so that this service can be started without the JWT secret. + r.Get("/remote.php/webdav/*", http.NotFound) + r.Get("/webdav/*", http.NotFound) }) // r.MethodFunc("REPORT", "/remote.php/dav/files/{id}/*", svc.Search) @@ -182,28 +182,6 @@ func (g Webdav) DavContext() func(next http.Handler) http.Handler { } } -func (g Webdav) WebdavContext() func(next http.Handler) http.Handler { - return func(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() - - u, ok := revactx.ContextGetUser(r.Context()) - if ok { - if u.Id == nil || u.Id.OpaqueId != "" { - ctx = context.WithValue(ctx, constants.ContextKeyID, u.Id.OpaqueId) - } - } - - filePath := r.URL.Path - filePath = strings.TrimPrefix(filePath, "/remote.php/webdav/") - filePath = strings.TrimPrefix(filePath, "/webdav/") - ctx = context.WithValue(ctx, constants.ContextKeyPath, filePath) - - next.ServeHTTP(w, r.WithContext(ctx)) - }) - } -} - // SpacesThumbnail is the endpoint for retrieving thumbnails inside of spaces. func (g Webdav) SpacesThumbnail(w http.ResponseWriter, r *http.Request) { tr, err := requests.ParseThumbnailRequest(r) From 2ddc7f73995d8f7ad1275b1e48f040f545e40214 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Tue, 26 Apr 2022 14:14:24 +0200 Subject: [PATCH 08/13] split context functions for public and user thumbnails --- extensions/webdav/pkg/service/v0/service.go | 27 ++++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/extensions/webdav/pkg/service/v0/service.go b/extensions/webdav/pkg/service/v0/service.go index c99afb87fb..7dcb09fe6e 100644 --- a/extensions/webdav/pkg/service/v0/service.go +++ b/extensions/webdav/pkg/service/v0/service.go @@ -88,13 +88,17 @@ func NewService(opts ...Option) (Service, error) { m.Route(options.Config.HTTP.Root, func(r chi.Router) { r.Group(func(r chi.Router) { - r.Use(svc.DavContext()) + r.Use(svc.DavUserContext()) r.Get("/remote.php/dav/spaces/{id}/*", svc.SpacesThumbnail) r.Get("/dav/spaces/{id}/*", svc.SpacesThumbnail) r.Get("/remote.php/dav/files/{id}/*", svc.Thumbnail) r.Get("/dav/files/{id}/*", svc.Thumbnail) + }) + + r.Group(func(r chi.Router) { + r.Use(svc.DavPublicContext()) r.Head("/remote.php/dav/public-files/{token}/*", svc.PublicThumbnailHead) r.Head("/dav/public-files/{token}/*", svc.PublicThumbnailHead) @@ -147,10 +151,11 @@ func (g Webdav) ServeHTTP(w http.ResponseWriter, r *http.Request) { g.mux.ServeHTTP(w, r) } -func (g Webdav) DavContext() func(next http.Handler) http.Handler { +func (g Webdav) DavUserContext() func(next http.Handler) http.Handler { return func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { ctx := r.Context() + filePath := r.URL.Path id := chi.URLParam(r, "id") id, err := url.QueryUnescape(id) @@ -158,7 +163,6 @@ func (g Webdav) DavContext() func(next http.Handler) http.Handler { ctx = context.WithValue(ctx, constants.ContextKeyID, id) } - filePath := r.URL.Path if id != "" { filePath = strings.TrimPrefix(filePath, path.Join("/remote.php/dav/spaces", id)+"/") filePath = strings.TrimPrefix(filePath, path.Join("/dav/spaces", id)+"/") @@ -167,10 +171,21 @@ func (g Webdav) DavContext() func(next http.Handler) http.Handler { filePath = strings.TrimPrefix(filePath, path.Join("/dav/files", id)+"/") } - // token for public links - token := chi.URLParam(r, "token") + ctx = context.WithValue(ctx, constants.ContextKeyPath, filePath) - if token != "" { + next.ServeHTTP(w, r.WithContext(ctx)) + + }) + } +} + +func (g Webdav) DavPublicContext() func(next http.Handler) http.Handler { + return func(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + filePath := r.URL.Path + + if token := chi.URLParam(r, "token"); token != "" { filePath = strings.TrimPrefix(filePath, path.Join("/remote.php/dav/public-files", token)+"/") filePath = strings.TrimPrefix(filePath, path.Join("/dav/public-files", token)+"/") } From 55815588695fb0a89994e4a8c0f1a8c80e2fe540 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Thu, 5 May 2022 15:51:19 +0200 Subject: [PATCH 09/13] add .keep file for idp asset folder to make unit tests run without generating assets --- extensions/idp/assets/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 extensions/idp/assets/.keep diff --git a/extensions/idp/assets/.keep b/extensions/idp/assets/.keep new file mode 100644 index 0000000000..e69de29bb2 From 5b49432d2d83ec52e6e164e9aad97640a85d1675 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Tue, 26 Apr 2022 14:21:47 +0200 Subject: [PATCH 10/13] add changelog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- changelog/unreleased/fix-thumbnails-dav.md | 10 ++++++++++ extensions/webdav/pkg/service/v0/service.go | 21 +++++---------------- 2 files changed, 15 insertions(+), 16 deletions(-) create mode 100644 changelog/unreleased/fix-thumbnails-dav.md diff --git a/changelog/unreleased/fix-thumbnails-dav.md b/changelog/unreleased/fix-thumbnails-dav.md new file mode 100644 index 0000000000..74212c2094 --- /dev/null +++ b/changelog/unreleased/fix-thumbnails-dav.md @@ -0,0 +1,10 @@ +Bugfix: Thumbnails for `/dav/xxx?preview=1` requests + +We've added the thumbnail rendering for `/dav/xxx?preview=1` requests, which was previously not supported because of missing routes. It now returns the same thumbnails as for +`/remote.php/dav/xxx?preview=1`. + +We've also ensured that `/remote.php/webdav/xxx?preview=1` and `/webdav/xxx?preview=1` will be +routed to the correct service and always return a 404 Not Found, because Thumbnails are currently +not implemented for that route. + +https://github.com/owncloud/ocis/pull/3567 diff --git a/extensions/webdav/pkg/service/v0/service.go b/extensions/webdav/pkg/service/v0/service.go index 7dcb09fe6e..4977e5034b 100644 --- a/extensions/webdav/pkg/service/v0/service.go +++ b/extensions/webdav/pkg/service/v0/service.go @@ -5,10 +5,7 @@ import ( "encoding/xml" "io" "net/http" -<<<<<<< HEAD -======= "net/url" ->>>>>>> 60f1081e8 (implement thumbnails also for webdav and non remote.php routes) "path" "path/filepath" "strings" @@ -18,27 +15,19 @@ import ( rpcv1beta1 "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1" "github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool" "github.com/cs3org/reva/v2/pkg/storage/utils/templates" + "github.com/go-chi/chi/v5" "github.com/go-chi/render" merrors "go-micro.dev/v4/errors" "google.golang.org/grpc/metadata" + "github.com/owncloud/ocis/v2/extensions/webdav/pkg/config" + "github.com/owncloud/ocis/v2/extensions/webdav/pkg/constants" + "github.com/owncloud/ocis/v2/extensions/webdav/pkg/dav/requests" "github.com/owncloud/ocis/v2/ocis-pkg/log" "github.com/owncloud/ocis/v2/ocis-pkg/service/grpc" - - "github.com/go-chi/chi/v5" -<<<<<<< HEAD - "github.com/owncloud/ocis/v2/extensions/webdav/pkg/config" - "github.com/owncloud/ocis/v2/extensions/webdav/pkg/dav/requests" thumbnailsmsg "github.com/owncloud/ocis/v2/protogen/gen/ocis/messages/thumbnails/v0" searchsvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/search/v0" thumbnailssvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/thumbnails/v0" -======= - "github.com/owncloud/ocis/extensions/webdav/pkg/config" - "github.com/owncloud/ocis/extensions/webdav/pkg/constants" - "github.com/owncloud/ocis/extensions/webdav/pkg/dav/requests" - thumbnailsmsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/thumbnails/v0" - thumbnailssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/thumbnails/v0" ->>>>>>> 60f1081e8 (implement thumbnails also for webdav and non remote.php routes) ) const ( @@ -114,7 +103,7 @@ func NewService(opts ...Option) (Service, error) { r.Get("/remote.php/webdav/*", http.NotFound) r.Get("/webdav/*", http.NotFound) }) - + // r.MethodFunc("REPORT", "/remote.php/dav/files/{id}/*", svc.Search) // This is a workaround for the go-chi concurrent map read write issue. From fd995475b6556b20bee79ca282d8f807b89fba11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Thu, 5 May 2022 14:45:24 +0000 Subject: [PATCH 11/13] use WhoAmI to look up user for legacy webdav endpoints MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- changelog/unreleased/fix-thumbnails-dav.md | 6 +- .../webdav/pkg/dav/requests/thumbnail.go | 8 ++- extensions/webdav/pkg/service/v0/service.go | 61 ++++++++++++++----- 3 files changed, 53 insertions(+), 22 deletions(-) diff --git a/changelog/unreleased/fix-thumbnails-dav.md b/changelog/unreleased/fix-thumbnails-dav.md index 74212c2094..0db2fb4f30 100644 --- a/changelog/unreleased/fix-thumbnails-dav.md +++ b/changelog/unreleased/fix-thumbnails-dav.md @@ -1,10 +1,6 @@ Bugfix: Thumbnails for `/dav/xxx?preview=1` requests -We've added the thumbnail rendering for `/dav/xxx?preview=1` requests, which was previously not supported because of missing routes. It now returns the same thumbnails as for +We've added the thumbnail rendering for `/dav/xxx?preview=1`, `/remote.php/webdav/{relative path}?preview=1` and `/webdav/{relative path}?preview=1` requests, which was previously not supported because of missing routes. It now returns the same thumbnails as for `/remote.php/dav/xxx?preview=1`. -We've also ensured that `/remote.php/webdav/xxx?preview=1` and `/webdav/xxx?preview=1` will be -routed to the correct service and always return a 404 Not Found, because Thumbnails are currently -not implemented for that route. - https://github.com/owncloud/ocis/pull/3567 diff --git a/extensions/webdav/pkg/dav/requests/thumbnail.go b/extensions/webdav/pkg/dav/requests/thumbnail.go index ccb6016d3b..c34da24666 100644 --- a/extensions/webdav/pkg/dav/requests/thumbnail.go +++ b/extensions/webdav/pkg/dav/requests/thumbnail.go @@ -10,7 +10,7 @@ import ( "github.com/go-chi/chi/v5" - "github.com/owncloud/ocis/extensions/webdav/pkg/constants" + "github.com/owncloud/ocis/v2/extensions/webdav/pkg/constants" ) const ( @@ -47,7 +47,11 @@ func ParseThumbnailRequest(r *http.Request) (*ThumbnailRequest, error) { return nil, errors.New("invalid file path") } - id := ctx.Value(constants.ContextKeyID).(string) + id := "" + v := ctx.Value(constants.ContextKeyID) + if v != nil { + id = v.(string) + } q := r.URL.Query() width, height, err := parseDimensions(q) diff --git a/extensions/webdav/pkg/service/v0/service.go b/extensions/webdav/pkg/service/v0/service.go index 4977e5034b..dd3fbb66fd 100644 --- a/extensions/webdav/pkg/service/v0/service.go +++ b/extensions/webdav/pkg/service/v0/service.go @@ -97,11 +97,9 @@ func NewService(opts ...Option) (Service, error) { }) r.Group(func(r chi.Router) { - // currently not implemented - // If we implement this endpoint, we need to get the user from the access token. - // We decided against doing it, so that this service can be started without the JWT secret. - r.Get("/remote.php/webdav/*", http.NotFound) - r.Get("/webdav/*", http.NotFound) + r.Use(svc.WebDAVContext()) + r.Get("/remote.php/webdav/*", svc.Thumbnail) + r.Get("/webdav/*", svc.Thumbnail) }) // r.MethodFunc("REPORT", "/remote.php/dav/files/{id}/*", svc.Search) @@ -185,6 +183,21 @@ func (g Webdav) DavPublicContext() func(next http.Handler) http.Handler { }) } } +func (g Webdav) WebDAVContext() func(next http.Handler) http.Handler { + return func(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + + filePath := r.URL.Path + filePath = strings.TrimPrefix(filePath, "/remote.php") + filePath = strings.TrimPrefix(filePath, "/webdav/") + + ctx := context.WithValue(r.Context(), constants.ContextKeyPath, filePath) + + next.ServeHTTP(w, r.WithContext(ctx)) + + }) + } +} // SpacesThumbnail is the endpoint for retrieving thumbnails inside of spaces. func (g Webdav) SpacesThumbnail(w http.ResponseWriter, r *http.Request) { @@ -238,18 +251,36 @@ func (g Webdav) Thumbnail(w http.ResponseWriter, r *http.Request) { } t := r.Header.Get(TokenHeader) - ctx := metadata.AppendToOutgoingContext(r.Context(), TokenHeader, t) - userRes, err := g.revaClient.GetUserByClaim(ctx, &userv1beta1.GetUserByClaimRequest{ - Claim: "username", - Value: tr.Identifier, - }) - if err != nil || userRes.Status.Code != rpcv1beta1.Code_CODE_OK { - g.log.Error().Err(err).Msg("could not get user") - renderError(w, r, errInternalError("could not get user")) - return + + var user *userv1beta1.User + + if tr.Identifier == "" { + // look up user from token via WhoAmI + userRes, err := g.revaClient.WhoAmI(r.Context(), &gatewayv1beta1.WhoAmIRequest{ + Token: t, + }) + if err != nil || userRes.Status.Code != rpcv1beta1.Code_CODE_OK { + g.log.Error().Err(err).Msg("could not get user") + renderError(w, r, errInternalError("could not get user")) + return + } + user = userRes.GetUser() + } else { + // look up user from URL via GetUserByClaim + ctx := metadata.AppendToOutgoingContext(r.Context(), TokenHeader, t) + userRes, err := g.revaClient.GetUserByClaim(ctx, &userv1beta1.GetUserByClaimRequest{ + Claim: "username", + Value: tr.Identifier, + }) + if err != nil || userRes.Status.Code != rpcv1beta1.Code_CODE_OK { + g.log.Error().Err(err).Msg("could not get user") + renderError(w, r, errInternalError("could not get user")) + return + } + user = userRes.GetUser() } - fullPath := filepath.Join(templates.WithUser(userRes.User, g.config.WebdavNamespace), tr.Filepath) + fullPath := filepath.Join(templates.WithUser(user, g.config.WebdavNamespace), tr.Filepath) rsp, err := g.thumbnailsClient.GetThumbnail(r.Context(), &thumbnailssvc.GetThumbnailRequest{ Filepath: strings.TrimLeft(tr.Filepath, "/"), ThumbnailType: extensionToThumbnailType(strings.TrimLeft(tr.Extension, ".")), From 761d72d901cce2c03b524d11cf0b169293e2c8cd Mon Sep 17 00:00:00 2001 From: kobergj Date: Thu, 5 May 2022 18:40:12 +0200 Subject: [PATCH 12/13] add "/data" to public link URLs (#3703) Signed-off-by: jkoberg --- extensions/proxy/pkg/middleware/basic_auth.go | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/proxy/pkg/middleware/basic_auth.go b/extensions/proxy/pkg/middleware/basic_auth.go index 425fc4ca0a..fce78d6e39 100644 --- a/extensions/proxy/pkg/middleware/basic_auth.go +++ b/extensions/proxy/pkg/middleware/basic_auth.go @@ -118,6 +118,7 @@ func (m basicAuth) isPublicLink(req *http.Request) bool { "/remote.php/dav/public-files/", "/remote.php/ocs/apps/files_sharing/api/v1/tokeninfo/unprotected", "/ocs/v1.php/cloud/capabilities", + "/data", } isPublic := false From 109ebaef8ad5168d50dbd33f0b1f08fc566c22bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Thu, 5 May 2022 19:11:01 +0000 Subject: [PATCH 13/13] Automated changelog update [skip ci] --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a7ed53d17..01a17bbfde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The following sections list the changes for unreleased. ## Summary +* Bugfix - Thumbnails for `/dav/xxx?preview=1` requests: [#3567](https://github.com/owncloud/ocis/pull/3567) * Bugfix - Idp: Check if CA certificate if present: [#3623](https://github.com/owncloud/ocis/issues/3623) * Bugfix - Return proper errors when ocs/cloud/users is using the cs3 backend: [#3483](https://github.com/owncloud/ocis/issues/3483) * Bugfix - URL encode the webdav url in the graph API: [#3597](https://github.com/owncloud/ocis/pull/3597) @@ -30,6 +31,15 @@ The following sections list the changes for unreleased. ## Details +* Bugfix - Thumbnails for `/dav/xxx?preview=1` requests: [#3567](https://github.com/owncloud/ocis/pull/3567) + + We've added the thumbnail rendering for `/dav/xxx?preview=1`, + `/remote.php/webdav/{relative path}?preview=1` and `/webdav/{relative + path}?preview=1` requests, which was previously not supported because of missing routes. It + now returns the same thumbnails as for `/remote.php/dav/xxx?preview=1`. + + https://github.com/owncloud/ocis/pull/3567 + * Bugfix - Idp: Check if CA certificate if present: [#3623](https://github.com/owncloud/ocis/issues/3623) Upon first start with the default configurtation the idm service creates a server