fusionauth_client 1.49.1 → 1.51.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +6 -0
- data/.github/fusionauth/.env +6 -0
- data/.github/fusionauth/docker-compose.yml +51 -0
- data/.github/fusionauth/kickstart.json +46 -0
- data/.github/workflows/deploy.yaml +87 -0
- data/.github/workflows/docs.yml +31 -0
- data/.github/workflows/test.yml +33 -0
- data/.ruby-version +1 -1
- data/Gemfile +5 -6
- data/Gemfile.lock +20 -23
- data/README.md +225 -0
- data/build.savant +3 -3
- data/doc/FusionAuth/FusionAuthClient.html +14185 -0
- data/doc/FusionAuth/FusionAuthClient.md +197 -80
- data/doc/FusionAuth.html +108 -0
- data/doc/FusionAuth.md +1 -1
- data/doc/created.rid +2 -2
- data/doc/css/fonts.css +167 -0
- data/doc/css/rdoc.css +619 -0
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +89 -0
- data/doc/js/darkfish.js +84 -0
- data/doc/js/navigation.js +105 -0
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search.js +110 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js +229 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +1765 -0
- data/fusionauth-ruby-client.iml +1 -4
- data/fusionauth_client.gemspec +2 -2
- data/lib/fusionauth/fusionauth_client.rb +84 -1
- data/lib/fusionauth/rest_client.rb +1 -1
- metadata +56 -5
- data/README.adoc +0 -106
- data/doc/index.db +0 -0
data/fusionauth-ruby-client.iml
CHANGED
@@ -8,8 +8,5 @@
|
|
8
8
|
</content>
|
9
9
|
<orderEntry type="jdk" jdkName="rbenv: 2.5.9" jdkType="RUBY_SDK" />
|
10
10
|
<orderEntry type="sourceFolder" forTests="false" />
|
11
|
-
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.2.5, rbenv: 2.5.9) [gem]" level="application" />
|
12
|
-
<orderEntry type="library" scope="PROVIDED" name="minitest (v5.8.3, rbenv: 2.5.9) [gem]" level="application" />
|
13
|
-
<orderEntry type="library" scope="PROVIDED" name="rake (v12.3.3, rbenv: 2.5.9) [gem]" level="application" />
|
14
11
|
</component>
|
15
|
-
</module>
|
12
|
+
</module>
|
data/fusionauth_client.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
|
-
# Copyright (c)
|
3
|
+
# Copyright (c) 2024, FusionAuth, All Rights Reserved
|
4
4
|
#
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
# you may not use this file except in compliance with the License.
|
@@ -19,7 +19,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
19
19
|
|
20
20
|
Gem::Specification.new do |spec|
|
21
21
|
spec.name = 'fusionauth_client'
|
22
|
-
spec.version = '1.
|
22
|
+
spec.version = '1.51.0'
|
23
23
|
spec.authors = ['Brian Pontarelli', 'Daniel DeGroff']
|
24
24
|
spec.email = %w(brian@fusionauth.io daniel@fusionauth.io)
|
25
25
|
|
@@ -557,6 +557,24 @@ module FusionAuth
|
|
557
557
|
.go()
|
558
558
|
end
|
559
559
|
|
560
|
+
#
|
561
|
+
# Creates a new custom OAuth scope for an application. You must specify the Id of the application you are creating the scope for.
|
562
|
+
# You can optionally specify an Id for the OAuth scope on the URL, if not provided one will be generated.
|
563
|
+
#
|
564
|
+
# @param application_id [string] The Id of the application to create the OAuth scope on.
|
565
|
+
# @param scope_id [string] (Optional) The Id of the OAuth scope. If not provided a secure random UUID will be generated.
|
566
|
+
# @param request [OpenStruct, Hash] The request object that contains all the information used to create the OAuth OAuth scope.
|
567
|
+
# @return [FusionAuth::ClientResponse] The ClientResponse object.
|
568
|
+
def create_o_auth_scope(application_id, scope_id, request)
|
569
|
+
start.uri('/api/application')
|
570
|
+
.url_segment(application_id)
|
571
|
+
.url_segment("scope")
|
572
|
+
.url_segment(scope_id)
|
573
|
+
.body_handler(FusionAuth::JSONBodyHandler.new(request))
|
574
|
+
.post()
|
575
|
+
.go()
|
576
|
+
end
|
577
|
+
|
560
578
|
#
|
561
579
|
# Creates a tenant. You can optionally specify an Id for the tenant, if not provided one will be generated.
|
562
580
|
#
|
@@ -776,7 +794,7 @@ module FusionAuth
|
|
776
794
|
# Hard deletes an application role. This is a dangerous operation and should not be used in most circumstances. This
|
777
795
|
# permanently removes the given role from all users that had it.
|
778
796
|
#
|
779
|
-
# @param application_id [string] The Id of the application to
|
797
|
+
# @param application_id [string] The Id of the application that the role belongs to.
|
780
798
|
# @param role_id [string] The Id of the role to delete.
|
781
799
|
# @return [FusionAuth::ClientResponse] The ClientResponse object.
|
782
800
|
def delete_application_role(application_id, role_id)
|
@@ -1001,6 +1019,22 @@ module FusionAuth
|
|
1001
1019
|
.go()
|
1002
1020
|
end
|
1003
1021
|
|
1022
|
+
#
|
1023
|
+
# Hard deletes a custom OAuth scope.
|
1024
|
+
# OAuth workflows that are still requesting the deleted OAuth scope may fail depending on the application's unknown scope policy.
|
1025
|
+
#
|
1026
|
+
# @param application_id [string] The Id of the application that the OAuth scope belongs to.
|
1027
|
+
# @param scope_id [string] The Id of the OAuth scope to delete.
|
1028
|
+
# @return [FusionAuth::ClientResponse] The ClientResponse object.
|
1029
|
+
def delete_o_auth_scope(application_id, scope_id)
|
1030
|
+
start.uri('/api/application')
|
1031
|
+
.url_segment(application_id)
|
1032
|
+
.url_segment("scope")
|
1033
|
+
.url_segment(scope_id)
|
1034
|
+
.delete()
|
1035
|
+
.go()
|
1036
|
+
end
|
1037
|
+
|
1004
1038
|
#
|
1005
1039
|
# Deletes the user registration for the given user and application.
|
1006
1040
|
#
|
@@ -1902,6 +1936,23 @@ module FusionAuth
|
|
1902
1936
|
.go()
|
1903
1937
|
end
|
1904
1938
|
|
1939
|
+
#
|
1940
|
+
# Updates, via PATCH, the custom OAuth scope with the given Id for the application.
|
1941
|
+
#
|
1942
|
+
# @param application_id [string] The Id of the application that the OAuth scope belongs to.
|
1943
|
+
# @param scope_id [string] The Id of the OAuth scope to update.
|
1944
|
+
# @param request [OpenStruct, Hash] The request that contains just the new OAuth scope information.
|
1945
|
+
# @return [FusionAuth::ClientResponse] The ClientResponse object.
|
1946
|
+
def patch_o_auth_scope(application_id, scope_id, request)
|
1947
|
+
start.uri('/api/application')
|
1948
|
+
.url_segment(application_id)
|
1949
|
+
.url_segment("scope")
|
1950
|
+
.url_segment(scope_id)
|
1951
|
+
.body_handler(FusionAuth::JSONBodyHandler.new(request))
|
1952
|
+
.patch()
|
1953
|
+
.go()
|
1954
|
+
end
|
1955
|
+
|
1905
1956
|
#
|
1906
1957
|
# Updates, via PATCH, the registration for the user with the given Id and the application defined in the request.
|
1907
1958
|
#
|
@@ -2820,6 +2871,21 @@ module FusionAuth
|
|
2820
2871
|
.go()
|
2821
2872
|
end
|
2822
2873
|
|
2874
|
+
#
|
2875
|
+
# Retrieves a custom OAuth scope.
|
2876
|
+
#
|
2877
|
+
# @param application_id [string] The Id of the application that the OAuth scope belongs to.
|
2878
|
+
# @param scope_id [string] The Id of the OAuth scope to retrieve.
|
2879
|
+
# @return [FusionAuth::ClientResponse] The ClientResponse object.
|
2880
|
+
def retrieve_o_auth_scope(application_id, scope_id)
|
2881
|
+
start.uri('/api/application')
|
2882
|
+
.url_segment(application_id)
|
2883
|
+
.url_segment("scope")
|
2884
|
+
.url_segment(scope_id)
|
2885
|
+
.get()
|
2886
|
+
.go()
|
2887
|
+
end
|
2888
|
+
|
2823
2889
|
#
|
2824
2890
|
# Retrieves the Oauth2 configuration for the application for the given Application Id.
|
2825
2891
|
#
|
@@ -4322,6 +4388,23 @@ module FusionAuth
|
|
4322
4388
|
.go()
|
4323
4389
|
end
|
4324
4390
|
|
4391
|
+
#
|
4392
|
+
# Updates the OAuth scope with the given Id for the application.
|
4393
|
+
#
|
4394
|
+
# @param application_id [string] The Id of the application that the OAuth scope belongs to.
|
4395
|
+
# @param scope_id [string] The Id of the OAuth scope to update.
|
4396
|
+
# @param request [OpenStruct, Hash] The request that contains all the new OAuth scope information.
|
4397
|
+
# @return [FusionAuth::ClientResponse] The ClientResponse object.
|
4398
|
+
def update_o_auth_scope(application_id, scope_id, request)
|
4399
|
+
start.uri('/api/application')
|
4400
|
+
.url_segment(application_id)
|
4401
|
+
.url_segment("scope")
|
4402
|
+
.url_segment(scope_id)
|
4403
|
+
.body_handler(FusionAuth::JSONBodyHandler.new(request))
|
4404
|
+
.put()
|
4405
|
+
.go()
|
4406
|
+
end
|
4407
|
+
|
4325
4408
|
#
|
4326
4409
|
# Updates the registration for the user with the given Id and the application defined in the request.
|
4327
4410
|
#
|
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.51.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: 2024-
|
12
|
+
date: 2024-06-06 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.
|
@@ -20,18 +20,69 @@ executables: []
|
|
20
20
|
extensions: []
|
21
21
|
extra_rdoc_files: []
|
22
22
|
files:
|
23
|
+
- ".github/dependabot.yml"
|
24
|
+
- ".github/fusionauth/.env"
|
25
|
+
- ".github/fusionauth/docker-compose.yml"
|
26
|
+
- ".github/fusionauth/kickstart.json"
|
27
|
+
- ".github/workflows/deploy.yaml"
|
28
|
+
- ".github/workflows/docs.yml"
|
29
|
+
- ".github/workflows/test.yml"
|
23
30
|
- ".gitignore"
|
24
31
|
- ".ruby-version"
|
25
32
|
- Gemfile
|
26
33
|
- Gemfile.lock
|
27
34
|
- LICENSE.txt
|
28
|
-
- README.
|
35
|
+
- README.md
|
29
36
|
- Rakefile
|
30
37
|
- build.savant
|
38
|
+
- doc/FusionAuth.html
|
31
39
|
- doc/FusionAuth.md
|
40
|
+
- doc/FusionAuth/FusionAuthClient.html
|
32
41
|
- doc/FusionAuth/FusionAuthClient.md
|
33
42
|
- doc/created.rid
|
34
|
-
- doc/
|
43
|
+
- doc/css/fonts.css
|
44
|
+
- doc/css/rdoc.css
|
45
|
+
- doc/fonts/Lato-Light.ttf
|
46
|
+
- doc/fonts/Lato-LightItalic.ttf
|
47
|
+
- doc/fonts/Lato-Regular.ttf
|
48
|
+
- doc/fonts/Lato-RegularItalic.ttf
|
49
|
+
- doc/fonts/SourceCodePro-Bold.ttf
|
50
|
+
- doc/fonts/SourceCodePro-Regular.ttf
|
51
|
+
- doc/images/add.png
|
52
|
+
- doc/images/arrow_up.png
|
53
|
+
- doc/images/brick.png
|
54
|
+
- doc/images/brick_link.png
|
55
|
+
- doc/images/bug.png
|
56
|
+
- doc/images/bullet_black.png
|
57
|
+
- doc/images/bullet_toggle_minus.png
|
58
|
+
- doc/images/bullet_toggle_plus.png
|
59
|
+
- doc/images/date.png
|
60
|
+
- doc/images/delete.png
|
61
|
+
- doc/images/find.png
|
62
|
+
- doc/images/loadingAnimation.gif
|
63
|
+
- doc/images/macFFBgHack.png
|
64
|
+
- doc/images/package.png
|
65
|
+
- doc/images/page_green.png
|
66
|
+
- doc/images/page_white_text.png
|
67
|
+
- doc/images/page_white_width.png
|
68
|
+
- doc/images/plugin.png
|
69
|
+
- doc/images/ruby.png
|
70
|
+
- doc/images/tag_blue.png
|
71
|
+
- doc/images/tag_green.png
|
72
|
+
- doc/images/transparent.png
|
73
|
+
- doc/images/wrench.png
|
74
|
+
- doc/images/wrench_orange.png
|
75
|
+
- doc/images/zoom.png
|
76
|
+
- doc/index.html
|
77
|
+
- doc/js/darkfish.js
|
78
|
+
- doc/js/navigation.js
|
79
|
+
- doc/js/navigation.js.gz
|
80
|
+
- doc/js/search.js
|
81
|
+
- doc/js/search_index.js
|
82
|
+
- doc/js/search_index.js.gz
|
83
|
+
- doc/js/searcher.js
|
84
|
+
- doc/js/searcher.js.gz
|
85
|
+
- doc/table_of_contents.html
|
35
86
|
- examples/create_user.rb
|
36
87
|
- examples/login.rb
|
37
88
|
- fusionauth-ruby-client.iml
|
@@ -58,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
109
|
- !ruby/object:Gem::Version
|
59
110
|
version: '0'
|
60
111
|
requirements: []
|
61
|
-
rubygems_version: 3.
|
112
|
+
rubygems_version: 3.4.22
|
62
113
|
signing_key:
|
63
114
|
specification_version: 4
|
64
115
|
summary: The Ruby client library for FusionAuth
|
data/README.adoc
DELETED
@@ -1,106 +0,0 @@
|
|
1
|
-
== FusionAuth::FusionAuthClient
|
2
|
-
|
3
|
-
This gem is the Ruby client library that helps connect Ruby applications to the FusionAuth (https://fusionauth.io) Identity and User Management platform.
|
4
|
-
|
5
|
-
== Getting Started
|
6
|
-
|
7
|
-
=== Installation
|
8
|
-
|
9
|
-
Add this line to your application’s Gemfile:
|
10
|
-
|
11
|
-
[source,ruby]
|
12
|
-
----
|
13
|
-
gem 'fusionauth_client'
|
14
|
-
----
|
15
|
-
|
16
|
-
And then execute:
|
17
|
-
|
18
|
-
[source,shell]
|
19
|
-
----
|
20
|
-
bundle
|
21
|
-
----
|
22
|
-
|
23
|
-
Or install it yourself as:
|
24
|
-
|
25
|
-
[source,shell]
|
26
|
-
----
|
27
|
-
gem install fusionauth_client
|
28
|
-
----
|
29
|
-
|
30
|
-
=== Usage
|
31
|
-
|
32
|
-
Once the gem is installed, you can call FusionAuth APIs.
|
33
|
-
|
34
|
-
[source,ruby]
|
35
|
-
----
|
36
|
-
require 'fusionauth/fusionauth_client'
|
37
|
-
require 'securerandom'
|
38
|
-
require 'pp'
|
39
|
-
|
40
|
-
# Construct the FusionAuth Client
|
41
|
-
client = FusionAuth::FusionAuthClient.new(
|
42
|
-
'REPLACE_ME',
|
43
|
-
'http://localhost:9011'
|
44
|
-
)
|
45
|
-
|
46
|
-
application_id = '85a03867-dccf-4882-adde-1a79aeec50df'
|
47
|
-
|
48
|
-
# Create a user + registration
|
49
|
-
id = SecureRandom.uuid
|
50
|
-
response = client.register(id, {
|
51
|
-
user: {
|
52
|
-
firstName: 'Ruby',
|
53
|
-
lastName: 'User',
|
54
|
-
email: 'ruby_user@example.com',
|
55
|
-
password: 'password'
|
56
|
-
},
|
57
|
-
registration: {
|
58
|
-
applicationId: application_id,
|
59
|
-
data: {
|
60
|
-
foo: 'bar'
|
61
|
-
},
|
62
|
-
preferredLanguages: %w(en fr),
|
63
|
-
roles: %w(dev)
|
64
|
-
}
|
65
|
-
})
|
66
|
-
|
67
|
-
#pp response
|
68
|
-
if response.success_response
|
69
|
-
pp response.success_response
|
70
|
-
else
|
71
|
-
if response.exception
|
72
|
-
# if we can't connect
|
73
|
-
print response.exception
|
74
|
-
end
|
75
|
-
print "status: #{response.status}"
|
76
|
-
print response.error_response
|
77
|
-
exit
|
78
|
-
end
|
79
|
-
----
|
80
|
-
|
81
|
-
== Documentation
|
82
|
-
|
83
|
-
Documentation can be found at https://github.com/FusionAuth/fusionauth-ruby-client/tree/master/doc[doc].
|
84
|
-
|
85
|
-
=== Questions and support
|
86
|
-
|
87
|
-
If you have a question or support issue regarding this client library, we’d love to hear from you.
|
88
|
-
|
89
|
-
If you have a paid edition with support included, please https://account.fusionauth.io/account/support/[open a ticket in your account portal]. Learn more about https://fusionauth.io/pricing[paid editions here].
|
90
|
-
|
91
|
-
Otherwise, please https://fusionauth.io/community/forum/[post your question in the community forum].
|
92
|
-
|
93
|
-
=== Contributing
|
94
|
-
|
95
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/FusionAuth/fusionauth-ruby-client.
|
96
|
-
|
97
|
-
All issues filed in this repository must abide by the [FusionAuth community guidelines](https://fusionauth.io/community/forum/topic/1000/code-of-conduct).
|
98
|
-
|
99
|
-
=== License
|
100
|
-
|
101
|
-
This code is available as open source under the terms of the https://opensource.org/licenses/Apache-2.0[Apache v2.0 License].
|
102
|
-
|
103
|
-
//tag::forDocSite[]
|
104
|
-
|
105
|
-
//end::forDocSite[]
|
106
|
-
|
data/doc/index.db
DELETED
Binary file
|