-
Notifications
You must be signed in to change notification settings - Fork 38.7k
rpc: Validate -rpcauth arguments #20461
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
Conversation
|
Concept ACK As it is a end-user affecting change it needs a brief (1 line) mention in the release notes. |
ryanofsky
left a 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.
Code review ACK 9860537473b160dfabb033f598848d8a60a339dc. Nice to get this better error handling and test coverage!
|
cr ACK 9860537473b160dfabb033f598848d8a60a339dc |
|
Concept ACK |
done |
|
cr ACK 35838a191f0e7a91aeeb5cf3e95b2fac022fcb04 |
|
ci (unrelated, I suppose, but noting it before it's restarted) |
|
Please don't restart a build without filing a bug. Either leave the failure, so that it can be found when scraping the logs with automated tools/manually, or file a bug if this is an intermittent failure. See also
|
jonatack
left a 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.
Approach ACK 35838a191f0e7a91aeeb5cf3e95b2fac022fcb04
35838a1 to
053b4fb
Compare
|
Addressed @jonatack review. |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
jonatack
left a 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.
ACK 053b4fb
|
|
||
| Changes to Wallet or GUI related settings can be found in the GUI or Wallet section below. | ||
|
|
||
| - Passing an invalid `-rpcauth` argument now cause bitcoind to fail to start. (#20461) |
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.
"now cause" should be either "now causes" or "will now cause"
luke-jr
left a 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.
Concept NACK. Additional fields is not necessarily an error.
A debug log line sounds fine.
|
review ACK 053b4fb |
@luke-jr what do you suggest? Ignore the whole argument? Just use the the first 3 fields? Not sure about the debug log since it's a sensitive value. |
|
Concept ACK: failing swiftly and loudly is better than failing silently |
Yes, at this startup stage. It will still fail loudly when the user attempts to authenticate later. (Maybe it would make sense to have a special error message returned for users with unrecognised configurations?)
No, this would potentially grant permissions not intended.
The username isn't (maybe the line number if it's a rpcauthfile). |
ryanofsky
left a 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.
Code review ACK 053b4fb. Only changes since last review are moving a variable declaration and adding a comment, release notes, and a const.
I think this PR looks good in it's current form. It seems to me the changes Luke is asking for would make this PR slightly worse. They'd make code more complicated and configuration problems harder to detect because errors would happen at authorization time instead of startup time. They also wouldn't seem to enable useful behavior because unrecognized options would still be rejected, just at a later time. Maybe Luke you could give an example of when the behavior you're suggesting might be useful?
I think if it comes down to a choice between Luke's more limited error reporting or no error reporting at all Luke's approach would be better. But current PR seems best, as far as I can tell
|
I think Luke case is to support same conf between knots and core? |
I don't understand how. What's the example situation where you would want to use the same configuration for knots and core, but have knots authorize RPC requests which core rejects? What would the requests be? Who would the users be? I can't think of a situation connected to reality where this would be useful. Just an opinion, but I think it would be good to think about specific situations where this feature could be useful before implementing it. |
|
@ryanofsky right, I'm just guessing. |
053b4fb doc: Release note regarding -rpcauth validation (João Barbosa) 4600132 rpc: Validate -rpcauth arguments (João Barbosa) d37c813 rpc: Refactor to process -rpcauth once (João Barbosa) Pull request description: Invalid `-rpcauth` arguments are currently silently ignored. This make server initialization fail if any `-rpcauth` is invalid. ACKs for top commit: MarcoFalke: review ACK 053b4fb jonatack: ACK 053b4fb ryanofsky: Code review ACK 053b4fb. Only changes since last review are moving a variable declaration and adding a comment, release notes, and a `const`. Tree-SHA512: c99923d4a121f0c9f882b07f5402ea53e9b2d9455ad34468a094ffab1d64df26c82e1279734c0d42bc2e113eae7b581fbc3be52f3ed4a2d7450d11793afcf406
|
So users don't need to swap out their rpcauth config to downgrade. This basically means people using advanced rpcauth features couldn't run Core on their system anymore without annoying additional steps... |
Ok IIUC there is no specific situation which causes a problem, just general idea to avoid overly strict validation of config options for more flexibility. I don't disagree with that and do think this could be a warning instead of an error. This all just seemed like an unlikely point of friction, so I was confused if there was more to explain the change requests and concept nack. Any followup that keeps an early error or warning seems good to me! |
|
Might make sense to have a |
Invalid
-rpcautharguments are currently silently ignored. This make server initialization fail if any-rpcauthis invalid.