fuser 0.1.4 → 0.2.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: 3e356667c0e19751bcad675aa9d66e650f74e54210c4206f8363baedf684081d
4
- data.tar.gz: 4f2b1cc8413fe6ebdabb3be28a24ea6bbac6c243e3686e1f7af77b2c58a80b01
3
+ metadata.gz: 5d39fd7173f7cc8131e6594ebef9ede3171195b615a3bbfb576d417724c62803
4
+ data.tar.gz: e9c9e60b2310c1b52b995810676e3d4c20c5001d5cdec126aab2a53fd718e524
5
5
  SHA512:
6
- metadata.gz: a5a4eace07eb1f47356b7fa51edbb6b682602bcc3a2726f63feb6aa3a086cec4cff0a74f2911b33d8673a13cdeea4ce48968c385a08cd0c79e4daf5cd4447640
7
- data.tar.gz: 9a597d8a72715a4f8705c5dfb9f0ef63b69175f859f59c0794f2508523a0ee9a94143c13e2abd90b7753a9ec5ab8a40559c7fc6a73cdb089ae208bb2350daa9c
6
+ metadata.gz: 0023a507b6fcbb80500ab216af1c4cad4bbed370e4c9a6245ce8121c845ddcfea522a302eb6f5a7ccb5ee7711bac414231e598d95d8a472ccac139d50094b8a3
7
+ data.tar.gz: 975b6a235b3020ea883ef9a9814dfca1705a78ac65c7a8a9f5a90de1b246d50afdee43b5f3081b374789cdf6c85081d59ddbfa4bbd812a4eb5d7b0c9387842dc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fuser (0.1.4)
4
+ fuser (0.2.0)
5
5
  httparty (~> 0.16.2)
6
6
  i18n (~> 1.1, >= 1.1.0)
7
7
 
@@ -15,10 +15,10 @@ GEM
15
15
  safe_yaml (~> 1.0.0)
16
16
  diff-lcs (1.3)
17
17
  hashdiff (0.3.7)
18
- httparty (0.16.3)
18
+ httparty (0.16.4)
19
19
  mime-types (~> 3.0)
20
20
  multi_xml (>= 0.5.2)
21
- i18n (1.5.3)
21
+ i18n (1.6.0)
22
22
  concurrent-ruby (~> 1.0)
23
23
  mime-types (3.2.2)
24
24
  mime-types-data (~> 3.2015)
data/lib/fuser/request.rb CHANGED
@@ -84,7 +84,22 @@ module Fuser
84
84
  'password': params[:password],
85
85
  'returnSecureToken': true
86
86
  }.compact
87
+ when :oauth_sign_in then
88
+ {
89
+ 'postBody': oauth_post_body(params),
90
+ 'requestUri': params[:request_uri],
91
+ 'returnSecureToken': true,
92
+ 'returnIdpCredential': true
93
+ }
87
94
  end
88
95
  end
96
+
97
+ def oauth_post_body(params)
98
+ [
99
+ params.slice(:access_token, :id_token)&.first&.join('='),
100
+ params.slice(:oauth_token_secret)&.first&.join('='),
101
+ "providerId=#{params[:provider_id]}"
102
+ ].compact.join('&')
103
+ end
89
104
  end
90
105
  end
@@ -51,12 +51,8 @@ module Fuser
51
51
  error_key = parsed_response.dig('error', 'message')
52
52
  return unless error_key
53
53
 
54
- parsed_response.deep_merge!(
55
- 'error' => {
56
- 'message' => error_explanation(error_key),
57
- 'key' => error_key
58
- }
59
- )
54
+ parsed_response['error']['message_explanation'] = error_explanation(error_key)
55
+ parsed_response['error']['key'] = error_key
60
56
  end
61
57
  end
62
58
  end
data/lib/fuser/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fuser
4
- VERSION = '0.1.4'
4
+ VERSION = '0.2.0'
5
5
  end
@@ -11,6 +11,7 @@ en:
11
11
  change_email: "https://www.googleapis.com/identitytoolkit/v3/relyingparty/setAccountInfo?key=%{api_key}"
12
12
  change_password: "https://www.googleapis.com/identitytoolkit/v3/relyingparty/setAccountInfo?key=%{api_key}"
13
13
  set_account_info: "https://www.googleapis.com/identitytoolkit/v3/relyingparty/setAccountInfo?key=%{api_key}"
14
+ oauth_sign_in: "https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyAssertion?key=%{api_key}"
14
15
  errors:
15
16
  default: "Something went wrong please try again."
16
17
  sign_up:
@@ -51,6 +52,7 @@ en:
51
52
  invalid_id_token: "The user's credential is no longer valid. The user must sign in again."
52
53
  weak_password: "The password must be 6 characters long or more."
53
54
  set_account_info:
55
+ credentials_too_old_login_again: "The user's credential is no longer valid. The user must sign in again."
54
56
  invalid_id_token: "The user's credential is no longer valid. The user must sign in again."
55
57
  email_exists: "The email address is already in use by another account."
56
58
  weak_password: "The password must be 6 characters long or more."
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fuser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - DeeMak13
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-29 00:00:00.000000000 Z
11
+ date: 2019-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty