Interface TrustedChecksumsSource


  • public interface TrustedChecksumsSource
    Component able to provide (trusted) checksums for artifacts.

    Note: the "trusted" meaning depends solely on implementation and the user using it. Resolver itself does nothing for "trust" (like some crypto magic or what not). It all boils down that the source being used by implementation is "trusted" by user or not.

    Since:
    1.9.0
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static interface  TrustedChecksumsSource.Writer
      A writer that is able to write/add trusted checksums to this implementation.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.String> getTrustedArtifactChecksums​(org.eclipse.aether.RepositorySystemSession session, org.eclipse.aether.artifact.Artifact artifact, org.eclipse.aether.repository.ArtifactRepository artifactRepository, java.util.List<ChecksumAlgorithmFactory> checksumAlgorithmFactories)
      May return the trusted checksums (for given artifact) from trusted source, or null if not enabled.
      TrustedChecksumsSource.Writer getTrustedArtifactChecksumsWriter​(org.eclipse.aether.RepositorySystemSession session)
      Some trusted checksums sources may implement this optional method: ability to write/add checksums to them.
      default java.util.Map<java.lang.String,​java.lang.String> getTrustedMetadataChecksums​(org.eclipse.aether.RepositorySystemSession session, org.eclipse.aether.metadata.Metadata metadata, org.eclipse.aether.repository.ArtifactRepository artifactRepository, java.util.List<ChecksumAlgorithmFactory> checksumAlgorithmFactories)
      May return the trusted checksums (for given metadata) from trusted source, or null if not enabled or the implementation does not cover metadata.
    • Method Detail

      • getTrustedArtifactChecksums

        java.util.Map<java.lang.String,​java.lang.String> getTrustedArtifactChecksums​(org.eclipse.aether.RepositorySystemSession session,
                                                                                           org.eclipse.aether.artifact.Artifact artifact,
                                                                                           org.eclipse.aether.repository.ArtifactRepository artifactRepository,
                                                                                           java.util.List<ChecksumAlgorithmFactory> checksumAlgorithmFactories)
        May return the trusted checksums (for given artifact) from trusted source, or null if not enabled. Enabled trusted checksum source SHOULD return non-null (empty map) result, when it has no data for given artifact. Empty map means in this case "no information", but how that case is interpreted depends on consumer for trusted checksums.
        Parameters:
        session - The repository system session, never null.
        artifact - The artifact we want checksums for, never null.
        artifactRepository - The origin repository: local, workspace, remote repository, never null.
        checksumAlgorithmFactories - The checksum algorithms that are expected, never null.
        Returns:
        Map of expected checksums, or null if not enabled.
      • getTrustedMetadataChecksums

        default java.util.Map<java.lang.String,​java.lang.String> getTrustedMetadataChecksums​(org.eclipse.aether.RepositorySystemSession session,
                                                                                                   org.eclipse.aether.metadata.Metadata metadata,
                                                                                                   org.eclipse.aether.repository.ArtifactRepository artifactRepository,
                                                                                                   java.util.List<ChecksumAlgorithmFactory> checksumAlgorithmFactories)
        May return the trusted checksums (for given metadata) from trusted source, or null if not enabled or the implementation does not cover metadata. Semantics are the same as for getTrustedArtifactChecksums(RepositorySystemSession, Artifact, ArtifactRepository, List), but covering metadata: metadata like maven-metadata.xml influences resolution decisions (for example version range selection), so trusted sources able to attest metadata should expose that here.

        The default implementation returns null ("not enabled for metadata"), preserving the behavior of implementations written before this method existed.

        Parameters:
        session - The repository system session, never null.
        metadata - The metadata we want checksums for, never null.
        artifactRepository - The origin repository: local, workspace, remote repository, never null.
        checksumAlgorithmFactories - The checksum algorithms that are expected, never null.
        Returns:
        Map of expected checksums, or null.
        Since:
        2.0.23
      • getTrustedArtifactChecksumsWriter

        TrustedChecksumsSource.Writer getTrustedArtifactChecksumsWriter​(org.eclipse.aether.RepositorySystemSession session)
        Some trusted checksums sources may implement this optional method: ability to write/add checksums to them. If source does not support this feature, method should return null.