-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Allow rpc_user and rpc_pass in config file #1527
Conversation
Let's not support this as flags but as a option in the config file. https://docs.rs/config/latest/config/ |
PR title says "instead of" we are just adding to. |
Tested 37d36ea 👍🏼
|
Yea, using rpc_user and rpc_pass should not be encouraged |
They will not be deprecated from use in clients. The deprecation refers to using bare |
Yes, true. Passing credentials as command line flags is still not ideal because those will be stored in plaintext in your bash history. I've add it as flags anyway because that fear is probably overblown. |
Generally I think we have to overhaul or configuration setup. I think there should be global |
In addition to these methods, you could also read |
I think |
Assuming a system with two users: |
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.
SO CLOSE
@@ -35,3 +35,32 @@ fn re_opening_database_does_not_trigger_schema_check() { | |||
.rpc_server(&rpc_server) | |||
.run(); | |||
} | |||
|
|||
#[test] | |||
fn index_runs_with_rpc_user_and_pass_as_env_vars() { |
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.
Let's modify this test to make sure we're using the correct values. Let's record the user and pass which are passed each time a client connects, and then do something like assert_eq!(rpc_server.client_credentials, &[("foo", "bar")])
.
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.
The way the our mock bitcoin core instance is written I do not have access to the Basic Authentication http header. So I can't know what credentials are passed in.
@@ -298,3 +298,50 @@ fn expected_sat_time_is_rounded() { | |||
r".*<dt>timestamp</dt><dd><time>.* \d+:\d+:\d+ UTC</time> \(expected\)</dd>.*", | |||
); | |||
} | |||
|
|||
#[test] | |||
fn server_runs_with_rpc_user_and_pass_as_env_vars() { |
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.
Let's do the same style of test in index_runs_with_rpc_user_and_pass_as_env_vars
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.
see above
Add the ability to authenticate bitcoind RPC calls using a username and password, as an alternative to cookie file authentication.
#1399
Probably closes:
#1785
#1562