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
Support basic auth in JSON RPC endpoint #6897
Conversation
51120c9
to
c064682
Compare
c064682
to
6fceab0
Compare
end | ||
[pool: :ethereum_jsonrpc] | ||
|> (&if(System.get_env("ETHEREUM_JSONRPC_HTTP_INSECURE", "") == "true", do: [:insecure] ++ &1, else: &1)).() | ||
|> (&if(basic_auth_user != "" && basic_auth_pass != "", |
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.
What if password is empty string?
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.
Does it make sense to enable Basic auth on RPC endpoint with blank password? I think it is very unlikely case.
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.
In some dev/test setups mb
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.
It is valid. Implemented in 3b5dc3d.
f7476e8
to
b4365fd
Compare
* Support basic auth in JSON RPC endpoint * Review comment: Allow blank password in basi auth of JSON RPC endpoint * Reuse basic auth configuration function --------- Co-authored-by: sl1depengwyn <max.pengwyn@gmail.com> (cherry picked from commit 65d7ad5)
Resolves #3501
Motivation
Blockscout doesn't support JSON RPC endpoints with basic auth.
Changelog
Support basic auth in JSON RPC endpoints by adding hackney params:
[basic_auth: {"user", "pass"}]
.ETHEREUM_JSONRPC_USER
andETHEREUM_JSONRPC_PASSWORD
are for basic auth management.Docs update in blockscout/docs#114.
Checklist for your Pull Request (PR)
CHANGELOG.md
with this PRmaster
in the Version column. Changes will be reflected in this table: https://docs.blockscout.com/for-developers/information-and-settings/env-variables.