Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error message on localFolderWhitelist #7776

Merged
merged 3 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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