-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Removed dependency on 'org.apache.commons.codec' #7460
Removed dependency on 'org.apache.commons.codec' #7460
Conversation
Signed-off-by: Christoph Weitkamp <[email protected]>
Signed-off-by: Christoph Weitkamp <[email protected]>
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.
I have the feeling it will break the Freebox binding.
// Covert array of Hex bytes to a String | ||
return new String(hexBytes, StandardCharsets.UTF_8); | ||
// Convert raw bytes to a String | ||
return HexUtils.bytesToHex(rawHmac); |
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.
I have the feeling this will not be the same result.
The new call will add a space between each hexa value while the previous code did not.
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.
It will work - check it out. I wrote a unit test for each change.
@Test
public void testFreebox() {
byte[] rawSubject = "test".getBytes(StandardCharsets.UTF_8);
byte[] hexBytes = new Hex().encode(rawSubject);
String subject = new String(hexBytes, StandardCharsets.UTF_8);
assertThat(subject, is(HexUtils.bytesToHex(rawSubject)));
}
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.
Ok, if you are sure, that is fine for me.
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.
@lolodomo Then please remove your "changes requested" review :-)
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.
I don't know how to suppress it !
I approved it even if I check only the part relative to the Freebox binding.
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.
Seems you made it :-)
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.
Yes, I approved it globally but only reviewed one part.
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.
Many thanks - you're the best 😎!
* Removed dependency on 'org.apache.commons.codec' * Replaced usage of 'StringUtils' Signed-off-by: Christoph Weitkamp <[email protected]> Signed-off-by: Eugen Freiter <[email protected]>
@cweitkamp : just after installing version 2.5.5, I discovered the authentication to the Freebox is no more working. I am afraid you have broken the binding with your change in the method hmacSha1 ! |
If I restore the previous code in the method |
Here is the comparison with the old code and your new code:
The difference is the case. I will apply a lowercase to the result with the new code to see if it works. |
If you find a fix, it would be a good idea to make a unit test out of it. |
PR openhab#7460 broke the freebox binding Signed-off-by: Laurent Garnier <[email protected]>
@cweitkamp : where is your unit test, I don't find it ? |
@lolodomo I am sorry to break it. See #7460 (comment) for the unit test. I did not commit it anywhere. Just executed it locally. IIRC I had to transform the result to lower case in another case too. |
In case it broke several bindings, it could be necessary to produce a new distribution 2.5.6 very quickly |
* [freebox] Hot fix for login to the freebox PR #7460 broke the freebox binding * Unit test added for method hmacSha1 Signed-off-by: Laurent Garnier <[email protected]>
* Removed dependency on 'org.apache.commons.codec' * Replaced usage of 'StringUtils' Signed-off-by: Christoph Weitkamp <[email protected]>
* [freebox] Hot fix for login to the freebox PR openhab#7460 broke the freebox binding * Unit test added for method hmacSha1 Signed-off-by: Laurent Garnier <[email protected]>
* Removed dependency on 'org.apache.commons.codec' * Replaced usage of 'StringUtils' Signed-off-by: Christoph Weitkamp <[email protected]>
* [freebox] Hot fix for login to the freebox PR openhab#7460 broke the freebox binding * Unit test added for method hmacSha1 Signed-off-by: Laurent Garnier <[email protected]>
* Removed dependency on 'org.apache.commons.codec' * Replaced usage of 'StringUtils' Signed-off-by: Christoph Weitkamp <[email protected]> Signed-off-by: CSchlipp <[email protected]>
* [freebox] Hot fix for login to the freebox PR openhab#7460 broke the freebox binding * Unit test added for method hmacSha1 Signed-off-by: Laurent Garnier <[email protected]> Signed-off-by: CSchlipp <[email protected]>
* Removed dependency on 'org.apache.commons.codec' * Replaced usage of 'StringUtils' Signed-off-by: Christoph Weitkamp <[email protected]>
* [freebox] Hot fix for login to the freebox PR openhab#7460 broke the freebox binding * Unit test added for method hmacSha1 Signed-off-by: Laurent Garnier <[email protected]>
* Removed dependency on 'org.apache.commons.codec' * Replaced usage of 'StringUtils' Signed-off-by: Christoph Weitkamp <[email protected]>
* [freebox] Hot fix for login to the freebox PR openhab#7460 broke the freebox binding * Unit test added for method hmacSha1 Signed-off-by: Laurent Garnier <[email protected]>
* Removed dependency on 'org.apache.commons.codec' * Replaced usage of 'StringUtils' Signed-off-by: Christoph Weitkamp <[email protected]>
* [freebox] Hot fix for login to the freebox PR openhab#7460 broke the freebox binding * Unit test added for method hmacSha1 Signed-off-by: Laurent Garnier <[email protected]>
* Removed dependency on 'org.apache.commons.codec' * Replaced usage of 'StringUtils' Signed-off-by: Christoph Weitkamp <[email protected]>
* [freebox] Hot fix for login to the freebox PR openhab#7460 broke the freebox binding * Unit test added for method hmacSha1 Signed-off-by: Laurent Garnier <[email protected]>
* Removed dependency on 'org.apache.commons.codec' * Replaced usage of 'StringUtils' Signed-off-by: Christoph Weitkamp <[email protected]> Signed-off-by: Daan Meijer <[email protected]>
* [freebox] Hot fix for login to the freebox PR openhab#7460 broke the freebox binding * Unit test added for method hmacSha1 Signed-off-by: Laurent Garnier <[email protected]> Signed-off-by: Daan Meijer <[email protected]>
* Removed dependency on 'org.apache.commons.codec' * Replaced usage of 'StringUtils' Signed-off-by: Christoph Weitkamp <[email protected]>
* [freebox] Hot fix for login to the freebox PR openhab#7460 broke the freebox binding * Unit test added for method hmacSha1 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab/openhab-core#1436
Signed-off-by: Christoph Weitkamp [email protected]