fuser 0.1.4 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/lib/fuser/request.rb +15 -0
- data/lib/fuser/response.rb +2 -6
- data/lib/fuser/version.rb +1 -1
- data/lib/locales/fuser.en.yml +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5d39fd7173f7cc8131e6594ebef9ede3171195b615a3bbfb576d417724c62803
|
|
4
|
+
data.tar.gz: e9c9e60b2310c1b52b995810676e3d4c20c5001d5cdec126aab2a53fd718e524
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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.
|
|
18
|
+
httparty (0.16.4)
|
|
19
19
|
mime-types (~> 3.0)
|
|
20
20
|
multi_xml (>= 0.5.2)
|
|
21
|
-
i18n (1.
|
|
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
|
data/lib/fuser/response.rb
CHANGED
|
@@ -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
|
|
55
|
-
|
|
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
data/lib/locales/fuser.en.yml
CHANGED
|
@@ -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.
|
|
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-
|
|
11
|
+
date: 2019-03-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: httparty
|