Class TrustedChecksumsArtifactResolverPostProcessor
- java.lang.Object
-
- org.eclipse.aether.internal.impl.resolution.ArtifactResolverPostProcessorSupport
-
- org.eclipse.aether.internal.impl.resolution.TrustedChecksumsArtifactResolverPostProcessor
-
- All Implemented Interfaces:
org.eclipse.aether.spi.resolution.ArtifactResolverPostProcessor
@Singleton @Named("trustedChecksums") public final class TrustedChecksumsArtifactResolverPostProcessor extends ArtifactResolverPostProcessorSupportArtifact resolver processor that verifies the checksums of all resolved artifacts against trusted checksums. Is also able to "record" (calculate and write them) to trusted checksum sources, that do support this operation.It uses a list of
ChecksumAlgorithmFactoryies to work with, by default SHA-1.Configuration keys:
aether.artifactResolver.postProcessor.trustedChecksums.checksumAlgorithms- Comma separated list ofChecksumAlgorithmFactorynames to use (default "SHA-1").aether.artifactResolver.postProcessor.trustedChecksums.failIfMissing- To fail if artifact being validated is missing a trusted checksum (defaultfalse).aether.artifactResolver.postProcessor.trustedChecksums.snapshots- Should snapshot artifacts be handled (validated or recorded). Snapshots are by "best practice" in-house produced, hence should be trusted (defaultfalse).aether.artifactResolver.postProcessor.trustedChecksums.record- If this value set totrue, this component with not validate but "record" encountered artifact checksums instead (defaultfalse).
This component uses
TrustedChecksumsSourceas source of checksums for validation and also to "record" the calculated checksums. To have this component usable, there must exist at least one enabled checksum source. In case of multiple checksum sources enabled, ALL of them are used as source for validation or recording. This implies that if two enabled checksum sources "disagree" about an artifact checksum, the validation failure is inevitable.- Since:
- 1.9.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringALL_SCOPEstatic java.lang.StringCONFIG_PROP_CHECKSUM_ALGORITHMSThe checksum algorithms to apply during post-processing as comma separated list.static java.lang.StringCONFIG_PROP_ENABLEDIs post processor enabled.static java.lang.StringCONFIG_PROP_FAIL_IF_MISSINGShould post processor fail resolution if checksum is missing?static java.lang.StringCONFIG_PROP_RECORDShould post processor go into "record" mode (and collect checksums instead of validate them)?static java.lang.StringCONFIG_PROP_SCOPEThe scope to apply during post-processing.static java.lang.StringCONFIG_PROP_SNAPSHOTSShould post processor process snapshots as well?static java.lang.StringDEFAULT_CHECKSUM_ALGORITHMSstatic java.lang.StringDEFAULT_SCOPEstatic java.lang.StringNAMEstatic java.lang.StringPROJECT_SCOPE
-
Constructor Summary
Constructors Constructor Description TrustedChecksumsArtifactResolverPostProcessor(org.eclipse.aether.spi.connector.checksum.ChecksumAlgorithmFactorySelector checksumAlgorithmFactorySelector, java.util.Map<java.lang.String,org.eclipse.aether.spi.checksums.TrustedChecksumsSource> trustedChecksumsSources)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoPostProcess(org.eclipse.aether.RepositorySystemSession session, java.util.List<org.eclipse.aether.resolution.ArtifactResult> artifactResults)protected booleanisEnabled(org.eclipse.aether.RepositorySystemSession session)Returnstrueif session configuration marks this instance as enabled.-
Methods inherited from class org.eclipse.aether.internal.impl.resolution.ArtifactResolverPostProcessorSupport
postProcess
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
CONFIG_PROP_ENABLED
public static final java.lang.String CONFIG_PROP_ENABLED
Is post processor enabled.- See Also:
- Constant Field Values
-
CONFIG_PROP_CHECKSUM_ALGORITHMS
public static final java.lang.String CONFIG_PROP_CHECKSUM_ALGORITHMS
The checksum algorithms to apply during post-processing as comma separated list.- See Also:
- Constant Field Values
-
DEFAULT_CHECKSUM_ALGORITHMS
public static final java.lang.String DEFAULT_CHECKSUM_ALGORITHMS
- See Also:
- Constant Field Values
-
CONFIG_PROP_SCOPE
public static final java.lang.String CONFIG_PROP_SCOPE
The scope to apply during post-processing. Accepted values areall(is default and is what happened before), andprojectwhen the scope of verification are project dependencies only (i.e. plugins are not verified).- Since:
- 2.0.11
- See Also:
- Constant Field Values
-
ALL_SCOPE
public static final java.lang.String ALL_SCOPE
- See Also:
- Constant Field Values
-
PROJECT_SCOPE
public static final java.lang.String PROJECT_SCOPE
- See Also:
- Constant Field Values
-
DEFAULT_SCOPE
public static final java.lang.String DEFAULT_SCOPE
- See Also:
- Constant Field Values
-
CONFIG_PROP_FAIL_IF_MISSING
public static final java.lang.String CONFIG_PROP_FAIL_IF_MISSING
Should post processor fail resolution if checksum is missing?- See Also:
- Constant Field Values
-
CONFIG_PROP_SNAPSHOTS
public static final java.lang.String CONFIG_PROP_SNAPSHOTS
Should post processor process snapshots as well?- See Also:
- Constant Field Values
-
CONFIG_PROP_RECORD
public static final java.lang.String CONFIG_PROP_RECORD
Should post processor go into "record" mode (and collect checksums instead of validate them)?- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TrustedChecksumsArtifactResolverPostProcessor
@Inject public TrustedChecksumsArtifactResolverPostProcessor(org.eclipse.aether.spi.connector.checksum.ChecksumAlgorithmFactorySelector checksumAlgorithmFactorySelector, java.util.Map<java.lang.String,org.eclipse.aether.spi.checksums.TrustedChecksumsSource> trustedChecksumsSources)
-
-
Method Detail
-
isEnabled
protected boolean isEnabled(org.eclipse.aether.RepositorySystemSession session)
Description copied from class:ArtifactResolverPostProcessorSupportReturnstrueif session configuration marks this instance as enabled.Default value is
false.- Specified by:
isEnabledin classArtifactResolverPostProcessorSupport
-
doPostProcess
protected void doPostProcess(org.eclipse.aether.RepositorySystemSession session, java.util.List<org.eclipse.aether.resolution.ArtifactResult> artifactResults)
- Specified by:
doPostProcessin classArtifactResolverPostProcessorSupport
-
-