fusionauth_client 1.18.0 → 1.22.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: 21109a2d8e1bd5cb1229077c02415245b6f04574e91f05240cce4ad5900eb0eb
4
- data.tar.gz: 971f1406ab820d744161bebaf1d427c665963789dd129bac32b092c05d8816ac
3
+ metadata.gz: 19c8c1a50df83ef803ec50ec990b0118e9f59477d4d55658276a83f0af609ac1
4
+ data.tar.gz: fef76faf3cec4d2c7a50e997ad08357af949bc974d9c35b96e88ecaf886acd30
5
5
  SHA512:
6
- metadata.gz: be173c20a7f84ce6c0155c6a6d3cbcdfc7114fde73b7698bbc61f3fa18731a55db4418ca8c2a42efa50b9bacda58726d0668d724bcdc6bac87ec8741dfcca3a4
7
- data.tar.gz: 5c3f0faa5560a56daf6a4ee2bee68c448896ee529fab405507a258669f99d3a91e0430c12056ed76d9345978b5ff62db47243931e683769d041a7be82864dd7b
6
+ metadata.gz: 312c6a9bd86ab513ca2be344bc9ad5fb616c58eb51382f22737c3b69c22a8678d1175c94fd0aef7df71b31754509b0e78fa7ccc9b3102dd3b5938d90aa95d11c
7
+ data.tar.gz: 42817bd2972014e153b7cfb38b725c5051f89a50493e8277ff2a19f59219747494222b833d9c2d7e69498f55d6e6c3c70170793541cf8fe97466616e6d701b7c
data/.gitignore CHANGED
@@ -8,4 +8,5 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  .rakeTasks
11
- /build
11
+ /build
12
+ **/.DS_Store
@@ -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.18.0", licenses: ["ApacheV2_0"]) {
19
+ project(group: "io.fusionauth", name: "fusionauth-ruby-client", version: "1.22.0", licenses: ["ApacheV2_0"]) {
20
20
  workflow {
21
21
  standard()
22
22
  }
@@ -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.18.0'
7
+ spec.version = '1.22.0'
8
8
  spec.authors = ['Brian Pontarelli', 'Daniel DeGroff']
9
9
  spec.email = %w(brian@fusionauth.io daniel@fusionauth.io)
10
10
 
@@ -652,6 +652,20 @@ module FusionAuth
652
652
  .go()
653
653
  end
654
654
 
655
+ #
656
+ # Deletes the tenant for the given Id asynchronously.
657
+ # This method is helpful if you do not want to wait for the delete operation to complete.
658
+ #
659
+ # @param tenant_id [string] The Id of the tenant to delete.
660
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
661
+ def delete_tenant_async(tenant_id)
662
+ start.uri('/api/tenant')
663
+ .url_segment(tenant_id)
664
+ .url_parameter('async', true)
665
+ .delete()
666
+ .go()
667
+ end
668
+
655
669
  #
656
670
  # Deletes the theme for the given Id.
657
671
  #
@@ -779,11 +793,11 @@ module FusionAuth
779
793
 
780
794
  #
781
795
  # Exchanges an OAuth authorization code for an access token.
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.
796
+ # Makes a request to the Token endpoint to exchange the authorization code returned from the Authorize endpoint for an access token.
783
797
  #
784
798
  # @param code [string] The authorization code returned on the /oauth2/authorize response.
785
- # @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.
786
- # @param client_secret [string] (Optional) The client secret. This value may optionally be provided in the request body instead of the Authorization header.
799
+ # @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.
800
+ # @param client_secret [string] (Optional) The client secret. This value will be required if client authentication is enabled.
787
801
  # @param redirect_uri [string] The URI to redirect to upon a successful request.
788
802
  # @return [FusionAuth::ClientResponse] The ClientResponse object.
789
803
  def exchange_o_auth_code_for_access_token(code, client_id, client_secret, redirect_uri)
@@ -800,6 +814,31 @@ module FusionAuth
800
814
  .go()
801
815
  end
802
816
 
817
+ #
818
+ # Exchanges an OAuth authorization code and code_verifier for an access token.
819
+ # 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.
820
+ #
821
+ # @param code [string] The authorization code returned on the /oauth2/authorize response.
822
+ # @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.
823
+ # @param client_secret [string] (Optional) The client secret. This value may optionally be provided in the request body instead of the Authorization header.
824
+ # @param redirect_uri [string] The URI to redirect to upon a successful request.
825
+ # @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.
826
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
827
+ def exchange_o_auth_code_for_access_token_using_pkce(code, client_id, client_secret, redirect_uri, code_verifier)
828
+ body = {
829
+ "code" => code,
830
+ "client_id" => client_id,
831
+ "client_secret" => client_secret,
832
+ "grant_type" => "authorization_code",
833
+ "redirect_uri" => redirect_uri,
834
+ "code_verifier" => code_verifier
835
+ }
836
+ startAnonymous.uri('/oauth2/token')
837
+ .body_handler(FusionAuth::FormDataBodyHandler.new(body))
838
+ .post()
839
+ .go()
840
+ end
841
+
803
842
  #
804
843
  # Exchange a Refresh Token for an Access Token.
805
844
  # 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.
@@ -940,8 +979,8 @@ module FusionAuth
940
979
  # @param encoded_jwt [string] The encoded JWT (access token).
941
980
  # @return [FusionAuth::ClientResponse] The ClientResponse object.
942
981
  def generate_two_factor_secret_using_jwt(encoded_jwt)
943
- start.uri('/api/two-factor/secret')
944
- .authorization('JWT ' + encoded_jwt)
982
+ startAnonymous.uri('/api/two-factor/secret')
983
+ .authorization('Bearer ' + encoded_jwt)
945
984
  .get()
946
985
  .go()
947
986
  end
@@ -975,9 +1014,33 @@ module FusionAuth
975
1014
  end
976
1015
 
977
1016
  #
978
- # Bulk imports multiple users. This does some validation, but then tries to run batch inserts of users. This reduces
979
- # latency when inserting lots of users. Therefore, the error response might contain some information about failures,
980
- # but it will likely be pretty generic.
1017
+ # Bulk imports refresh tokens. This request performs minimal validation and runs batch inserts of refresh tokens with the
1018
+ # expectation that each token represents a user that already exists and is registered for the corresponding FusionAuth
1019
+ # Application. This is done to increases the insert performance.
1020
+ #
1021
+ # Therefore, if you encounter an error due to a database key violation, the response will likely offer a generic
1022
+ # explanation. If you encounter an error, you may optionally enable additional validation to receive a JSON response
1023
+ # body with specific validation errors. This will slow the request down but will allow you to identify the cause of
1024
+ # the failure. See the validateDbConstraints request parameter.
1025
+ #
1026
+ # @param request [OpenStruct, Hash] The request that contains all of the information about all of the refresh tokens to import.
1027
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
1028
+ def import_refresh_tokens(request)
1029
+ start.uri('/api/user/refresh-token/import')
1030
+ .body_handler(FusionAuth::JSONBodyHandler.new(request))
1031
+ .post()
1032
+ .go()
1033
+ end
1034
+
1035
+ #
1036
+ # Bulk imports users. This request performs minimal validation and runs batch inserts of users with the expectation
1037
+ # that each user does not yet exist and each registration corresponds to an existing FusionAuth Application. This is done to
1038
+ # increases the insert performance.
1039
+ #
1040
+ # Therefore, if you encounter an error due to a database key violation, the response will likely offer
1041
+ # a generic explanation. If you encounter an error, you may optionally enable additional validation to receive a JSON response
1042
+ # body with specific validation errors. This will slow the request down but will allow you to identify the cause of the failure. See
1043
+ # the validateDbConstraints request parameter.
981
1044
  #
982
1045
  # @param request [OpenStruct, Hash] The request that contains all of the information about all of the users to import.
983
1046
  # @return [FusionAuth::ClientResponse] The ClientResponse object.
@@ -988,6 +1051,23 @@ module FusionAuth
988
1051
  .go()
989
1052
  end
990
1053
 
1054
+ #
1055
+ # Inspect an access token issued by FusionAuth.
1056
+ #
1057
+ # @param client_id [string] The unique client identifier. The client Id is the Id of the FusionAuth Application for which this token was generated.
1058
+ # @param token [string] The access token returned by this OAuth provider as the result of a successful authentication.
1059
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
1060
+ def introspect_access_token(client_id, token)
1061
+ body = {
1062
+ "client_id" => client_id,
1063
+ "token" => token
1064
+ }
1065
+ startAnonymous.uri('/oauth2/introspect')
1066
+ .body_handler(FusionAuth::FormDataBodyHandler.new(body))
1067
+ .post()
1068
+ .go()
1069
+ end
1070
+
991
1071
  #
992
1072
  # Issue a new access token (JWT) for the requested Application after ensuring the provided JWT is valid. A valid
993
1073
  # access token is properly signed and not expired.
@@ -998,12 +1078,12 @@ module FusionAuth
998
1078
  # @param application_id [string] The Application Id for which you are requesting a new access token be issued.
999
1079
  # @param encoded_jwt [string] The encoded JWT (access token).
1000
1080
  # @param refresh_token [string] (Optional) An existing refresh token used to request a refresh token in addition to a JWT in the response.
1001
- # <p>The target application represented by the applicationid request parameter must have refresh
1081
+ # <p>The target application represented by the applicationId request parameter must have refresh
1002
1082
  # tokens enabled in order to receive a refresh token in the response.</p>
1003
1083
  # @return [FusionAuth::ClientResponse] The ClientResponse object.
1004
1084
  def issue_jwt(application_id, encoded_jwt, refresh_token)
1005
- start.uri('/api/jwt/issue')
1006
- .authorization('JWT ' + encoded_jwt)
1085
+ startAnonymous.uri('/api/jwt/issue')
1086
+ .authorization('Bearer ' + encoded_jwt)
1007
1087
  .url_parameter('applicationId', application_id)
1008
1088
  .url_parameter('refreshToken', refresh_token)
1009
1089
  .get()
@@ -1447,6 +1527,21 @@ module FusionAuth
1447
1527
  .go()
1448
1528
  end
1449
1529
 
1530
+ #
1531
+ # Re-sends the verification email to the user. If the Application has configured a specific email template this will be used
1532
+ # instead of the tenant configuration.
1533
+ #
1534
+ # @param application_id [string] The unique Application Id to used to resolve an application specific email template.
1535
+ # @param email [string] The email address of the user that needs a new verification email.
1536
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
1537
+ def resend_email_verification_with_application_template(application_id, email)
1538
+ start.uri('/api/user/verify-email')
1539
+ .url_parameter('applicationId', application_id)
1540
+ .url_parameter('email', email)
1541
+ .put()
1542
+ .go()
1543
+ end
1544
+
1450
1545
  #
1451
1546
  # Re-sends the application registration verification email to the user.
1452
1547
  #
@@ -2288,6 +2383,18 @@ module FusionAuth
2288
2383
  .go()
2289
2384
  end
2290
2385
 
2386
+ #
2387
+ # Call the UserInfo endpoint to retrieve User Claims from the access token issued by FusionAuth.
2388
+ #
2389
+ # @param encoded_jwt [string] The encoded JWT (access token).
2390
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
2391
+ def retrieve_user_info_from_access_token(encoded_jwt)
2392
+ startAnonymous.uri('/oauth2/userinfo')
2393
+ .authorization('Bearer ' + encoded_jwt)
2394
+ .get()
2395
+ .go()
2396
+ end
2397
+
2291
2398
  #
2292
2399
  # 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
2293
2400
  # login counts for that application.
@@ -2349,7 +2456,7 @@ module FusionAuth
2349
2456
  # @return [FusionAuth::ClientResponse] The ClientResponse object.
2350
2457
  def retrieve_user_using_jwt(encoded_jwt)
2351
2458
  startAnonymous.uri('/api/user')
2352
- .authorization('JWT ' + encoded_jwt)
2459
+ .authorization('Bearer ' + encoded_jwt)
2353
2460
  .get()
2354
2461
  .go()
2355
2462
  end
@@ -2912,7 +3019,7 @@ module FusionAuth
2912
3019
  # @return [FusionAuth::ClientResponse] The ClientResponse object.
2913
3020
  def validate_jwt(encoded_jwt)
2914
3021
  startAnonymous.uri('/api/jwt/validate')
2915
- .authorization('JWT ' + encoded_jwt)
3022
+ .authorization('Bearer ' + encoded_jwt)
2916
3023
  .get()
2917
3024
  .go()
2918
3025
  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.18.0
4
+ version: 1.22.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-07-19 00:00:00.000000000 Z
12
+ date: 2020-12-02 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
@@ -52,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
52
52
  version: '0'
53
53
  requirements: []
54
54
  rubygems_version: 3.1.4
55
- signing_key:
55
+ signing_key:
56
56
  specification_version: 4
57
57
  summary: The Ruby client library for FusionAuth
58
58
  test_files: []