fusionauth_client 1.49.1 → 1.50.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +6 -0
  3. data/.github/fusionauth/.env +6 -0
  4. data/.github/fusionauth/docker-compose.yml +51 -0
  5. data/.github/fusionauth/kickstart.json +46 -0
  6. data/.github/workflows/docs.yml +31 -0
  7. data/.github/workflows/test.yml +31 -0
  8. data/.ruby-version +1 -1
  9. data/Gemfile +5 -6
  10. data/Gemfile.lock +20 -23
  11. data/README.md +225 -0
  12. data/build.savant +2 -2
  13. data/doc/FusionAuth/FusionAuthClient.html +14185 -0
  14. data/doc/FusionAuth/FusionAuthClient.md +197 -80
  15. data/doc/FusionAuth.html +108 -0
  16. data/doc/FusionAuth.md +1 -1
  17. data/doc/created.rid +2 -2
  18. data/doc/css/fonts.css +167 -0
  19. data/doc/css/rdoc.css +619 -0
  20. data/doc/fonts/Lato-Light.ttf +0 -0
  21. data/doc/fonts/Lato-LightItalic.ttf +0 -0
  22. data/doc/fonts/Lato-Regular.ttf +0 -0
  23. data/doc/fonts/Lato-RegularItalic.ttf +0 -0
  24. data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
  25. data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
  26. data/doc/images/add.png +0 -0
  27. data/doc/images/arrow_up.png +0 -0
  28. data/doc/images/brick.png +0 -0
  29. data/doc/images/brick_link.png +0 -0
  30. data/doc/images/bug.png +0 -0
  31. data/doc/images/bullet_black.png +0 -0
  32. data/doc/images/bullet_toggle_minus.png +0 -0
  33. data/doc/images/bullet_toggle_plus.png +0 -0
  34. data/doc/images/date.png +0 -0
  35. data/doc/images/delete.png +0 -0
  36. data/doc/images/find.png +0 -0
  37. data/doc/images/loadingAnimation.gif +0 -0
  38. data/doc/images/macFFBgHack.png +0 -0
  39. data/doc/images/package.png +0 -0
  40. data/doc/images/page_green.png +0 -0
  41. data/doc/images/page_white_text.png +0 -0
  42. data/doc/images/page_white_width.png +0 -0
  43. data/doc/images/plugin.png +0 -0
  44. data/doc/images/ruby.png +0 -0
  45. data/doc/images/tag_blue.png +0 -0
  46. data/doc/images/tag_green.png +0 -0
  47. data/doc/images/transparent.png +0 -0
  48. data/doc/images/wrench.png +0 -0
  49. data/doc/images/wrench_orange.png +0 -0
  50. data/doc/images/zoom.png +0 -0
  51. data/doc/index.html +89 -0
  52. data/doc/js/darkfish.js +84 -0
  53. data/doc/js/navigation.js +105 -0
  54. data/doc/js/navigation.js.gz +0 -0
  55. data/doc/js/search.js +110 -0
  56. data/doc/js/search_index.js +1 -0
  57. data/doc/js/search_index.js.gz +0 -0
  58. data/doc/js/searcher.js +229 -0
  59. data/doc/js/searcher.js.gz +0 -0
  60. data/doc/table_of_contents.html +1765 -0
  61. data/fusionauth-ruby-client.iml +1 -4
  62. data/fusionauth_client.gemspec +2 -2
  63. data/lib/fusionauth/fusionauth_client.rb +84 -1
  64. data/lib/fusionauth/rest_client.rb +1 -1
  65. metadata +54 -4
  66. data/README.adoc +0 -106
  67. data/doc/index.db +0 -0
@@ -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>
@@ -1,6 +1,6 @@
1
1
  # coding: utf-8
2
2
 
3
- # Copyright (c) 2022, FusionAuth, All Rights Reserved
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.49.1'
22
+ spec.version = '1.50.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 deactivate.
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
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2019-2023, FusionAuth, All Rights Reserved
1
+ # Copyright (c) 2019-2024, 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.
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.49.1
4
+ version: 1.50.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-03-07 00:00:00.000000000 Z
12
+ date: 2024-04-25 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,68 @@ 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/docs.yml"
28
+ - ".github/workflows/test.yml"
23
29
  - ".gitignore"
24
30
  - ".ruby-version"
25
31
  - Gemfile
26
32
  - Gemfile.lock
27
33
  - LICENSE.txt
28
- - README.adoc
34
+ - README.md
29
35
  - Rakefile
30
36
  - build.savant
37
+ - doc/FusionAuth.html
31
38
  - doc/FusionAuth.md
39
+ - doc/FusionAuth/FusionAuthClient.html
32
40
  - doc/FusionAuth/FusionAuthClient.md
33
41
  - doc/created.rid
34
- - doc/index.db
42
+ - doc/css/fonts.css
43
+ - doc/css/rdoc.css
44
+ - doc/fonts/Lato-Light.ttf
45
+ - doc/fonts/Lato-LightItalic.ttf
46
+ - doc/fonts/Lato-Regular.ttf
47
+ - doc/fonts/Lato-RegularItalic.ttf
48
+ - doc/fonts/SourceCodePro-Bold.ttf
49
+ - doc/fonts/SourceCodePro-Regular.ttf
50
+ - doc/images/add.png
51
+ - doc/images/arrow_up.png
52
+ - doc/images/brick.png
53
+ - doc/images/brick_link.png
54
+ - doc/images/bug.png
55
+ - doc/images/bullet_black.png
56
+ - doc/images/bullet_toggle_minus.png
57
+ - doc/images/bullet_toggle_plus.png
58
+ - doc/images/date.png
59
+ - doc/images/delete.png
60
+ - doc/images/find.png
61
+ - doc/images/loadingAnimation.gif
62
+ - doc/images/macFFBgHack.png
63
+ - doc/images/package.png
64
+ - doc/images/page_green.png
65
+ - doc/images/page_white_text.png
66
+ - doc/images/page_white_width.png
67
+ - doc/images/plugin.png
68
+ - doc/images/ruby.png
69
+ - doc/images/tag_blue.png
70
+ - doc/images/tag_green.png
71
+ - doc/images/transparent.png
72
+ - doc/images/wrench.png
73
+ - doc/images/wrench_orange.png
74
+ - doc/images/zoom.png
75
+ - doc/index.html
76
+ - doc/js/darkfish.js
77
+ - doc/js/navigation.js
78
+ - doc/js/navigation.js.gz
79
+ - doc/js/search.js
80
+ - doc/js/search_index.js
81
+ - doc/js/search_index.js.gz
82
+ - doc/js/searcher.js
83
+ - doc/js/searcher.js.gz
84
+ - doc/table_of_contents.html
35
85
  - examples/create_user.rb
36
86
  - examples/login.rb
37
87
  - fusionauth-ruby-client.iml
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