mwunsch / weary

A framework and DSL for building RESTful web service clients
MIT License
482 stars 23 forks source link

basic auth conflict with params #18

Closed aaronchi closed 12 years ago

aaronchi commented 12 years ago

I have a situation where an api call includes the variable username but uses a basic auth request or authentication. It seems like these two parameters conflict in instances like this.

Would it make more sense to next basic_auth and oauth params to avoid conflicts like this?

:basic_auth => {:username => username, :password => password}, :username => otherusername

mwunsch commented 12 years ago

Hi there. Part of the call to basic_auth! in Weary::Resource are optional arguments to set the expected parameter to avoid conflicts such as this. See: https://github.com/mwunsch/weary/blob/196356ac11dde4e4d0649f3ec884ca19bc684e8e/lib/weary/resource.rb#L70-78

so you can call r.basic_auth! :auth_user, :auth_pass and that would rename expected parameters. Make sense?

aaronchi commented 12 years ago

yep. found this the other day. Thanks!