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

Fix web backend to redirect DKG setup requests #153

Merged
merged 3 commits into from
Jun 27, 2022

Conversation

cmsigrist
Copy link
Contributor

@cmsigrist cmsigrist commented Jun 26, 2022

I am absolutely not sure if this is correctly written !
But currently DKG setup requests are not redirected, they use the default proxy, the idea is to redirect them to the correct proxy (the one provided in the input json).
As the regex used to check if it's an initialisation request does not match the setup i.e const regex = /\/evoting\/services\/dkg\/actors$/ does not match with the setup endpoint: /api/evoting/services/dkg/actors/${ElectionID}

@cmsigrist cmsigrist requested a review from nkcr June 26, 2022 14:26
@coveralls
Copy link

coveralls commented Jun 26, 2022

Pull Request Test Coverage Report for Build 2567751785

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 13 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.3%) to 62.271%

Files with Coverage Reduction New Missed Lines %
services/dkg/pedersen/handler.go 13 84.84%
Totals Coverage Status
Change from base Build 2554926834: -0.3%
Covered Lines: 3088
Relevant Lines: 4959

💛 - Coveralls

// update the payload.
const regex = /\/evoting\/services\/dkg\/actors$/;
// in case this is a DKG setup request, we must update the payload.
const regex = /\/evoting\/services\/dkg\/actors/;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const regex = /\/evoting\/services\/dkg\/actors/;
const regex = /\/evoting\/services\/dkg\/actors$/;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But that won't match a DKG setup request with the '$' at the end will it (since it's an end of string) and the setup still has the {ElectionID} at the end ie. actors/{ElectionID} ?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes you're right, /\/evoting\/services\/dkg\/actors\/.*$/ would be the one then. Just to be as much explicit as possible.

@cmsigrist cmsigrist requested a review from nkcr June 27, 2022 07:59
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@cmsigrist cmsigrist merged commit 04a64bf into main Jun 27, 2022
@cmsigrist cmsigrist deleted the web-backend-node-setup branch June 27, 2022 08:32
@coveralls
Copy link

coveralls commented Sep 20, 2024

Pull Request Test Coverage Report for Build 2567751785

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 13 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.3%) to 62.271%

Files with Coverage Reduction New Missed Lines %
services/dkg/pedersen/handler.go 13 84.84%
Totals Coverage Status
Change from base Build 2554926834: -0.3%
Covered Lines: 3088
Relevant Lines: 4959

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 2567659463

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 62.533%

Totals Coverage Status
Change from base Build 2554926834: 0.0%
Covered Lines: 3101
Relevant Lines: 4959

💛 - Coveralls

1 similar comment
@coveralls
Copy link

Pull Request Test Coverage Report for Build 2567659463

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 62.533%

Totals Coverage Status
Change from base Build 2554926834: 0.0%
Covered Lines: 3101
Relevant Lines: 4959

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants