Skip to content
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

Merged
merged 7 commits into from
May 7, 2024
Merged

Optional RSU/SDX TIM Signing #67

merged 7 commits into from
May 7, 2024

Conversation

mwodahl
Copy link

@mwodahl mwodahl commented Mar 21, 2024

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

  • [ X ] Defect fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that cause existing functionality to change)

Checklist:

  • I have added any new packages to the sonar-scanner.properties file
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
    ODE Contributing Guide
  • I have added tests to cover my changes.
  • [ X ] All new and existing tests passed.

Copy link
Member

@dmccoystephenson dmccoystephenson left a 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.

Copy link

@payneBrandon payneBrandon left a 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!

Copy link
Member

@dmccoystephenson dmccoystephenson left a 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.

sample.env Outdated Show resolved Hide resolved
Copy link
Member

@dmccoystephenson dmccoystephenson left a 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)

Copy link
Member

@dmccoystephenson dmccoystephenson left a 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!

@mwodahl mwodahl requested a review from dmccoystephenson April 3, 2024 14:49
Copy link
Member

@dmccoystephenson dmccoystephenson left a 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.

Comment on lines +103 to +108
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) {
Copy link
Member

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.

Copy link

@payneBrandon payneBrandon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@drewjj drewjj merged commit e05c1d8 into dev May 7, 2024
3 of 4 checks passed
@drewjj drewjj deleted the Update/optional-signing branch May 7, 2024 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants