fusionauth_client 1.15.3 → 1.19.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: 43bd0bd89fdd6ec3ce3a4b0dde7473ca5fc115267b8d1812bfa10b580cbc3410
4
- data.tar.gz: babeb2aef80ce760f675120c6836085ba217717255295d7abf803998c3f2434f
3
+ metadata.gz: d303bd307e78872200ef01bc1e844055b9ea1ae03d1b2d6511b3461d5c74982c
4
+ data.tar.gz: ca014231534dc88b074bf0b346f6816dda024c2f616084e9597384582d85504b
5
5
  SHA512:
6
- metadata.gz: d1de52b05abeac8c7490895c452b4aa9192d1c722e4e636ae1e4639cce7e4c69b3d07c3094f38b0f17e286ede486b6d5112ad0c4ca3cef795ee88d2ef403e328
7
- data.tar.gz: 18051a9e1497294febad008597ef7cd44385800768bd49e0daf43709bc17de25c95026209534d63625b3c95554b07e8f239158d86cae5ed14f2e52cabdf7c3d3
6
+ metadata.gz: aef780bb6cf6fc5c2e28f7f85eccdb374994e46ad23ce2114d21c22b4b24efc44e807164edace5cd804ac8d3a72f53567e6eb268ed881480d563138361137227
7
+ data.tar.gz: e4b5f5c4c42e8f9a957d504541f4484ef8edbe7f63566559e93a1695821406730e5b36ea844a2ba7351d7c179227b4b69cc051918c3c413097ff4ea313199623
@@ -1 +1 @@
1
- 2.3.1
1
+ 2.5.1
data/Gemfile CHANGED
@@ -1,7 +1,21 @@
1
+ # Copyright (c) 2019, FusionAuth, All Rights Reserved
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing,
10
+ # software distributed under the License is distributed on an
11
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
12
+ # either express or implied. See the License for the specific
13
+ # language governing permissions and limitations under the License.
14
+
1
15
  source 'https://rubygems.org'
2
- ruby '2.3.1'
16
+ ruby '2.5.1'
3
17
 
4
- gem "rake", "10.4.2"
18
+ gem "rake", "12.3.3"
5
19
  gem "minitest", "5.8.3"
6
20
 
7
21
  # Specify your gem's dependencies in fusionauth_client.gemspec
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.15.3", licenses: ["ApacheV2_0"]) {
19
+ project(group: "io.fusionauth", name: "fusionauth-ruby-client", version: "1.19.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 (v10.4.2, 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
- </module>
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.15.3'
7
+ spec.version = '1.19.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
@@ -704,8 +782,8 @@ module FusionAuth
704
782
  # 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.
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)
@@ -897,9 +975,33 @@ module FusionAuth
897
975
  end
898
976
 
899
977
  #
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.
978
+ # Bulk imports refresh tokens. This request performs minimal validation and runs batch inserts of refresh tokens with the
979
+ # expectation that each token represents a user that already exists and is registered for the corresponding FusionAuth
980
+ # Application. This is done to increases the insert performance.
981
+ #
982
+ # Therefore, if you encounter an error due to a database key violation, the response will likely offer a generic
983
+ # explanation. If you encounter an error, you may optionally enable additional validation to receive a JSON response
984
+ # body with specific validation errors. This will slow the request down but will allow you to identify the cause of
985
+ # the failure. See the validateDbConstraints request parameter.
986
+ #
987
+ # @param request [OpenStruct, Hash] The request that contains all of the information about all of the refresh tokens to import.
988
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
989
+ def import_refresh_tokens(request)
990
+ start.uri('/api/user/refresh-token/import')
991
+ .body_handler(FusionAuth::JSONBodyHandler.new(request))
992
+ .post()
993
+ .go()
994
+ end
995
+
996
+ #
997
+ # Bulk imports users. This request performs minimal validation and runs batch inserts of users with the expectation
998
+ # that each user does not yet exist and each registration corresponds to an existing FusionAuth Application. This is done to
999
+ # increases the insert performance.
1000
+ #
1001
+ # Therefore, if you encounter an error due to a database key violation, the response will likely offer
1002
+ # a generic explanation. If you encounter an error, you may optionally enable additional validation to receive a JSON response
1003
+ # body with specific validation errors. This will slow the request down but will allow you to identify the cause of the failure. See
1004
+ # the validateDbConstraints request parameter.
903
1005
  #
904
1006
  # @param request [OpenStruct, Hash] The request that contains all of the information about all of the users to import.
905
1007
  # @return [FusionAuth::ClientResponse] The ClientResponse object.
@@ -920,7 +1022,7 @@ module FusionAuth
920
1022
  # @param application_id [string] The Application Id for which you are requesting a new access token be issued.
921
1023
  # @param encoded_jwt [string] The encoded JWT (access token).
922
1024
  # @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
1025
+ # <p>The target application represented by the applicationId request parameter must have refresh
924
1026
  # tokens enabled in order to receive a refresh token in the response.</p>
925
1027
  # @return [FusionAuth::ClientResponse] The ClientResponse object.
926
1028
  def issue_jwt(application_id, encoded_jwt, refresh_token)
@@ -1055,6 +1157,20 @@ module FusionAuth
1055
1157
  .go()
1056
1158
  end
1057
1159
 
1160
+ #
1161
+ # Updates, via PATCH, the connector with the given Id.
1162
+ #
1163
+ # @param connector_id [string] The Id of the connector to update.
1164
+ # @param request [OpenStruct, Hash] The request that contains just the new connector information.
1165
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
1166
+ def patch_connector(connector_id, request)
1167
+ start.uri('/api/connector')
1168
+ .url_segment(connector_id)
1169
+ .body_handler(FusionAuth::JSONBodyHandler.new(request))
1170
+ .patch()
1171
+ .go()
1172
+ end
1173
+
1058
1174
  #
1059
1175
  # Updates, via PATCH, the consent with the given Id.
1060
1176
  #
@@ -1355,6 +1471,21 @@ module FusionAuth
1355
1471
  .go()
1356
1472
  end
1357
1473
 
1474
+ #
1475
+ # Re-sends the verification email to the user. If the Application has configured a specific email template this will be used
1476
+ # instead of the tenant configuration.
1477
+ #
1478
+ # @param application_id [string] The unique Application Id to used to resolve an application specific email template.
1479
+ # @param email [string] The email address of the user that needs a new verification email.
1480
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
1481
+ def resend_email_verification_with_application_template(application_id, email)
1482
+ start.uri('/api/user/verify-email')
1483
+ .url_parameter('applicationId', application_id)
1484
+ .url_parameter('email', email)
1485
+ .put()
1486
+ .go()
1487
+ end
1488
+
1358
1489
  #
1359
1490
  # Re-sends the application registration verification email to the user.
1360
1491
  #
@@ -1455,6 +1586,28 @@ module FusionAuth
1455
1586
  .go()
1456
1587
  end
1457
1588
 
1589
+ #
1590
+ # Retrieves the connector with the given Id.
1591
+ #
1592
+ # @param connector_id [string] The Id of the connector.
1593
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
1594
+ def retrieve_connector(connector_id)
1595
+ start.uri('/api/connector')
1596
+ .url_segment(connector_id)
1597
+ .get()
1598
+ .go()
1599
+ end
1600
+
1601
+ #
1602
+ # Retrieves all of the connectors.
1603
+ #
1604
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
1605
+ def retrieve_connectors()
1606
+ start.uri('/api/connector')
1607
+ .get()
1608
+ .go()
1609
+ end
1610
+
1458
1611
  #
1459
1612
  # Retrieves the Consent for the given Id.
1460
1613
  #
@@ -1566,6 +1719,50 @@ module FusionAuth
1566
1719
  .go()
1567
1720
  end
1568
1721
 
1722
+ #
1723
+ # Retrieves the form with the given Id.
1724
+ #
1725
+ # @param form_id [string] The Id of the form.
1726
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
1727
+ def retrieve_form(form_id)
1728
+ start.uri('/api/form')
1729
+ .url_segment(form_id)
1730
+ .get()
1731
+ .go()
1732
+ end
1733
+
1734
+ #
1735
+ # Retrieves the form field with the given Id.
1736
+ #
1737
+ # @param field_id [string] The Id of the form field.
1738
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
1739
+ def retrieve_form_field(field_id)
1740
+ start.uri('/api/form/field')
1741
+ .url_segment(field_id)
1742
+ .get()
1743
+ .go()
1744
+ end
1745
+
1746
+ #
1747
+ # Retrieves all of the forms fields
1748
+ #
1749
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
1750
+ def retrieve_form_fields()
1751
+ start.uri('/api/form/field')
1752
+ .get()
1753
+ .go()
1754
+ end
1755
+
1756
+ #
1757
+ # Retrieves all of the forms.
1758
+ #
1759
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
1760
+ def retrieve_forms()
1761
+ start.uri('/api/form')
1762
+ .get()
1763
+ .go()
1764
+ end
1765
+
1569
1766
  #
1570
1767
  # Retrieves the group for the given Id.
1571
1768
  #
@@ -2467,6 +2664,20 @@ module FusionAuth
2467
2664
  .go()
2468
2665
  end
2469
2666
 
2667
+ #
2668
+ # Updates the connector with the given Id.
2669
+ #
2670
+ # @param connector_id [string] The Id of the connector to update.
2671
+ # @param request [OpenStruct, Hash] The request object that contains all of the new connector information.
2672
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
2673
+ def update_connector(connector_id, request)
2674
+ start.uri('/api/connector')
2675
+ .url_segment(connector_id)
2676
+ .body_handler(FusionAuth::JSONBodyHandler.new(request))
2677
+ .put()
2678
+ .go()
2679
+ end
2680
+
2470
2681
  #
2471
2682
  # Updates the consent with the given Id.
2472
2683
  #
@@ -2495,6 +2706,34 @@ module FusionAuth
2495
2706
  .go()
2496
2707
  end
2497
2708
 
2709
+ #
2710
+ # Updates the form with the given Id.
2711
+ #
2712
+ # @param form_id [string] The Id of the form to update.
2713
+ # @param request [OpenStruct, Hash] The request object that contains all of the new form information.
2714
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
2715
+ def update_form(form_id, request)
2716
+ start.uri('/api/form')
2717
+ .url_segment(form_id)
2718
+ .body_handler(FusionAuth::JSONBodyHandler.new(request))
2719
+ .put()
2720
+ .go()
2721
+ end
2722
+
2723
+ #
2724
+ # Updates the form field with the given Id.
2725
+ #
2726
+ # @param field_id [string] The Id of the form field to update.
2727
+ # @param request [OpenStruct, Hash] The request object that contains all of the new form field information.
2728
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
2729
+ def update_form_field(field_id, request)
2730
+ start.uri('/api/form/field')
2731
+ .url_segment(field_id)
2732
+ .body_handler(FusionAuth::JSONBodyHandler.new(request))
2733
+ .put()
2734
+ .go()
2735
+ end
2736
+
2498
2737
  #
2499
2738
  # Updates the group with the given Id.
2500
2739
  #
@@ -1,3 +1,17 @@
1
+ # Copyright (c) 2019, FusionAuth, All Rights Reserved
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing,
10
+ # software distributed under the License is distributed on an
11
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
12
+ # either express or implied. See the License for the specific
13
+ # language governing permissions and limitations under the License.
14
+
1
15
  require 'base64'
2
16
  require 'json'
3
17
  require 'net/http'
@@ -41,7 +55,7 @@ module FusionAuth
41
55
  # @param body_handler [BodyHandler] The body handler.
42
56
  # @return [RESTClient] this
43
57
  #
44
- def rbody_handler(body_handler)
58
+ def body_handler(body_handler)
45
59
  @body_handler = body_handler
46
60
  self
47
61
  end
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.15.3
4
+ version: 1.19.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: 2020-02-27 00:00:00.000000000 Z
12
+ date: 2020-09-04 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.
@@ -51,7 +51,7 @@ 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
54
+ rubygems_version: 3.1.4
55
55
  signing_key:
56
56
  specification_version: 4
57
57
  summary: The Ruby client library for FusionAuth