Skip to content

Commit

Permalink
Improve warning message with no digest found
Browse files Browse the repository at this point in the history
Currently the message only mentions the artifact to download but not
where it originates from, this makes it very hard to analyze and fix the
issue (actually one needs to to run a debugger).

This enhances the message a tiny little bit to mention the artifact
descriptors repository URL.
  • Loading branch information
laeubi committed Mar 28, 2024
1 parent 9380637 commit ca09e6e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ protected IStatus getArtifact(IArtifactDescriptor artifactDescriptor, OutputStre
IArtifactDescriptor.DOWNLOAD_CHECKSUM, Collections.emptySet());
if (steps.isEmpty()) {
LogHelper.log(new Status(IStatus.WARNING, Activator.ID,
NLS.bind(Messages.noDigestAlgorithmToVerifyDownload, artifactDescriptor.getArtifactKey())));
NLS.bind(Messages.noDigestAlgorithmToVerifyDownload, artifactDescriptor.getArtifactKey(),
artifactDescriptor.getRepository().getLocation())));
}
ProcessingStep[] stepArray = steps.toArray(new ProcessingStep[steps.size()]);
// TODO should probably be using createAndLink here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ retryRequest=Download of {0} failed on repository {1}. Retrying.
error_copying_local_file=An error occurred copying file {0}.

onlyInsecureDigestAlgorithmUsed = The digest algorithms ({0}) used to verify {1} have severely compromised security. Please report this concern to the artifact provider.
noDigestAlgorithmToVerifyDownload = No digest algorithm is available to verify download of {0}.
noDigestAlgorithmToVerifyDownload = No digest algorithm is available to verify download of {0} from repository {1}.
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,8 @@ private OutputStream addPreSteps(ProcessingStepHandler handler, IArtifactDescrip
addChecksumVerifiers(descriptor, downloadChecksumSteps, skipChecksums, IArtifactDescriptor.DOWNLOAD_CHECKSUM);
if (downloadChecksumSteps.isEmpty() && !isLocal()) {
LogHelper.log(new Status(IStatus.WARNING, Activator.ID,
NLS.bind(Messages.noDigestAlgorithmToVerifyDownload, descriptor.getArtifactKey())));
NLS.bind(Messages.noDigestAlgorithmToVerifyDownload, descriptor.getArtifactKey(),
descriptor.getRepository().getLocation())));
}
steps.addAll(downloadChecksumSteps);

Expand Down

0 comments on commit ca09e6e

Please sign in to comment.