oauth-cli

a simple CLI client to test your oauth API easily

Installation

oauth-cli is packed as gem, install with:

gem install oauth-cli

Usage

oauthc [options] [http_method_verb uri [body]]

Options:

--help             Display this message
--profile          Name of preset profile to load, put profiles to a .yml file in ~/.oauthconfig
--host             Host to connect to
--consumer_key     Consumer Key
--consumer_secret  Consumer Secret
--token            Authentication Token
--token_secret     Authentication Secret
--mime_type        Set mime type, default: application/xml
--content_type     Set content type, default: application/xml

Request params (leave blank for interactive mode)

http_method_verb  nay method of get, post, put or delete
uri               Uri to request
body              Body attached to request

Interactive Mode

if no request params are specified, interactive mode is started. Those commands are available:

Interactive Commands:

get     uri          Get request for given uri
post    uri  [body]  Post request for given uri, asks for body if not provided
put     uri  [body]  Put request for given uri, asks for body if not provided
delete  uri          Delete request for given uri

auth                 Request authentication token
help                 Display this message

Examples

oauthc was originally developed to test the Qype API. Run these examples agains it:

post /feedbacks '<feedback><link href="http://api.qype.com/v1/reviews/66"  rel="http://schemas.qype.com/review"/><comment><![CDATA[This review contains offending text]]></comment></feedback>'
post /places/31/checkins '<checkins><point>53.5505,9.93631</point></checkins>'
get /positions/53.55224,9.999/recommended_places
get /locators/de600-hamburg/feed
get /badges
get /users/tobiasb/badges
get /places/31.json?expand=popular_checkins

Hints

Todos

  • save given keys to config, e.g. introduce ‘save’ command

  • go into config mode, if no profiles found and no params specified

  • better support for getting authkeys

  • testing + better docs

  • check oauth client, streamline!?

  • add autocomplete for interactive commands

  • add auth profiles for Qype, Twitter etc!?

FAQ

What’s the difference to the client provided by oauth gem?

problem with oauth cli client provided with the gem is the lack of post request with body content as well as easy usage with repl to have proper CLI options

The MIT License

Copyright © 2010 RngTng, Tobias Bielohlawek

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More

Easy way to create your gem: