fusionauth_client 1.17.0 → 1.21.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f91a54dc500875d697bca113a8dfd213c8c4de1f4ac8b4cc8ee3eb605b83d98d
4
- data.tar.gz: 05d4ed2eb2a09ee56a4d995115682d8661964b70b403bb88304a1bfcf5e4e810
3
+ metadata.gz: a2112fbc16e044c2716b50a04c2a720acc7616e99e0119bc494c721947282504
4
+ data.tar.gz: 902dcf9aa23e9ea20ec66636d9cdb30d210adc6735cc56e60058c6c8eb643235
5
5
  SHA512:
6
- metadata.gz: 1570fbff542d1f5d7a4ed1c6168ac5a8264e6e97bdd7eaa560257ce6796ff7562cf81bbbe74310a0e997f016e055d7911d1e541d784f5048ea14ad4c851c8f80
7
- data.tar.gz: d46ff0619da3c0d70ae9093f3a338216390286048b731ee336e785bab72b726d80c4e50230ebe8e847e708f98ffeeaa5f5dfd1339ecac0f28db743c7af1a28b9
6
+ metadata.gz: 3c754dbde8485f89dc21b9b746b8ca4880ea8135612af8dcf056798ff92c0d98267b981d78fe1643574348cd4e4b8892df6b0807ff34581fcbfb89e403c266e1
7
+ data.tar.gz: 240debc7317d5c870636dcccf5aea0380b98dfe95ec10db183992658b8eb140970ac8c5084366ff013b7fcf09412d69b1e9fb2a5d9e3143935e06559004e5a9b
data/.gitignore CHANGED
@@ -8,4 +8,5 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  .rakeTasks
11
- /build
11
+ /build
12
+ **/.DS_Store
@@ -1 +1 @@
1
- 2.3.1
1
+ 2.5.1
data/Gemfile CHANGED
@@ -13,7 +13,7 @@
13
13
  # language governing permissions and limitations under the License.
14
14
 
15
15
  source 'https://rubygems.org'
16
- ruby '2.3.1'
16
+ ruby '2.5.1'
17
17
 
18
18
  gem "rake", "12.3.3"
19
19
  gem "minitest", "5.8.3"
data/README.md CHANGED
@@ -33,7 +33,7 @@ client = FusionAuth::FusionAuthClient.new(
33
33
 
34
34
  # Create a user + registration
35
35
  id = SecureRandom.uuid
36
- client.register!(id, {
36
+ client.register(id, {
37
37
  :user => {
38
38
  :firstName => 'Ruby',
39
39
  :lastName => 'Client',
@@ -51,12 +51,12 @@ client.register!(id, {
51
51
  })
52
52
 
53
53
  # Authenticate the user
54
- response = client.login!({
54
+ response = client.login({
55
55
  :loginId => 'ruby.client.test@fusionauth.io',
56
56
  :password => 'password',
57
57
  :applicationId => application_id
58
58
  })
59
- user = response.user
59
+ user = response.success.response.user
60
60
  ```
61
61
 
62
62
  ## Contributing
@@ -16,7 +16,7 @@
16
16
  savantVersion = "1.0.0"
17
17
 
18
18
  pubVersion = ""
19
- project(group: "io.fusionauth", name: "fusionauth-ruby-client", version: "1.17.0", licenses: ["ApacheV2_0"]) {
19
+ project(group: "io.fusionauth", name: "fusionauth-ruby-client", version: "1.21.0", licenses: ["ApacheV2_0"]) {
20
20
  workflow {
21
21
  standard()
22
22
  }
@@ -6,10 +6,10 @@
6
6
  <sourceFolder url="file://$MODULE_DIR$/lib" isTestSource="false" />
7
7
  <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
8
8
  </content>
9
- <orderEntry type="jdk" jdkName="rbenv: 2.3.1" jdkType="RUBY_SDK" />
9
+ <orderEntry type="jdk" jdkName="rbenv: 2.5.1" jdkType="RUBY_SDK" />
10
10
  <orderEntry type="sourceFolder" forTests="false" />
11
- <orderEntry type="library" scope="PROVIDED" name="bundler (v2.0.2, rbenv: 2.3.1) [gem]" level="application" />
12
- <orderEntry type="library" scope="PROVIDED" name="minitest (v5.8.3, rbenv: 2.3.1) [gem]" level="application" />
13
- <orderEntry type="library" scope="PROVIDED" name="rake (v12.3.3, rbenv: 2.3.1) [gem]" level="application" />
11
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v2.1.4, rbenv: 2.5.1) [gem]" level="application" />
12
+ <orderEntry type="library" scope="PROVIDED" name="minitest (v5.8.3, rbenv: 2.5.1) [gem]" level="application" />
13
+ <orderEntry type="library" scope="PROVIDED" name="rake (v12.3.3, rbenv: 2.5.1) [gem]" level="application" />
14
14
  </component>
15
15
  </module>
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'fusionauth_client'
7
- spec.version = '1.17.0'
7
+ spec.version = '1.21.0'
8
8
  spec.authors = ['Brian Pontarelli', 'Daniel DeGroff']
9
9
  spec.email = %w(brian@fusionauth.io daniel@fusionauth.io)
10
10
 
@@ -170,6 +170,20 @@ module FusionAuth
170
170
  .go()
171
171
  end
172
172
 
173
+ #
174
+ # Creates a connector. You can optionally specify an Id for the connector, if not provided one will be generated.
175
+ #
176
+ # @param connector_id [string] (Optional) The Id for the connector. If not provided a secure random UUID will be generated.
177
+ # @param request [OpenStruct, Hash] The request object that contains all of the information used to create the connector.
178
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
179
+ def create_connector(connector_id, request)
180
+ start.uri('/api/connector')
181
+ .url_segment(connector_id)
182
+ .body_handler(FusionAuth::JSONBodyHandler.new(request))
183
+ .post()
184
+ .go()
185
+ end
186
+
173
187
  #
174
188
  # Creates a user consent type. You can optionally specify an Id for the consent type, if not provided one will be generated.
175
189
  #
@@ -213,6 +227,34 @@ module FusionAuth
213
227
  .go()
214
228
  end
215
229
 
230
+ #
231
+ # Creates a form. You can optionally specify an Id for the form, if not provided one will be generated.
232
+ #
233
+ # @param form_id [string] (Optional) The Id for the form. If not provided a secure random UUID will be generated.
234
+ # @param request [OpenStruct, Hash] The request object that contains all of the information used to create the form.
235
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
236
+ def create_form(form_id, request)
237
+ start.uri('/api/form')
238
+ .url_segment(form_id)
239
+ .body_handler(FusionAuth::JSONBodyHandler.new(request))
240
+ .post()
241
+ .go()
242
+ end
243
+
244
+ #
245
+ # Creates a form field. You can optionally specify an Id for the form, if not provided one will be generated.
246
+ #
247
+ # @param field_id [string] (Optional) The Id for the form field. If not provided a secure random UUID will be generated.
248
+ # @param request [OpenStruct, Hash] The request object that contains all of the information used to create the form field.
249
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
250
+ def create_form_field(field_id, request)
251
+ start.uri('/api/form/field')
252
+ .url_segment(field_id)
253
+ .body_handler(FusionAuth::JSONBodyHandler.new(request))
254
+ .post()
255
+ .go()
256
+ end
257
+
216
258
  #
217
259
  # Creates a group. You can optionally specify an Id for the group, if not provided one will be generated.
218
260
  #
@@ -464,6 +506,18 @@ module FusionAuth
464
506
  .go()
465
507
  end
466
508
 
509
+ #
510
+ # Deletes the connector for the given Id.
511
+ #
512
+ # @param connector_id [string] The Id of the connector to delete.
513
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
514
+ def delete_connector(connector_id)
515
+ start.uri('/api/connector')
516
+ .url_segment(connector_id)
517
+ .delete()
518
+ .go()
519
+ end
520
+
467
521
  #
468
522
  # Deletes the consent for the given Id.
469
523
  #
@@ -488,6 +542,30 @@ module FusionAuth
488
542
  .go()
489
543
  end
490
544
 
545
+ #
546
+ # Deletes the form for the given Id.
547
+ #
548
+ # @param form_id [string] The Id of the form to delete.
549
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
550
+ def delete_form(form_id)
551
+ start.uri('/api/form')
552
+ .url_segment(form_id)
553
+ .delete()
554
+ .go()
555
+ end
556
+
557
+ #
558
+ # Deletes the form field for the given Id.
559
+ #
560
+ # @param field_id [string] The Id of the form field to delete.
561
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
562
+ def delete_form_field(field_id)
563
+ start.uri('/api/form/field')
564
+ .url_segment(field_id)
565
+ .delete()
566
+ .go()
567
+ end
568
+
491
569
  #
492
570
  # Deletes the group for the given Id.
493
571
  #
@@ -527,11 +605,11 @@ module FusionAuth
527
605
  #
528
606
  # Deletes the key for the given Id.
529
607
  #
530
- # @param key_od [string] The Id of the key to delete.
608
+ # @param key_id [string] The Id of the key to delete.
531
609
  # @return [FusionAuth::ClientResponse] The ClientResponse object.
532
- def delete_key(key_od)
610
+ def delete_key(key_id)
533
611
  start.uri('/api/key')
534
- .url_segment(key_od)
612
+ .url_segment(key_id)
535
613
  .delete()
536
614
  .go()
537
615
  end
@@ -701,11 +779,11 @@ module FusionAuth
701
779
 
702
780
  #
703
781
  # Exchanges an OAuth authorization code for an access token.
704
- # If you will be using the Authorization Code grant, you will make a request to the Token endpoint to exchange the authorization code returned from the Authorize endpoint for an access token.
782
+ # Makes a request to the Token endpoint to exchange the authorization code returned from the Authorize endpoint for an access token.
705
783
  #
706
784
  # @param code [string] The authorization code returned on the /oauth2/authorize response.
707
- # @param client_id [string] (Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you you are attempting to authenticate. This parameter is optional when the Authorization header is provided.
708
- # @param client_secret [string] (Optional) The client secret. This value may optionally be provided in the request body instead of the Authorization header.
785
+ # @param client_id [string] The unique client identifier. The client Id is the Id of the FusionAuth Application in which you you are attempting to authenticate.
786
+ # @param client_secret [string] (Optional) The client secret. This value will be required if client authentication is enabled.
709
787
  # @param redirect_uri [string] The URI to redirect to upon a successful request.
710
788
  # @return [FusionAuth::ClientResponse] The ClientResponse object.
711
789
  def exchange_o_auth_code_for_access_token(code, client_id, client_secret, redirect_uri)
@@ -722,6 +800,31 @@ module FusionAuth
722
800
  .go()
723
801
  end
724
802
 
803
+ #
804
+ # Exchanges an OAuth authorization code and code_verifier for an access token.
805
+ # Makes a request to the Token endpoint to exchange the authorization code returned from the Authorize endpoint and a code_verifier for an access token.
806
+ #
807
+ # @param code [string] The authorization code returned on the /oauth2/authorize response.
808
+ # @param client_id [string] (Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you you are attempting to authenticate. This parameter is optional when the Authorization header is provided.
809
+ # @param client_secret [string] (Optional) The client secret. This value may optionally be provided in the request body instead of the Authorization header.
810
+ # @param redirect_uri [string] The URI to redirect to upon a successful request.
811
+ # @param code_verifier [string] The random string generated previously. Will be compared with the code_challenge sent previously, which allows the OAuth provider to authenticate your app.
812
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
813
+ def exchange_o_auth_code_for_access_token_using_pkce(code, client_id, client_secret, redirect_uri, code_verifier)
814
+ body = {
815
+ "code" => code,
816
+ "client_id" => client_id,
817
+ "client_secret" => client_secret,
818
+ "grant_type" => "authorization_code",
819
+ "redirect_uri" => redirect_uri,
820
+ "code_verifier" => code_verifier
821
+ }
822
+ startAnonymous.uri('/oauth2/token')
823
+ .body_handler(FusionAuth::FormDataBodyHandler.new(body))
824
+ .post()
825
+ .go()
826
+ end
827
+
725
828
  #
726
829
  # Exchange a Refresh Token for an Access Token.
727
830
  # If you will be using the Refresh Token Grant, you will make a request to the Token endpoint to exchange the user’s refresh token for an access token.
@@ -862,8 +965,8 @@ module FusionAuth
862
965
  # @param encoded_jwt [string] The encoded JWT (access token).
863
966
  # @return [FusionAuth::ClientResponse] The ClientResponse object.
864
967
  def generate_two_factor_secret_using_jwt(encoded_jwt)
865
- start.uri('/api/two-factor/secret')
866
- .authorization('JWT ' + encoded_jwt)
968
+ startAnonymous.uri('/api/two-factor/secret')
969
+ .authorization('Bearer ' + encoded_jwt)
867
970
  .get()
868
971
  .go()
869
972
  end
@@ -897,9 +1000,33 @@ module FusionAuth
897
1000
  end
898
1001
 
899
1002
  #
900
- # Bulk imports multiple users. This does some validation, but then tries to run batch inserts of users. This reduces
901
- # latency when inserting lots of users. Therefore, the error response might contain some information about failures,
902
- # but it will likely be pretty generic.
1003
+ # Bulk imports refresh tokens. This request performs minimal validation and runs batch inserts of refresh tokens with the
1004
+ # expectation that each token represents a user that already exists and is registered for the corresponding FusionAuth
1005
+ # Application. This is done to increases the insert performance.
1006
+ #
1007
+ # Therefore, if you encounter an error due to a database key violation, the response will likely offer a generic
1008
+ # explanation. If you encounter an error, you may optionally enable additional validation to receive a JSON response
1009
+ # body with specific validation errors. This will slow the request down but will allow you to identify the cause of
1010
+ # the failure. See the validateDbConstraints request parameter.
1011
+ #
1012
+ # @param request [OpenStruct, Hash] The request that contains all of the information about all of the refresh tokens to import.
1013
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
1014
+ def import_refresh_tokens(request)
1015
+ start.uri('/api/user/refresh-token/import')
1016
+ .body_handler(FusionAuth::JSONBodyHandler.new(request))
1017
+ .post()
1018
+ .go()
1019
+ end
1020
+
1021
+ #
1022
+ # Bulk imports users. This request performs minimal validation and runs batch inserts of users with the expectation
1023
+ # that each user does not yet exist and each registration corresponds to an existing FusionAuth Application. This is done to
1024
+ # increases the insert performance.
1025
+ #
1026
+ # Therefore, if you encounter an error due to a database key violation, the response will likely offer
1027
+ # a generic explanation. If you encounter an error, you may optionally enable additional validation to receive a JSON response
1028
+ # body with specific validation errors. This will slow the request down but will allow you to identify the cause of the failure. See
1029
+ # the validateDbConstraints request parameter.
903
1030
  #
904
1031
  # @param request [OpenStruct, Hash] The request that contains all of the information about all of the users to import.
905
1032
  # @return [FusionAuth::ClientResponse] The ClientResponse object.
@@ -910,6 +1037,23 @@ module FusionAuth
910
1037
  .go()
911
1038
  end
912
1039
 
1040
+ #
1041
+ # Inspect an access token issued by FusionAuth.
1042
+ #
1043
+ # @param client_id [string] The unique client identifier. The client Id is the Id of the FusionAuth Application for which this token was generated.
1044
+ # @param token [string] The access token returned by this OAuth provider as the result of a successful authentication.
1045
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
1046
+ def introspect_access_token(client_id, token)
1047
+ body = {
1048
+ "client_id" => client_id,
1049
+ "token" => token
1050
+ }
1051
+ startAnonymous.uri('/oauth2/introspect')
1052
+ .body_handler(FusionAuth::FormDataBodyHandler.new(body))
1053
+ .post()
1054
+ .go()
1055
+ end
1056
+
913
1057
  #
914
1058
  # Issue a new access token (JWT) for the requested Application after ensuring the provided JWT is valid. A valid
915
1059
  # access token is properly signed and not expired.
@@ -920,12 +1064,12 @@ module FusionAuth
920
1064
  # @param application_id [string] The Application Id for which you are requesting a new access token be issued.
921
1065
  # @param encoded_jwt [string] The encoded JWT (access token).
922
1066
  # @param refresh_token [string] (Optional) An existing refresh token used to request a refresh token in addition to a JWT in the response.
923
- # <p>The target application represented by the applicationid request parameter must have refresh
1067
+ # <p>The target application represented by the applicationId request parameter must have refresh
924
1068
  # tokens enabled in order to receive a refresh token in the response.</p>
925
1069
  # @return [FusionAuth::ClientResponse] The ClientResponse object.
926
1070
  def issue_jwt(application_id, encoded_jwt, refresh_token)
927
- start.uri('/api/jwt/issue')
928
- .authorization('JWT ' + encoded_jwt)
1071
+ startAnonymous.uri('/api/jwt/issue')
1072
+ .authorization('Bearer ' + encoded_jwt)
929
1073
  .url_parameter('applicationId', application_id)
930
1074
  .url_parameter('refreshToken', refresh_token)
931
1075
  .get()
@@ -1055,6 +1199,20 @@ module FusionAuth
1055
1199
  .go()
1056
1200
  end
1057
1201
 
1202
+ #
1203
+ # Updates, via PATCH, the connector with the given Id.
1204
+ #
1205
+ # @param connector_id [string] The Id of the connector to update.
1206
+ # @param request [OpenStruct, Hash] The request that contains just the new connector information.
1207
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
1208
+ def patch_connector(connector_id, request)
1209
+ start.uri('/api/connector')
1210
+ .url_segment(connector_id)
1211
+ .body_handler(FusionAuth::JSONBodyHandler.new(request))
1212
+ .patch()
1213
+ .go()
1214
+ end
1215
+
1058
1216
  #
1059
1217
  # Updates, via PATCH, the consent with the given Id.
1060
1218
  #
@@ -1355,6 +1513,21 @@ module FusionAuth
1355
1513
  .go()
1356
1514
  end
1357
1515
 
1516
+ #
1517
+ # Re-sends the verification email to the user. If the Application has configured a specific email template this will be used
1518
+ # instead of the tenant configuration.
1519
+ #
1520
+ # @param application_id [string] The unique Application Id to used to resolve an application specific email template.
1521
+ # @param email [string] The email address of the user that needs a new verification email.
1522
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
1523
+ def resend_email_verification_with_application_template(application_id, email)
1524
+ start.uri('/api/user/verify-email')
1525
+ .url_parameter('applicationId', application_id)
1526
+ .url_parameter('email', email)
1527
+ .put()
1528
+ .go()
1529
+ end
1530
+
1358
1531
  #
1359
1532
  # Re-sends the application registration verification email to the user.
1360
1533
  #
@@ -1455,6 +1628,28 @@ module FusionAuth
1455
1628
  .go()
1456
1629
  end
1457
1630
 
1631
+ #
1632
+ # Retrieves the connector with the given Id.
1633
+ #
1634
+ # @param connector_id [string] The Id of the connector.
1635
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
1636
+ def retrieve_connector(connector_id)
1637
+ start.uri('/api/connector')
1638
+ .url_segment(connector_id)
1639
+ .get()
1640
+ .go()
1641
+ end
1642
+
1643
+ #
1644
+ # Retrieves all of the connectors.
1645
+ #
1646
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
1647
+ def retrieve_connectors()
1648
+ start.uri('/api/connector')
1649
+ .get()
1650
+ .go()
1651
+ end
1652
+
1458
1653
  #
1459
1654
  # Retrieves the Consent for the given Id.
1460
1655
  #
@@ -1566,6 +1761,50 @@ module FusionAuth
1566
1761
  .go()
1567
1762
  end
1568
1763
 
1764
+ #
1765
+ # Retrieves the form with the given Id.
1766
+ #
1767
+ # @param form_id [string] The Id of the form.
1768
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
1769
+ def retrieve_form(form_id)
1770
+ start.uri('/api/form')
1771
+ .url_segment(form_id)
1772
+ .get()
1773
+ .go()
1774
+ end
1775
+
1776
+ #
1777
+ # Retrieves the form field with the given Id.
1778
+ #
1779
+ # @param field_id [string] The Id of the form field.
1780
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
1781
+ def retrieve_form_field(field_id)
1782
+ start.uri('/api/form/field')
1783
+ .url_segment(field_id)
1784
+ .get()
1785
+ .go()
1786
+ end
1787
+
1788
+ #
1789
+ # Retrieves all of the forms fields
1790
+ #
1791
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
1792
+ def retrieve_form_fields()
1793
+ start.uri('/api/form/field')
1794
+ .get()
1795
+ .go()
1796
+ end
1797
+
1798
+ #
1799
+ # Retrieves all of the forms.
1800
+ #
1801
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
1802
+ def retrieve_forms()
1803
+ start.uri('/api/form')
1804
+ .get()
1805
+ .go()
1806
+ end
1807
+
1569
1808
  #
1570
1809
  # Retrieves the group for the given Id.
1571
1810
  #
@@ -2130,6 +2369,18 @@ module FusionAuth
2130
2369
  .go()
2131
2370
  end
2132
2371
 
2372
+ #
2373
+ # Call the UserInfo endpoint to retrieve User Claims from the access token issued by FusionAuth.
2374
+ #
2375
+ # @param encoded_jwt [string] The encoded JWT (access token).
2376
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
2377
+ def retrieve_user_info_from_access_token(encoded_jwt)
2378
+ startAnonymous.uri('/oauth2/userinfo')
2379
+ .authorization('Bearer ' + encoded_jwt)
2380
+ .get()
2381
+ .go()
2382
+ end
2383
+
2133
2384
  #
2134
2385
  # Retrieves the login report between the two instants for a particular user by Id. If you specify an application id, it will only return the
2135
2386
  # login counts for that application.
@@ -2191,7 +2442,7 @@ module FusionAuth
2191
2442
  # @return [FusionAuth::ClientResponse] The ClientResponse object.
2192
2443
  def retrieve_user_using_jwt(encoded_jwt)
2193
2444
  startAnonymous.uri('/api/user')
2194
- .authorization('JWT ' + encoded_jwt)
2445
+ .authorization('Bearer ' + encoded_jwt)
2195
2446
  .get()
2196
2447
  .go()
2197
2448
  end
@@ -2467,6 +2718,20 @@ module FusionAuth
2467
2718
  .go()
2468
2719
  end
2469
2720
 
2721
+ #
2722
+ # Updates the connector with the given Id.
2723
+ #
2724
+ # @param connector_id [string] The Id of the connector to update.
2725
+ # @param request [OpenStruct, Hash] The request object that contains all of the new connector information.
2726
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
2727
+ def update_connector(connector_id, request)
2728
+ start.uri('/api/connector')
2729
+ .url_segment(connector_id)
2730
+ .body_handler(FusionAuth::JSONBodyHandler.new(request))
2731
+ .put()
2732
+ .go()
2733
+ end
2734
+
2470
2735
  #
2471
2736
  # Updates the consent with the given Id.
2472
2737
  #
@@ -2495,6 +2760,34 @@ module FusionAuth
2495
2760
  .go()
2496
2761
  end
2497
2762
 
2763
+ #
2764
+ # Updates the form with the given Id.
2765
+ #
2766
+ # @param form_id [string] The Id of the form to update.
2767
+ # @param request [OpenStruct, Hash] The request object that contains all of the new form information.
2768
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
2769
+ def update_form(form_id, request)
2770
+ start.uri('/api/form')
2771
+ .url_segment(form_id)
2772
+ .body_handler(FusionAuth::JSONBodyHandler.new(request))
2773
+ .put()
2774
+ .go()
2775
+ end
2776
+
2777
+ #
2778
+ # Updates the form field with the given Id.
2779
+ #
2780
+ # @param field_id [string] The Id of the form field to update.
2781
+ # @param request [OpenStruct, Hash] The request object that contains all of the new form field information.
2782
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
2783
+ def update_form_field(field_id, request)
2784
+ start.uri('/api/form/field')
2785
+ .url_segment(field_id)
2786
+ .body_handler(FusionAuth::JSONBodyHandler.new(request))
2787
+ .put()
2788
+ .go()
2789
+ end
2790
+
2498
2791
  #
2499
2792
  # Updates the group with the given Id.
2500
2793
  #
@@ -2712,7 +3005,7 @@ module FusionAuth
2712
3005
  # @return [FusionAuth::ClientResponse] The ClientResponse object.
2713
3006
  def validate_jwt(encoded_jwt)
2714
3007
  startAnonymous.uri('/api/jwt/validate')
2715
- .authorization('JWT ' + encoded_jwt)
3008
+ .authorization('Bearer ' + encoded_jwt)
2716
3009
  .get()
2717
3010
  .go()
2718
3011
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fusionauth_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.0
4
+ version: 1.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Pontarelli
8
8
  - Daniel DeGroff
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-06-02 00:00:00.000000000 Z
12
+ date: 2020-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.
@@ -36,7 +36,7 @@ licenses:
36
36
  - Apache-2.0
37
37
  metadata:
38
38
  allowed_push_host: https://rubygems.org
39
- post_install_message:
39
+ post_install_message:
40
40
  rdoc_options: []
41
41
  require_paths:
42
42
  - lib
@@ -51,8 +51,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
51
51
  - !ruby/object:Gem::Version
52
52
  version: '0'
53
53
  requirements: []
54
- rubygems_version: 3.0.2
55
- signing_key:
54
+ rubygems_version: 3.1.4
55
+ signing_key:
56
56
  specification_version: 4
57
57
  summary: The Ruby client library for FusionAuth
58
58
  test_files: []