Improper usage of HTTParty support for basic HTTP auth credentials
Summary
In a number of places, a spec incorrectly passes basic_auth: { user: ... }
to an HTTParty
verb.
Example
HTTParty.put(
url,
headers: headers,
- basic_auth: { user: user.username, password: personal_access_token.token },
+ basic_auth: { username: user.username, password: personal_access_token.token },
body: file.read
)
What is the current bug behavior?
The test incorrectly passes a username to HTTParty and when the resulting request header is decoded the username is missing (blank, instead of the expected value).
What is the expected correct behavior?
The test correctly passes a username to HTTParty and when the resulting request header is decoded the username has the expected value.
Possible fixes
Correct all existing instances (replace user:
with username:
) and add a cop to identify this error.
Edited by Ethan Reesor