-
Notifications
You must be signed in to change notification settings - Fork 176
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
Fix for the default password max length (as per the 1.6 spec) and other minor changes #345
Conversation
rpseng
commented
Apr 24, 2024
- As per the 1.6 spec the authorization key should be 20 bytes long, in hex format that is 40 chars
- gson library updated due to a reported vulnerability
- Keep a single instance of JSONConfiguration.java so users can actually configure it
I also found that the authentication key (aka password) should be handled as a hex string and not as a byte array. These changes I'm sending were tested with the following simulator: https://github.com/matth-x/MicroOcppSimulator |
This should fix #304 |
Hi @rpseng, Thanks for your contribution. Everything look good, so I merged the PR. |
@TVolden that's a very useful contribution, we were also facing issues because of the password field. When do you plan to publish the newest version on maven repository? |
Hello @EltonSaraci99 you can use jitpack to get any commit integrated with a gradle or maven build. For this case, please check: |
hello @rpseng thanks a lot, appreciate it! Just added:
and now I have a password string. The problem is that if I remove the dependency below that I got from maven I get a lot of import errors.
any idea what I can possibly be doing wrong? and if I add both the dependencies it requires me to put again a byte array password in the Override method. |
I'm not a maven expert, but I believe the |
Unfortunately, that is WRONG. The authorization key is only CONFIGURED as a hex string in an OCPP 1.6 ChangeConfiguration key, but the charge point MUST treat it as a binary byte array. Please re-read the OCPP-J 1.6 specification page 16: Example If you base64-decode the end of the last line, you see that the BYTES are in there, not the hex string. This entire change is wrong and only breaks things. Please revert ASAP. |
public static JSONConfiguration get() { | ||
return new JSONConfiguration(); | ||
return instance; |
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.
API breaking change. Instead of getting a default configuration, you now get whatever configuration the last library user left behind.