From d4ea26c2b5969fed6985e6b51d0f8c7e7e226cd8 Mon Sep 17 00:00:00 2001 From: Florian RUEN Date: Mon, 9 Dec 2024 08:54:22 +0100 Subject: [PATCH 1/4] feat: remove sensitive information from plugin api call --- lib/Service/ExternalStorageService.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/Service/ExternalStorageService.php b/lib/Service/ExternalStorageService.php index a6c2ce5..13dd8de 100644 --- a/lib/Service/ExternalStorageService.php +++ b/lib/Service/ExternalStorageService.php @@ -113,7 +113,7 @@ public function getExternalStorageConfigurationForSpecificFile(IUser $nextcloudU return ['message' => 'external storage type for file ' . $fileId . ' is not a cidgravity storage', 'error' => 'external_storage_invalid_type']; } - return $this->buildExternalStorageConfiguration($mountsForFile[0]->getInternalPath(), $externalStorage, $includeAuthSettings); + return $this->buildLightExternalStorageConfiguration($externalStorage); } catch (Exception $e) { return ['message' => 'error getting external storage config', 'error' => $e->getMessage()]; @@ -158,4 +158,16 @@ private function buildExternalStorageConfiguration(string $fileInternalPath, Sto return $configuration; } + + /** + * Construct light specific configuration object from external storage configuration + * @param StorageConfig $externalStorage External storage to build configuration for + * @return array + */ + private function buildLightExternalStorageConfiguration(StorageConfig $externalStorage): array { + $configuration = []; + $configuration['is_cidgravity'] = $externalStorage->getBackend()->getIdentifier() == "cidgravity"; + $configuration['default_ipfs_gateway'] = $externalStorage->getBackendOption('default_ipfs_gateway'); + return $configuration; + } } \ No newline at end of file From 14d5c703fb1ec38377305c0b5b09f33bc4c49921 Mon Sep 17 00:00:00 2001 From: Florian RUEN Date: Mon, 9 Dec 2024 09:06:35 +0100 Subject: [PATCH 2/4] feat: upgrade npm packages versions --- .vscode/settings.json | 3 ++- package.json | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index f03a8f5..fd506a9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,5 +10,6 @@ "**/*tsconfig.json": true, ".cache": true, "retool.config.json": true - } + }, + "makefile.configureOnOpen": false } \ No newline at end of file diff --git a/package.json b/package.json index ffdd254..29c6140 100644 --- a/package.json +++ b/package.json @@ -30,8 +30,8 @@ "@nextcloud/dialogs": "^6.0.1", "@nextcloud/moment": "^1.3.1", "@nextcloud/router": "^3.0.1", - "@nextcloud/vue": "^8.17.0", - "axios": "^1.7.5", + "@nextcloud/vue": "^8.21.0", + "axios": "^1.7.9", "moment": "^2.30.1", "nextcloud-l10n": "^0.1.1", "stylelint-webpack-plugin": "^5.0.1", @@ -59,13 +59,13 @@ "csp-html-webpack-plugin": "^5.1.0", "eslint-config-standard": "^17.1.0", "eslint-webpack-plugin": "^4.2.0", - "node-polyfill-webpack-plugin": "^3.0.0", - "sass": "^1.80.6", - "sass-loader": "^13.3.2", + "node-polyfill-webpack-plugin": "^4.1.0", + "sass": "^1.82.0", + "sass-loader": "^16.0.4", "url-loader": "^4.1.1", "vue-loader": "^15.11.1", "vue-template-compiler": "^2.7.16", - "webpack": "^5.96.1", + "webpack": "^5.97.1", "webpack-cli": "^5.1.4", "webpack-merge": "^6.0.1" } From acd0d6599b683ca649e4eb51eb237725ace2e0b9 Mon Sep 17 00:00:00 2001 From: Florian RUEN Date: Mon, 9 Dec 2024 09:11:03 +0100 Subject: [PATCH 3/4] feat: bump version to 1.1.7 --- appinfo/info.xml | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index eab824c..1b28be2 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -4,7 +4,7 @@ Cidgravity_Gateway An application to display files/directory metadata on decentralized web for CIDgravity storage files An application to display files/directory metadata on decentralized web for CIDgravity storage files - 1.1.6 + 1.1.7 agpl CIDgravity CIDgravity diff --git a/package-lock.json b/package-lock.json index 6a95307..3fbd020 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cidgravity_gateway", - "version": "1.1.6", + "version": "1.1.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cidgravity_gateway", - "version": "1.1.6", + "version": "1.1.7", "license": "agpl", "dependencies": { "@mdi/js": "^7.4.47", diff --git a/package.json b/package.json index 29c6140..091eadb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cidgravity_gateway", "description": "An application to display files/directory metadata on decentralized web for CIDgravity storage files", - "version": "1.1.6", + "version": "1.1.7", "author": "CIDgravity ", "bugs": { "url": "https://github.com/CIDgravity/nextcloud-cidgravity-gateway-app" From 0655827f46af2e7017d7c445d05a5424501a78cc Mon Sep 17 00:00:00 2001 From: Florian RUEN Date: Tue, 10 Dec 2024 09:47:45 +0100 Subject: [PATCH 4/4] fix: missing return element in backend --- lib/Service/ExternalStorageService.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Service/ExternalStorageService.php b/lib/Service/ExternalStorageService.php index 13dd8de..7271fb2 100644 --- a/lib/Service/ExternalStorageService.php +++ b/lib/Service/ExternalStorageService.php @@ -96,7 +96,7 @@ public function getMetadataForSpecificFile(IUser $nextcloudUser, int $fileId): a * @return array * @throws Exception */ - public function getExternalStorageConfigurationForSpecificFile(IUser $nextcloudUser, int $fileId, bool $includeAuthSettings): array { + public function getExternalStorageConfigurationForSpecificFile(IUser $nextcloudUser, int $fileId, bool $includeSensitiveSettings): array { try { $mountsForFile = $this->userMountCache->getMountsForFileId($fileId, $nextcloudUser->getUID()); @@ -113,6 +113,10 @@ public function getExternalStorageConfigurationForSpecificFile(IUser $nextcloudU return ['message' => 'external storage type for file ' . $fileId . ' is not a cidgravity storage', 'error' => 'external_storage_invalid_type']; } + if ($includeSensitiveSettings) { + return $this->buildExternalStorageConfiguration($mountsForFile[0]->getInternalPath(), $externalStorage, $includeSensitiveSettings); + } + return $this->buildLightExternalStorageConfiguration($externalStorage); } catch (Exception $e) {