Skip to content

rpcclient: allow disabling basic auth#2540

Open
0xjc65eth wants to merge 1 commit into
btcsuite:masterfrom
0xjc65eth:rpcclient-disable-auth-2505
Open

rpcclient: allow disabling basic auth#2540
0xjc65eth wants to merge 1 commit into
btcsuite:masterfrom
0xjc65eth:rpcclient-disable-auth-2505

Conversation

@0xjc65eth

Copy link
Copy Markdown

Summary

  • Add ConnConfig.DisableAuth so clients can skip HTTP Basic Auth.
  • Do not call getAuth or send Authorization when disabled, including HTTP POST mode and websocket dialing.
  • Add regression coverage that default POST requests still send Basic Auth, while disabled-auth POST requests work without credentials or an Authorization header.

Fixes #2505.

Tests

  • go test ./rpcclient -run 'TestSendPostRequestWithRetry(UsesBasicAuthByDefault|DisableAuth|Success)$' -count=1
  • go test ./rpcclient -count=1
  • git diff --check

@TechLateef

Copy link
Copy Markdown

Thanks for opening this! Just a heads-up that this issue has already been handled and approved over in PR #2514 here. You might want to take a look at that thread!

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.

rpcclient: make HTTP Basic Auth optional in HTTPPostMode

2 participants