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

Feat/block proposal authorization password for v2/block_proposal endpoint #4471

Merged
merged 2 commits into from Mar 5, 2024

Conversation

jferrant
Copy link
Collaborator

@jferrant jferrant commented Mar 1, 2024

Added config option to the signer and to the ConnectionOptions for adding a password. Just passing it around as a plaintext password in the authorization header.

Copy link

codecov bot commented Mar 2, 2024

Codecov Report

Attention: Patch coverage is 86.51685% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 83.30%. Comparing base (0910eed) to head (60c9e33).
Report is 5 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #4471      +/-   ##
==========================================
+ Coverage   83.23%   83.30%   +0.07%     
==========================================
  Files         453      453              
  Lines      325584   325630      +46     
  Branches      318      318              
==========================================
+ Hits       270993   271263     +270     
+ Misses      54583    54359     -224     
  Partials        8        8              
Files Coverage Δ
stacks-signer/src/client/stacks_client.rs 87.25% <100.00%> (+0.10%) ⬆️
stacks-signer/src/config.rs 84.71% <100.00%> (+0.29%) ⬆️
stackslib/src/net/api/mod.rs 91.37% <100.00%> (+0.30%) ⬆️
stackslib/src/net/connection.rs 83.51% <100.00%> (+0.01%) ⬆️
stackslib/src/net/httpcore.rs 82.77% <100.00%> (-0.19%) ⬇️
testnet/stacks-node/src/config.rs 74.26% <100.00%> (+6.28%) ⬆️
testnet/stacks-node/src/tests/signer.rs 93.45% <100.00%> (+0.06%) ⬆️
stacks-signer/src/cli.rs 33.60% <0.00%> (-0.28%) ⬇️
stacks-signer/src/main.rs 32.26% <0.00%> (-0.09%) ⬇️
stackslib/src/net/api/postblock_proposal.rs 80.67% <81.81%> (-0.21%) ⬇️
... and 1 more

... and 29 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0910eed...60c9e33. Read the comment docs.

hstove
hstove previously approved these changes Mar 2, 2024
Copy link
Contributor

@hstove hstove left a comment

Choose a reason for hiding this comment

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

Thanks for hustling on this!

stackslib/src/net/connection.rs Outdated Show resolved Hide resolved
stackslib/src/net/http/request.rs Outdated Show resolved Hide resolved
obycode
obycode previously approved these changes Mar 2, 2024
Copy link
Contributor

@obycode obycode left a comment

Choose a reason for hiding this comment

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

🙌 lgtm!

Copy link
Member

@jcnelson jcnelson left a comment

Choose a reason for hiding this comment

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

This isn't the right way to do HMAC. Also, we don't need it here since we're not even supporting HTTPS.

Can you instead just have the block-proposal endpoint check for an authorization header and treat the value as a bare password? Thanks!

@jferrant
Copy link
Collaborator Author

jferrant commented Mar 4, 2024

This isn't the right way to do HMAC. Also, we don't need it here since we're not even supporting HTTPS.

Can you instead just have the block-proposal endpoint check for an authorization header and treat the value as a bare password? Thanks!

Yep will do!

obycode
obycode previously approved these changes Mar 4, 2024
Copy link
Contributor

@obycode obycode left a comment

Choose a reason for hiding this comment

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

lgtm!

jcnelson
jcnelson previously approved these changes Mar 4, 2024
hstove
hstove previously approved these changes Mar 4, 2024
Copy link
Contributor

@hstove hstove left a comment

Choose a reason for hiding this comment

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

👏

@hstove
Copy link
Contributor

hstove commented Mar 4, 2024

@jferrant as a sanity check, can you run the regtest env with this PR's latest commit and make sure it produces at least one Nakamoto block?

… endpoint

Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
@hstove
Copy link
Contributor

hstove commented Mar 4, 2024

Re-requesting reviews. I'm running regtest-env based on the last commit here and it's working as expected! I've added the needed config changes to hirosystems/stacks-regtest-env#32

Copy link
Contributor

@hstove hstove left a comment

Choose a reason for hiding this comment

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

lgtm and have tested in regtest!

@jferrant jferrant enabled auto-merge March 4, 2024 21:12
Copy link
Contributor

@obycode obycode left a comment

Choose a reason for hiding this comment

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

lgtm!

@jferrant jferrant added this pull request to the merge queue Mar 5, 2024
Merged via the queue into next with commit 2d82e60 Mar 5, 2024
3 checks passed
@hstove hstove deleted the feat/block-proposal-auth branch March 5, 2024 17:39
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.

None yet

4 participants