Skip to content

Commit

Permalink
Fix error message on localFolderWhitelist (#7776)
Browse files Browse the repository at this point in the history
* Update ExploreRemoteLayerService.scala

* Update RemoteSourceDescriptorService.scala

---------

Co-authored-by: Florian M <[email protected]>
  • Loading branch information
normanrz and fm3 authored May 2, 2024
1 parent 6ee06fb commit 0e6ce88
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/dataset/explore/ExploreRemoteLayerService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class ExploreRemoteLayerService @Inject()(credentialService: CredentialService,

private def assertLocalPathInWhitelist(uri: URI)(implicit ec: ExecutionContext): Fox[Unit] =
if (uri.getScheme == DataVaultService.schemeFile) {
bool2Fox(wkConf.Datastore.localFolderWhitelist.exists(whitelistEntry => uri.getPath.startsWith(whitelistEntry))) ?~> s"Absolute path ${uri.getPath} in local file system is not in path whitelist. Consider adding it to datastore.pathWhitelist"
bool2Fox(wkConf.Datastore.localFolderWhitelist.exists(whitelistEntry => uri.getPath.startsWith(whitelistEntry))) ?~> s"Absolute path ${uri.getPath} in local file system is not in path whitelist. Consider adding it to datastore.localFolderWhitelist"
} else Fox.successful(())

private def exploreRemoteLayersForRemotePath(remotePath: VaultPath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class RemoteSourceDescriptorService @Inject()(dSRemoteWebknossosClient: DSRemote
uri
else
throw new Exception(
s"Absolute path $localPath in local file system is not in path whitelist. Consider adding it to datastore.pathWhitelist")
s"Absolute path $localPath in local file system is not in path whitelist. Consider adding it to datastore.localFolderWhitelist")
} else { // relative local path, resolve in dataset dir
val magPathRelativeToDataset = localDatasetDir.resolve(localPath)
val magPathRelativeToLayer = localDatasetDir.resolve(layerName).resolve(localPath)
Expand Down

0 comments on commit 0e6ce88

Please sign in to comment.