From 41bb3090946057a2f8897e60d34bf41dce0e8a8b Mon Sep 17 00:00:00 2001 From: ulferts Date: Mon, 3 Jun 2019 16:19:54 +0200 Subject: [PATCH] disable wp schema caching until it is turned save for it again [ci skip] --- .../work_packages/schema/work_package_schema_representer.rb | 6 +++++- .../v3/work_packages/work_packages_schemas_resource_spec.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/api/v3/work_packages/schema/work_package_schema_representer.rb b/lib/api/v3/work_packages/schema/work_package_schema_representer.rb index c8ae51a8dd5..0412d6291f0 100644 --- a/lib/api/v3/work_packages/schema/work_package_schema_representer.rb +++ b/lib/api/v3/work_packages/schema/work_package_schema_representer.rb @@ -35,7 +35,11 @@ module API module WorkPackages module Schema class WorkPackageSchemaRepresenter < ::API::Decorators::SchemaRepresenter - include API::Caching::CachedRepresenter + # TODO: reenable caching after having ensured that the cache is + # user or at least roles in project specific. + # Otherwise, the writable information will not be correct and information + # cached e.g. in an embedded query (project name) is leaked to the user. + # include API::Caching::CachedRepresenter extend ::API::V3::Utilities::CustomFieldInjector::RepresenterClass custom_field_injector type: :schema_representer diff --git a/spec/requests/api/v3/work_packages/work_packages_schemas_resource_spec.rb b/spec/requests/api/v3/work_packages/work_packages_schemas_resource_spec.rb index b5f105e3859..333bcfab583 100644 --- a/spec/requests/api/v3/work_packages/work_packages_schemas_resource_spec.rb +++ b/spec/requests/api/v3/work_packages/work_packages_schemas_resource_spec.rb @@ -145,7 +145,7 @@ describe API::V3::WorkPackages::Schema::WorkPackageSchemasAPI, type: :request do expect(last_response.headers['ETag']).to match(/W\/\"\w+\"/) end - it 'caches the response' do + it 'caches the response', skip: true do schema_class = API::V3::WorkPackages::Schema::TypedWorkPackageSchema representer_class = API::V3::WorkPackages::Schema::WorkPackageSchemaRepresenter