auth0-ruby 0.9.1 → 0.10
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.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/Gemfile.lock +2 -4
- data/auth0.gemspec +0 -1
- data/doc/Auth0.html +3 -3
- data/doc/Auth0/AccessDenied.html +142 -0
- data/doc/Auth0/Api.html +3 -3
- data/doc/Auth0/Api/AuthenticationEndpoints.html +3 -7
- data/doc/Auth0/Api/V1.html +4 -8
- data/doc/Auth0/Api/V1/Clients.html +1 -1
- data/doc/Auth0/Api/V1/Connections.html +1 -1
- data/doc/Auth0/Api/V1/Logs.html +1 -1
- data/doc/Auth0/Api/V1/Rules.html +1 -1
- data/doc/Auth0/Api/V1/Users.html +1 -1
- data/doc/Auth0/Api/V2.html +193 -0
- data/doc/Auth0/Api/V2/Blacklists.html +268 -0
- data/doc/Auth0/Api/V2/Clients.html +477 -0
- data/doc/Auth0/Api/V2/Jobs.html +277 -0
- data/doc/Auth0/Api/V2/Router.html +109 -0
- data/doc/Auth0/Api/V2/Stats.html +268 -0
- data/doc/Auth0/Api/V2/Users.html +652 -0
- data/doc/Auth0/BadRequest.html +1 -1
- data/doc/Auth0/Client.html +1 -73
- data/doc/Auth0/Exception.html +2 -2
- data/doc/Auth0/InvalidParameter.html +142 -0
- data/doc/Auth0/Mixins.html +4 -76
- data/doc/Auth0/Mixins/HTTPartyProxy.html +1 -1
- data/doc/Auth0/Mixins/Initializer.html +20 -14
- data/doc/Auth0/NotFound.html +1 -1
- data/doc/Auth0/ServerError.html +1 -1
- data/doc/Auth0/Unauthorized.html +1 -1
- data/doc/Auth0/Unsupported.html +1 -1
- data/doc/Auth0/UserIdIsBlank.html +1 -1
- data/doc/Auth0Client.html +1 -73
- data/doc/_index.html +59 -3
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +1 -1
- data/doc/index.html +1 -1
- data/doc/method_list.html +132 -30
- data/doc/top-level-namespace.html +1 -1
- data/lib/auth0/api/v2.rb +19 -0
- data/lib/auth0/api/v2/blacklists.rb +22 -0
- data/lib/auth0/api/v2/clients.rb +39 -0
- data/lib/auth0/api/v2/jobs.rb +20 -0
- data/lib/auth0/api/v2/router.rb +28 -0
- data/lib/auth0/api/v2/stats.rb +22 -0
- data/lib/auth0/api/v2/users.rb +64 -0
- data/lib/auth0/exception.rb +5 -1
- data/lib/auth0/mixins.rb +2 -3
- data/lib/auth0/mixins/httparty_proxy.rb +7 -1
- data/lib/auth0/mixins/initializer.rb +13 -8
- data/lib/auth0/version.rb +1 -1
- data/spec/lib/auth0/api/v2/blacklists_spec.rb +25 -0
- data/spec/lib/auth0/api/v2/clients_spec.rb +55 -0
- data/spec/lib/auth0/api/v2/jobs_spec.rb +22 -0
- data/spec/lib/auth0/api/v2/stats_spec.rb +23 -0
- data/spec/lib/auth0/api/v2/users_spec.rb +73 -0
- data/spec/lib/auth0/client_spec.rb +31 -8
- data/spec/lib/auth0/mixins/httparty_proxy_spec.rb +60 -1
- data/spec/lib/auth0_client_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +25 -37
- data/doc/Auth0/Mixins/JwtOperations.html +0 -202
- data/lib/auth0/mixins/jwt_operations.rb +0 -14
- data/spec/lib/auth0/mixins/jwt_operations_spec.rb +0 -31
- data/spec/support/stub_class_with_client_secret.rb +0 -7
@@ -0,0 +1,73 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
describe Auth0::Api::V2::Users do
|
3
|
+
before :all do
|
4
|
+
dummy_instance = DummyClass.new
|
5
|
+
dummy_instance.extend(Auth0::Api::V2::Users)
|
6
|
+
dummy_instance.extend(Auth0::Api::V2::Router)
|
7
|
+
@instance = dummy_instance
|
8
|
+
end
|
9
|
+
|
10
|
+
context ".users" do
|
11
|
+
it {expect(@instance).to respond_to(:users)}
|
12
|
+
it {expect(@instance).to respond_to(:get_users)}
|
13
|
+
it "is expected to call /api/v2/users" do
|
14
|
+
expect(@instance).to receive(:get).with("/api/v2/users",{:per_page=>nil, :page=>nil, :include_totals=>nil, :sort=>nil, :connection=>nil, :fields=>nil, :exclude_fields=>nil, :q=>nil})
|
15
|
+
expect{@instance.users}.not_to raise_error
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
context ".user" do
|
20
|
+
it {expect(@instance).to respond_to(:user)}
|
21
|
+
it "is expected to call get request to /api/v2/users/USER_ID" do
|
22
|
+
expect(@instance).to receive(:get).with("/api/v2/users/USER_ID", {fields: nil, exclude_fields: nil})
|
23
|
+
expect{@instance.user("USER_ID")}.not_to raise_error
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
context ".create_user" do
|
29
|
+
it {expect(@instance).to respond_to(:create_user)}
|
30
|
+
it "is expected to call post to /api/v2/users" do
|
31
|
+
expect(@instance).to receive(:post).with("/api/v2/users", {email: "test@test.com", password: "password", connection: "conn", name:"name"})
|
32
|
+
@instance.create_user("name", {email:"test@test.com",password: "password", connection: "conn"})
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
context ".delete_users" do
|
37
|
+
it {expect(@instance).to respond_to :delete_users}
|
38
|
+
it "is expected to call delete to /api/v2/users" do
|
39
|
+
expect(@instance).to receive(:delete).with("/api/v2/users")
|
40
|
+
@instance.delete_users
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
context ".delete_user" do
|
45
|
+
it {expect(@instance).to respond_to(:delete_user)}
|
46
|
+
it "is expected to call delete to /api/v2/users/userId" do
|
47
|
+
expect(@instance).to receive(:delete).with("/api/v2/users/userId")
|
48
|
+
@instance.delete_user("userId")
|
49
|
+
end
|
50
|
+
|
51
|
+
it "is expected not to call delete to /api/v2/users if user_id is blank" do
|
52
|
+
expect(@instance).not_to receive(:delete)
|
53
|
+
expect{@instance.delete_user("")}.to raise_exception(Auth0::UserIdIsBlank)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
context ".delete_user_provider" do
|
58
|
+
it {expect(@instance).to respond_to(:delete_user_provider)}
|
59
|
+
it "is expected to call delete to /api/v2/users/userId/multifactor/provider" do
|
60
|
+
expect(@instance).to receive(:delete).with("/api/v2/users/userId/multifactor/provider")
|
61
|
+
@instance.delete_user_provider("userId", "provider")
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
context ".patch_user" do
|
66
|
+
it {expect(@instance).to respond_to(:patch_user)}
|
67
|
+
it "is expected to call patch to /api/v2/users/userID" do
|
68
|
+
expect(@instance).to receive(:patch).with("/api/v2/users/UserID", {email: "test@test.com", password: "password", connection: "conn", name:"name"})
|
69
|
+
@instance.patch_user("UserID", {email:"test@test.com",password: "password", connection: "conn", name:"name"})
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
describe Auth0::Client do
|
3
|
-
context "modules to be included" do
|
3
|
+
context "V1 modules to be included" do
|
4
4
|
let(:subject){Auth0::Client.new({})}
|
5
5
|
before :each do
|
6
|
-
allow_any_instance_of(Auth0::
|
6
|
+
allow_any_instance_of(Auth0::Api::AuthenticationEndpoints).to receive(:obtain_access_token)
|
7
7
|
end
|
8
8
|
it {expect(subject).to be_a HTTParty}
|
9
9
|
it {expect(subject).to be_a Auth0::Mixins}
|
@@ -15,12 +15,35 @@ describe Auth0::Client do
|
|
15
15
|
it {expect(subject).to be_a Auth0::Api::V1::Rules}
|
16
16
|
it {expect(subject).to be_a Auth0::Api::V1::Logs}
|
17
17
|
it {expect(subject).to be_a Auth0::Api::AuthenticationEndpoints}
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
it {expect(subject).not_to be_a Auth0::Api::V2}
|
19
|
+
it {expect(subject).not_to be_a Auth0::Api::V2::Clients}
|
20
|
+
it {expect(subject).not_to be_a Auth0::Api::V2::Users}
|
21
|
+
it {expect(subject).not_to be_a Auth0::Api::V2::Jobs}
|
22
|
+
it {expect(subject).not_to be_a Auth0::Api::V2::Stats}
|
23
|
+
it {expect(subject).not_to be_a Auth0::Api::V2::Blacklists}
|
24
|
+
it {expect(subject).not_to be_a Auth0::Api::V2::Router}
|
25
|
+
end
|
26
|
+
context "V2 modules to be included" do
|
27
|
+
let(:subject){Auth0::Client.new({protocols: "v2"})}
|
28
|
+
before :each do
|
29
|
+
expect_any_instance_of(Auth0::Api::AuthenticationEndpoints).not_to receive(:obtain_access_token)
|
24
30
|
end
|
31
|
+
it {expect(subject).to be_a HTTParty}
|
32
|
+
it {expect(subject).to be_a Auth0::Mixins}
|
33
|
+
it {expect(subject).to be_a Auth0::Mixins::Initializer}
|
34
|
+
it {expect(subject).to be_a Auth0::Api::V2}
|
35
|
+
it {expect(subject).to be_a Auth0::Api::V2::Clients}
|
36
|
+
it {expect(subject).to be_a Auth0::Api::V2::Users}
|
37
|
+
it {expect(subject).to be_a Auth0::Api::V2::Router}
|
38
|
+
it {expect(subject).to be_a Auth0::Api::V2::Stats}
|
39
|
+
it {expect(subject).to be_a Auth0::Api::V2::Jobs}
|
40
|
+
it {expect(subject).to be_a Auth0::Api::V2::Blacklists}
|
41
|
+
it {expect(subject).not_to be_a Auth0::Api::V1}
|
42
|
+
it {expect(subject).not_to be_a Auth0::Api::V1::Users}
|
43
|
+
it {expect(subject).not_to be_a Auth0::Api::V1::Connections}
|
44
|
+
it {expect(subject).not_to be_a Auth0::Api::V1::Clients}
|
45
|
+
it {expect(subject).not_to be_a Auth0::Api::V1::Rules}
|
46
|
+
it {expect(subject).not_to be_a Auth0::Api::V1::Logs}
|
47
|
+
it {expect(subject).not_to be_a Auth0::Api::AuthenticationEndpoints}
|
25
48
|
end
|
26
49
|
end
|
@@ -5,7 +5,66 @@ describe Auth0::Mixins::HTTPartyProxy do
|
|
5
5
|
dummy_instance.extend(Auth0::Mixins::HTTPartyProxy)
|
6
6
|
@instance = dummy_instance
|
7
7
|
end
|
8
|
-
|
8
|
+
|
9
|
+
%i(get).each do |http_method|
|
10
|
+
context ".#{http_method}" do
|
11
|
+
it {expect(@instance).to respond_to(http_method.to_sym)}
|
12
|
+
it "should call send http #{http_method} method to path defined through HTTParty" do
|
13
|
+
allow(DummyClassForProxy).to receive(http_method).with("http://login.auth0.com/test", :query => {})
|
14
|
+
expect(DummyClassForProxy).to receive(http_method).with("/test", :query => {}).and_return(StubResponse.new({}, true, 200))
|
15
|
+
expect{@instance.send(http_method,"/test")}.not_to raise_error
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should not raise exception if data returned not in json format(should be fixed in v2)" do
|
19
|
+
allow(DummyClassForProxy).to receive(http_method).with("/test", :query => {}).and_return(StubResponse.new("Some random text here", true, 200))
|
20
|
+
expect{@instance.send(http_method,"/test")}.not_to raise_error
|
21
|
+
expect(@instance.send(http_method,"/test")).to eql "Some random text here"
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should raise Auth0::Unauthorized on send http #{http_method} method to path defined through HTTParty when 401 status received" do
|
25
|
+
allow(DummyClassForProxy).to receive(http_method).with("http://login.auth0.com/test", :query => {})
|
26
|
+
expect(DummyClassForProxy).to receive(http_method).with("/test", :query => {}).and_return(StubResponse.new({}, false, 401))
|
27
|
+
expect{@instance.send(http_method,"/test")}.to raise_error(Auth0::Unauthorized)
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should raise Auth0::NotFound on send http #{http_method} method to path defined through HTTParty when 404 status received" do
|
31
|
+
allow(DummyClassForProxy).to receive(http_method).with("http://login.auth0.com/test", :query => {})
|
32
|
+
expect(DummyClassForProxy).to receive(http_method).with("/test", :query => {}).and_return(StubResponse.new({}, false, 404))
|
33
|
+
expect{@instance.send(http_method,"/test")}.to raise_error(Auth0::NotFound)
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should raise Auth0::Unsupported on send http #{http_method} method to path defined through HTTParty when 418 or other unknown status received" do
|
37
|
+
allow(DummyClassForProxy).to receive(http_method).with("http://login.auth0.com/test", :query => {})
|
38
|
+
expect(DummyClassForProxy).to receive(http_method).with("/test", :query => {}).and_return(StubResponse.new({}, false, 418))
|
39
|
+
expect{@instance.send(http_method,"/test")}.to raise_error(Auth0::Unsupported)
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should raise Auth0::BadRequest on send http #{http_method} method to path defined through HTTParty when 400 or other unknown status received" do
|
43
|
+
allow(DummyClassForProxy).to receive(http_method).with("http://login.auth0.com/test", :query => {})
|
44
|
+
expect(DummyClassForProxy).to receive(http_method).with("/test", :query => {}).and_return(StubResponse.new({}, false, 400))
|
45
|
+
expect{@instance.send(http_method,"/test")}.to raise_error(Auth0::BadRequest)
|
46
|
+
end
|
47
|
+
|
48
|
+
it "should raise Auth0::AccessDenied on send http #{http_method} method to path defined through HTTParty when 403" do
|
49
|
+
allow(DummyClassForProxy).to receive(http_method).with("http://login.auth0.com/test", :query => {})
|
50
|
+
expect(DummyClassForProxy).to receive(http_method).with("/test", :query => {}).and_return(StubResponse.new({}, false, 403))
|
51
|
+
expect{@instance.send(http_method,"/test")}.to raise_error(Auth0::AccessDenied)
|
52
|
+
end
|
53
|
+
it "should raise Auth0::ServerError on send http #{http_method} method to path defined through HTTParty when 500 received" do
|
54
|
+
allow(DummyClassForProxy).to receive(http_method).with("http://login.auth0.com/test", :query => {})
|
55
|
+
expect(DummyClassForProxy).to receive(http_method).with("/test", :query => {}).and_return(StubResponse.new({}, false, 500))
|
56
|
+
expect{@instance.send(http_method,"/test")}.to raise_error(Auth0::ServerError)
|
57
|
+
end
|
58
|
+
|
59
|
+
it "should escape path with URI.escape" do
|
60
|
+
allow(DummyClassForProxy).to receive(http_method).with("http://login.auth0.com/te%20st", :query => {})
|
61
|
+
expect(DummyClassForProxy).to receive(http_method).with("/te%20st", :query => {}).and_return(StubResponse.new({}, true, 200))
|
62
|
+
expect{@instance.send(http_method,"/te st")}.not_to raise_error
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
%i(post put patch delete).each do |http_method|
|
9
68
|
context ".#{http_method}" do
|
10
69
|
it {expect(@instance).to respond_to(http_method.to_sym)}
|
11
70
|
it "should call send http #{http_method} method to path defined through HTTParty" do
|
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
describe Auth0Client do
|
3
3
|
let(:subject){Auth0Client.new({})}
|
4
4
|
before :each do
|
5
|
-
allow_any_instance_of(
|
5
|
+
allow_any_instance_of(Auth0::Api::AuthenticationEndpoints).to receive(:obtain_access_token)
|
6
6
|
end
|
7
7
|
it {expect(subject).to be_a Auth0::Client}
|
8
8
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: auth0-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.10'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Auth0
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-02-
|
14
|
+
date: 2015-02-22 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: httparty
|
@@ -131,20 +131,6 @@ dependencies:
|
|
131
131
|
- - '>='
|
132
132
|
- !ruby/object:Gem::Version
|
133
133
|
version: '0'
|
134
|
-
- !ruby/object:Gem::Dependency
|
135
|
-
name: jwt
|
136
|
-
requirement: !ruby/object:Gem::Requirement
|
137
|
-
requirements:
|
138
|
-
- - '>='
|
139
|
-
- !ruby/object:Gem::Version
|
140
|
-
version: '0'
|
141
|
-
type: :development
|
142
|
-
prerelease: false
|
143
|
-
version_requirements: !ruby/object:Gem::Requirement
|
144
|
-
requirements:
|
145
|
-
- - '>='
|
146
|
-
- !ruby/object:Gem::Version
|
147
|
-
version: '0'
|
148
134
|
description: Ruby client library for the Auth0 platform. This is fork of https://github.com/auth0/ruby-auth0,
|
149
135
|
but while auth0 is not hurring to merge prs, I've decided to make my own gem with
|
150
136
|
blackjack and hookers. But I really recommend you to switch to ruby-auth0 gem after
|
@@ -164,6 +150,7 @@ files:
|
|
164
150
|
- Rakefile
|
165
151
|
- auth0.gemspec
|
166
152
|
- doc/Auth0.html
|
153
|
+
- doc/Auth0/AccessDenied.html
|
167
154
|
- doc/Auth0/Api.html
|
168
155
|
- doc/Auth0/Api/AuthenticationEndpoints.html
|
169
156
|
- doc/Auth0/Api/V1.html
|
@@ -172,13 +159,20 @@ files:
|
|
172
159
|
- doc/Auth0/Api/V1/Logs.html
|
173
160
|
- doc/Auth0/Api/V1/Rules.html
|
174
161
|
- doc/Auth0/Api/V1/Users.html
|
162
|
+
- doc/Auth0/Api/V2.html
|
163
|
+
- doc/Auth0/Api/V2/Blacklists.html
|
164
|
+
- doc/Auth0/Api/V2/Clients.html
|
165
|
+
- doc/Auth0/Api/V2/Jobs.html
|
166
|
+
- doc/Auth0/Api/V2/Router.html
|
167
|
+
- doc/Auth0/Api/V2/Stats.html
|
168
|
+
- doc/Auth0/Api/V2/Users.html
|
175
169
|
- doc/Auth0/BadRequest.html
|
176
170
|
- doc/Auth0/Client.html
|
177
171
|
- doc/Auth0/Exception.html
|
172
|
+
- doc/Auth0/InvalidParameter.html
|
178
173
|
- doc/Auth0/Mixins.html
|
179
174
|
- doc/Auth0/Mixins/HTTPartyProxy.html
|
180
175
|
- doc/Auth0/Mixins/Initializer.html
|
181
|
-
- doc/Auth0/Mixins/JwtOperations.html
|
182
176
|
- doc/Auth0/NotFound.html
|
183
177
|
- doc/Auth0/ServerError.html
|
184
178
|
- doc/Auth0/Unauthorized.html
|
@@ -207,12 +201,18 @@ files:
|
|
207
201
|
- lib/auth0/api/v1/logs.rb
|
208
202
|
- lib/auth0/api/v1/rules.rb
|
209
203
|
- lib/auth0/api/v1/users.rb
|
204
|
+
- lib/auth0/api/v2.rb
|
205
|
+
- lib/auth0/api/v2/blacklists.rb
|
206
|
+
- lib/auth0/api/v2/clients.rb
|
207
|
+
- lib/auth0/api/v2/jobs.rb
|
208
|
+
- lib/auth0/api/v2/router.rb
|
209
|
+
- lib/auth0/api/v2/stats.rb
|
210
|
+
- lib/auth0/api/v2/users.rb
|
210
211
|
- lib/auth0/client.rb
|
211
212
|
- lib/auth0/exception.rb
|
212
213
|
- lib/auth0/mixins.rb
|
213
214
|
- lib/auth0/mixins/httparty_proxy.rb
|
214
215
|
- lib/auth0/mixins/initializer.rb
|
215
|
-
- lib/auth0/mixins/jwt_operations.rb
|
216
216
|
- lib/auth0/version.rb
|
217
217
|
- lib/auth0_client.rb
|
218
218
|
- spec/lib/auth0/api/authentication_endpoints_spec.rb
|
@@ -221,14 +221,17 @@ files:
|
|
221
221
|
- spec/lib/auth0/api/v1/logs_spec.rb
|
222
222
|
- spec/lib/auth0/api/v1/rules_spec.rb
|
223
223
|
- spec/lib/auth0/api/v1/users_spec.rb
|
224
|
+
- spec/lib/auth0/api/v2/blacklists_spec.rb
|
225
|
+
- spec/lib/auth0/api/v2/clients_spec.rb
|
226
|
+
- spec/lib/auth0/api/v2/jobs_spec.rb
|
227
|
+
- spec/lib/auth0/api/v2/stats_spec.rb
|
228
|
+
- spec/lib/auth0/api/v2/users_spec.rb
|
224
229
|
- spec/lib/auth0/client_spec.rb
|
225
230
|
- spec/lib/auth0/mixins/httparty_proxy_spec.rb
|
226
|
-
- spec/lib/auth0/mixins/jwt_operations_spec.rb
|
227
231
|
- spec/lib/auth0_client_spec.rb
|
228
232
|
- spec/spec_helper.rb
|
229
233
|
- spec/support/dummy_class.rb
|
230
234
|
- spec/support/dummy_class_for_proxy.rb
|
231
|
-
- spec/support/stub_class_with_client_secret.rb
|
232
235
|
- spec/support/stub_response.rb
|
233
236
|
homepage: https://github.com/offtop/ruby-auth0
|
234
237
|
licenses:
|
@@ -250,24 +253,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
250
253
|
version: '0'
|
251
254
|
requirements: []
|
252
255
|
rubyforge_project:
|
253
|
-
rubygems_version: 2.4.
|
256
|
+
rubygems_version: 2.4.5
|
254
257
|
signing_key:
|
255
258
|
specification_version: 4
|
256
259
|
summary: Ruby client library for the Auth0 platform.
|
257
|
-
test_files:
|
258
|
-
- spec/lib/auth0/api/authentication_endpoints_spec.rb
|
259
|
-
- spec/lib/auth0/api/v1/clients_spec.rb
|
260
|
-
- spec/lib/auth0/api/v1/connections_spec.rb
|
261
|
-
- spec/lib/auth0/api/v1/logs_spec.rb
|
262
|
-
- spec/lib/auth0/api/v1/rules_spec.rb
|
263
|
-
- spec/lib/auth0/api/v1/users_spec.rb
|
264
|
-
- spec/lib/auth0/client_spec.rb
|
265
|
-
- spec/lib/auth0/mixins/httparty_proxy_spec.rb
|
266
|
-
- spec/lib/auth0/mixins/jwt_operations_spec.rb
|
267
|
-
- spec/lib/auth0_client_spec.rb
|
268
|
-
- spec/spec_helper.rb
|
269
|
-
- spec/support/dummy_class.rb
|
270
|
-
- spec/support/dummy_class_for_proxy.rb
|
271
|
-
- spec/support/stub_class_with_client_secret.rb
|
272
|
-
- spec/support/stub_response.rb
|
260
|
+
test_files: []
|
273
261
|
has_rdoc:
|
@@ -1,202 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
-
<head>
|
5
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
-
<title>
|
7
|
-
Module: Auth0::Mixins::JwtOperations
|
8
|
-
|
9
|
-
— Documentation by YARD 0.8.7.6
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
-
|
17
|
-
<script type="text/javascript" charset="utf-8">
|
18
|
-
hasFrames = window.top.frames.main ? true : false;
|
19
|
-
relpath = '../../';
|
20
|
-
framesUrl = "../../frames.html#!Auth0/Mixins/JwtOperations.html";
|
21
|
-
</script>
|
22
|
-
|
23
|
-
|
24
|
-
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
-
|
26
|
-
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
-
|
28
|
-
|
29
|
-
</head>
|
30
|
-
<body>
|
31
|
-
<div id="header">
|
32
|
-
<div id="menu">
|
33
|
-
|
34
|
-
<a href="../../_index.html">Index (J)</a> »
|
35
|
-
<span class='title'><span class='object_link'><a href="../../Auth0.html" title="Auth0 (module)">Auth0</a></span></span> » <span class='title'><span class='object_link'><a href="../Mixins.html" title="Auth0::Mixins (module)">Mixins</a></span></span>
|
36
|
-
»
|
37
|
-
<span class="title">JwtOperations</span>
|
38
|
-
|
39
|
-
|
40
|
-
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
-
</div>
|
42
|
-
|
43
|
-
<div id="search">
|
44
|
-
|
45
|
-
<a class="full_list_link" id="class_list_link"
|
46
|
-
href="../../class_list.html">
|
47
|
-
Class List
|
48
|
-
</a>
|
49
|
-
|
50
|
-
<a class="full_list_link" id="method_list_link"
|
51
|
-
href="../../method_list.html">
|
52
|
-
Method List
|
53
|
-
</a>
|
54
|
-
|
55
|
-
<a class="full_list_link" id="file_list_link"
|
56
|
-
href="../../file_list.html">
|
57
|
-
File List
|
58
|
-
</a>
|
59
|
-
|
60
|
-
</div>
|
61
|
-
<div class="clear"></div>
|
62
|
-
</div>
|
63
|
-
|
64
|
-
<iframe id="search_frame"></iframe>
|
65
|
-
|
66
|
-
<div id="content"><h1>Module: Auth0::Mixins::JwtOperations
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
</h1>
|
71
|
-
|
72
|
-
<dl class="box">
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
<dt class="r1 last">Defined in:</dt>
|
82
|
-
<dd class="r1 last">lib/auth0/mixins/jwt_operations.rb</dd>
|
83
|
-
|
84
|
-
</dl>
|
85
|
-
<div class="clear"></div>
|
86
|
-
|
87
|
-
<h2>Overview</h2><div class="docstring">
|
88
|
-
<div class="discussion">
|
89
|
-
|
90
|
-
<p>Working with JWT</p>
|
91
|
-
|
92
|
-
<p><a href="https://auth0.com/docs/jwt">auth0.com/docs/jwt</a></p>
|
93
|
-
|
94
|
-
|
95
|
-
</div>
|
96
|
-
</div>
|
97
|
-
<div class="tags">
|
98
|
-
|
99
|
-
|
100
|
-
</div>
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
<h2>
|
109
|
-
Instance Method Summary
|
110
|
-
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
111
|
-
</h2>
|
112
|
-
|
113
|
-
<ul class="summary">
|
114
|
-
|
115
|
-
<li class="public ">
|
116
|
-
<span class="summary_signature">
|
117
|
-
|
118
|
-
<a href="#decode_jwt-instance_method" title="#decode_jwt (instance method)">- (Object) <strong>decode_jwt</strong>(token, client_secret = @client_secret) </a>
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
</span>
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
<span class="summary_desc"><div class='inline'>
|
133
|
-
<p><a
|
134
|
-
href="https://auth0.com/docs/server-apis/ruby">auth0.com/docs/server-apis/ruby</a>.</p>
|
135
|
-
</div></span>
|
136
|
-
|
137
|
-
</li>
|
138
|
-
|
139
|
-
|
140
|
-
</ul>
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
<div id="instance_method_details" class="method_details_list">
|
146
|
-
<h2>Instance Method Details</h2>
|
147
|
-
|
148
|
-
|
149
|
-
<div class="method_details first">
|
150
|
-
<h3 class="signature first" id="decode_jwt-instance_method">
|
151
|
-
|
152
|
-
- (<tt>Object</tt>) <strong>decode_jwt</strong>(token, client_secret = @client_secret)
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
</h3><div class="docstring">
|
159
|
-
<div class="discussion">
|
160
|
-
|
161
|
-
<p><a
|
162
|
-
href="https://auth0.com/docs/server-apis/ruby">auth0.com/docs/server-apis/ruby</a></p>
|
163
|
-
|
164
|
-
|
165
|
-
</div>
|
166
|
-
</div>
|
167
|
-
<div class="tags">
|
168
|
-
|
169
|
-
|
170
|
-
</div><table class="source_code">
|
171
|
-
<tr>
|
172
|
-
<td>
|
173
|
-
<pre class="lines">
|
174
|
-
|
175
|
-
|
176
|
-
9
|
177
|
-
10
|
178
|
-
11</pre>
|
179
|
-
</td>
|
180
|
-
<td>
|
181
|
-
<pre class="code"><span class="info file"># File 'lib/auth0/mixins/jwt_operations.rb', line 9</span>
|
182
|
-
|
183
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_decode_jwt'>decode_jwt</span><span class='lparen'>(</span><span class='id identifier rubyid_token'>token</span><span class='comma'>,</span> <span class='id identifier rubyid_client_secret'>client_secret</span><span class='op'>=</span><span class='ivar'>@client_secret</span><span class='rparen'>)</span>
|
184
|
-
<span class='const'>JWT</span><span class='period'>.</span><span class='id identifier rubyid_decode'>decode</span><span class='lparen'>(</span><span class='id identifier rubyid_token'>token</span><span class='comma'>,</span><span class='const'>Base64</span><span class='period'>.</span><span class='id identifier rubyid_decode64'>decode64</span><span class='lparen'>(</span><span class='id identifier rubyid_client_secret'>client_secret</span><span class='period'>.</span><span class='id identifier rubyid_tr'>tr</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>-_</span><span class='tstring_end'>"</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>+/</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
185
|
-
<span class='kw'>end</span></pre>
|
186
|
-
</td>
|
187
|
-
</tr>
|
188
|
-
</table>
|
189
|
-
</div>
|
190
|
-
|
191
|
-
</div>
|
192
|
-
|
193
|
-
</div>
|
194
|
-
|
195
|
-
<div id="footer">
|
196
|
-
Generated on Wed Feb 4 17:42:51 2015 by
|
197
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
198
|
-
0.8.7.6 (ruby-2.0.0).
|
199
|
-
</div>
|
200
|
-
|
201
|
-
</body>
|
202
|
-
</html>
|