Skip to content
Snippets Groups Projects

Issue #3300224: Key file not loaded when Stream Wrapper is used for file location

Open Issue #3300224: Key file not loaded when Stream Wrapper is used for file location
3 unresolved threads
Open Anoop Singh requested to merge issue/key-3300224:3300224-key-file-not into 8.x-1.x
3 unresolved threads

Merge request reports

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
105 106 */
106 107 public function getKeyValue(KeyInterface $key) {
107 108 $file = $this->configuration['file_location'];
109 // Convert stream wrapper to real path if needed.
110 if (StreamWrapperManager::getScheme($file)) {
111 $file = \Drupal::service('file_system')->realpath($file);
  • 105 106 */
    106 107 public function getKeyValue(KeyInterface $key) {
    107 108 $file = $this->configuration['file_location'];
    109 // Convert stream wrapper to real path if needed.
    110 if (StreamWrapperManager::getScheme($file)) {
  • Pravin Gaikwad added 1 commit

    added 1 commit

    • dca8d831 - Update getKeyValue to work with realpath, stearmwrapper and remote urls.

    Compare with previous version

  • Pravin Gaikwad added 1 commit

    added 1 commit

    • c241a6ee - Add comprehensive test coverage for FileKeyProvider Plugin.

    Compare with previous version

  • 138 */
    139 protected function fileGetContents($url) {
    140 return file_get_contents($url);
    141 }
    142
    103 143 /**
    104 144 * {@inheritdoc}
    105 145 */
    106 146 public function getKeyValue(KeyInterface $key) {
    107 147 $file = $this->configuration['file_location'];
    108 148
    149 // Determine if the file is using a stream wrapper or is a remote URL.
    150 $scheme = StreamWrapperManager::getScheme($file);
    151 if ($scheme) {
    152 // Handle Drupal stream wrappers (e.g. public://, private://).
    153 if (in_array($scheme, ['public', 'private'])) {
    • This makes an invalid assumption that public:// and private:// are local streams. S3fs can 'takeover' these and provide them as remote streamWrappers.

    • I now understand how the public:// and private:// stream wrappers function with S3FS. This setup makes it quite challenging to distinguish the native local stream wrapper in Drupal when S3FS is configured to use these wrappers.

    • Please register or sign in to reply
  • Pravin Gaikwad added 5 commits

    added 5 commits

    • bb9ce1e3 - 1 commit from branch project:8.x-1.x
    • 3bb7a28a - Issue #3300224: Key file not loaded when Stream Wrapper is used for file location
    • 3e1d6f5c - Issue #3300224: Key file not loaded when Stream Wrapper is used for file location
    • acf54a46 - Update getKeyValue to work with realpath, stearmwrapper and remote urls.
    • 2dab19ee - Add comprehensive test coverage for FileKeyProvider Plugin.

    Compare with previous version

  • Pravin Gaikwad added 7 commits

    added 7 commits

    • 2dab19ee...fe33c89b - 3 commits from branch project:8.x-1.x
    • 979700b1 - Issue #3300224: Key file not loaded when Stream Wrapper is used for file location
    • 5e36f36d - Issue #3300224: Key file not loaded when Stream Wrapper is used for file location
    • dff0f2bc - Update getKeyValue to work with realpath, stearmwrapper and remote urls.
    • 6c85d2bb - Add comprehensive test coverage for FileKeyProvider Plugin.

    Compare with previous version

  • This can be closed in favor of MR!47.

  • Please register or sign in to reply
    Loading