-
Notifications
You must be signed in to change notification settings - Fork 2
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
Optional RSU/SDX TIM Signing #67
Conversation
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.
Unit tests pass! I've just left a few questions/comments.
jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/services/asn1/Asn1EncodedDataRouter.java
Show resolved
Hide resolved
jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/services/asn1/Asn1EncodedDataRouter.java
Outdated
Show resolved
Hide resolved
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.
A couple comments, this will be nice to have!
jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/services/asn1/Asn1EncodedDataRouter.java
Outdated
Show resolved
Hide resolved
jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/services/asn1/Asn1EncodedDataRouter.java
Outdated
Show resolved
Hide resolved
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.
Code looks good & the unit tests pass! I'm so glad you pulled the signing out into its own method, that's much cleaner.
I left a few comments regarding a typo & an inaccurate comment, but these aren't critical necessarily so I'm approving the PR.
jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/services/asn1/Asn1EncodedDataRouter.java
Outdated
Show resolved
Hide resolved
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.
Left a comment regarding a potential refactor of the isDataSigningEnabled()
method.
Relevant comment: #67 (comment)
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.
Looks like there are some merge conflicts to resolve, otherwise looking good!
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.
Looks good to me! I've just left some comments regarding consistent capitalization and potential clean code improvements.
jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/services/asn1/Asn1EncodedDataRouter.java
Outdated
Show resolved
Hide resolved
if (rsus instanceof JSONObject) { | ||
JSONObject rsusIn = (JSONObject) request.get(TimTransmogrifier.RSUS_STRING); | ||
if (rsusIn.has(TimTransmogrifier.RSUS_STRING)) { | ||
Object rsu = rsusIn.get(TimTransmogrifier.RSUS_STRING); | ||
JSONArray rsusOut = new JSONArray(); | ||
if (rsu instanceof JSONArray) { |
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 think it would improve readability and comprehension for the reader if we extracted the blocks of these "if" statements into methods with descriptive names. Also, while it might be less impactful, extracting the conditions being checked into methods with descriptive names could also improve clarity. We should consider implementing these changes at some point.
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.
lgtm!
PR Details
Description
These updates allow users to specify whether signing occurs for RSU-delivery TIMs and SDX-delivery TIMs.
Motivation and Context
Previously, signing was either on or off. This update allows for greater flexibility with TIM signing.
How Has This Been Tested?
This change has been tested locally using the /tim endpoint to deposit both RSU-delivery TIMs and SDX-delivery TIMs.
Types of changes
Checklist:
ODE Contributing Guide