Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

crazylegs

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crazylegs

  • 0.1.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= Crazylegs - the hacky 2-legged OAuth Library

Author:: Dave Copeland (mailto:dave@opower.com) Copyright:: Copyright (c) 2011 by Dave Copeland License:: Distributes under the Apache License, see LICENSE.txt in the source distro

Crazylegs is a very small library to sign urls for two-legged OAuth. This will not request urls for you, it will not parse a response for you, it will not give you some crazy DSL to abstract away the details. It will properly sign a URL using a consumer key and secret so that you can make an OAuth request for 2-legged auth. That's it.

== Use

Install if you need to:

gem install crazylegs

== Example

include Crazylegs
credentials = Credentials.new(consumer_key,shared_secret)
url = SignedURL.new(credentials,"http://api.example.com/api/customers",'GET')
url['accountNumber'] = '655321'
signed_url = url.full_url
# signed_url can now be requested of the remote server

# If you want to use the header-based version
url = SignedURL.new(credentials,"http://api.example.com/api/customers/12/address",'POST')
signed_url,headers = url.full_url_using_headers
# Now, you can POST signed_url as long as you included headers in your HTTP request

See Crazylegs::SignedURL and Crazylegs::Credentials for more info.

=== Seeing WTF is going on

logger = Logger.new(STDERR)
logger.level = Logger::DEBUG
url = SignedURL.new(credentials,"http://scrapi-demo-dev.opower.com/api/customers",'GET',logger)

FAQs

Package last updated on 17 Jun 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc