cstamas commented on code in PR #200:
URL: https://github.com/apache/maven-resolver/pull/200#discussion_r990943260
##########
maven-resolver-spi/src/main/java/org/eclipse/aether/spi/checksums/TrustedChecksumsSource.java:
##########
@@ -39,16 +39,44 @@
public interface TrustedChecksumsSource
{
/**
- * May return the trusted checksums (for given artifact) from trusted
source, or {@code null}.
+ * May return the trusted checksums (for given artifact) from trusted
source, or {@code 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.
*
* @param session The repository system session, never
{@code null}.
* @param artifact The artifact we want checksums for,
never {@code null}.
* @param artifactRepository The origin repository: local,
workspace, remote repository, never {@code null}.
* @param checksumAlgorithmFactories The checksum algorithms that are
expected, never {@code null}.
- * @return Map of expected checksums, or {@code null}.
+ * @return Map of expected checksums, or {@code null} if not enabled.
*/
Map<String, String> getTrustedArtifactChecksums( RepositorySystemSession
session,
Artifact artifact,
ArtifactRepository
artifactRepository,
List<ChecksumAlgorithmFactory> checksumAlgorithmFactories );
+
+ /**
+ * A writer that is able to write/add trusted checksums to this
implementation.
+ */
+ interface Writer
Review Comment:
The `Writer getTrustedArtifactChecksumsWriter( RepositorySystemSession )`
method is the "factory", but given is 2nd method on interface, I think
"newInstance" would be a mess, is much clearer like this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]