-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge CheckSumPipe and HashPipe and add hashEncoding #7456
Conversation
} | ||
} | ||
|
||
protected static class ZipChecksumGenerator implements ChecksumGenerator { | ||
|
||
static class BasicGenerator implements ChecksumGenerator { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ik twijfelde nog een beetje over deze naam, maar 'zip' moest er iig vanaf wat mij betreft
checksum.reset(); | ||
} | ||
|
||
@Override | ||
public void update(int b){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deze werd nergens gebruikt
@@ -80,7 +80,7 @@ | |||
* <pipe name="make unique message" className="org.frankframework.pipes.FixedResultPipe" | |||
* returnString="<msg mid="MID" action="ACTION" />" replaceFixedParams="true"> | |||
* <param name="MID" sessionKey="mid" /> | |||
* <param name="ACTION" xpathExpression="request/@action" /> | |||
* <param name="ACTION" xpathExpression="request/@action" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting fix voor wat we vanochtend zagen
@@ -21,41 +25,6 @@ public ChecksumPipe createPipe() { | |||
return new ChecksumPipe(); | |||
} | |||
|
|||
@Test | |||
public void rightChecksumGeneratedMD5() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deze testen waren vrij zinloos: check of je een md5 checksumgenerator aanmaakt als je een md5 generator aanmaakt. Qua coverage verliezen we hier ook niets. De enige relevant is cantCalculate
hieronder wat mij betreft.
URL file = TestFileUtils.getTestFileURL("/Pipes/2.txt"); | ||
assertEquals(expected, calculateChecksum(file.getPath(), ChecksumType.MD5, true)); | ||
assertEquals(expected, calculateChecksum(file.openStream(), ChecksumType.MD5)); | ||
public static Stream<Arguments> values() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mooier als ParameterizedTest vond ik
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alleen formatting
* need to prove the authenticity of the message as well, please use the {@link HashPipe} which uses an algorithm and a secret to prove both | ||
* integrity and authenticity. | ||
* <p> | ||
* The hash is generated based on the bytes of the given input message or on the bytes read from the file path if @{inputIsFile} is @{code true} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* The hash is generated based on the bytes of the given input message or on the bytes read from the file path if @{inputIsFile} is @{code true} | |
* The hash is generated based on the bytes of the given input message or on the bytes read from the file path if {@code inputIsFile} is {@code true} |
* | ||
* CRC32 and Adler32 are {@link Checksum} implementations, the others are {@link MessageDigest} implementations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* CRC32 and Adler32 are {@link Checksum} implementations, the others are {@link MessageDigest} implementations. |
Dit is veel te technisch.
* Example usage: | ||
* <pre>{@code | ||
* <pipe className="org.frankframework.pipes.ChecksumPipe" | ||
* name="SHA" | ||
* algorithm="SHA"> | ||
* <forward name="success" path="READY"/> | ||
* </pipe> | ||
* }</pre> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dit gaan we later automatisch genereren, en de syntax klopt niet, dus dit kan ook beter weggelaten worden.
* <p> | ||
* Example usage: | ||
* <pre>{@code | ||
* <pipe className="org.frankframework.pipes.HashPipe" | ||
* name="SHA" | ||
* algorithm="HmacSHA1" | ||
* secret="privateSecretString"> | ||
* <forward name="success" path="READY"/> | ||
* </pipe> | ||
* }</pre> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ook hier geldt het zelfde.
* <li>MD5</li> | ||
* <li>SHA</li> | ||
* <li>SHA256</li> | ||
* <li>SHA384</li> | ||
* <li>SHA512</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Als ik dit zo terugzie is het eigenlijk helemaal niet zo lastig om van deze 2 pipes 1 te maken. Misschien toch maandag even in de groep gooien?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, ik heb de rest aangepast
public boolean isRequiresSecret() { | ||
return requiresSecret; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stiekem vind ik dan requiresSecret
mooier zonder de is er voor 😶🌫️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
na overleg aangepast naar isSecretRequired
.
Quality Gate passedIssues Measures |
And add clear documentation and unit tests for HashPipe and ChecksumPipe