Skip to content

Commit

Permalink
Merge pull request #28 from City-of-Helsinki/revert-27-UHF-10462
Browse files Browse the repository at this point in the history
UHF-10533
  • Loading branch information
hyrsky authored Aug 28, 2024
2 parents 25c7b80 + 698be53 commit 8f3de38
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 46 deletions.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
},
"extra": {
"patches": {
"drupal/core": {
"UHF-10533 D10.3 images": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-module-helfi-azure-fs/f933226cdd9b046d76757d4f885d3d3567365264/patches/UHF-10533-d10-images.patch"
},
"twistor/flysystem-stream-wrapper": {
"PHP 8.2 support (https://www.drupal.org/project/flysystem/issues/3387094)": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-module-helfi-azure-fs/ddb222622b92d1c2b7db975a84167a00579a1ad0/patches/3387094-add-context-property-to-stream-wrapper.patch"
}
Expand Down
2 changes: 1 addition & 1 deletion helfi_azure_fs.info.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: HELfi azure file system
type: module
package: Custom
core_version_requirement: ^9 || ^10 || ^11
core_version_requirement: ^10 || ^11
2 changes: 1 addition & 1 deletion helfi_azure_fs.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ services:
_defaults:
autoconfigure: true
autowire: true

azure_file_system:
class: Drupal\helfi_azure_fs\AzureFileSystem
decorates: file_system
Expand All @@ -11,4 +12,3 @@ services:
- '@stream_wrapper_manager'
- '@settings'

Drupal\helfi_azure_fs\Routing\RouteSubscriber: ~
15 changes: 15 additions & 0 deletions patches/UHF-10533-d10-images.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/core/modules/image/src/Controller/ImageStyleDownloadController.php b/core/modules/image/src/Controller/ImageStyleDownloadController.php
index bfc5c985d8..18d513b97e 100644
--- a/core/modules/image/src/Controller/ImageStyleDownloadController.php
+++ b/core/modules/image/src/Controller/ImageStyleDownloadController.php
@@ -158,7 +158,9 @@ public function deliver(Request $request, $scheme, ImageStyleInterface $image_st
$derivative_scheme = $this->streamWrapperManager->getScheme($derivative_uri);

if ($required_derivative_scheme !== $derivative_scheme) {
- throw new AccessDeniedHttpException("The scheme for this image doesn't match the scheme for the original image");
+ // Remove 10.3 security check. Hel.fi should only serve public files, so
+ // this should be fine for use while we are working on a more permanent solution.
+ $this->logger->info('Got %derivative_uri, expected scheme %required_scheme.', ['%derivative_uri' => $derivative_uri, '%required_scheme' => $required_derivative_scheme]);
}

if ($token_is_valid) {
44 changes: 0 additions & 44 deletions src/Routing/RouteSubscriber.php

This file was deleted.

0 comments on commit 8f3de38

Please sign in to comment.