oauth2-client 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ WqQm��*�Ϳ���2 �BI�����,O#���]ݏ������}'�r���:38C���ֽ�1'���l�����Lp�;�#�ƛ��7���ܟ� ����o�l1�5a�n���$c�ǯK���J<>��כ� ǒR6w9��L!��s,N�L��� 5�H�n~mU���d�q�v3%
2
+ `�����E`�� �W��,d����Y���?f#�<'�� (x��o{|1UA�
3
+ K�K쩂
data/Gemfile CHANGED
@@ -6,6 +6,7 @@ group :test do
6
6
  gem 'json', :platforms => :ruby_18
7
7
  gem 'rspec', '>= 2.11'
8
8
  gem 'simplecov', :require => false
9
+ gem 'coveralls', :require => false
9
10
  gem 'webmock'
10
11
  end
11
12
 
@@ -4,30 +4,40 @@ PATH
4
4
  oauth2-client (1.1.0)
5
5
  addressable
6
6
  bcrypt-ruby (~> 3.0.0)
7
- json
8
7
 
9
8
  GEM
10
9
  remote: https://rubygems.org/
11
10
  specs:
12
11
  addressable (2.3.3)
13
12
  bcrypt-ruby (3.0.1)
13
+ colorize (0.5.8)
14
+ coveralls (0.6.0)
15
+ colorize
16
+ multi_json (~> 1.3)
17
+ rest-client
18
+ simplecov (>= 0.7)
19
+ thor
14
20
  crack (0.3.2)
15
- diff-lcs (1.1.3)
16
- json (1.7.5)
17
- multi_json (1.3.6)
18
- rake (0.9.2.2)
19
- rspec (2.12.0)
20
- rspec-core (~> 2.12.0)
21
- rspec-expectations (~> 2.12.0)
22
- rspec-mocks (~> 2.12.0)
23
- rspec-core (2.12.2)
24
- rspec-expectations (2.12.1)
25
- diff-lcs (~> 1.1.3)
26
- rspec-mocks (2.12.1)
21
+ diff-lcs (1.2.1)
22
+ json (1.7.7)
23
+ mime-types (1.21)
24
+ multi_json (1.6.1)
25
+ rake (10.0.3)
26
+ rest-client (1.6.7)
27
+ mime-types (>= 1.16)
28
+ rspec (2.13.0)
29
+ rspec-core (~> 2.13.0)
30
+ rspec-expectations (~> 2.13.0)
31
+ rspec-mocks (~> 2.13.0)
32
+ rspec-core (2.13.0)
33
+ rspec-expectations (2.13.0)
34
+ diff-lcs (>= 1.1.3, < 2.0)
35
+ rspec-mocks (2.13.0)
27
36
  simplecov (0.7.1)
28
37
  multi_json (~> 1.0)
29
38
  simplecov-html (~> 0.7.1)
30
39
  simplecov-html (0.7.1)
40
+ thor (0.17.0)
31
41
  webmock (1.10.1)
32
42
  addressable (>= 2.2.7)
33
43
  crack (>= 0.3.2)
@@ -37,6 +47,7 @@ PLATFORMS
37
47
 
38
48
  DEPENDENCIES
39
49
  bundler (~> 1.0)
50
+ coveralls
40
51
  json
41
52
  oauth2-client!
42
53
  rake
data/README.md CHANGED
@@ -2,9 +2,13 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/oauth2-client.png)][gem]
4
4
  [![Build Status](https://secure.travis-ci.org/tiabas/oauth2-client.png?branch=master)][travis]
5
+ [![Dependency Status](https://gemnasium.com/tiabas/oauth2-client.png)][gemnasium]
6
+ [![Coverage Status](https://coveralls.io/repos/tiabas/oauth2-client/badge.png?branch=master)][coveralls]
5
7
 
6
8
  [gem]: https://rubygems.org/gems/oauth2-client
7
9
  [travis]: http://travis-ci.org/tiabas/oauth2-client
10
+ [gemnasium]: https://gemnasium.com/tiabas/oauth2-client
11
+ [coveralls]: https://coveralls.io/r/tiabas/oauth2-client
8
12
 
9
13
  A Ruby wrapper for the OAuth 2.0 specification. It is designed with the philosophy that
10
14
  different service providers implement OAuth 2.0 differently and not exactly according to the
@@ -43,11 +47,11 @@ client.authorization_code.authorization_path(:redirect_uri => 'http://localhost/
43
47
  ## Authorization Grants
44
48
  The client wraps around the creation of any given grant and passing in the parameters defined in the configuration
45
49
  file. The supported grants include Authorization Code, Implicit, Resource Owner Password Credentials, Client Credentials.
46
- There is also support for device authentication as described in Google's OAuth 2.0 authentication methods(https://developers.google.com/accounts/docs/OAuth2ForDevices). They are available via the #authorization_code, #implicit, #password, #client_credentials, #refresh_token
47
- and #device methods on a client object.
50
+ There is also support for device authentication as described in Google's OAuth 2.0 authentication methods(https://developers.google.com/accounts/docs/OAuth2ForDevices). They are available via the `authorization_code`, `implicit`, `password`, `client_credentials`, `refresh_token`
51
+ and `device` methods on a client object.
48
52
 
49
- The #get_token method on the grants does not make any assumptions about the format ofthe response from the OAuth provider. The ideal
50
- case would be to treat all responses as JSON. However, some services may respond with in XML instead of JSON. The #get_token method
53
+ The `get_token` method on the grants does not make any assumptions about the format ofthe response from the OAuth provider. The ideal
54
+ case would be to treat all responses as JSON. However, some services may respond with in XML instead of JSON. The `get_token` method
51
55
  therefore, returns with an HTTPResponse object.
52
56
 
53
57
  ### Authorization Code
@@ -92,13 +96,13 @@ token = client.device_code.get_token(device_auth_code)
92
96
  ```
93
97
 
94
98
  # Using a custom Http wrapper
95
- By default, oauth2-client uses a Net::HTTP wrapper called OAuth2::HttpConnection. However, if you wish to use a different HTTP library, you only
99
+ By default, oauth2-client uses a `Net::HTTP` wrapper called `OAuth2::HttpConnection`. However, if you wish to use a different HTTP library, you only
96
100
  need to create a wrapper around your favorite library that will respond to the `send_request` method.
97
101
 
98
102
  ```ruby
99
103
  class TyphoeusHttpConnection
100
104
 
101
- def initalize(site_url, connection_options={})
105
+ def initialize(site_url, connection_options={})
102
106
  # set url and connection options
103
107
  @site_url = site_url
104
108
  @connection_options = connection_options
@@ -185,12 +189,12 @@ response.inspect
185
189
 
186
190
  response.body
187
191
  # => {
188
- "access_token" : "ya91.AHES8ZS-oCZnc5yHepnsosFjNln9ZKLuioF6FcMRCGUIzA",
189
- "token_type" : "Bearer",
190
- "expires_in" : 3600,
191
- "id_token" : "eyJhbGciOiJSUzI1NiIsImtpZCI6IjY4ZGM2ZmIxNDQ5OGJmMWRhNjNiMWYyMDA2YmRmMDA2N2Q4MzY",
192
- "refresh_token" : "6/Ju8uhi9xOctGEyHRzWwHhaYimfxmY0tiJ_qW3qvjWXM"
193
- }
192
+ # "access_token" : "ya91.AHES8ZS-oCZnc5yHepnsosFjNln9ZKLuioF6FcMRCGUIzA",
193
+ # "token_type" : "Bearer",
194
+ # "expires_in" : 3600,
195
+ # "id_token" : "eyJhbGciOiJSUzI1NiIsImtpZCI6IjY4ZGM2ZmIxNDQ5OGJmMWRhNjNiMWYyMDA2YmRmMDA2N2Q4MzY",
196
+ # "refresh_token" : "6/Ju8uhi9xOctGEyHRzWwHhaYimfxmY0tiJ_qW3qvjWXM"
197
+ #}
194
198
  ```
195
199
 
196
200
  ## Github Client
@@ -219,9 +223,9 @@ response.inspect
219
223
 
220
224
  response.body
221
225
  # => {
222
- "access_token" : "e409f4272fe539166a77c42479de030e7660812a",
223
- "token_type" : "bearer"
224
- }"
226
+ # "access_token" : "e409f4272fe539166a77c42479de030e7660812a",
227
+ # "token_type" : "bearer"
228
+ # }"
225
229
  ```
226
230
 
227
231
  ## Supported Ruby Versions
@@ -0,0 +1,21 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MREwDwYDVQQDDAh0aWFi
3
+ YXNuazEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
4
+ MB4XDTEzMDMwMzA2MjAxNVoXDTE0MDMwMzA2MjAxNVowPzERMA8GA1UEAwwIdGlh
5
+ YmFzbmsxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
6
+ bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMsmVsErcNuwQLKLh9T6
7
+ a57QiK35g9zjpID2pUBn4alMTmIeAXg2bXWLdAzU0swcjmaGBWz5AaZeqTnnBveO
8
+ ZDoH6e811uuRjJMYCkLQxhlghEB0TQkAqOnxlj80TN2jFw+YFWLmSnxR4PBonvpp
9
+ YwWAY0ylqM54FPRhaAIYC5/3Pvx1SYL9/Us0376HEpV0Rty6VXz7tUzv8vFki5ot
10
+ gyfp5ceWiYIZjQ9Uvhm4luJSfXci13UHZ0AeO7E1padWlx3z8hZIvjawueTGRe5p
11
+ BgZlI0+xV2ogvAlu8/NCy0hWUwcpnvRdPyBVDRMli8gXGE9jNv8dBWe67vdjzGSk
12
+ YDUCAwEAAaN3MHUwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFInh
13
+ qvJkuISNqDOcsrBRotZC0qolMB0GA1UdEQQWMBSBEnRpYWJhc25rQGdtYWlsLmNv
14
+ bTAdBgNVHRIEFjAUgRJ0aWFiYXNua0BnbWFpbC5jb20wDQYJKoZIhvcNAQEFBQAD
15
+ ggEBAEGb4gRDulJ9jkf5oRLydfw9UZi6fVWj6aaiJfbbT5NLotpVaWnWdCOO7hy8
16
+ HDPYWN430zLwr0ODOU9XNueKnEkhnBRiYkcQ0JmYddPkL57kp0qlH4g2IqQfQV2W
17
+ 1b7sE410zFHn55B5nihQY3c0MMSL7wq9Dz2EktbIMikf6sG6zfUgYFE4IQGi2RbO
18
+ xa5fnTWt7KB5DD02HnHLTZ9Hl2kxlPyWwyjREwNwEjPoSUJFEBiosvAml8frUDA9
19
+ j6fATg/4fqpgILPVqFIGZOMJDFcJy/oehwwxLu5XMx88WFD9jT1vRj77D7iPLbXd
20
+ rfGs/qCJKgifXd/1am5hlAH5jXU=
21
+ -----END CERTIFICATE-----
@@ -2,7 +2,7 @@ module OAuth2
2
2
  class Version
3
3
  MAJOR = 1 unless defined? OAuth2::Version::MAJOR
4
4
  MINOR = 1 unless defined? OAuth2::Version::MINOR
5
- PATCH = 0 unless defined? OAuth2::Version::PATCH
5
+ PATCH = 1 unless defined? OAuth2::Version::PATCH
6
6
 
7
7
  def self.to_s
8
8
  [MAJOR, MINOR, PATCH].compact.join('.')
@@ -3,21 +3,23 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
  require 'oauth2/version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
- spec.add_dependency 'json'
7
6
  spec.add_dependency 'bcrypt-ruby', '~> 3.0.0'
8
7
  spec.add_dependency 'addressable'
9
8
  spec.add_development_dependency 'bundler', '~> 1.0'
10
9
 
11
- spec.name = 'oauth2-client'
12
- spec.version = OAuth2::Version
10
+ spec.authors = ["Kevin Mutyaba"]
13
11
  spec.date = %q{2013-03-03}
14
- spec.summary = "OAuth2 client wrapper in Ruby"
15
12
  spec.description = "Create quick and dirty OAuth2 clients"
16
- spec.authors = ["Kevin Mutyaba"]
17
13
  spec.email = %q{tiabasnk@gmail.com}
18
- spec.homepage = 'http://tiabas.github.com/oauth2-client/'
19
14
  spec.files = `git ls-files`.split("\n")
20
- spec.require_paths = ['lib']
15
+ spec.homepage = 'http://tiabas.github.com/oauth2-client/'
21
16
  spec.licenses = ['MIT']
17
+ spec.name = 'oauth2-client'
18
+ spec.require_paths = ['lib']
22
19
  spec.required_rubygems_version = '>= 1.3.6'
20
+ spec.summary = "OAuth2 client wrapper in Ruby"
21
+ spec.version = OAuth2::Version
22
+
23
+ spec.cert_chain = ['certs/tiabas.pem']
24
+ spec.signing_key = File.expand_path("~/.gem/certs/private_key.pem")
23
25
  end
@@ -1,12 +1,20 @@
1
1
  $:.unshift File.expand_path('../../examples', __FILE__)
2
2
 
3
- # require 'simplecov'
4
- # SimpleCov.start
3
+ require 'simplecov'
4
+ require 'coveralls'
5
5
 
6
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
7
+ SimpleCov::Formatter::HTMLFormatter,
8
+ Coveralls::SimpleCov::Formatter
9
+ ]
10
+ SimpleCov.start
11
+
12
+ require 'oauth2'
6
13
  require 'rspec'
7
14
  require 'rspec/autorun'
8
15
  require 'webmock/rspec'
9
- require 'oauth2'
16
+
17
+ WebMock.disable_net_connect!(:allow => 'coveralls.io')
10
18
 
11
19
  RSpec.configure do |config|
12
20
  config.mock_with :rspec
metadata CHANGED
@@ -1,32 +1,49 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oauth2-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Kevin Mutyaba
8
9
  autorequire:
9
10
  bindir: bin
10
- cert_chain: []
11
+ cert_chain:
12
+ - !binary |-
13
+ LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURjRENDQWxpZ0F3SUJB
14
+ Z0lCQVRBTkJna3Foa2lHOXcwQkFRVUZBREEvTVJFd0R3WURWUVFEREFoMGFX
15
+ RmkKWVhOdWF6RVZNQk1HQ2dtU0pvbVQ4aXhrQVJrV0JXZHRZV2xzTVJNd0VR
16
+ WUtDWkltaVpQeUxHUUJHUllEWTI5dApNQjRYRFRFek1ETXdNekEyTWpBeE5W
17
+ b1hEVEUwTURNd016QTJNakF4TlZvd1B6RVJNQThHQTFVRUF3d0lkR2xoCllt
18
+ RnpibXN4RlRBVEJnb0praWFKay9Jc1pBRVpGZ1ZuYldGcGJERVRNQkVHQ2dt
19
+ U0pvbVQ4aXhrQVJrV0EyTnYKYlRDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFB
20
+ RGdnRVBBRENDQVFvQ2dnRUJBTXNtVnNFcmNOdXdRTEtMaDlUNgphNTdRaUsz
21
+ NWc5empwSUQycFVCbjRhbE1UbUllQVhnMmJYV0xkQXpVMHN3Y2ptYUdCV3o1
22
+ QWFaZXFUbm5CdmVPClpEb0g2ZTgxMXV1UmpKTVlDa0xReGhsZ2hFQjBUUWtB
23
+ cU9ueGxqODBUTjJqRncrWUZXTG1TbnhSNFBCb252cHAKWXdXQVkweWxxTTU0
24
+ RlBSaGFBSVlDNS8zUHZ4MVNZTDkvVXMwMzc2SEVwVjBSdHk2Vlh6N3RVenY4
25
+ dkZraTVvdApneWZwNWNlV2lZSVpqUTlVdmhtNGx1SlNmWGNpMTNVSFowQWVP
26
+ N0UxcGFkV2x4M3o4aFpJdmphd3VlVEdSZTVwCkJnWmxJMCt4VjJvZ3ZBbHU4
27
+ L05DeTBoV1V3Y3BudlJkUHlCVkRSTWxpOGdYR0U5ak52OGRCV2U2N3ZkanpH
28
+ U2sKWURVQ0F3RUFBYU4zTUhVd0NRWURWUjBUQkFJd0FEQUxCZ05WSFE4RUJB
29
+ TUNCTEF3SFFZRFZSME9CQllFRkluaApxdkprdUlTTnFET2NzckJSb3RaQzBx
30
+ b2xNQjBHQTFVZEVRUVdNQlNCRW5ScFlXSmhjMjVyUUdkdFlXbHNMbU52CmJU
31
+ QWRCZ05WSFJJRUZqQVVnUkowYVdGaVlYTnVhMEJuYldGcGJDNWpiMjB3RFFZ
32
+ SktvWklodmNOQVFFRkJRQUQKZ2dFQkFFR2I0Z1JEdWxKOWprZjVvUkx5ZGZ3
33
+ OVVaaTZmVldqNmFhaUpmYmJUNU5Mb3RwVmFXbldkQ09PN2h5OApIRFBZV040
34
+ MzB6THdyME9ET1U5WE51ZUtuRWtobkJSaVlrY1EwSm1ZZGRQa0w1N2twMHFs
35
+ SDRnMklxUWZRVjJXCjFiN3NFNDEwekZIbjU1QjVuaWhRWTNjME1NU0w3d3E5
36
+ RHoyRWt0YklNaWtmNnNHNnpmVWdZRkU0SVFHaTJSYk8KeGE1Zm5UV3Q3S0I1
37
+ REQwMkhuSExUWjlIbDJreGxQeVd3eWpSRXdOd0VqUG9TVUpGRUJpb3N2QW1s
38
+ OGZyVURBOQpqNmZBVGcvNGZxcGdJTFBWcUZJR1pPTUpERmNKeS9vZWh3d3hM
39
+ dTVYTXg4OFdGRDlqVDF2Umo3N0Q3aVBMYlhkCnJmR3MvcUNKS2dpZlhkLzFh
40
+ bTVobEFINWpYVT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
11
41
  date: 2013-03-03 00:00:00.000000000 Z
12
42
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: json
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ! '>='
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ! '>='
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
43
  - !ruby/object:Gem::Dependency
28
44
  name: bcrypt-ruby
29
45
  requirement: !ruby/object:Gem::Requirement
46
+ none: false
30
47
  requirements:
31
48
  - - ~>
32
49
  - !ruby/object:Gem::Version
@@ -34,6 +51,7 @@ dependencies:
34
51
  type: :runtime
35
52
  prerelease: false
36
53
  version_requirements: !ruby/object:Gem::Requirement
54
+ none: false
37
55
  requirements:
38
56
  - - ~>
39
57
  - !ruby/object:Gem::Version
@@ -41,6 +59,7 @@ dependencies:
41
59
  - !ruby/object:Gem::Dependency
42
60
  name: addressable
43
61
  requirement: !ruby/object:Gem::Requirement
62
+ none: false
44
63
  requirements:
45
64
  - - ! '>='
46
65
  - !ruby/object:Gem::Version
@@ -48,6 +67,7 @@ dependencies:
48
67
  type: :runtime
49
68
  prerelease: false
50
69
  version_requirements: !ruby/object:Gem::Requirement
70
+ none: false
51
71
  requirements:
52
72
  - - ! '>='
53
73
  - !ruby/object:Gem::Version
@@ -55,6 +75,7 @@ dependencies:
55
75
  - !ruby/object:Gem::Dependency
56
76
  name: bundler
57
77
  requirement: !ruby/object:Gem::Requirement
78
+ none: false
58
79
  requirements:
59
80
  - - ~>
60
81
  - !ruby/object:Gem::Version
@@ -62,6 +83,7 @@ dependencies:
62
83
  type: :development
63
84
  prerelease: false
64
85
  version_requirements: !ruby/object:Gem::Requirement
86
+ none: false
65
87
  requirements:
66
88
  - - ~>
67
89
  - !ruby/object:Gem::Version
@@ -79,6 +101,7 @@ files:
79
101
  - LICENSE.md
80
102
  - README.md
81
103
  - Rakefile
104
+ - certs/tiabas.pem
82
105
  - doc/README
83
106
  - examples/github_client.rb
84
107
  - examples/google_client.rb
@@ -114,25 +137,26 @@ files:
114
137
  homepage: http://tiabas.github.com/oauth2-client/
115
138
  licenses:
116
139
  - MIT
117
- metadata: {}
118
140
  post_install_message:
119
141
  rdoc_options: []
120
142
  require_paths:
121
143
  - lib
122
144
  required_ruby_version: !ruby/object:Gem::Requirement
145
+ none: false
123
146
  requirements:
124
147
  - - ! '>='
125
148
  - !ruby/object:Gem::Version
126
149
  version: '0'
127
150
  required_rubygems_version: !ruby/object:Gem::Requirement
151
+ none: false
128
152
  requirements:
129
153
  - - ! '>='
130
154
  - !ruby/object:Gem::Version
131
155
  version: 1.3.6
132
156
  requirements: []
133
157
  rubyforge_project:
134
- rubygems_version: 2.0.0
158
+ rubygems_version: 1.8.25
135
159
  signing_key:
136
- specification_version: 4
160
+ specification_version: 3
137
161
  summary: OAuth2 client wrapper in Ruby
138
162
  test_files: []
Binary file
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- N2U2ZjkyMjc5YjBhZWE1MjE3YTZjZDEzMjM4M2Y0MDZlYTA3MmU0YQ==
5
- data.tar.gz: !binary |-
6
- M2NhZDBhYjljNzVmY2ZkYTEwNjcxZGI4MmRjNTUxODhhOTNlMzYzMQ==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- MzJhY2RiOWQ4ZWFkZTZjNmI2YmRhYWYyOGUzZTBiM2YzNmJmZWY0ZTgyZTRj
10
- M2IwYTkyOTgxM2MzZmQ1MzhlODYyOGM4YjEwZGJhZWZkNDg3ZDA4YzEyNWVk
11
- NDQxNWM0N2QzYjRiZmM2Y2UwMzc4MzRlOTQ1OGQ2YjBjNTk5NTg=
12
- data.tar.gz: !binary |-
13
- ZGU0YmRiM2Y5YjRlNzUzMTdmNTA0ZWVjOGIzMzViNDliNzQxNjk0OWNiN2Zj
14
- MDVjYjYxYzUxYTRiN2I0ZDJjYjQxZDc0YmEyZmI4ZWQ4YjFhNjMwYjVlMTcy
15
- YzUwNGFjNDlmZDM4YjU1ODVlMDc1MGIzMDE5ZTViYmU3YTNjNjY=