auth0 4.15.0 → 4.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/Gemfile.lock +23 -25
- data/README.md +4 -0
- data/lib/auth0/api/v2/jobs.rb +11 -1
- data/lib/auth0/api/v2/tickets.rb +12 -1
- data/lib/auth0/version.rb +1 -1
- data/spec/integration/lib/auth0/api/v2/api_jobs_spec.rb +12 -0
- data/spec/integration/lib/auth0/api/v2/api_tickets_spec.rb +7 -1
- data/spec/lib/auth0/api/v2/jobs_spec.rb +17 -0
- data/spec/lib/auth0/api/v2/tickets_spec.rb +17 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c773de4346d595a93a87c037c195c59eaee818777201c8ee3bc291a3e49845bc
|
4
|
+
data.tar.gz: 647034c402dcbe84488ca6f472b7bfe451e3567b4b6d70ff7b79ec81cbb8a16b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7a196b81295ac4657f4789239e328f68522a510608d2282614c975900f50b46355ad0277b51b50f5a75b02fe04601e8dc511cc016d6f40607520b24af4b0bd0
|
7
|
+
data.tar.gz: 303ac2f09a489a6727e73ce384fc3257bae9c872a2039fe732fea8bc853f8aa625d397d3da0e885f78eb96ee3f8bfca9d8bcc6adaddaf82335eaa7680ddd94ea
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [v4.16.0](https://github.com/auth0/ruby-auth0/tree/v4.16.0) (2020-10-02)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/auth0/ruby-auth0/compare/v4.15.0...v4.16.0)
|
6
|
+
|
7
|
+
**Added**
|
8
|
+
|
9
|
+
- New Email Verification Fields [\#237](https://github.com/auth0/ruby-auth0/pull/237) ([davidpatrick](https://github.com/davidpatrick))
|
10
|
+
|
11
|
+
**Security**
|
12
|
+
|
13
|
+
- Bump actionview from 6.0.3.2 to 6.0.3.3 [\#236](https://github.com/auth0/ruby-auth0/pull/236) ([dependabot[bot]](https://github.com/apps/dependabot))
|
14
|
+
|
3
15
|
## [v4.15.0](https://github.com/auth0/ruby-auth0/tree/v4.15.0) (2020-09-04)
|
4
16
|
|
5
17
|
**Added**
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
auth0 (4.
|
4
|
+
auth0 (4.16.0)
|
5
5
|
jwt (~> 2.2.0)
|
6
6
|
rest-client (~> 2.0.0)
|
7
7
|
zache (~> 0.12.0)
|
@@ -9,20 +9,20 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
actionpack (6.0.3.
|
13
|
-
actionview (= 6.0.3.
|
14
|
-
activesupport (= 6.0.3.
|
12
|
+
actionpack (6.0.3.3)
|
13
|
+
actionview (= 6.0.3.3)
|
14
|
+
activesupport (= 6.0.3.3)
|
15
15
|
rack (~> 2.0, >= 2.0.8)
|
16
16
|
rack-test (>= 0.6.3)
|
17
17
|
rails-dom-testing (~> 2.0)
|
18
18
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
19
|
-
actionview (6.0.3.
|
20
|
-
activesupport (= 6.0.3.
|
19
|
+
actionview (6.0.3.3)
|
20
|
+
activesupport (= 6.0.3.3)
|
21
21
|
builder (~> 3.1)
|
22
22
|
erubi (~> 1.4)
|
23
23
|
rails-dom-testing (~> 2.0)
|
24
24
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
25
|
-
activesupport (6.0.3.
|
25
|
+
activesupport (6.0.3.3)
|
26
26
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
27
27
|
i18n (>= 0.7, < 2)
|
28
28
|
minitest (~> 5.1)
|
@@ -32,7 +32,7 @@ GEM
|
|
32
32
|
public_suffix (>= 2.0.2, < 5.0)
|
33
33
|
ast (2.4.1)
|
34
34
|
builder (3.2.4)
|
35
|
-
codecov (0.2.
|
35
|
+
codecov (0.2.11)
|
36
36
|
json
|
37
37
|
simplecov
|
38
38
|
coderay (1.1.3)
|
@@ -43,8 +43,7 @@ GEM
|
|
43
43
|
simplecov (>= 0.7)
|
44
44
|
term-ansicolor
|
45
45
|
thor
|
46
|
-
crack (0.4.
|
47
|
-
safe_yaml (~> 1.0.0)
|
46
|
+
crack (0.4.4)
|
48
47
|
crass (1.0.6)
|
49
48
|
diff-lcs (1.4.4)
|
50
49
|
docile (1.3.2)
|
@@ -106,7 +105,7 @@ GEM
|
|
106
105
|
nenv (~> 0.1)
|
107
106
|
shellany (~> 0.0)
|
108
107
|
parallel (1.19.2)
|
109
|
-
parser (2.7.1.
|
108
|
+
parser (2.7.1.5)
|
110
109
|
ast (~> 2.4.1)
|
111
110
|
pry (0.10.4)
|
112
111
|
coderay (~> 1.1.0)
|
@@ -123,9 +122,9 @@ GEM
|
|
123
122
|
nokogiri (>= 1.6)
|
124
123
|
rails-html-sanitizer (1.3.0)
|
125
124
|
loofah (~> 2.3)
|
126
|
-
railties (6.0.3.
|
127
|
-
actionpack (= 6.0.3.
|
128
|
-
activesupport (= 6.0.3.
|
125
|
+
railties (6.0.3.3)
|
126
|
+
actionpack (= 6.0.3.3)
|
127
|
+
activesupport (= 6.0.3.3)
|
129
128
|
method_source
|
130
129
|
rake (>= 0.8.7)
|
131
130
|
thor (>= 0.20.3, < 2.0)
|
@@ -134,7 +133,7 @@ GEM
|
|
134
133
|
rb-fsevent (0.10.4)
|
135
134
|
rb-inotify (0.10.1)
|
136
135
|
ffi (~> 1.0)
|
137
|
-
regexp_parser (1.
|
136
|
+
regexp_parser (1.8.1)
|
138
137
|
rest-client (2.0.2)
|
139
138
|
http-cookie (>= 1.0.2, < 2.0)
|
140
139
|
mime-types (>= 1.16, < 4.0)
|
@@ -144,7 +143,7 @@ GEM
|
|
144
143
|
rspec-core (~> 3.9.0)
|
145
144
|
rspec-expectations (~> 3.9.0)
|
146
145
|
rspec-mocks (~> 3.9.0)
|
147
|
-
rspec-core (3.9.
|
146
|
+
rspec-core (3.9.3)
|
148
147
|
rspec-support (~> 3.9.3)
|
149
148
|
rspec-expectations (3.9.2)
|
150
149
|
diff-lcs (>= 1.2.0, < 2.0)
|
@@ -153,28 +152,27 @@ GEM
|
|
153
152
|
diff-lcs (>= 1.2.0, < 2.0)
|
154
153
|
rspec-support (~> 3.9.0)
|
155
154
|
rspec-support (3.9.3)
|
156
|
-
rubocop (0.
|
155
|
+
rubocop (0.92.0)
|
157
156
|
parallel (~> 1.10)
|
158
|
-
parser (>= 2.7.1.
|
157
|
+
parser (>= 2.7.1.5)
|
159
158
|
rainbow (>= 2.2.2, < 4.0)
|
160
159
|
regexp_parser (>= 1.7)
|
161
160
|
rexml
|
162
|
-
rubocop-ast (>= 0.
|
161
|
+
rubocop-ast (>= 0.5.0)
|
163
162
|
ruby-progressbar (~> 1.7)
|
164
163
|
unicode-display_width (>= 1.4.0, < 2.0)
|
165
|
-
rubocop-ast (0.
|
166
|
-
parser (>= 2.7.1.
|
167
|
-
rubocop-rails (2.
|
164
|
+
rubocop-ast (0.7.1)
|
165
|
+
parser (>= 2.7.1.5)
|
166
|
+
rubocop-rails (2.8.1)
|
168
167
|
activesupport (>= 4.2.0)
|
169
168
|
rack (>= 1.1)
|
170
169
|
rubocop (>= 0.87.0)
|
171
170
|
ruby-progressbar (1.10.1)
|
172
|
-
safe_yaml (1.0.5)
|
173
171
|
shellany (0.0.1)
|
174
172
|
simplecov (0.19.0)
|
175
173
|
docile (~> 1.1)
|
176
174
|
simplecov-html (~> 0.11)
|
177
|
-
simplecov-html (0.12.
|
175
|
+
simplecov-html (0.12.3)
|
178
176
|
slop (3.6.0)
|
179
177
|
sync (0.5.0)
|
180
178
|
term-ansicolor (1.7.1)
|
@@ -191,7 +189,7 @@ GEM
|
|
191
189
|
unf_ext (0.0.7.7)
|
192
190
|
unicode-display_width (1.7.0)
|
193
191
|
vcr (6.0.0)
|
194
|
-
webmock (3.
|
192
|
+
webmock (3.9.1)
|
195
193
|
addressable (>= 2.3.6)
|
196
194
|
crack (>= 0.3.2)
|
197
195
|
hashdiff (>= 0.4.0, < 2.0.0)
|
data/README.md
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
[![codecov](https://codecov.io/gh/auth0/ruby-auth0/branch/master/graph/badge.svg)](https://codecov.io/gh/auth0/ruby-auth0)
|
6
6
|
[![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/github/auth0/ruby-auth0/master/frames)
|
7
7
|
[![MIT licensed](https://img.shields.io/dub/l/vibe-d.svg?style=flat)](https://github.com/auth0/ruby-auth0/blob/master/LICENSE)
|
8
|
+
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fauth0%2Fruby-auth0.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fauth0%2Fruby-auth0?ref=badge_shield)
|
8
9
|
|
9
10
|
Ruby API client for the [Auth0](https://auth0.com) platform.
|
10
11
|
|
@@ -234,3 +235,6 @@ If you find a bug or have a feature request, please report them in this reposito
|
|
234
235
|
## License
|
235
236
|
|
236
237
|
This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.
|
238
|
+
|
239
|
+
|
240
|
+
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fauth0%2Fruby-auth0.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fauth0%2Fruby-auth0?ref=badge_large)
|
data/lib/auth0/api/v2/jobs.rb
CHANGED
@@ -78,14 +78,24 @@ module Auth0
|
|
78
78
|
# @see https://auth0.com/docs/api/management/v2#!/Jobs/post_verification_email
|
79
79
|
# @param user_id [string] The user_id of the user to whom the email will be sent.
|
80
80
|
# @param client_id [string] Client ID to send an Application-specific email.
|
81
|
+
# @param identity [hash] Used to verify secondary, federated, and passwordless-email identities.
|
82
|
+
# * :user_id [string] user_id of the identity.
|
83
|
+
# * :provider [string] provider of the identity.
|
81
84
|
#
|
82
85
|
# @return [json] Returns the job status and properties.
|
83
|
-
def send_verification_email(user_id, client_id = nil)
|
86
|
+
def send_verification_email(user_id, client_id = nil, identity: nil)
|
84
87
|
raise Auth0::InvalidParameter, 'Must specify a user id' if user_id.to_s.empty?
|
85
88
|
|
86
89
|
request_params = { user_id: user_id }
|
87
90
|
request_params[:client_id] = client_id unless client_id.nil?
|
88
91
|
|
92
|
+
if identity
|
93
|
+
unless identity.is_a? Hash
|
94
|
+
raise Auth0::InvalidParameter, 'Identity must be a hash send an email verification'
|
95
|
+
end
|
96
|
+
request_params[:identity] = identity
|
97
|
+
end
|
98
|
+
|
89
99
|
path = "#{jobs_path}/verification-email"
|
90
100
|
post(path, request_params)
|
91
101
|
end
|
data/lib/auth0/api/v2/tickets.rb
CHANGED
@@ -12,9 +12,12 @@ module Auth0
|
|
12
12
|
# @param ttl_sec [integer] The ticket's lifetime in seconds starting from the moment of creation.
|
13
13
|
# After expiration, the ticket cannot be used to verify the user's email. If not specified or if
|
14
14
|
# you send 0, the Auth0 default lifetime of five days will be applied
|
15
|
+
# @param identity [hash] Used to verify secondary, federated, and passwordless-email identities.
|
16
|
+
# * :user_id [string] user_id of the identity.
|
17
|
+
# * :provider [string] provider of the identity.
|
15
18
|
#
|
16
19
|
# @return [json] Returns the created ticket url.
|
17
|
-
def post_email_verification(user_id, result_url: nil, ttl_sec: nil)
|
20
|
+
def post_email_verification(user_id, result_url: nil, ttl_sec: nil, identity: nil)
|
18
21
|
if user_id.to_s.empty?
|
19
22
|
raise Auth0::InvalidParameter, 'Must supply a valid user id to post an email verification'
|
20
23
|
end
|
@@ -24,6 +27,14 @@ module Auth0
|
|
24
27
|
result_url: result_url,
|
25
28
|
ttl_sec: ttl_sec.is_a?(Integer) ? ttl_sec : nil
|
26
29
|
}
|
30
|
+
|
31
|
+
if identity
|
32
|
+
unless identity.is_a? Hash
|
33
|
+
raise Auth0::InvalidParameter, 'Identity must be a hash to post an email verification'
|
34
|
+
end
|
35
|
+
request_params[:identity] = identity
|
36
|
+
end
|
37
|
+
|
27
38
|
post(path, request_params)
|
28
39
|
end
|
29
40
|
|
data/lib/auth0/version.rb
CHANGED
@@ -100,6 +100,18 @@ describe Auth0::Api::V2::Jobs do
|
|
100
100
|
client.send_verification_email(user['user_id'], Random.new(32).to_s)
|
101
101
|
end.to raise_error Auth0::BadRequest
|
102
102
|
end
|
103
|
+
|
104
|
+
it 'should raise an error if the user id is empty' do
|
105
|
+
expect do
|
106
|
+
client.send_verification_email( '' )
|
107
|
+
end.to raise_error Auth0::InvalidParameter, 'Must specify a user id'
|
108
|
+
end
|
109
|
+
|
110
|
+
it 'should raise an error if the identity supplied is not a Hash' do
|
111
|
+
expect do
|
112
|
+
client.send_verification_email( 'user_id', identity: 'not a hash')
|
113
|
+
end.to raise_error Auth0::InvalidParameter, 'Identity must be a hash send an email verification'
|
114
|
+
end
|
103
115
|
end
|
104
116
|
|
105
117
|
after(:all) do
|
@@ -35,7 +35,13 @@ describe Auth0::Api::V2::Tickets do
|
|
35
35
|
it 'should raise an error if the user id is empty' do
|
36
36
|
expect do
|
37
37
|
client.post_email_verification( '' )
|
38
|
-
end.to raise_error Auth0::InvalidParameter
|
38
|
+
end.to raise_error Auth0::InvalidParameter, 'Must supply a valid user id to post an email verification'
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'should raise an error if the identity supplied is not a Hash' do
|
42
|
+
expect do
|
43
|
+
client.post_email_verification( '', identity: 'not a hash')
|
44
|
+
end.to raise_error Auth0::InvalidParameter, 'Must supply a valid user id to post an email verification'
|
39
45
|
end
|
40
46
|
end
|
41
47
|
|
@@ -102,6 +102,23 @@ describe Auth0::Api::V2::Jobs do
|
|
102
102
|
end.not_to raise_error
|
103
103
|
end
|
104
104
|
|
105
|
+
it 'expect client to accept hash identity' do
|
106
|
+
expect(@instance).to receive(:post).with('/api/v2/jobs/verification-email', user_id: 'user_id',
|
107
|
+
identity: {
|
108
|
+
provider: "auth0",
|
109
|
+
user_id: "user_id"
|
110
|
+
})
|
111
|
+
expect {
|
112
|
+
@instance.send_verification_email('user_id', identity: { provider: "auth0", user_id: "user_id"})
|
113
|
+
}.not_to raise_error
|
114
|
+
end
|
115
|
+
|
116
|
+
it 'expect client to return nil when calling with a non-hash identity' do
|
117
|
+
expect { @instance.send_verification_email('user_id', identity: "nonhash") }.to raise_error(
|
118
|
+
'Identity must be a hash send an email verification'
|
119
|
+
)
|
120
|
+
end
|
121
|
+
|
105
122
|
it 'should raise an error if the user_id is empty' do
|
106
123
|
expect do
|
107
124
|
@instance.send_verification_email('')
|
@@ -21,6 +21,23 @@ describe Auth0::Api::V2::Tickets do
|
|
21
21
|
result_url: nil, ttl_sec: nil)
|
22
22
|
expect { @instance.post_email_verification('user_id', ttl_sec: "noninteger") }.not_to raise_error
|
23
23
|
end
|
24
|
+
it 'expect client to accept hash identity' do
|
25
|
+
expect(@instance).to receive(:post).with('/api/v2/tickets/email-verification', user_id: 'user_id',
|
26
|
+
result_url: nil,
|
27
|
+
ttl_sec: nil,
|
28
|
+
identity: {
|
29
|
+
provider: "auth0",
|
30
|
+
user_id: "user_id"
|
31
|
+
})
|
32
|
+
expect {
|
33
|
+
@instance.post_email_verification('user_id', identity: { provider: "auth0", user_id: "user_id"})
|
34
|
+
}.not_to raise_error
|
35
|
+
end
|
36
|
+
it 'expect client to return nil when calling with a non-hash identity' do
|
37
|
+
expect { @instance.post_email_verification('user_id', identity: "nonhash") }.to raise_error(
|
38
|
+
'Identity must be a hash to post an email verification'
|
39
|
+
)
|
40
|
+
end
|
24
41
|
it 'expect client to rasie error when calling with empty body' do
|
25
42
|
expect { @instance.post_email_verification(nil) }.to raise_error(
|
26
43
|
'Must supply a valid user id to post an email verification'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: auth0
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.16.0
|
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: 2020-
|
14
|
+
date: 2020-10-03 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rest-client
|