Socket
Book a DemoInstallSign in
Socket

faraday-oauth1

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

faraday-oauth1

0.1.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

Faraday OAuth1

GitHub Workflow Status Gem License

Faraday OAuth1 Middleware.

Installation

Add this line to your application's Gemfile:

gem 'faraday-oauth1'

And then execute:

bundle install

Or install it yourself as:

gem install faraday-oauth1

Usage

require 'faraday'
require 'faraday/oauth1'

base_uri = "https://example.com"
path = "/webservices/has-oauth1"
headers = {}
headers["Content-Type"] ||= "application/x-www-form-urlencoded"
# see https://github.com/laserlemon/simple_oauth for credentials options
credentials = {
  consumer_key: consumer_key,
  consumer_secret: consumer_secret,
  access_token: nil,
  access_token_secret: nil
}.compact
auth_type = "param"
conn = Faraday.new(url: base_uri) do |builder|
  builder.request :oauth1, auth_type, **credentials
  builder.use Faraday::Response::RaiseError
  builder.adapter Faraday.default_adapter
  builder.headers.update(headers) if headers
end
response = conn.get(path)

Development

After checking out the repo, run bin/setup to install dependencies.

Then, run bin/test to run the tests.

To install this gem onto your local machine, run rake build.

To release a new version, make a commit with a message such as "Bumped to 0.0.2" and then run rake release. See how it works here.

Contributing

Bug reports and pull requests are welcome on GitHub.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 12 Oct 2023

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.