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

Support for basic authentication as part of the URL #261

Open
barnabasbusa opened this issue Sep 28, 2023 · 3 comments
Open

Support for basic authentication as part of the URL #261

barnabasbusa opened this issue Sep 28, 2023 · 3 comments
Labels
good first issue Good for newcomers

Comments

@barnabasbusa
Copy link

Looks like basic authentication is not supported in dshackle.

Is there any quick way to enable this?

Example:
config:

cluster:
      upstreams:
        - id: "geth-lighthouse"
          chain: ethereum
          connection:
            ethereum:
              rpc:
                url: "https://username:pass@rpc.lighthouse-geth-001.srv.holesky.ethpandaops.io"

dshackle logs:

2023-28-09 13:58:51.821 | INFO  |  ConfiguredUpstreams | Using Ethereum upstream, at https://username:pass@rpc.lighthouse-geth-001.srv.holesky.ethpandaops.io
2023-28-09 13:58:52.120 | WARN  |  EthereumRpcUpstream | Setting up upstream geth-lighthouse with RPC-only access, less effective than WS+RPC
2023-28-09 13:58:52.131 | INFO  |  EthereumRpcUpstream | Configured for Ethereum
2023-28-09 13:58:52.727 | INFO  | entMultistreamHolder | Upstream geth-lighthouse with chain ETHEREUM has been added
2023-28-09 13:58:52.741 | WARN  |         AbstractHead | Restarting the Head...
2023-28-09 13:58:53.635 | INFO  |            StarterKt | Started StarterKt in 16.031 seconds (JVM running for 18.811)
2023-28-09 13:59:07.726 | INFO  |          Multistream | State of ETH: height=?, status=[UNAVAILABLE/1], lag=[0], weak=[geth-lighthouse]

Raw curl to the rpc endpoint

curl --data '{"method":"eth_blockNumber","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST  https://username:password@rpc.lighthouse-geth-001.srv.holesky.ethpandaops.io

response:

{"jsonrpc":"2.0","id":1,"result":"0x207"}
@splix
Copy link
Member

splix commented Oct 11, 2023

Did you try to specify it as basic-auth option? https://github.com/emeraldpay/dshackle/blob/master/docs/reference-configuration.adoc#ethereum-connection-options

PS I guess it's possible to extract from the URL as well, but at this time I could suggest to use the config option

@splix splix changed the title Support for basic authentication Support for basic authentication as part of the URL Oct 11, 2023
@splix splix added the good first issue Good for newcomers label Oct 11, 2023
@barnabasbusa
Copy link
Author

Yeah,I wasn't aware of this field. Thanks it is working using this extra field, but indeed it would be great if the standard method with the prefixed username:pass method would also be supported out of the box.

@barnabasbusa
Copy link
Author

Also it would be great if custom auth headers could also be passed, not just basic auth. For example something like this: https://developers.cloudflare.com/cloudflare-one/identity/service-tokens/#connect-your-service-to-access

splix pushed a commit that referenced this issue Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants