Search in sources :

Example 1 with SignatureVerificationFailure

use of org.gradle.api.internal.artifacts.verification.verifier.SignatureVerificationFailure in project gradle by gradle.

the class HtmlDependencyVerificationReportRenderer method createFileLink.

private String createFileLink(ModuleComponentArtifactIdentifier key, VerificationFailure vf, String repositoryName) {
    String fileLink = "<div uk-tooltip=\"title: From repository '" + repositoryName + "'\">";
    fileLink += "<a href=\"" + vf.getFilePath().toURI().toASCIIString() + "\">" + key.getFileName() + "</a>";
    if (vf instanceof SignatureVerificationFailure) {
        File signatureFile = ((SignatureVerificationFailure) vf).getSignatureFile();
        if (signatureFile != null) {
            fileLink += "&nbsp;<a href=\"" + signatureFile.toURI().toASCIIString() + "\">(.asc)</a>";
        }
    }
    fileLink += "</div>";
    return fileLink;
}
Also used : SignatureVerificationFailure(org.gradle.api.internal.artifacts.verification.verifier.SignatureVerificationFailure) File(java.io.File)

Example 2 with SignatureVerificationFailure

use of org.gradle.api.internal.artifacts.verification.verifier.SignatureVerificationFailure in project gradle by gradle.

the class DependencyVerificationReportWriter method explainSingleFailure.

private void explainSingleFailure(DependencyVerificationReportRenderer renderer, ReportState state, RepositoryAwareVerificationFailure wrapper) {
    VerificationFailure failure = wrapper.getFailure();
    if (failure instanceof MissingChecksums) {
        state.hasMissing();
    } else {
        if (failure instanceof SignatureVerificationFailure) {
            state.failedSignatures();
            if (((SignatureVerificationFailure) failure).getErrors().values().stream().map(SignatureVerificationFailure.SignatureError::getKind).noneMatch(kind -> kind == SignatureVerificationFailure.FailureKind.PASSED_NOT_TRUSTED)) {
                state.maybeCompromised();
            } else {
                state.hasUntrustedKeys();
            }
        } else {
            state.maybeCompromised();
        }
    }
    renderer.reportFailure(wrapper);
}
Also used : SignatureVerificationFailure(org.gradle.api.internal.artifacts.verification.verifier.SignatureVerificationFailure) MissingChecksums(org.gradle.api.internal.artifacts.verification.verifier.MissingChecksums) SignatureVerificationFailure(org.gradle.api.internal.artifacts.verification.verifier.SignatureVerificationFailure) VerificationFailure(org.gradle.api.internal.artifacts.verification.verifier.VerificationFailure) RepositoryAwareVerificationFailure(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.verification.RepositoryAwareVerificationFailure)

Aggregations

SignatureVerificationFailure (org.gradle.api.internal.artifacts.verification.verifier.SignatureVerificationFailure)2 File (java.io.File)1 RepositoryAwareVerificationFailure (org.gradle.api.internal.artifacts.ivyservice.ivyresolve.verification.RepositoryAwareVerificationFailure)1 MissingChecksums (org.gradle.api.internal.artifacts.verification.verifier.MissingChecksums)1 VerificationFailure (org.gradle.api.internal.artifacts.verification.verifier.VerificationFailure)1