signet-0.7.3/ 0000755 0001750 0001750 00000000000 13043627421 012040 5 ustar pravi pravi signet-0.7.3/CHANGELOG.md 0000644 0001750 0001750 00000006344 13043627421 013660 0 ustar pravi pravi # 0.7.3
* Fix timestamp parsing on 32-bit systems
* Fix expiration check when issue/expiry times are nil
# 0.7.2
* Don't assume Faraday form encoding middleware is present
# 0.7.1
* Fix an issue with date parsing
# 0.7
* No longer overwrite SSL environment variables.
* Tighten up date & URL (de)serialization for OAuth2 client
* Allow Hurley as a connection
* Allow scope as an option in `fetch_access_token!` to request downscoped access tokens
* Add expires_within(sec) method to oauth2 client to facilitate proactive
refreshes
# 0.6.1
* Fix language warnings for unused & shadowed variables ((@blowmage)[])
* Update SSL cert path for OSX ((@gambaroff)[])
* Update JWT library and fix broken tests
* Fix incorrect parameter name in OAuth2 client docs ((@samuelreh)[])
* Fix symbolization of URL parameter keys ((@swifthand)[])
# 0.6.0
* Drop support for ruby versions < 1.9.3
* Update gem dependencies and lock down versions tighter
* Allow form encoded responses when exchanging OAuth 2 authorization codes
* Normalize options keys for indifferent access
# 0.5.1
* Allow Hash objects to be used to initialize authorization URI
* Added PLAINTEXT and RSA-SHA1 signature methods to OAuth 1 support
* Added client object serialization
* The `approval_prompt` option no longer defaults to `:force`
* The `approval_prompt` and `prompt` are now mutually exclusive.
# 0.5.0
* Switched to faraday 0.9.0
* Added `expires_at` option
# 0.4.5
* Minor documentation fixes
* Allow postmessage as a valid redirect_uri in OAuth 2
# 0.4.4
* Add support for assertion profile
# 0.4.3
* Added method to clear credentials
# 0.4.2
* Backwards compatibility for MultiJson
# 0.4.1
* Updated Launchy dependency
# 0.4.0
* Added OAuth 1 server implementation
* Updated Faraday dependency
# 0.3.4
* Attempts to auto-detect CA cert location
# 0.3.3
* Request objects no longer recreated during processing
* Faraday middleware now supported
* Streamed requests now supported
* Fixed assertion profiles; client ID/secret omission no longer an error
# 0.3.2
* Added audience security check for ID tokens
# 0.3.1
* Fixed a warning while determining grant type
* Removed requirement that a connection be supplied when authorizing requests
* Updated addressable dependency to avoid minor bug
* Fixed some documentation stuff around markdown formatting
* Added support for Google Code wiki format output when generating docs
# 0.3.0
* Replaced httpadapter gem dependency with faraday
* Replaced json gem dependency with multi_json
* Updated to OAuth 2.0 draft 22
* Complete test coverage
# 0.2.4
* Updated to incorporate changes to the Google OAuth endpoints
# 0.2.3
* Added support for JWT-formatted ID tokens.
* Added :issued_at option to #update_token! method.
# 0.2.2
* Lowered requirements for json gem
# 0.2.1
* Updated to keep in sync with the new httpadapter changes
# 0.2.0
* Added support for OAuth 2.0 draft 10
# 0.1.4
* Added support for a two-legged authorization flow
# 0.1.3
* Fixed issue with headers passed in as a Hash
* Fixed incompatibilities with Ruby 1.8.6
# 0.1.2
* Fixed bug with overzealous normalization
# 0.1.1
* Fixed bug with missing StringIO require
* Fixed issue with dependency on unreleased features of addressable
# 0.1.0
* Initial release
signet-0.7.3/README.md 0000644 0001750 0001750 00000002763 13043627421 013327 0 ustar pravi pravi # Signet
- Homepage
- http://code.google.com/p/oauth-signet/
- Author
- Bob Aman
- Copyright
- Copyright © 2010 Google, Inc.
- License
- Apache 2.0
[](http://travis-ci.org/google/signet)
[](https://gemnasium.com/google/signet)
## Description
Signet is an OAuth 1.0 / OAuth 2.0 implementation.
## Reference
- {Signet::OAuth1}
- {Signet::OAuth1::Client}
- {Signet::OAuth1::Credential}
- {Signet::OAuth1::Server}
- {Signet::OAuth2}
- {Signet::OAuth2::Client}
## Example Usage for Google
# Initialize the client
``` ruby
require 'signet/oauth_2/client'
client = Signet::OAuth2::Client.new(
:authorization_uri => 'https://accounts.google.com/o/oauth2/auth',
:token_credential_uri => 'https://www.googleapis.com/oauth2/v3/token',
:client_id => '44410190108-74nkm6jc5e3vvjqis803frkvmu88cu3a.apps.googleusercontent.com',
:client_secret => 'X1NUhvO-rQr9sm8uUSMY8i7v',
:scope => 'email profile',
:redirect_uri => 'https://example.client.com/oauth'
)
```
# Request an authorization code
```
redirect_to(client.authorization_uri)
```
# Obtain an access token
```
client.code = request.query['code']
client.fetch_access_token!
```
## Install
`gem install signet`
Be sure `https://rubygems.org` is in your gem sources.
signet-0.7.3/signet.gemspec 0000644 0001750 0001750 00000002630 13043627421 014677 0 ustar pravi pravi # -*- encoding: utf-8 -*-
# stub: signet 0.5.1 ruby lib
require File.join(File.dirname(__FILE__), 'lib/signet', 'version')
Gem::Specification.new do |s|
s.name = "signet"
s.version = Signet::VERSION::STRING
s.required_rubygems_version = ">= 1.3.5"
s.require_paths = ["lib"]
s.authors = ["Bob Aman", "Steven Bazyl"]
s.license = "Apache-2.0"
s.description = "Signet is an OAuth 1.0 / OAuth 2.0 implementation.\n"
s.email = "sbazyl@google.com"
s.extra_rdoc_files = ["README.md"]
s.files = %w(signet.gemspec Rakefile LICENSE CHANGELOG.md README.md Gemfile)
s.files += Dir.glob("lib/**/*.rb")
s.files += Dir.glob("spec/**/*.{rb,opts}")
s.files += Dir.glob("vendor/**/*.rb")
s.files += Dir.glob("tasks/**/*")
s.files += Dir.glob("website/**/*")
s.homepage = "https://github.com/google/signet/"
s.rdoc_options = ["--main", "README.md"]
s.summary = "Signet is an OAuth 1.0 / OAuth 2.0 implementation."
s.add_runtime_dependency 'addressable', '~> 2.3'
s.add_runtime_dependency 'faraday', '~> 0.9'
s.add_runtime_dependency 'multi_json', '~> 1.10'
s.add_runtime_dependency 'jwt', '~> 1.5'
s.add_development_dependency 'rake', '~> 10.0'
s.add_development_dependency 'yard', '~> 0.8'
s.add_development_dependency 'rspec', '~> 3.1'
s.add_development_dependency 'launchy', '~> 2.4'
s.add_development_dependency 'kramdown', '~> 1.5'
s.add_development_dependency 'simplecov', '~> 0.9'
end
signet-0.7.3/lib/ 0000755 0001750 0001750 00000000000 13043627421 012606 5 ustar pravi pravi signet-0.7.3/lib/compat/ 0000755 0001750 0001750 00000000000 13043627421 014071 5 ustar pravi pravi signet-0.7.3/lib/compat/digest/ 0000755 0001750 0001750 00000000000 13043627421 015350 5 ustar pravi pravi signet-0.7.3/lib/compat/digest/hmac.rb 0000644 0001750 0001750 00000004501 13043627421 016605 0 ustar pravi pravi # = digest/hmac.rb
#
# An implementation of HMAC keyed-hashing algorithm
#
# == Overview
#
# This library adds a method named hmac() to Digest classes, which
# creates a Digest class for calculating HMAC digests.
#
# == Examples
#
# require 'digest/hmac'
#
# # one-liner example
# puts Digest::HMAC.hexdigest("data", "hash key", Digest::SHA1)
#
# # rather longer one
# hmac = Digest::HMAC.new("foo", Digest::RMD160)
#
# buf = ""
# while stream.read(16384, buf)
# hmac.update(buf)
# end
#
# puts hmac.bubblebabble
#
# == License
#
# Copyright (c) 2006 Akinori MUSHA
#
# Documentation by Akinori MUSHA
#
# All rights reserved. You can redistribute and/or modify it under
# the same terms as Ruby.
#
# $Id: hmac.rb 14881 2008-01-04 07:26:14Z akr $
#
require 'digest'
if !''.respond_to?(:bytesize) || !''.respond_to?(:bytes)
begin
require 'backports/1.8.7'
rescue LoadError
STDERR.puts "Please install backports:"
STDERR.puts "sudo gem install backports"
exit(1)
end
end
unless defined?(Digest::HMAC)
module Digest
class HMAC < Digest::Class
def initialize(key, digester)
@md = digester.new
block_len = @md.block_length
if key.bytesize > block_len
key = @md.digest(key)
end
ipad = Array.new(block_len).fill(0x36)
opad = Array.new(block_len).fill(0x5c)
key.bytes.each_with_index { |c, i|
ipad[i] ^= c
opad[i] ^= c
}
@key = key.freeze
@ipad = ipad.inject('') { |s, c| s << c.chr }.freeze
@opad = opad.inject('') { |s, c| s << c.chr }.freeze
@md.update(@ipad)
end
def initialize_copy(other)
@md = other.instance_eval { @md.clone }
end
def update(text)
@md.update(text)
self
end
alias << update
def reset
@md.reset
@md.update(@ipad)
self
end
def finish
d = @md.digest!
@md.update(@opad)
@md.update(d)
@md.digest!
end
private :finish
def digest_length
@md.digest_length
end
def block_length
@md.block_length
end
def inspect
sprintf('#<%s: key=%s, digest=%s>', self.class.name, @key.inspect, @md.inspect.sub(/^\#<(.*)>$/) { $1 });
end
end
end
end
signet-0.7.3/lib/compat/multi_json.rb 0000644 0001750 0001750 00000000433 13043627421 016601 0 ustar pravi pravi gem 'multi_json', '>= 1.0.0'
require 'multi_json'
unless MultiJson.respond_to?(:load)
module MultiJson
class <