oauth2 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +2 -3
- data/LICENSE.md +1 -1
- data/README.md +25 -7
- data/lib/oauth2/access_token.rb +1 -0
- data/lib/oauth2/version.rb +1 -1
- data/spec/oauth2/access_token_spec.rb +7 -0
- metadata +134 -140
- metadata.gz.sig +2 -3
data.tar.gz.sig
CHANGED
@@ -1,3 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
12�yHΨ�%��s���;�Fr�� �ψ�/��
|
1
|
+
Q��
|
2
|
+
D!d�I��"���N�O�9M�eg��8>�Rn@��h�O�b�:He�̤q��W��Z���p��#b�7��;r�PJ��E�B�xc"�d����"�%��Z���B���*��ʔ)�7�&GH�_�B��˻g<m�^�<�$Fk��,1M�[�����h*랪����n���S�5�Fi_��X��)H���]�獶S�����Ҹ���M?�,,��L�El�[�kq��@����0��]�g��
|
data/LICENSE.md
CHANGED
data/README.md
CHANGED
@@ -1,15 +1,32 @@
|
|
1
|
-
# OAuth2
|
1
|
+
# OAuth2
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/oauth2.png)][gem]
|
3
|
+
[![Build Status](https://secure.travis-ci.org/intridea/oauth2.png?branch=master)][travis]
|
4
|
+
[![Dependency Status](https://gemnasium.com/intridea/oauth2.png?travis)][gemnasium]
|
5
|
+
[![Code Climate](https://codeclimate.com/github/intridea/oauth2.png)][codeclimate]
|
6
|
+
|
7
|
+
[gem]: https://rubygems.org/gems/oauth2
|
8
|
+
[travis]: http://travis-ci.org/intridea/oauth2
|
9
|
+
[gemnasium]: https://gemnasium.com/intridea/oauth2
|
10
|
+
[codeclimate]: https://codeclimate.com/github/intridea/oauth2
|
11
|
+
|
2
12
|
A Ruby wrapper for the OAuth 2.0 specification. This is a work in progress,
|
3
13
|
being built first to solve the pragmatic process of connecting to existing
|
4
14
|
OAuth 2.0 endpoints (a.k.a. Facebook) with the goal of building it up to meet
|
5
15
|
the entire specification over time.
|
6
16
|
|
7
|
-
[travis]: http://travis-ci.org/intridea/oauth2
|
8
|
-
[gemnasium]: https://gemnasium.com/intridea/oauth2
|
9
|
-
|
10
17
|
## Installation
|
11
18
|
gem install oauth2
|
12
19
|
|
20
|
+
To ensure the code you're installing hasn't been tampered with, it's
|
21
|
+
recommended that you verify the signature. To do this, you need to add my
|
22
|
+
public key as a trusted certificate (you only need to do this once):
|
23
|
+
|
24
|
+
gem cert --add <(curl -Ls https://gist.github.com/sferik/4701180/raw/public_cert.pem)
|
25
|
+
|
26
|
+
Then, install the gem with the high security trust policy:
|
27
|
+
|
28
|
+
gem install oauth2 -P HighSecurity
|
29
|
+
|
13
30
|
## Resources
|
14
31
|
* [View Source on GitHub][code]
|
15
32
|
* [Report Issues on GitHub][issues]
|
@@ -113,7 +130,8 @@ implementation, you will be responsible for providing patches in a timely
|
|
113
130
|
fashion. If critical issues for a particular implementation exist at the time
|
114
131
|
of a major release, support for that Ruby version may be dropped.
|
115
132
|
|
116
|
-
##
|
117
|
-
Copyright (c) 2011 Intridea, Inc.
|
118
|
-
|
133
|
+
## License
|
134
|
+
Copyright (c) 2011-2013 Michael Bleigh and Intridea, Inc. See [LICENSE][] for
|
135
|
+
details.
|
136
|
+
|
119
137
|
[license]: LICENSE.md
|
data/lib/oauth2/access_token.rb
CHANGED
@@ -44,6 +44,7 @@ module OAuth2
|
|
44
44
|
end
|
45
45
|
@expires_in ||= opts.delete('expires')
|
46
46
|
@expires_in &&= @expires_in.to_i
|
47
|
+
@expires_at &&= @expires_at.to_i
|
47
48
|
@expires_at ||= Time.now.to_i + @expires_in if @expires_in
|
48
49
|
@options = {:mode => opts.delete(:mode) || :header,
|
49
50
|
:header_format => opts.delete(:header_format) || 'Bearer %s',
|
data/lib/oauth2/version.rb
CHANGED
@@ -59,6 +59,13 @@ describe AccessToken do
|
|
59
59
|
expect(target.options[:header_format]).to eq('Bearer %')
|
60
60
|
expect(target.options[:mode]).to eq(:body)
|
61
61
|
end
|
62
|
+
|
63
|
+
it "initializes with a string expires_at" do
|
64
|
+
hash = {:access_token => token, :expires_at => '1361396829', 'foo' => 'bar'}
|
65
|
+
target = AccessToken.from_hash(client, hash)
|
66
|
+
assert_initialized_token(target)
|
67
|
+
expect(target.expires_at).to be_a(Integer)
|
68
|
+
end
|
62
69
|
end
|
63
70
|
|
64
71
|
describe "#request" do
|
metadata
CHANGED
@@ -1,161 +1,165 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: oauth2
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.9.1
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 9
|
9
|
-
- 0
|
10
|
-
version: 0.9.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Michael Bleigh
|
14
9
|
- Erik Michaels-Ober
|
15
10
|
autorequire:
|
16
11
|
bindir: bin
|
17
|
-
cert_chain:
|
18
|
-
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
12
|
+
cert_chain:
|
13
|
+
- !binary |-
|
14
|
+
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURMakNDQWhhZ0F3SUJB
|
15
|
+
Z0lCQURBTkJna3Foa2lHOXcwQkFRVUZBREE5TVE4d0RRWURWUVFEREFaelpt
|
16
|
+
VnkKYVdzeEZUQVRCZ29Ka2lhSmsvSXNaQUVaRmdWbmJXRnBiREVUTUJFR0Nn
|
17
|
+
bVNKb21UOGl4a0FSa1dBMk52YlRBZQpGdzB4TXpBeU1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ZXVL
|
33
|
+
Mk9oVStPZTNUcHFyQWc1VEsKUjhHUUlMblZ1MkZlbUdBNnNBa1BEbGNQdGdB
|
34
|
+
NmllSTE5UFpPRjZIVkxtYy9JRC9kUC9OZ1pXV3pFZXFRS21jSwoyK0hNK1NF
|
35
|
+
RURoWmtTY1lla3c0Wk9lMTY0WnRaRzgxNm9BdjV4MHBHaXRTSWt1bVVwN1Y4
|
36
|
+
aUVaLzZlaHI3WTllClhPZzRlZXVuNUwvSmptakFSb1cya05kdmtSRDNjMkVl
|
37
|
+
U0xxV3ZRUnNCbHlwSGZoczZKSnVMbHlaUEdoVTNSL3YKU2YzbFZLcEJDV2dS
|
38
|
+
cEdUdnk0NVhWcEIrNTl5MzNQSm1FdVExUFRFT1l2UXlhbzlVS01BQWFBTi83
|
39
|
+
cVdRdGpsMApobHc9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
|
40
|
+
date: 2013-02-20 00:00:00.000000000 Z
|
41
|
+
dependencies:
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
43
|
name: bundler
|
44
|
-
|
45
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
46
45
|
none: false
|
47
|
-
requirements:
|
46
|
+
requirements:
|
48
47
|
- - ~>
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
|
51
|
-
segments:
|
52
|
-
- 1
|
53
|
-
- 0
|
54
|
-
version: "1.0"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '1.0'
|
55
50
|
type: :development
|
56
|
-
version_requirements: *id001
|
57
|
-
- !ruby/object:Gem::Dependency
|
58
|
-
name: faraday
|
59
51
|
prerelease: false
|
60
|
-
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ~>
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '1.0'
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: faraday
|
60
|
+
requirement: !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
|
-
requirements:
|
62
|
+
requirements:
|
63
63
|
- - ~>
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
|
66
|
-
segments:
|
67
|
-
- 0
|
68
|
-
- 8
|
69
|
-
version: "0.8"
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0.8'
|
70
66
|
type: :runtime
|
71
|
-
version_requirements: *id002
|
72
|
-
- !ruby/object:Gem::Dependency
|
73
|
-
name: httpauth
|
74
67
|
prerelease: false
|
75
|
-
|
68
|
+
version_requirements: !ruby/object:Gem::Requirement
|
76
69
|
none: false
|
77
|
-
requirements:
|
70
|
+
requirements:
|
78
71
|
- - ~>
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0.8'
|
74
|
+
- !ruby/object:Gem::Dependency
|
75
|
+
name: httpauth
|
76
|
+
requirement: !ruby/object:Gem::Requirement
|
77
|
+
none: false
|
78
|
+
requirements:
|
79
|
+
- - ~>
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0.1'
|
85
82
|
type: :runtime
|
86
|
-
version_requirements: *id003
|
87
|
-
- !ruby/object:Gem::Dependency
|
88
|
-
name: multi_json
|
89
83
|
prerelease: false
|
90
|
-
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
85
|
none: false
|
92
|
-
requirements:
|
86
|
+
requirements:
|
93
87
|
- - ~>
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.1'
|
90
|
+
- !ruby/object:Gem::Dependency
|
91
|
+
name: multi_json
|
92
|
+
requirement: !ruby/object:Gem::Requirement
|
93
|
+
none: false
|
94
|
+
requirements:
|
95
|
+
- - ~>
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '1.0'
|
100
98
|
type: :runtime
|
101
|
-
version_requirements: *id004
|
102
|
-
- !ruby/object:Gem::Dependency
|
103
|
-
name: multi_xml
|
104
99
|
prerelease: false
|
105
|
-
|
100
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
101
|
none: false
|
107
|
-
requirements:
|
102
|
+
requirements:
|
108
103
|
- - ~>
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '1.0'
|
106
|
+
- !ruby/object:Gem::Dependency
|
107
|
+
name: multi_xml
|
108
|
+
requirement: !ruby/object:Gem::Requirement
|
109
|
+
none: false
|
110
|
+
requirements:
|
111
|
+
- - ~>
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0.5'
|
115
114
|
type: :runtime
|
116
|
-
version_requirements: *id005
|
117
|
-
- !ruby/object:Gem::Dependency
|
118
|
-
name: rack
|
119
115
|
prerelease: false
|
120
|
-
|
116
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
117
|
none: false
|
122
|
-
requirements:
|
118
|
+
requirements:
|
123
119
|
- - ~>
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0.5'
|
122
|
+
- !ruby/object:Gem::Dependency
|
123
|
+
name: rack
|
124
|
+
requirement: !ruby/object:Gem::Requirement
|
125
|
+
none: false
|
126
|
+
requirements:
|
127
|
+
- - ~>
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '1.2'
|
130
130
|
type: :runtime
|
131
|
-
version_requirements: *id006
|
132
|
-
- !ruby/object:Gem::Dependency
|
133
|
-
name: jwt
|
134
131
|
prerelease: false
|
135
|
-
|
132
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
133
|
none: false
|
137
|
-
requirements:
|
134
|
+
requirements:
|
138
135
|
- - ~>
|
139
|
-
- !ruby/object:Gem::Version
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '1.2'
|
138
|
+
- !ruby/object:Gem::Dependency
|
139
|
+
name: jwt
|
140
|
+
requirement: !ruby/object:Gem::Requirement
|
141
|
+
none: false
|
142
|
+
requirements:
|
143
|
+
- - ~>
|
144
|
+
- !ruby/object:Gem::Version
|
145
145
|
version: 0.1.4
|
146
146
|
type: :runtime
|
147
|
-
|
148
|
-
|
149
|
-
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
none: false
|
150
|
+
requirements:
|
151
|
+
- - ~>
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: 0.1.4
|
154
|
+
description: A Ruby wrapper for the OAuth 2.0 protocol built with a similar style
|
155
|
+
to the original OAuth spec.
|
156
|
+
email:
|
150
157
|
- michael@intridea.com
|
151
158
|
- sferik@gmail.com
|
152
159
|
executables: []
|
153
|
-
|
154
160
|
extensions: []
|
155
|
-
|
156
161
|
extra_rdoc_files: []
|
157
|
-
|
158
|
-
files:
|
162
|
+
files:
|
159
163
|
- .document
|
160
164
|
- CONTRIBUTING.md
|
161
165
|
- LICENSE.md
|
@@ -185,41 +189,31 @@ files:
|
|
185
189
|
- spec/oauth2/strategy/implicit_spec.rb
|
186
190
|
- spec/oauth2/strategy/password_spec.rb
|
187
191
|
homepage: http://github.com/intridea/oauth2
|
188
|
-
licenses:
|
192
|
+
licenses:
|
189
193
|
- MIT
|
190
194
|
post_install_message:
|
191
195
|
rdoc_options: []
|
192
|
-
|
193
|
-
require_paths:
|
196
|
+
require_paths:
|
194
197
|
- lib
|
195
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
198
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
196
199
|
none: false
|
197
|
-
requirements:
|
198
|
-
- -
|
199
|
-
- !ruby/object:Gem::Version
|
200
|
-
|
201
|
-
|
202
|
-
- 0
|
203
|
-
version: "0"
|
204
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
200
|
+
requirements:
|
201
|
+
- - ! '>='
|
202
|
+
- !ruby/object:Gem::Version
|
203
|
+
version: '0'
|
204
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
205
205
|
none: false
|
206
|
-
requirements:
|
207
|
-
- -
|
208
|
-
- !ruby/object:Gem::Version
|
209
|
-
hash: 23
|
210
|
-
segments:
|
211
|
-
- 1
|
212
|
-
- 3
|
213
|
-
- 6
|
206
|
+
requirements:
|
207
|
+
- - ! '>='
|
208
|
+
- !ruby/object:Gem::Version
|
214
209
|
version: 1.3.6
|
215
210
|
requirements: []
|
216
|
-
|
217
211
|
rubyforge_project:
|
218
|
-
rubygems_version: 1.8.
|
212
|
+
rubygems_version: 1.8.23
|
219
213
|
signing_key:
|
220
214
|
specification_version: 3
|
221
215
|
summary: A Ruby wrapper for the OAuth 2.0 protocol.
|
222
|
-
test_files:
|
216
|
+
test_files:
|
223
217
|
- spec/helper.rb
|
224
218
|
- spec/oauth2/access_token_spec.rb
|
225
219
|
- spec/oauth2/client_spec.rb
|
metadata.gz.sig
CHANGED
@@ -1,3 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
�HT!�Xc�Z�Ҵn<�L�>ߝV\˨O6�]P�+
|
1
|
+
&3��0wQ0{Ce1>����A#����I�����9u����_�����c>�5n�+��ł�CV��~���&$#�2wab�����O��KiUy�zy#};�*�5�w�*Q�=�۴ZG�c�Zl�<!k���Eݨ�6�(�[��:F_iM����
|
2
|
+
�]�S�I��d��QН���1�0�S�9W�|�1H`^��('��T/u��#1Q52�;��s���aL��2@����jfg�����N�ۏ�
|