signet 0.1.4 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +4 -0
- data/README +3 -0
- data/lib/signet.rb +54 -0
- data/lib/signet/errors.rb +44 -9
- data/lib/signet/oauth_1.rb +20 -19
- data/lib/signet/oauth_1/client.rb +23 -13
- data/lib/signet/oauth_2.rb +148 -0
- data/lib/signet/oauth_2/client.rb +851 -0
- data/lib/signet/version.rb +4 -4
- data/spec/signet/oauth_1_spec.rb +25 -2
- data/spec/signet/oauth_2/client_spec.rb +70 -0
- data/spec/signet/oauth_2_spec.rb +164 -0
- data/spec/signet_spec.rb +80 -0
- data/tasks/gem.rake +1 -0
- data/tasks/spec.rake +4 -2
- metadata +38 -17
data/lib/signet/version.rb
CHANGED
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
|
|
15
15
|
# Used to prevent the class/module from being loaded more than once
|
|
16
16
|
unless defined? Signet::VERSION
|
|
17
|
-
module Signet
|
|
18
|
-
module VERSION
|
|
17
|
+
module Signet
|
|
18
|
+
module VERSION
|
|
19
19
|
MAJOR = 0
|
|
20
|
-
MINOR =
|
|
21
|
-
TINY =
|
|
20
|
+
MINOR = 2
|
|
21
|
+
TINY = 0
|
|
22
22
|
|
|
23
23
|
STRING = [MAJOR, MINOR, TINY].join('.')
|
|
24
24
|
end
|
data/spec/signet/oauth_1_spec.rb
CHANGED
|
@@ -350,6 +350,29 @@ describe Signet::OAuth1 do
|
|
|
350
350
|
parameters['oauth_version'].should == '1.0'
|
|
351
351
|
end
|
|
352
352
|
|
|
353
|
+
it 'should not unescape a realm in an authorization header' do
|
|
354
|
+
parameters = Signet::OAuth1.parse_authorization_header(
|
|
355
|
+
'OAuth realm="http%3A%2F%2Fsp.example.com%2F", ' +
|
|
356
|
+
'domain="http%3A%2F%2Fsp.example.com%2F", ' +
|
|
357
|
+
'oauth_consumer_key="0685bd9184jfhq22", ' +
|
|
358
|
+
'oauth_token="ad180jjd733klru7", ' +
|
|
359
|
+
'oauth_signature_method="HMAC-SHA1", ' +
|
|
360
|
+
'oauth_signature="wOJIO9A2W5mFwDgiDvZbTSMK%2FPY%3D", ' +
|
|
361
|
+
'oauth_timestamp="137131200", ' +
|
|
362
|
+
'oauth_nonce="4572616e48616d6d65724c61686176", ' +
|
|
363
|
+
'oauth_version="1.0"'
|
|
364
|
+
).inject({}) { |h,(k,v)| h[k]=v; h }
|
|
365
|
+
parameters['realm'].should == 'http%3A%2F%2Fsp.example.com%2F'
|
|
366
|
+
parameters['domain'].should == 'http://sp.example.com/'
|
|
367
|
+
parameters['oauth_consumer_key'].should == '0685bd9184jfhq22'
|
|
368
|
+
parameters['oauth_token'].should == 'ad180jjd733klru7'
|
|
369
|
+
parameters['oauth_signature_method'].should == 'HMAC-SHA1'
|
|
370
|
+
parameters['oauth_signature'].should == 'wOJIO9A2W5mFwDgiDvZbTSMK/PY='
|
|
371
|
+
parameters['oauth_timestamp'].should == '137131200'
|
|
372
|
+
parameters['oauth_nonce'].should == '4572616e48616d6d65724c61686176'
|
|
373
|
+
parameters['oauth_version'].should == '1.0'
|
|
374
|
+
end
|
|
375
|
+
|
|
353
376
|
it 'should raise an error if parsing an authorization header ' +
|
|
354
377
|
'with bogus values' do
|
|
355
378
|
(lambda do
|
|
@@ -362,7 +385,7 @@ describe Signet::OAuth1 do
|
|
|
362
385
|
Signet::OAuth1.parse_authorization_header(
|
|
363
386
|
'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
|
|
364
387
|
)
|
|
365
|
-
end).should raise_error(
|
|
388
|
+
end).should raise_error(Signet::ParseError)
|
|
366
389
|
end
|
|
367
390
|
|
|
368
391
|
it 'should correctly parse a form encoded credential' do
|
|
@@ -421,7 +444,7 @@ describe Signet::OAuth1 do
|
|
|
421
444
|
parameters = {
|
|
422
445
|
"oauth_consumer_key" => "dpf43f3p2l4k3l03",
|
|
423
446
|
"oauth_token" => "nnch734d00sl2jdk",
|
|
424
|
-
"oauth_signature_method" => "HMAC-BOGUS",
|
|
447
|
+
"oauth_signature_method" => "HMAC-BOGUS", # Unknown signature method
|
|
425
448
|
"oauth_timestamp" => "1191242096",
|
|
426
449
|
"oauth_nonce" => "kllo9940pd9333jh",
|
|
427
450
|
"oauth_version" => "1.0",
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Copyright (C) 2010 Google Inc.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
require 'spec_helper'
|
|
16
|
+
|
|
17
|
+
require 'signet/oauth_2/client'
|
|
18
|
+
|
|
19
|
+
describe Signet::OAuth2::Client, 'unconfigured' do
|
|
20
|
+
before do
|
|
21
|
+
@client = Signet::OAuth2::Client.new
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
it 'should have no authorization_uri' do
|
|
25
|
+
@client.authorization_uri.should == nil
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
it 'should allow the authorization_uri to be set to a String' do
|
|
29
|
+
@client.authorization_uri = 'https://example.com/authorize'
|
|
30
|
+
@client.client_id = 's6BhdRkqt3'
|
|
31
|
+
@client.redirect_uri = 'https://example.client.com/callback'
|
|
32
|
+
@client.authorization_uri.to_s.should include(
|
|
33
|
+
'https://example.com/authorize'
|
|
34
|
+
)
|
|
35
|
+
@client.authorization_uri.query_values['client_id'].should == 's6BhdRkqt3'
|
|
36
|
+
@client.authorization_uri.query_values['redirect_uri'].should == (
|
|
37
|
+
'https://example.client.com/callback'
|
|
38
|
+
)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
it 'should allow the authorization_uri to be set to a URI' do
|
|
42
|
+
@client.authorization_uri =
|
|
43
|
+
Addressable::URI.parse('https://example.com/authorize')
|
|
44
|
+
@client.client_id = 's6BhdRkqt3'
|
|
45
|
+
@client.redirect_uri =
|
|
46
|
+
Addressable::URI.parse('https://example.client.com/callback')
|
|
47
|
+
@client.authorization_uri.to_s.should include(
|
|
48
|
+
'https://example.com/authorize'
|
|
49
|
+
)
|
|
50
|
+
@client.authorization_uri.query_values['client_id'].should == 's6BhdRkqt3'
|
|
51
|
+
@client.authorization_uri.query_values['redirect_uri'].should == (
|
|
52
|
+
'https://example.client.com/callback'
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
it 'should have no token_credential_uri' do
|
|
57
|
+
@client.token_credential_uri.should == nil
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
it 'should allow the token_credential_uri to be set to a String' do
|
|
61
|
+
@client.token_credential_uri = "https://example.com/token"
|
|
62
|
+
@client.token_credential_uri.should === "https://example.com/token"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
it 'should allow the token_credential_uri to be set to a URI' do
|
|
66
|
+
@client.token_credential_uri =
|
|
67
|
+
Addressable::URI.parse("https://example.com/token")
|
|
68
|
+
@client.token_credential_uri.should === "https://example.com/token"
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# Copyright (C) 2010 Google Inc.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
require 'spec_helper'
|
|
16
|
+
|
|
17
|
+
require 'signet/oauth_2'
|
|
18
|
+
|
|
19
|
+
describe Signet::OAuth2 do
|
|
20
|
+
# This behavior will almost certainly change in subsequent updates.
|
|
21
|
+
describe 'when parsing an Authorization header' do
|
|
22
|
+
it 'should correctly handle HTTP Basic auth-scheme' do
|
|
23
|
+
parameters = Signet::OAuth2.parse_authorization_header(
|
|
24
|
+
'Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW'
|
|
25
|
+
).inject({}) { |h,(k,v)| h[k]=v; h }
|
|
26
|
+
parameters['client_id'].should == 's6BhdRkqt3'
|
|
27
|
+
parameters['client_secret'].should == 'gX1fBat3bV'
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it 'should correctly handle OAuth auth-scheme' do
|
|
31
|
+
parameters = Signet::OAuth2.parse_authorization_header(
|
|
32
|
+
'OAuth vF9dft4qmT'
|
|
33
|
+
).inject({}) { |h,(k,v)| h[k]=v; h }
|
|
34
|
+
parameters['access_token'].should == 'vF9dft4qmT'
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
it 'should correctly handle OAuth auth-scheme with realm' do
|
|
38
|
+
parameters = Signet::OAuth2.parse_authorization_header(
|
|
39
|
+
'OAuth vF9dft4qmT, realm="http://sp.example.com/"'
|
|
40
|
+
).inject({}) { |h,(k,v)| h[k]=v; h }
|
|
41
|
+
parameters['access_token'].should == 'vF9dft4qmT'
|
|
42
|
+
parameters['realm'].should == 'http://sp.example.com/'
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
it 'should correctly handle OAuth auth-scheme with multiple auth-params' do
|
|
46
|
+
parameters = Signet::OAuth2.parse_authorization_header(
|
|
47
|
+
'OAuth vF9dft4qmT, first="one", second="two"'
|
|
48
|
+
).inject({}) { |h,(k,v)| h[k]=v; h }
|
|
49
|
+
parameters['access_token'].should == 'vF9dft4qmT'
|
|
50
|
+
parameters['first'].should == 'one'
|
|
51
|
+
parameters['second'].should == 'two'
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
it 'should liberally handle auth-params with single-quoted strings' do
|
|
55
|
+
parameters = Signet::OAuth2.parse_authorization_header(
|
|
56
|
+
'OAuth vF9dft4qmT, first=\'one\', second=\'two\''
|
|
57
|
+
).inject({}) { |h,(k,v)| h[k]=v; h }
|
|
58
|
+
parameters['access_token'].should == 'vF9dft4qmT'
|
|
59
|
+
parameters['first'].should == 'one'
|
|
60
|
+
parameters['second'].should == 'two'
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
it 'should liberally handle auth-params with unquoted strings' do
|
|
64
|
+
parameters = Signet::OAuth2.parse_authorization_header(
|
|
65
|
+
'OAuth vF9dft4qmT, first=one, second=two'
|
|
66
|
+
).inject({}) { |h,(k,v)| h[k]=v; h }
|
|
67
|
+
parameters['access_token'].should == 'vF9dft4qmT'
|
|
68
|
+
parameters['first'].should == 'one'
|
|
69
|
+
parameters['second'].should == 'two'
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
it 'should not allow unquoted strings that do not match tchar' do
|
|
73
|
+
(lambda do
|
|
74
|
+
parameters = Signet::OAuth2.parse_authorization_header(
|
|
75
|
+
'OAuth vF9dft4qmT, first=one:1'
|
|
76
|
+
)
|
|
77
|
+
end).should raise_error(Signet::ParseError)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
it 'should not parse non-OAuth auth-schemes' do
|
|
81
|
+
(lambda do
|
|
82
|
+
Signet::OAuth2.parse_authorization_header(
|
|
83
|
+
'AuthSub token="GD32CMCL25aZ-v____8B"'
|
|
84
|
+
)
|
|
85
|
+
end).should raise_error(Signet::ParseError)
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# This behavior will almost certainly change in subsequent updates.
|
|
90
|
+
describe 'when parsing a WWW-Authenticate header' do
|
|
91
|
+
it 'should correctly handle OAuth challenge with auth-params' do
|
|
92
|
+
parameters = Signet::OAuth2.parse_www_authenticate_header(
|
|
93
|
+
'OAuth realm="http://sp.example.com/", error="expired_token", ' +
|
|
94
|
+
'error_description="The access token has expired."'
|
|
95
|
+
).inject({}) { |h,(k,v)| h[k]=v; h }
|
|
96
|
+
parameters['realm'].should == 'http://sp.example.com/'
|
|
97
|
+
parameters['error'].should == 'expired_token'
|
|
98
|
+
parameters['error_description'].should == 'The access token has expired.'
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
it 'should liberally handle auth-params with single-quoted strings' do
|
|
102
|
+
parameters = Signet::OAuth2.parse_www_authenticate_header(
|
|
103
|
+
'OAuth realm=\'http://sp.example.com/\', error=\'expired_token\', ' +
|
|
104
|
+
'error_description=\'The access token has expired.\''
|
|
105
|
+
).inject({}) { |h,(k,v)| h[k]=v; h }
|
|
106
|
+
parameters['realm'].should == 'http://sp.example.com/'
|
|
107
|
+
parameters['error'].should == 'expired_token'
|
|
108
|
+
parameters['error_description'].should == 'The access token has expired.'
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
it 'should liberally handle auth-params with token strings' do
|
|
112
|
+
parameters = Signet::OAuth2.parse_www_authenticate_header(
|
|
113
|
+
'OAuth realm="http://sp.example.com/", error=expired_token, ' +
|
|
114
|
+
'error_description="The access token has expired."'
|
|
115
|
+
).inject({}) { |h,(k,v)| h[k]=v; h }
|
|
116
|
+
parameters['realm'].should == 'http://sp.example.com/'
|
|
117
|
+
parameters['error'].should == 'expired_token'
|
|
118
|
+
parameters['error_description'].should == 'The access token has expired.'
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
it 'should liberally handle out-of-order auth-params' do
|
|
122
|
+
parameters = Signet::OAuth2.parse_www_authenticate_header(
|
|
123
|
+
'OAuth error_description=\'The access token has expired.\', ' +
|
|
124
|
+
'error=\'expired_token\', realm=\'http://sp.example.com/\''
|
|
125
|
+
).inject({}) { |h,(k,v)| h[k]=v; h }
|
|
126
|
+
parameters['realm'].should == 'http://sp.example.com/'
|
|
127
|
+
parameters['error'].should == 'expired_token'
|
|
128
|
+
parameters['error_description'].should == 'The access token has expired.'
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
it 'should not allow unquoted strings that do not match tchar' do
|
|
132
|
+
(lambda do
|
|
133
|
+
Signet::OAuth2.parse_www_authenticate_header(
|
|
134
|
+
'OAuth realm=http://sp.example.com/, error=expired_token, ' +
|
|
135
|
+
'error_description="The access token has expired."'
|
|
136
|
+
)
|
|
137
|
+
end).should raise_error(Signet::ParseError)
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
it 'should not parse non-OAuth challenges' do
|
|
141
|
+
(lambda do
|
|
142
|
+
Signet::OAuth2.parse_www_authenticate_header(
|
|
143
|
+
'AuthSub realm="https://www.google.com/accounts/AuthSubRequest"'
|
|
144
|
+
)
|
|
145
|
+
end).should raise_error(Signet::ParseError)
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
describe 'when generating a Basic Authorization header' do
|
|
150
|
+
it 'should correctly handle client ID and password pairs' do
|
|
151
|
+
# Example from OAuth 2 spec
|
|
152
|
+
Signet::OAuth2.generate_basic_authorization_header(
|
|
153
|
+
's6BhdRkqt3', 'gX1fBat3bV'
|
|
154
|
+
).should == 'Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW'
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
it 'should correctly encode using the alogrithm given in RFC 2617' do
|
|
158
|
+
# Example from RFC 2617
|
|
159
|
+
Signet::OAuth2.generate_basic_authorization_header(
|
|
160
|
+
'Aladdin', 'open sesame'
|
|
161
|
+
).should == 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
end
|
data/spec/signet_spec.rb
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Copyright (C) 2010 Google Inc.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
require 'spec_helper'
|
|
16
|
+
|
|
17
|
+
require 'signet/oauth_2'
|
|
18
|
+
|
|
19
|
+
describe Signet do
|
|
20
|
+
describe 'when parsing an auth param list' do
|
|
21
|
+
it 'should correctly handle commas' do
|
|
22
|
+
parameters = Signet.parse_auth_param_list(
|
|
23
|
+
'a="1, 2" , b="3,4",c="5 , 6" ,d="7 ,8"'
|
|
24
|
+
).inject({}) { |h,(k,v)| h[k]=v; h }
|
|
25
|
+
parameters['a'].should == '1, 2'
|
|
26
|
+
parameters['b'].should == '3,4'
|
|
27
|
+
parameters['c'].should == '5 , 6'
|
|
28
|
+
parameters['d'].should == '7 ,8'
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
it 'should correctly handle backslash-escaped pairs' do
|
|
32
|
+
parameters = Signet.parse_auth_param_list(
|
|
33
|
+
'token="\t\o\k\e\n" sigalg="\s\i\g\a\l\g" data="\d\a\t\a"'
|
|
34
|
+
).inject({}) { |h,(k,v)| h[k]=v; h }
|
|
35
|
+
parameters['token'].should == 'token'
|
|
36
|
+
parameters['sigalg'].should == 'sigalg'
|
|
37
|
+
parameters['data'].should == 'data'
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
it 'should liberally handle space-separated auth-param lists' do
|
|
41
|
+
parameters = Signet.parse_auth_param_list(
|
|
42
|
+
'token="token" sigalg="sigalg" data="data" sig="sig"'
|
|
43
|
+
).inject({}) { |h,(k,v)| h[k]=v; h }
|
|
44
|
+
parameters['token'].should == 'token'
|
|
45
|
+
parameters['sigalg'].should == 'sigalg'
|
|
46
|
+
parameters['data'].should == 'data'
|
|
47
|
+
parameters['sig'].should == 'sig'
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
it 'should liberally handle single-quoted auth-param lists' do
|
|
51
|
+
parameters = Signet.parse_auth_param_list(
|
|
52
|
+
'token=\'token\' sigalg=\'sigalg\' data=\'data\' sig=\'sig\''
|
|
53
|
+
).inject({}) { |h,(k,v)| h[k]=v; h }
|
|
54
|
+
parameters['token'].should == 'token'
|
|
55
|
+
parameters['sigalg'].should == 'sigalg'
|
|
56
|
+
parameters['data'].should == 'data'
|
|
57
|
+
parameters['sig'].should == 'sig'
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
it 'should liberally handle unquoted auth-param lists' do
|
|
61
|
+
parameters = Signet.parse_auth_param_list(
|
|
62
|
+
'token=token sigalg=sigalg data=data sig=sig'
|
|
63
|
+
).inject({}) { |h,(k,v)| h[k]=v; h }
|
|
64
|
+
parameters['token'].should == 'token'
|
|
65
|
+
parameters['sigalg'].should == 'sigalg'
|
|
66
|
+
parameters['data'].should == 'data'
|
|
67
|
+
parameters['sig'].should == 'sig'
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
it 'should liberally handle auth-param lists with empty sections' do
|
|
71
|
+
parameters = Signet.parse_auth_param_list(
|
|
72
|
+
'token=token, , sigalg=sigalg,, data=data, sig=sig'
|
|
73
|
+
).inject({}) { |h,(k,v)| h[k]=v; h }
|
|
74
|
+
parameters['token'].should == 'token'
|
|
75
|
+
parameters['sigalg'].should == 'sigalg'
|
|
76
|
+
parameters['data'].should == 'data'
|
|
77
|
+
parameters['sig'].should == 'sig'
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
data/tasks/gem.rake
CHANGED
|
@@ -24,6 +24,7 @@ namespace :gem do
|
|
|
24
24
|
|
|
25
25
|
s.add_runtime_dependency("httpadapter", "~> 0.2.0")
|
|
26
26
|
s.add_runtime_dependency("addressable", "~> 2.2.1")
|
|
27
|
+
s.add_runtime_dependency("json", "~> 1.5.0")
|
|
27
28
|
|
|
28
29
|
s.add_development_dependency("rake", "~> 0.8.3")
|
|
29
30
|
s.add_development_dependency("rspec", "~> 1.1.11")
|
data/tasks/spec.rake
CHANGED
|
@@ -15,11 +15,13 @@ namespace :spec do
|
|
|
15
15
|
t.rcov = false
|
|
16
16
|
end
|
|
17
17
|
t.rcov_opts = [
|
|
18
|
+
'--exclude', 'lib\\/compat',
|
|
18
19
|
'--exclude', 'spec',
|
|
19
|
-
'--exclude', '
|
|
20
|
+
'--exclude', '\\.rvm\\/gems',
|
|
20
21
|
'--exclude', '1\\.8\\/gems',
|
|
21
22
|
'--exclude', '1\\.9\\/gems',
|
|
22
|
-
'--exclude', '\\.rvm'
|
|
23
|
+
'--exclude', '\\.rvm',
|
|
24
|
+
'--exclude', '\\/Library\\/Ruby'
|
|
23
25
|
]
|
|
24
26
|
end
|
|
25
27
|
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: signet
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
5
|
-
prerelease:
|
|
4
|
+
hash: 23
|
|
5
|
+
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
version: 0.
|
|
8
|
+
- 2
|
|
9
|
+
- 0
|
|
10
|
+
version: 0.2.0
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Bob Aman
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date:
|
|
18
|
+
date: 2011-02-21 00:00:00 -08:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|
|
@@ -51,9 +51,25 @@ dependencies:
|
|
|
51
51
|
type: :runtime
|
|
52
52
|
version_requirements: *id002
|
|
53
53
|
- !ruby/object:Gem::Dependency
|
|
54
|
-
name:
|
|
54
|
+
name: json
|
|
55
55
|
prerelease: false
|
|
56
56
|
requirement: &id003 !ruby/object:Gem::Requirement
|
|
57
|
+
none: false
|
|
58
|
+
requirements:
|
|
59
|
+
- - ~>
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
hash: 3
|
|
62
|
+
segments:
|
|
63
|
+
- 1
|
|
64
|
+
- 5
|
|
65
|
+
- 0
|
|
66
|
+
version: 1.5.0
|
|
67
|
+
type: :runtime
|
|
68
|
+
version_requirements: *id003
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: rake
|
|
71
|
+
prerelease: false
|
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
|
57
73
|
none: false
|
|
58
74
|
requirements:
|
|
59
75
|
- - ~>
|
|
@@ -65,11 +81,11 @@ dependencies:
|
|
|
65
81
|
- 3
|
|
66
82
|
version: 0.8.3
|
|
67
83
|
type: :development
|
|
68
|
-
version_requirements: *
|
|
84
|
+
version_requirements: *id004
|
|
69
85
|
- !ruby/object:Gem::Dependency
|
|
70
86
|
name: rspec
|
|
71
87
|
prerelease: false
|
|
72
|
-
requirement: &
|
|
88
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
|
73
89
|
none: false
|
|
74
90
|
requirements:
|
|
75
91
|
- - ~>
|
|
@@ -81,11 +97,11 @@ dependencies:
|
|
|
81
97
|
- 11
|
|
82
98
|
version: 1.1.11
|
|
83
99
|
type: :development
|
|
84
|
-
version_requirements: *
|
|
100
|
+
version_requirements: *id005
|
|
85
101
|
- !ruby/object:Gem::Dependency
|
|
86
102
|
name: launchy
|
|
87
103
|
prerelease: false
|
|
88
|
-
requirement: &
|
|
104
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
|
89
105
|
none: false
|
|
90
106
|
requirements:
|
|
91
107
|
- - ~>
|
|
@@ -97,11 +113,11 @@ dependencies:
|
|
|
97
113
|
- 2
|
|
98
114
|
version: 0.3.2
|
|
99
115
|
type: :development
|
|
100
|
-
version_requirements: *
|
|
116
|
+
version_requirements: *id006
|
|
101
117
|
- !ruby/object:Gem::Dependency
|
|
102
118
|
name: diff-lcs
|
|
103
119
|
prerelease: false
|
|
104
|
-
requirement: &
|
|
120
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
|
105
121
|
none: false
|
|
106
122
|
requirements:
|
|
107
123
|
- - ~>
|
|
@@ -113,11 +129,11 @@ dependencies:
|
|
|
113
129
|
- 2
|
|
114
130
|
version: 1.1.2
|
|
115
131
|
type: :development
|
|
116
|
-
version_requirements: *
|
|
132
|
+
version_requirements: *id007
|
|
117
133
|
- !ruby/object:Gem::Dependency
|
|
118
134
|
name: typhoeus
|
|
119
135
|
prerelease: false
|
|
120
|
-
requirement: &
|
|
136
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
|
121
137
|
none: false
|
|
122
138
|
requirements:
|
|
123
139
|
- - ~>
|
|
@@ -129,7 +145,7 @@ dependencies:
|
|
|
129
145
|
- 31
|
|
130
146
|
version: 0.1.31
|
|
131
147
|
type: :development
|
|
132
|
-
version_requirements: *
|
|
148
|
+
version_requirements: *id008
|
|
133
149
|
description: |
|
|
134
150
|
Signet is an OAuth 1.0 / OAuth 2.0 implementation.
|
|
135
151
|
|
|
@@ -148,6 +164,8 @@ files:
|
|
|
148
164
|
- lib/signet/oauth_1/credential.rb
|
|
149
165
|
- lib/signet/oauth_1/signature_methods/hmac_sha1.rb
|
|
150
166
|
- lib/signet/oauth_1.rb
|
|
167
|
+
- lib/signet/oauth_2/client.rb
|
|
168
|
+
- lib/signet/oauth_2.rb
|
|
151
169
|
- lib/signet/version.rb
|
|
152
170
|
- lib/signet.rb
|
|
153
171
|
- spec/force_compat/digest/hmac.rb
|
|
@@ -157,6 +175,9 @@ files:
|
|
|
157
175
|
- spec/signet/oauth_1/services/google_spec.rb
|
|
158
176
|
- spec/signet/oauth_1/signature_methods/hmac_sha1_spec.rb
|
|
159
177
|
- spec/signet/oauth_1_spec.rb
|
|
178
|
+
- spec/signet/oauth_2/client_spec.rb
|
|
179
|
+
- spec/signet/oauth_2_spec.rb
|
|
180
|
+
- spec/signet_spec.rb
|
|
160
181
|
- spec/spec.opts
|
|
161
182
|
- spec/spec_helper.rb
|
|
162
183
|
- tasks/clobber.rake
|
|
@@ -203,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
203
224
|
requirements: []
|
|
204
225
|
|
|
205
226
|
rubyforge_project: signet
|
|
206
|
-
rubygems_version: 1.
|
|
227
|
+
rubygems_version: 1.4.1
|
|
207
228
|
signing_key:
|
|
208
229
|
specification_version: 3
|
|
209
230
|
summary: Package Summary
|