fusionauth_client 1.39.0 → 1.41.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.
- checksums.yaml +4 -4
- data/Gemfile +3 -3
- data/Gemfile.lock +1 -1
- data/build.savant +4 -5
- data/fusionauth-ruby-client.iml +0 -28
- data/fusionauth_client.gemspec +26 -11
- data/lib/fusionauth/fusionauth_client.rb +128 -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: 1b267a3d6f8f3a00b68ac5727b783b756fef5fecffbe961fef3c3598255186a0
|
|
4
|
+
data.tar.gz: 69de43665a4b212dc29ec957203b6cc9ac38cb143f21b60ac68cd0b93d6336fc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e47bfe9d82626e71a2a48e87d5c7add7e79244b780e404954629644f465c95afa9fe05356707393ff06f17120164cb96a6311c59bda27634f2d107eb1c5dce2a
|
|
7
|
+
data.tar.gz: '092c4e6154b7704114a28c76ab03873282333067e79fb322db51f90f92d2cfc8f8c3c174c0cabdfd31c23f288c6d64e06e810dd405db03109ca274009701b9ca'
|
data/Gemfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2019, FusionAuth, All Rights Reserved
|
|
1
|
+
# Copyright (c) 2019-2022, FusionAuth, All Rights Reserved
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
source 'https://rubygems.org'
|
|
16
16
|
ruby '2.5.9'
|
|
17
17
|
|
|
18
|
-
gem "rake",
|
|
19
|
-
gem "minitest",
|
|
18
|
+
gem "rake", "12.3.3"
|
|
19
|
+
gem "minitest", "5.8.3"
|
|
20
20
|
|
|
21
21
|
# Specify your gem's dependencies in fusionauth_client.gemspec
|
|
22
22
|
gemspec
|
data/Gemfile.lock
CHANGED
data/build.savant
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2018-
|
|
2
|
+
* Copyright (c) 2018-2022, FusionAuth, All Rights Reserved
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -13,10 +13,9 @@
|
|
|
13
13
|
* either express or implied. See the License for the specific
|
|
14
14
|
* language governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
savantVersion = "1.0.0"
|
|
17
16
|
|
|
18
17
|
pubVersion = ""
|
|
19
|
-
project(group: "io.fusionauth", name: "fusionauth-ruby-client", version: "1.
|
|
18
|
+
project(group: "io.fusionauth", name: "fusionauth-ruby-client", version: "1.41.0", licenses: ["ApacheV2_0"]) {
|
|
20
19
|
workflow {
|
|
21
20
|
fetch {
|
|
22
21
|
cache()
|
|
@@ -40,8 +39,8 @@ project(group: "io.fusionauth", name: "fusionauth-ruby-client", version: "1.39.0
|
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
// Plugins
|
|
43
|
-
file = loadPlugin(id: "org.savantbuild.plugin:file:
|
|
44
|
-
release = loadPlugin(id: "org.savantbuild.plugin:release-git
|
|
42
|
+
file = loadPlugin(id: "org.savantbuild.plugin:file:2.0.0-RC.4")
|
|
43
|
+
release = loadPlugin(id: "org.savantbuild.plugin:release-git:2.0.0-RC.4")
|
|
45
44
|
|
|
46
45
|
target(name: "clean", description: "Cleans build directory") {
|
|
47
46
|
file.prune(dir: 'pkg')
|
data/fusionauth-ruby-client.iml
CHANGED
|
@@ -12,32 +12,4 @@
|
|
|
12
12
|
<orderEntry type="library" scope="PROVIDED" name="minitest (v5.8.3, rbenv: 2.5.9) [gem]" level="application" />
|
|
13
13
|
<orderEntry type="library" scope="PROVIDED" name="rake (v12.3.3, rbenv: 2.5.9) [gem]" level="application" />
|
|
14
14
|
</component>
|
|
15
|
-
<component name="RakeTasksCache">
|
|
16
|
-
<option name="myRootTask">
|
|
17
|
-
<RakeTaskImpl id="rake">
|
|
18
|
-
<subtasks>
|
|
19
|
-
<RakeTaskImpl description="Build fusionauth_client-1.37.0.gem into the pkg directory" fullCommand="build" id="build" />
|
|
20
|
-
<RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
|
|
21
|
-
<RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
|
|
22
|
-
<RakeTaskImpl description="Build and install fusionauth_client-1.37.0.gem into system gems" fullCommand="install" id="install" />
|
|
23
|
-
<RakeTaskImpl id="install">
|
|
24
|
-
<subtasks>
|
|
25
|
-
<RakeTaskImpl description="Build and install fusionauth_client-1.37.0.gem into system gems without network access" fullCommand="install:local" id="local" />
|
|
26
|
-
</subtasks>
|
|
27
|
-
</RakeTaskImpl>
|
|
28
|
-
<RakeTaskImpl description="Create tag v1.37.0 and build and push fusionauth_client-1.37.0.gem to https://rubygems.org" fullCommand="release[remote]" id="release[remote]" />
|
|
29
|
-
<RakeTaskImpl description="Run tests" fullCommand="test" id="test" />
|
|
30
|
-
<RakeTaskImpl description="" fullCommand="default" id="default" />
|
|
31
|
-
<RakeTaskImpl description="" fullCommand="release" id="release" />
|
|
32
|
-
<RakeTaskImpl id="release">
|
|
33
|
-
<subtasks>
|
|
34
|
-
<RakeTaskImpl description="" fullCommand="release:guard_clean" id="guard_clean" />
|
|
35
|
-
<RakeTaskImpl description="" fullCommand="release:rubygem_push" id="rubygem_push" />
|
|
36
|
-
<RakeTaskImpl description="" fullCommand="release:source_control_push" id="source_control_push" />
|
|
37
|
-
</subtasks>
|
|
38
|
-
</RakeTaskImpl>
|
|
39
|
-
</subtasks>
|
|
40
|
-
</RakeTaskImpl>
|
|
41
|
-
</option>
|
|
42
|
-
</component>
|
|
43
15
|
</module>
|
data/fusionauth_client.gemspec
CHANGED
|
@@ -1,17 +1,32 @@
|
|
|
1
1
|
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2022, FusionAuth, All Rights Reserved
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
|
12
|
+
# software distributed under the License is distributed on an
|
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
|
14
|
+
# either express or implied. See the License for the specific
|
|
15
|
+
# language governing permissions and limitations under the License.
|
|
16
|
+
|
|
2
17
|
lib = File.expand_path('../lib', __FILE__)
|
|
3
18
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
19
|
|
|
5
20
|
Gem::Specification.new do |spec|
|
|
6
|
-
spec.name
|
|
7
|
-
spec.version
|
|
8
|
-
spec.authors
|
|
9
|
-
spec.email
|
|
21
|
+
spec.name = 'fusionauth_client'
|
|
22
|
+
spec.version = '1.41.0'
|
|
23
|
+
spec.authors = ['Brian Pontarelli', 'Daniel DeGroff']
|
|
24
|
+
spec.email = %w(brian@fusionauth.io daniel@fusionauth.io)
|
|
10
25
|
|
|
11
|
-
spec.summary
|
|
12
|
-
spec.description
|
|
13
|
-
spec.homepage
|
|
14
|
-
spec.license
|
|
26
|
+
spec.summary = %q{The Ruby client library for FusionAuth}
|
|
27
|
+
spec.description = %q{This library contains the Ruby client library that helps you connect your application to FusionAuth.}
|
|
28
|
+
spec.homepage = 'https://github.com/FusionAuth/fusionauth-ruby-client'
|
|
29
|
+
spec.license = 'Apache-2.0'
|
|
15
30
|
|
|
16
31
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
|
17
32
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
|
@@ -21,11 +36,11 @@ Gem::Specification.new do |spec|
|
|
|
21
36
|
raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
|
|
22
37
|
end
|
|
23
38
|
|
|
24
|
-
spec.files
|
|
39
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
25
40
|
f.match(%r{^(test|spec|features)/})
|
|
26
41
|
end
|
|
27
|
-
spec.bindir
|
|
28
|
-
spec.executables
|
|
42
|
+
spec.bindir = 'exe'
|
|
43
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
29
44
|
spec.require_paths = ['lib']
|
|
30
45
|
|
|
31
46
|
# spec.add_development_dependency 'bundler', '~> 1.14'
|
|
@@ -175,6 +175,26 @@ module FusionAuth
|
|
|
175
175
|
.go()
|
|
176
176
|
end
|
|
177
177
|
|
|
178
|
+
#
|
|
179
|
+
# Make a Client Credentials grant request to obtain an access token.
|
|
180
|
+
#
|
|
181
|
+
# @param client_id [string] The client identifier. The client Id is the Id of the FusionAuth Entity in which you are attempting to authenticate.
|
|
182
|
+
# @param client_secret [string] The client secret used to authenticate this request.
|
|
183
|
+
# @param scope [string] (Optional) This parameter is used to indicate which target entity you are requesting access. To request access to an entity, use the format target-entity:<target-entity-id>:<roles>. Roles are an optional comma separated list.
|
|
184
|
+
# @return [FusionAuth::ClientResponse] The ClientResponse object.
|
|
185
|
+
def client_credentials_grant(client_id, client_secret, scope)
|
|
186
|
+
body = {
|
|
187
|
+
"client_id" => client_id,
|
|
188
|
+
"client_secret" => client_secret,
|
|
189
|
+
"grant_type" => "client_credentials",
|
|
190
|
+
"scope" => scope
|
|
191
|
+
}
|
|
192
|
+
startAnonymous.uri('/oauth2/token')
|
|
193
|
+
.body_handler(FusionAuth::FormDataBodyHandler.new(body))
|
|
194
|
+
.post()
|
|
195
|
+
.go()
|
|
196
|
+
end
|
|
197
|
+
|
|
178
198
|
#
|
|
179
199
|
# Adds a comment to the user's account.
|
|
180
200
|
#
|
|
@@ -187,6 +207,42 @@ module FusionAuth
|
|
|
187
207
|
.go()
|
|
188
208
|
end
|
|
189
209
|
|
|
210
|
+
#
|
|
211
|
+
# Complete a WebAuthn authentication ceremony by validating the signature against the previously generated challenge without logging the user in
|
|
212
|
+
#
|
|
213
|
+
# @param request [OpenStruct, Hash] An object containing data necessary for completing the authentication ceremony
|
|
214
|
+
# @return [FusionAuth::ClientResponse] The ClientResponse object.
|
|
215
|
+
def complete_web_authn_assertion(request)
|
|
216
|
+
startAnonymous.uri('/api/webauthn/assert')
|
|
217
|
+
.body_handler(FusionAuth::JSONBodyHandler.new(request))
|
|
218
|
+
.post()
|
|
219
|
+
.go()
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
#
|
|
223
|
+
# Complete a WebAuthn authentication ceremony by validating the signature against the previously generated challenge and then login the user in
|
|
224
|
+
#
|
|
225
|
+
# @param request [OpenStruct, Hash] An object containing data necessary for completing the authentication ceremony
|
|
226
|
+
# @return [FusionAuth::ClientResponse] The ClientResponse object.
|
|
227
|
+
def complete_web_authn_login(request)
|
|
228
|
+
startAnonymous.uri('/api/webauthn/login')
|
|
229
|
+
.body_handler(FusionAuth::JSONBodyHandler.new(request))
|
|
230
|
+
.post()
|
|
231
|
+
.go()
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
#
|
|
235
|
+
# Complete a WebAuthn registration ceremony by validating the client request and saving the new credential
|
|
236
|
+
#
|
|
237
|
+
# @param request [OpenStruct, Hash] An object containing data necessary for completing the registration ceremony
|
|
238
|
+
# @return [FusionAuth::ClientResponse] The ClientResponse object.
|
|
239
|
+
def complete_web_authn_registration(request)
|
|
240
|
+
start.uri('/api/webauthn/register/complete')
|
|
241
|
+
.body_handler(FusionAuth::JSONBodyHandler.new(request))
|
|
242
|
+
.post()
|
|
243
|
+
.go()
|
|
244
|
+
end
|
|
245
|
+
|
|
190
246
|
#
|
|
191
247
|
# Creates an API key. You can optionally specify a unique Id for the key, if not provided one will be generated.
|
|
192
248
|
# an API key can only be created with equal or lesser authority. An API key cannot create another API key unless it is granted
|
|
@@ -1110,6 +1166,18 @@ module FusionAuth
|
|
|
1110
1166
|
.go()
|
|
1111
1167
|
end
|
|
1112
1168
|
|
|
1169
|
+
#
|
|
1170
|
+
# Deletes the WebAuthn credential for the given Id.
|
|
1171
|
+
#
|
|
1172
|
+
# @param id [string] The Id of the WebAuthn credential to delete.
|
|
1173
|
+
# @return [FusionAuth::ClientResponse] The ClientResponse object.
|
|
1174
|
+
def delete_web_authn_credential(id)
|
|
1175
|
+
start.uri('/api/webauthn')
|
|
1176
|
+
.url_segment(id)
|
|
1177
|
+
.delete()
|
|
1178
|
+
.go()
|
|
1179
|
+
end
|
|
1180
|
+
|
|
1113
1181
|
#
|
|
1114
1182
|
# Deletes the webhook for the given Id.
|
|
1115
1183
|
#
|
|
@@ -1438,6 +1506,18 @@ module FusionAuth
|
|
|
1438
1506
|
.go()
|
|
1439
1507
|
end
|
|
1440
1508
|
|
|
1509
|
+
#
|
|
1510
|
+
# Import a WebAuthn credential
|
|
1511
|
+
#
|
|
1512
|
+
# @param request [OpenStruct, Hash] An object containing data necessary for importing the credential
|
|
1513
|
+
# @return [FusionAuth::ClientResponse] The ClientResponse object.
|
|
1514
|
+
def import_web_authn_credential(request)
|
|
1515
|
+
start.uri('/api/webauthn/import')
|
|
1516
|
+
.body_handler(FusionAuth::JSONBodyHandler.new(request))
|
|
1517
|
+
.post()
|
|
1518
|
+
.go()
|
|
1519
|
+
end
|
|
1520
|
+
|
|
1441
1521
|
#
|
|
1442
1522
|
# Inspect an access token issued by FusionAuth.
|
|
1443
1523
|
#
|
|
@@ -3230,6 +3310,30 @@ module FusionAuth
|
|
|
3230
3310
|
.go()
|
|
3231
3311
|
end
|
|
3232
3312
|
|
|
3313
|
+
#
|
|
3314
|
+
# Retrieves the WebAuthn credential for the given Id.
|
|
3315
|
+
#
|
|
3316
|
+
# @param id [string] The Id of the WebAuthn credential.
|
|
3317
|
+
# @return [FusionAuth::ClientResponse] The ClientResponse object.
|
|
3318
|
+
def retrieve_web_authn_credential(id)
|
|
3319
|
+
start.uri('/api/webauthn')
|
|
3320
|
+
.url_segment(id)
|
|
3321
|
+
.get()
|
|
3322
|
+
.go()
|
|
3323
|
+
end
|
|
3324
|
+
|
|
3325
|
+
#
|
|
3326
|
+
# Retrieves all WebAuthn credentials for the given user.
|
|
3327
|
+
#
|
|
3328
|
+
# @param user_id [string] The user's ID.
|
|
3329
|
+
# @return [FusionAuth::ClientResponse] The ClientResponse object.
|
|
3330
|
+
def retrieve_web_authn_credentials_for_user(user_id)
|
|
3331
|
+
start.uri('/api/webauthn')
|
|
3332
|
+
.url_parameter('userId', user_id)
|
|
3333
|
+
.get()
|
|
3334
|
+
.go()
|
|
3335
|
+
end
|
|
3336
|
+
|
|
3233
3337
|
#
|
|
3234
3338
|
# Retrieves the webhook for the given Id. If you pass in null for the id, this will return all the webhooks.
|
|
3235
3339
|
#
|
|
@@ -3684,6 +3788,30 @@ module FusionAuth
|
|
|
3684
3788
|
.go()
|
|
3685
3789
|
end
|
|
3686
3790
|
|
|
3791
|
+
#
|
|
3792
|
+
# Start a WebAuthn authentication ceremony by generating a new challenge for the user
|
|
3793
|
+
#
|
|
3794
|
+
# @param request [OpenStruct, Hash] An object containing data necessary for starting the authentication ceremony
|
|
3795
|
+
# @return [FusionAuth::ClientResponse] The ClientResponse object.
|
|
3796
|
+
def start_web_authn_login(request)
|
|
3797
|
+
start.uri('/api/webauthn/start')
|
|
3798
|
+
.body_handler(FusionAuth::JSONBodyHandler.new(request))
|
|
3799
|
+
.post()
|
|
3800
|
+
.go()
|
|
3801
|
+
end
|
|
3802
|
+
|
|
3803
|
+
#
|
|
3804
|
+
# Start a WebAuthn registration ceremony by generating a new challenge for the user
|
|
3805
|
+
#
|
|
3806
|
+
# @param request [OpenStruct, Hash] An object containing data necessary for starting the registration ceremony
|
|
3807
|
+
# @return [FusionAuth::ClientResponse] The ClientResponse object.
|
|
3808
|
+
def start_web_authn_registration(request)
|
|
3809
|
+
start.uri('/api/webauthn/register/start')
|
|
3810
|
+
.body_handler(FusionAuth::JSONBodyHandler.new(request))
|
|
3811
|
+
.post()
|
|
3812
|
+
.go()
|
|
3813
|
+
end
|
|
3814
|
+
|
|
3687
3815
|
#
|
|
3688
3816
|
# Complete login using a 2FA challenge
|
|
3689
3817
|
#
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fusionauth_client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.41.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brian Pontarelli
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2022-
|
|
12
|
+
date: 2022-11-10 00:00:00.000000000 Z
|
|
13
13
|
dependencies: []
|
|
14
14
|
description: This library contains the Ruby client library that helps you connect
|
|
15
15
|
your application to FusionAuth.
|