fusionauth_client 1.19.0 → 1.22.1

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: d303bd307e78872200ef01bc1e844055b9ea1ae03d1b2d6511b3461d5c74982c
4
- data.tar.gz: ca014231534dc88b074bf0b346f6816dda024c2f616084e9597384582d85504b
3
+ metadata.gz: d0f60f6be98ee612f4db6e561984edd34809cb28ffcf6067d48e2a1ffea002ca
4
+ data.tar.gz: 562ea8268599ee1d2ff67bc9861235f2da0f8d9d46d679ee8e076a3412ca8b93
5
5
  SHA512:
6
- metadata.gz: aef780bb6cf6fc5c2e28f7f85eccdb374994e46ad23ce2114d21c22b4b24efc44e807164edace5cd804ac8d3a72f53567e6eb268ed881480d563138361137227
7
- data.tar.gz: e4b5f5c4c42e8f9a957d504541f4484ef8edbe7f63566559e93a1695821406730e5b36ea844a2ba7351d7c179227b4b69cc051918c3c413097ff4ea313199623
6
+ metadata.gz: 1fd1072baa45440345d09b7210709aaf6281dfb1a4ff8ccef80c68c000325cf4c91f29cfa9f4dd6462c977fc6b078ba9a224218fb36d62af89462aaa677b1cd3
7
+ data.tar.gz: 24131b46825b6567f22f85bae91883700a0135885e8951fc8a0a012d25fcb2e656d4a49d20c1d233f79733c29b36416f78018a1b6648aaa22f9b79e9f9dbae29
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.19.0", licenses: ["ApacheV2_0"]) {
19
+ project(group: "io.fusionauth", name: "fusionauth-ruby-client", version: "1.22.1", licenses: ["ApacheV2_0"]) {
20
20
  workflow {
21
21
  standard()
22
22
  }
@@ -12,4 +12,4 @@
12
12
  <orderEntry type="library" scope="PROVIDED" name="minitest (v5.8.3, rbenv: 2.5.1) [gem]" level="application" />
13
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.19.0'
7
+ spec.version = '1.22.1'
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,7 +793,7 @@ 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
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,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
@@ -1012,6 +1051,23 @@ module FusionAuth
1012
1051
  .go()
1013
1052
  end
1014
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
+
1015
1071
  #
1016
1072
  # Issue a new access token (JWT) for the requested Application after ensuring the provided JWT is valid. A valid
1017
1073
  # access token is properly signed and not expired.
@@ -1026,8 +1082,8 @@ module FusionAuth
1026
1082
  # tokens enabled in order to receive a refresh token in the response.</p>
1027
1083
  # @return [FusionAuth::ClientResponse] The ClientResponse object.
1028
1084
  def issue_jwt(application_id, encoded_jwt, refresh_token)
1029
- start.uri('/api/jwt/issue')
1030
- .authorization('JWT ' + encoded_jwt)
1085
+ startAnonymous.uri('/api/jwt/issue')
1086
+ .authorization('Bearer ' + encoded_jwt)
1031
1087
  .url_parameter('applicationId', application_id)
1032
1088
  .url_parameter('refreshToken', refresh_token)
1033
1089
  .get()
@@ -2327,6 +2383,18 @@ module FusionAuth
2327
2383
  .go()
2328
2384
  end
2329
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
+
2330
2398
  #
2331
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
2332
2400
  # login counts for that application.
@@ -2388,7 +2456,7 @@ module FusionAuth
2388
2456
  # @return [FusionAuth::ClientResponse] The ClientResponse object.
2389
2457
  def retrieve_user_using_jwt(encoded_jwt)
2390
2458
  startAnonymous.uri('/api/user')
2391
- .authorization('JWT ' + encoded_jwt)
2459
+ .authorization('Bearer ' + encoded_jwt)
2392
2460
  .get()
2393
2461
  .go()
2394
2462
  end
@@ -2951,7 +3019,7 @@ module FusionAuth
2951
3019
  # @return [FusionAuth::ClientResponse] The ClientResponse object.
2952
3020
  def validate_jwt(encoded_jwt)
2953
3021
  startAnonymous.uri('/api/jwt/validate')
2954
- .authorization('JWT ' + encoded_jwt)
3022
+ .authorization('Bearer ' + encoded_jwt)
2955
3023
  .get()
2956
3024
  .go()
2957
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.19.0
4
+ version: 1.22.1
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-09-04 00:00:00.000000000 Z
12
+ date: 2020-12-09 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: []