authing_ruby 1.0.7 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/authing_ruby/GraphQLAPI.rb +13 -2
- data/lib/authing_ruby/authentication/AuthenticationClient.rb +66 -60
- data/lib/authing_ruby/common/GraphqlClient.rb +42 -4
- data/lib/authing_ruby/graphql/mutations/updatePhone.gql +63 -0
- data/lib/authing_ruby/management/ManagementClient.rb +1 -1
- data/lib/authing_ruby/management/ManagementTokenProvider.rb +9 -8
- data/lib/authing_ruby/management/UsersManagementClient.rb +4 -6
- data/lib/authing_ruby/test/helper.rb +6 -2
- data/lib/authing_ruby/test/js_sdk_test/2.registerByPhoneCode.js +130 -0
- data/lib/authing_ruby/test/js_sdk_test/3.sendSMS.js +23 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/browser/index.min.js +1 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/authentication/AuthenticationClient.d.ts +41 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/authentication/AuthenticationClient.js +60 -2
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/authentication/QrCodeAuthenticationClient.js +6 -3
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/authentication/SocialAuthenticationClient.d.ts +4 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/authentication/SocialAuthenticationClient.js +6 -5
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/authentication/types.d.ts +10 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/authentication/types.js +1 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/common/GraphqlClient.js +10 -8
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/common/HttpClient.js +17 -15
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/graphqlapi.d.ts +12 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/graphqlapi.js +192 -2
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/ApplicationsManagementClient.js +5 -3
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/GroupsManagementClient.d.ts +5 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/GroupsManagementClient.js +29 -11
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/ManagementClient.d.ts +5 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/ManagementClient.js +15 -2
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/OrgManagementClient.d.ts +34 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/OrgManagementClient.js +71 -3
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/RolesManagementClient.d.ts +6 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/RolesManagementClient.js +45 -10
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/UsersManagementClient.d.ts +34 -3
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/UsersManagementClient.js +189 -52
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/types.d.ts +10 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/types.js +1 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/utils.d.ts +1 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/utils.js +1 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/version.d.ts +1 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/version.js +2 -2
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/types/graphql.v2.d.ts +661 -32
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/types/graphql.v2.js +30 -19
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/authentication/AuthenticationClient.d.ts +41 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/authentication/AuthenticationClient.js +61 -3
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/authentication/QrCodeAuthenticationClient.js +6 -3
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/authentication/SocialAuthenticationClient.d.ts +4 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/authentication/SocialAuthenticationClient.js +6 -5
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/authentication/types.d.ts +10 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/authentication/types.js +1 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/common/GraphqlClient.js +10 -8
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/common/HttpClient.js +17 -15
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/graphqlapi.d.ts +12 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/graphqlapi.js +192 -2
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/ApplicationsManagementClient.js +5 -3
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/GroupsManagementClient.d.ts +5 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/GroupsManagementClient.js +30 -12
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/ManagementClient.d.ts +5 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/ManagementClient.js +15 -2
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/OrgManagementClient.d.ts +34 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/OrgManagementClient.js +72 -4
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/RolesManagementClient.d.ts +6 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/RolesManagementClient.js +46 -11
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/UsersManagementClient.d.ts +34 -3
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/UsersManagementClient.js +190 -53
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/types.d.ts +10 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/types.js +1 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/utils.d.ts +1 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/utils.js +1 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/version.d.ts +1 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/version.js +2 -2
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/types/graphql.v2.d.ts +661 -32
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/types/graphql.v2.js +29 -18
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/authentication/AuthenticationClient.d.ts +41 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/authentication/AuthenticationClient.js +60 -2
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/authentication/QrCodeAuthenticationClient.js +6 -3
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/authentication/SocialAuthenticationClient.d.ts +4 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/authentication/SocialAuthenticationClient.js +6 -5
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/authentication/types.d.ts +10 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/authentication/types.js +1 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/common/GraphqlClient.js +10 -8
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/common/HttpClient.js +17 -15
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/graphqlapi.d.ts +12 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/graphqlapi.js +192 -2
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/ApplicationsManagementClient.js +5 -3
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/GroupsManagementClient.d.ts +5 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/GroupsManagementClient.js +29 -11
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/ManagementClient.d.ts +5 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/ManagementClient.js +15 -2
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/OrgManagementClient.d.ts +34 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/OrgManagementClient.js +71 -3
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/RolesManagementClient.d.ts +6 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/RolesManagementClient.js +45 -10
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/UsersManagementClient.d.ts +34 -3
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/UsersManagementClient.js +189 -52
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/types.d.ts +10 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/types.js +1 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/utils.d.ts +1 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/utils.js +1 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/version.d.ts +1 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/version.js +2 -2
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/types/graphql.v2.d.ts +661 -32
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/types/graphql.v2.js +30 -19
- data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/package.json +1 -1
- data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/CHANGELOG.md +210 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/LICENSE +23 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/README.md +275 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/config.js +11 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/lib/cli-options.js +13 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/lib/env-options.js +18 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/lib/main.js +118 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/package.json +57 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/types/index.d.ts +59 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/types/test.ts +19 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/types/tsconfig.json +15 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/types/tslint.json +6 -0
- data/lib/authing_ruby/test/js_sdk_test/node_modules/follow-redirects/index.js +0 -4
- data/lib/authing_ruby/test/js_sdk_test/node_modules/follow-redirects/package.json +1 -1
- data/lib/authing_ruby/test/js_sdk_test/package-lock.json +7 -7
- data/lib/authing_ruby/test/js_sdk_test/package.json +3 -2
- data/lib/authing_ruby/test/js_sdk_test/yarn.lock +71 -0
- data/lib/authing_ruby/test/mini_test/TestApplicationsManagementClient.rb +2 -2
- data/lib/authing_ruby/test/mini_test/TestAuthenticationClient.rb +27 -13
- data/lib/authing_ruby/test/mini_test/TestManagementClient.rb +31 -43
- data/lib/authing_ruby/test/mini_test/TestSMSandEmail.rb +47 -3
- data/lib/authing_ruby/test/sms.rb +18 -0
- data/lib/authing_ruby/utils/utils.rb +68 -0
- data/lib/authing_ruby/version.rb +1 -1
- metadata +23 -6
@@ -1,8 +1,8 @@
|
|
1
|
-
# ruby ./lib/test/mini_test/TestApplicationsManagementClient.rb
|
1
|
+
# ruby ./lib/authing_ruby/test/mini_test/TestApplicationsManagementClient.rb
|
2
2
|
|
3
3
|
require "minitest/autorun"
|
4
4
|
require "./lib/authing_ruby.rb"
|
5
|
-
require "./lib/test/helper.rb"
|
5
|
+
require "./lib/authing_ruby/test/helper.rb"
|
6
6
|
require 'dotenv'
|
7
7
|
Dotenv.load('.env.test')
|
8
8
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# 测试内容: 用户认证模块-认证核心模块
|
2
|
-
# 如何运行: ruby
|
2
|
+
# 如何运行: ruby ./lib/authing_ruby/test/mini_test/TestAuthenticationClient.rb
|
3
3
|
|
4
4
|
require "minitest/autorun" # Minitest
|
5
5
|
require "./lib/authing_ruby.rb" # 模块主文件
|
@@ -11,13 +11,32 @@ Dotenv.load('.env.test') # 你可以编辑这个文件来修改环境变量
|
|
11
11
|
class TestAuthenticationClient < Minitest::Test
|
12
12
|
def setup
|
13
13
|
options = {
|
14
|
-
appHost: ENV["appHost"], # "https://rails-demo.authing.cn",
|
15
|
-
appId: ENV["appId"], # "60800b9151d040af9016d60b"
|
14
|
+
# appHost: ENV["appHost"], # "https://rails-demo.authing.cn",
|
15
|
+
# appId: ENV["appId"], # "60800b9151d040af9016d60b"
|
16
|
+
appId: "60ab26fe5be730bfc1742c68",
|
17
|
+
appHost: "https://hn-staging.authing.cn",
|
16
18
|
}
|
17
19
|
@authenticationClient = AuthingRuby::AuthenticationClient.new(options)
|
18
20
|
@helper = Test::Helper.new
|
19
21
|
end
|
20
22
|
|
23
|
+
# 测试: 手机号+验证码+密码 注册
|
24
|
+
# 需要手动测试(填验证码)
|
25
|
+
# ruby ./lib/authing_ruby/test/mini_test/TestAuthenticationClient.rb -n test_registerByPhoneCode
|
26
|
+
def test_registerByPhoneCode
|
27
|
+
phone = '13556136684'
|
28
|
+
code = '8086'
|
29
|
+
password = '1234567890'
|
30
|
+
res = @authenticationClient.registerByPhoneCode(phone, code, password)
|
31
|
+
# puts '拿到的结果是:-----'
|
32
|
+
# puts res
|
33
|
+
# {:code=>2026, :message=>"用户已存在,请直接登录!", :data=>nil}
|
34
|
+
# {:code=>2001, :message=>"验证码不正确!", :data=>nil}
|
35
|
+
|
36
|
+
# 如果成功
|
37
|
+
# {"id"=>"60ad0c49d6e166f9fe23ba4d", "arn"=>"arn:cn:authing:60ab26fe478f98290befefaa:user:60ad0c49d6e166f9fe23ba4d", "userPoolId"=>"60ab26fe478f98290befefaa", "status"=>"Activated", "username"=>nil, "email"=>nil, "emailVerified"=>false, "phone"=>"13556136684", "phoneVerified"=>true, "unionid"=>nil, "openid"=>nil, "nickname"=>nil, "registerSource"=>["basic:phone-code"], "photo"=>"default-user-avatar.png", "password"=>"0361a6088087f31edd172c4f6076c0e6", "oauth"=>nil, "token"=>nil, "tokenExpiredAt"=>nil, "loginsCount"=>0, "lastLogin"=>nil, "lastIP"=>nil, "signedUp"=>nil, "blocked"=>false, "isDeleted"=>false, "device"=>nil, "browser"=>nil, "company"=>nil, "name"=>nil, "givenName"=>nil, "familyName"=>nil, "middleName"=>nil, "profile"=>nil, "preferredUsername"=>nil, "website"=>nil, "gender"=>"U", "birthdate"=>nil, "zoneinfo"=>nil, "locale"=>nil, "address"=>nil, "formatted"=>nil, "streetAddress"=>nil, "locality"=>nil, "region"=>nil, "postalCode"=>nil, "city"=>nil, "province"=>nil, "country"=>nil, "createdAt"=>"2021-05-25T14:40:09+00:00", "updatedAt"=>"2021-05-25T14:40:09+00:00", "externalId"=>nil}
|
38
|
+
end
|
39
|
+
|
21
40
|
# 测试邮箱+密码注册
|
22
41
|
# ruby /lib/authing_ruby/test/mini_test/TestAuthenticationClient.rb -n test_registerByEmail
|
23
42
|
def test_registerByEmail
|
@@ -119,11 +138,13 @@ class TestAuthenticationClient < Minitest::Test
|
|
119
138
|
end
|
120
139
|
|
121
140
|
# 测试: 修改用户资料
|
122
|
-
#
|
141
|
+
# 需要手动测试(确保用户名+密码账号的确存在)
|
142
|
+
# ruby ./lib/authing_ruby/test/mini_test/TestAuthenticationClient.rb -n test_updateProfile
|
123
143
|
def test_updateProfile
|
124
144
|
# 先登录
|
125
145
|
username = 'zhengcheng123'
|
126
146
|
password = "123456789"
|
147
|
+
@authenticationClient.registerByUsername(username, password)
|
127
148
|
@authenticationClient.loginByUsername(username, password)
|
128
149
|
|
129
150
|
# 进行第一次修改
|
@@ -188,14 +209,6 @@ class TestAuthenticationClient < Minitest::Test
|
|
188
209
|
assert(result.dig('id') != nil, result)
|
189
210
|
end
|
190
211
|
|
191
|
-
# 测试: 解绑手机号
|
192
|
-
def test_unbindPhone
|
193
|
-
end
|
194
|
-
|
195
|
-
# 测试: 更新用户手机号
|
196
|
-
def test_updatePhone
|
197
|
-
end
|
198
|
-
|
199
212
|
# 绑定邮箱
|
200
213
|
def test_bindEmail
|
201
214
|
end
|
@@ -205,11 +218,12 @@ class TestAuthenticationClient < Minitest::Test
|
|
205
218
|
end
|
206
219
|
|
207
220
|
# 测试: 检测 Token 登录状态
|
208
|
-
# ruby
|
221
|
+
# ruby ./lib/authing_ruby/test/mini_test/TestAuthenticationClient.rb -n test_checkLoginStatus
|
209
222
|
def test_checkLoginStatus
|
210
223
|
# 第一步:先登录然后获取 token
|
211
224
|
username = 'zhengcheng123'
|
212
225
|
password = "123456789"
|
226
|
+
@authenticationClient.registerByUsername(username, password)
|
213
227
|
user = @authenticationClient.loginByUsername(username, password)
|
214
228
|
token = user.dig("token")
|
215
229
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require "minitest/autorun"
|
4
4
|
require "./lib/authing_ruby.rb"
|
5
|
-
require "./lib/test/helper.rb"
|
5
|
+
require "./lib/authing_ruby/test/helper.rb"
|
6
6
|
require 'dotenv'
|
7
7
|
Dotenv.load('.env.test')
|
8
8
|
|
@@ -10,6 +10,7 @@ class TestManagementClient < Minitest::Test
|
|
10
10
|
def setup
|
11
11
|
@options = {
|
12
12
|
host: 'https://core.authing.cn',
|
13
|
+
# host: 'https://core.authing.co', # 2021-5-13 他们临时使用 .co,过几天等他们恢复了 .cn 这里就改回 .cn
|
13
14
|
userPoolId: ENV["userPoolId"],
|
14
15
|
secret: ENV["secret"],
|
15
16
|
}
|
@@ -17,24 +18,26 @@ class TestManagementClient < Minitest::Test
|
|
17
18
|
end
|
18
19
|
|
19
20
|
# 创建用户
|
20
|
-
# ruby ./lib/test/mini_test/TestManagementClient.rb -n test_users_create
|
21
|
+
# ruby ./lib/authing_ruby/test/mini_test/TestManagementClient.rb -n test_users_create
|
21
22
|
def test_users_create
|
22
23
|
managementClient = AuthingRuby::ManagementClient.new(@options)
|
24
|
+
random_phone = "135#{@helper.randomNumString(8)}"
|
23
25
|
userInfo = {
|
24
|
-
username: @helper.randomString, # 随机字符串,比如 "mpflok"
|
26
|
+
# username: @helper.randomString, # 随机字符串,比如 "mpflok"
|
25
27
|
# username: 'SpongeBob3', # 或者明确指定用户名
|
26
|
-
|
28
|
+
phone: random_phone,
|
29
|
+
password: '123456789',
|
27
30
|
}
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
#
|
31
|
+
puts userInfo
|
32
|
+
hash = managementClient.users.create(userInfo)
|
33
|
+
|
34
|
+
# 成功
|
32
35
|
# {"data":{"createUser":{"id":"608ab9828eab7e35e81bd732","arn":"arn:cn:authing:60800b8ee5b66b23128b4980:user:608ab9828eab7e35e81bd732","userPoolId":"60800b8ee5b66b23128b4980","status":"Activated","username":"SpongeBob2","email":null,"emailVerified":false,"phone":null,"phoneVerified":false,"unionid":null,"openid":null,"nickname":null,"registerSource":["import:manual"],"photo":"default-user-avatar.png","password":"91b133c2e13e40852505946b7e0c2f04","oauth":null,"token":null,"tokenExpiredAt":null,"loginsCount":0,"lastLogin":null,"lastIP":null,"signedUp":null,"blocked":false,"isDeleted":false,"device":null,"browser":null,"company":null,"name":null,"givenName":null,"familyName":null,"middleName":null,"profile":null,"preferredUsername":null,"website":null,"gender":"U","birthdate":null,"zoneinfo":null,"locale":null,"address":null,"formatted":null,"streetAddress":null,"locality":null,"region":null,"postalCode":null,"city":null,"province":null,"country":null,"createdAt":"2021-04-29T13:49:54+00:00","updatedAt":"2021-04-29T13:49:54+00:00","externalId":null}}}
|
33
36
|
|
34
|
-
#
|
37
|
+
# 失败
|
35
38
|
# {"errors":[{"message":{"code":2026,"message":"用户已存在,请勿重复创建!"},"locations":[{"line":2,"column":3}],"path":["createUser"],"extensions":{"code":"INTERNAL_SERVER_ERROR"}}],"data":null}
|
36
39
|
|
37
|
-
assert(
|
40
|
+
assert(hash.dig("data", "createUser") != nil, hash)
|
38
41
|
end
|
39
42
|
|
40
43
|
# 创建用户
|
@@ -48,10 +51,8 @@ class TestManagementClient < Minitest::Test
|
|
48
51
|
loginsCount: 2, # 原有用户系统记录的用户登录次数
|
49
52
|
signedUp: '2020-10-15T17:55:37+08:00' # 原有用户系统记录的用户注册时间
|
50
53
|
}
|
51
|
-
|
52
|
-
|
53
|
-
json = JSON.parse(res)
|
54
|
-
assert(json.dig("data", "createUser") != nil, json)
|
54
|
+
hash = managementClient.users.create(userInfo)
|
55
|
+
assert(hash.dig("data", "createUser") != nil, hash)
|
55
56
|
end
|
56
57
|
|
57
58
|
# 创建一个用户, 并返回这个用户
|
@@ -66,14 +67,13 @@ class TestManagementClient < Minitest::Test
|
|
66
67
|
end
|
67
68
|
|
68
69
|
managementClient = AuthingRuby::ManagementClient.new(@options)
|
69
|
-
|
70
|
-
|
71
|
-
user = json.dig("data", "createUser")
|
70
|
+
hash = managementClient.users.create(userInfo)
|
71
|
+
user = hash.dig("data", "createUser")
|
72
72
|
return user
|
73
73
|
end
|
74
74
|
|
75
75
|
# 更新用户
|
76
|
-
# ruby ./lib/test/mini_test/TestManagementClient.rb -n test_update_user
|
76
|
+
# ruby ./lib/authing_ruby/test/mini_test/TestManagementClient.rb -n test_update_user
|
77
77
|
def test_update_user
|
78
78
|
# 第一步:创建用户
|
79
79
|
user = create_random_user()
|
@@ -81,44 +81,37 @@ class TestManagementClient < Minitest::Test
|
|
81
81
|
|
82
82
|
# 第二步:更新用户
|
83
83
|
managementClient = AuthingRuby::ManagementClient.new(@options)
|
84
|
-
|
84
|
+
hash = managementClient.users.update(user_id, {
|
85
85
|
nickname: 'Nick',
|
86
86
|
})
|
87
87
|
# puts res2
|
88
88
|
# 如果失败
|
89
89
|
# {"errors":[{"message":{"code":2004,"message":"用户不存在"},"locations":[{"line":2,"column":3}],"path":["updateUser"],"extensions":{"code":"INTERNAL_SERVER_ERROR"}}],"data":null}
|
90
90
|
|
91
|
-
|
92
|
-
assert(json2.dig("data", "updateUser") != nil, json2)
|
91
|
+
assert(hash.dig("data", "updateUser") != nil, hash)
|
93
92
|
end
|
94
93
|
|
95
94
|
# 测试通过 ID 获取用户信息
|
96
|
-
# ruby ./lib/test/mini_test/TestManagementClient.rb -n test_detail
|
95
|
+
# ruby ./lib/authing_ruby/test/mini_test/TestManagementClient.rb -n test_detail
|
97
96
|
def test_detail
|
98
97
|
user = create_random_user()
|
99
98
|
user_id = user.dig("id")
|
100
99
|
|
101
100
|
managementClient = AuthingRuby::ManagementClient.new(@options)
|
102
|
-
|
103
|
-
|
104
|
-
json = JSON.parse(res)
|
105
|
-
assert(json.dig("data", "user") != nil, json)
|
101
|
+
hash = managementClient.users.detail(user_id)
|
102
|
+
assert(hash.dig("data", "user") != nil, hash)
|
106
103
|
end
|
107
104
|
|
108
105
|
# 测试删除用户
|
109
|
-
# ruby ./lib/test/mini_test/TestManagementClient.rb -n test_delete
|
106
|
+
# ruby ./lib/authing_ruby/test/mini_test/TestManagementClient.rb -n test_delete
|
110
107
|
def test_delete
|
111
108
|
user = create_random_user()
|
112
109
|
user_id = user.dig("id")
|
113
110
|
|
114
111
|
managementClient = AuthingRuby::ManagementClient.new(@options)
|
115
|
-
|
116
|
-
|
117
|
-
# puts res
|
112
|
+
hash = managementClient.users.delete(user_id)
|
118
113
|
# {"data":{"deleteUser":{"message":"删除成功!","code":200}}}
|
119
|
-
|
120
|
-
json = JSON.parse(res)
|
121
|
-
assert(json.dig("data", "deleteUser") != nil, json)
|
114
|
+
assert(hash.dig("data", "deleteUser") != nil, hash)
|
122
115
|
end
|
123
116
|
|
124
117
|
# 测试删除多个用户
|
@@ -133,22 +126,17 @@ class TestManagementClient < Minitest::Test
|
|
133
126
|
user_ids = [user1_id, user2_id]
|
134
127
|
|
135
128
|
managementClient = AuthingRuby::ManagementClient.new(@options)
|
136
|
-
|
137
|
-
# puts res
|
129
|
+
hash = managementClient.users.deleteMany(user_ids)
|
138
130
|
# {"data":{"deleteUsers":{"message":"删除成功!","code":200}}}
|
139
|
-
|
140
|
-
json = JSON.parse(res)
|
141
|
-
assert(json.dig("data", "deleteUsers") != nil, json)
|
131
|
+
assert(hash.dig("data", "deleteUsers") != nil, hash)
|
142
132
|
end
|
143
133
|
|
144
134
|
# 测试获取用户列表
|
145
135
|
# ruby ./lib/test/mini_test/TestManagementClient.rb -n test_list
|
146
136
|
def test_list
|
147
137
|
managementClient = AuthingRuby::ManagementClient.new(@options)
|
148
|
-
|
149
|
-
|
150
|
-
json = JSON.parse(res)
|
151
|
-
assert(json.dig("data", "users") != nil, json)
|
138
|
+
hash = managementClient.users.list()
|
139
|
+
assert(hash.dig("data", "users") != nil, hash)
|
152
140
|
end
|
153
141
|
|
154
142
|
# 测试 检查用户是否存在 (返回 true | false)
|
@@ -172,7 +160,7 @@ class TestManagementClient < Minitest::Test
|
|
172
160
|
end
|
173
161
|
|
174
162
|
# 测试 查找用户 (返回这个用户)
|
175
|
-
# ruby ./lib/test/mini_test/TestManagementClient.rb -n test_find
|
163
|
+
# ruby ./lib/authing_ruby/test/mini_test/TestManagementClient.rb -n test_find
|
176
164
|
def test_find
|
177
165
|
# 第一步:先创建用户
|
178
166
|
userInfo = {
|
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
require "minitest/autorun"
|
14
14
|
require "./lib/authing_ruby.rb"
|
15
|
-
require "./lib/test/helper.rb"
|
15
|
+
require "./lib/authing_ruby/test/helper.rb"
|
16
16
|
require 'dotenv'
|
17
17
|
Dotenv.load('.env.test')
|
18
18
|
|
@@ -97,5 +97,49 @@ class TestSMSandEmail < Minitest::Test
|
|
97
97
|
# 清理工作:测完了删除第一步注册的用户
|
98
98
|
user_id = user['id']
|
99
99
|
@managementClient.users.delete(user_id)
|
100
|
-
end
|
101
|
-
|
100
|
+
end
|
101
|
+
|
102
|
+
# 测试: 更新用户手机号
|
103
|
+
# ruby ./lib/authing_ruby/test/mini_test/TestSMSandEmail.rb -n test_updatePhone
|
104
|
+
# 文档: https://docs.authing.cn/v2/reference/sdk-for-node/authentication/AuthenticationClient.html#%E6%9B%B4%E6%96%B0%E7%94%A8%E6%88%B7%E6%89%8B%E6%9C%BA%E5%8F%B7
|
105
|
+
def test_updatePhone
|
106
|
+
# 前提条件:先确保有一个现有用户,可以进 Authing 手工新建一个,新建时设定手机号和密码,手机号随便填如 13511112222 密码 123456789
|
107
|
+
|
108
|
+
# 先登录:
|
109
|
+
phone = '13511112222'
|
110
|
+
password = '123456789'
|
111
|
+
user = @authenticationClient.loginByPhonePassword(phone, password)
|
112
|
+
|
113
|
+
# 填写要绑定的新手机号(可以填你自己的,这样才能收到短信)
|
114
|
+
phone = '13556136684'
|
115
|
+
|
116
|
+
# 给新手机号发送短信验证码 (把下面这行先取消注释, 收到短信后再注释上)
|
117
|
+
# puts manual_send_SMS(phone); return;
|
118
|
+
|
119
|
+
# 填写收到的短信验证码
|
120
|
+
code = '4874'
|
121
|
+
|
122
|
+
# 默认情况下,如果用户当前已经绑定了手机号,需要同时验证原有手机号
|
123
|
+
# 开发者也可以选择不开启 “验证原有手机号“ ,可以在 Authing 控制台 的 设置目录下的安全信息模块进行关闭。
|
124
|
+
# 单个用户池 -> 设置 -> 安全信息 -> 用户池安全设置 -> 修改手机号时是否验证旧手机号 -> 点击开关,切换为关闭 -> 右上角"保存"
|
125
|
+
# 由于没有2个手机号,这里是关闭后再测试
|
126
|
+
oldPhone = nil
|
127
|
+
oldPhoneCode = nil
|
128
|
+
|
129
|
+
updatePhoneResult = @authenticationClient.updatePhone(phone, code, oldPhone, oldPhoneCode)
|
130
|
+
puts updatePhoneResult
|
131
|
+
assert(updatePhoneResult.dig('id') != nil)
|
132
|
+
|
133
|
+
# 错误:
|
134
|
+
# {:code=>2020, :message=>"尚未登录,无访问权限", :data=>nil}
|
135
|
+
# {:code=>500, :message=>"该手机号已被绑定", :data=>nil}
|
136
|
+
# {:code=>2230, :message=>"新手机号和旧手机号一样", :data=>nil}
|
137
|
+
# {:code=>500, :message=>"修改手机号必须验证原来的手机号。", :data=>nil}
|
138
|
+
# {:code=>500, :message=>"验证码已过期", :data=>nil}
|
139
|
+
# {:code=>500, :message=>"验证码不正确!", :data=>nil}
|
140
|
+
|
141
|
+
# 成功会返回 User
|
142
|
+
# {"id"=>"60b5b17a9cf59b23b2bcbccb", "arn"=>"arn:cn:authing:60800b8ee5b66b23128b4980:user:60b5b17a9cf59b23b2bcbccb", "userPoolId"=>"60800b8ee5b66b23128b4980", "status"=>"Activated", "username"=>"测试更新手机号", "email"=>nil, "emailVerified"=>false, "phone"=>"13556136684", "phoneVerified"=>true, "unionid"=>nil, "openid"=>nil, "nickname"=>nil, "registerSource"=>["import:manual"], "photo"=>"https://files.authing.co/authing-console/default-user-avatar.png", "password"=>"871fde109c2f0f463cc35e0c3e840932", "oauth"=>nil, "token"=>"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI2MGI1YjE3YTljZjU5YjIzYjJiY2JjY2IiLCJiaXJ0aGRhdGUiOm51bGwsImZhbWlseV9uYW1lIjpudWxsLCJnZW5kZXIiOiJVIiwiZ2l2ZW5fbmFtZSI6bnVsbCwibG9jYWxlIjpudWxsLCJtaWRkbGVfbmFtZSI6bnVsbCwibmFtZSI6bnVsbCwibmlja25hbWUiOm51bGwsInBpY3R1cmUiOiJodHRwczovL2ZpbGVzLmF1dGhpbmcuY28vYXV0aGluZy1jb25zb2xlL2RlZmF1bHQtdXNlci1hdmF0YXIucG5nIiwicHJlZmVycmVkX3VzZXJuYW1lIjpudWxsLCJwcm9maWxlIjpudWxsLCJ1cGRhdGVkX2F0IjoiMjAyMS0wNi0wMVQwNDoxNjo1MS41NDBaIiwid2Vic2l0ZSI6bnVsbCwiem9uZWluZm8iOm51bGwsImFkZHJlc3MiOnsiY291bnRyeSI6bnVsbCwicG9zdGFsX2NvZGUiOm51bGwsInJlZ2lvbiI6bnVsbCwiZm9ybWF0dGVkIjpudWxsfSwicGhvbmVfbnVtYmVyIjoiMTM1MTExMTIyMjIiLCJwaG9uZV9udW1iZXJfdmVyaWZpZWQiOmZhbHNlLCJlbWFpbCI6bnVsbCwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJleHRlcm5hbF9pZCI6bnVsbCwidW5pb25pZCI6bnVsbCwiZGF0YSI6eyJ0eXBlIjoidXNlciIsInVzZXJQb29sSWQiOiI2MDgwMGI4ZWU1YjY2YjIzMTI4YjQ5ODAiLCJhcHBJZCI6IjYwYjViMjFiZTMxMjkwNjI2ZmY2ZDgyZiIsImlkIjoiNjBiNWIxN2E5Y2Y1OWIyM2IyYmNiY2NiIiwidXNlcklkIjoiNjBiNWIxN2E5Y2Y1OWIyM2IyYmNiY2NiIiwiX2lkIjoiNjBiNWIxN2E5Y2Y1OWIyM2IyYmNiY2NiIiwicGhvbmUiOiIxMzUxMTExMjIyMiIsImVtYWlsIjpudWxsLCJ1c2VybmFtZSI6Iua1i-ivleabtOaWsOaJi-acuuWPtyIsInVuaW9uaWQiOm51bGwsIm9wZW5pZCI6bnVsbCwiY2xpZW50SWQiOiI2MDgwMGI4ZWU1YjY2YjIzMTI4YjQ5ODAifSwidXNlcnBvb2xfaWQiOiI2MDgwMGI4ZWU1YjY2YjIzMTI4YjQ5ODAiLCJhdWQiOiI2MGI1YjIxYmUzMTI5MDYyNmZmNmQ4MmYiLCJleHAiOjE2MjM3MzA2MzEsImlhdCI6MTYyMjUyMTAzMSwiaXNzIjoiaHR0cHM6Ly9tb3Jlbi5hdXRoaW5nLmNuL29pZGMifQ.VKSB6q-DBmtKLzOh_2qjBPQCSNZUAtrw_G2ZlNjOxbs", "tokenExpiredAt"=>"2021-06-15T04:17:11+00:00", "loginsCount"=>6, "lastLogin"=>"2021-06-01T04:17:11+00:00", "lastIP"=>nil, "signedUp"=>"2021-06-01T04:03:06+00:00", "blocked"=>false, "isDeleted"=>false, "device"=>nil, "browser"=>nil, "company"=>nil, "name"=>nil, "givenName"=>nil, "familyName"=>nil, "middleName"=>nil, "profile"=>nil, "preferredUsername"=>nil, "website"=>nil, "gender"=>"U", "birthdate"=>nil, "zoneinfo"=>nil, "locale"=>nil, "address"=>nil, "formatted"=>nil, "streetAddress"=>nil, "locality"=>nil, "region"=>nil, "postalCode"=>nil, "city"=>nil, "province"=>nil, "country"=>nil, "createdAt"=>"2021-06-01T04:03:06+00:00", "updatedAt"=>"2021-06-01T04:17:12+00:00"}
|
143
|
+
end
|
144
|
+
|
145
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# 发短信
|
2
|
+
# ruby ./lib/authing_ruby/test/sms.rb
|
3
|
+
|
4
|
+
require "./lib/authing_ruby.rb" # 模块主文件
|
5
|
+
require "./lib/authing_ruby/test/helper.rb"
|
6
|
+
require 'dotenv'
|
7
|
+
Dotenv.load('.env.test') # 你可以编辑这个文件来修改环境变量
|
8
|
+
|
9
|
+
options = {
|
10
|
+
# appHost: ENV["appHost"] || , # "https://rails-demo.authing.cn",
|
11
|
+
# appId: ENV["appId"], # "60800b9151d040af9016d60b"
|
12
|
+
appId: "60ab26fe5be730bfc1742c68",
|
13
|
+
appHost: "https://hn-staging.authing.cn",
|
14
|
+
}
|
15
|
+
@authenticationClient = AuthingRuby::AuthenticationClient.new(options)
|
16
|
+
phone = "13556136684"
|
17
|
+
sms_result = @authenticationClient.sendSmsCode(phone)
|
18
|
+
puts sms_result
|
@@ -1,5 +1,8 @@
|
|
1
|
+
# 一些工具函数放这里
|
2
|
+
|
1
3
|
require 'openssl'
|
2
4
|
require "base64"
|
5
|
+
require 'jwt'
|
3
6
|
|
4
7
|
module AuthingRuby
|
5
8
|
class Utils
|
@@ -36,5 +39,70 @@ module AuthingRuby
|
|
36
39
|
return result
|
37
40
|
end
|
38
41
|
|
42
|
+
# verifyIDTokenHS256 函数用于验证 HS256 id_token
|
43
|
+
|
44
|
+
# 文档:使用指南 -> 常见问题 -> 如何验证用户身份凭证(token) -> 使用应用密钥验证 HS256 算法签名的 Token
|
45
|
+
# https://docs.authing.cn/v2/guides/faqs/how-to-validate-user-token.html#%E4%BD%BF%E7%94%A8%E5%BA%94%E7%94%A8%E5%AF%86%E9%92%A5%E9%AA%8C%E8%AF%81-hs256-%E7%AE%97%E6%B3%95%E7%AD%BE%E5%90%8D%E7%9A%84-token
|
46
|
+
|
47
|
+
# 官方文档目前(2021-5-13)是让用户自己处理 HS256 的 token,自己进行验证,但这样比较麻烦,我在 Ruby SDK 这边写一个方便的方法。
|
48
|
+
# verifyIDTokenHS256 返回 Boolean, true 代表 token 有效,false 代表无效
|
49
|
+
|
50
|
+
# 注意: 可以在 "应用 -> 授权 -> id_token 签名算法" 这里看到,选的是不是 HS256
|
51
|
+
# 如果是 HS256 才应该用这个方法来验证
|
52
|
+
|
53
|
+
# 参数 id_token 就是登录返回的 "token"
|
54
|
+
# 参数 appSecret 就是 Authing 里某个应用的 appSecret
|
55
|
+
def self.verifyIDTokenHS256(id_token, appSecret)
|
56
|
+
# 如果解码出错,直接返回 false
|
57
|
+
begin
|
58
|
+
hmac_secret = appSecret
|
59
|
+
decoded = JWT.decode id_token, hmac_secret, true, { algorithm: 'HS256' }
|
60
|
+
rescue => error
|
61
|
+
# puts error.message
|
62
|
+
return false
|
63
|
+
end
|
64
|
+
|
65
|
+
payload = decoded[0]
|
66
|
+
header = decoded[1]
|
67
|
+
|
68
|
+
# 从 payload 获得过期时间,然后判断是否过期
|
69
|
+
exp = payload["exp"] # 过期时间
|
70
|
+
current_timestamp = Time.now.to_i
|
71
|
+
if current_timestamp < exp
|
72
|
+
return true # 没过期
|
73
|
+
else
|
74
|
+
return false # 过期了
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# decodeIdToken 函数用于 解码 id token 得到用户信息
|
79
|
+
# 因为 id token 其实就是一个普通的 JWT,所以 payload 没有加密过,只是 base64 编码了而已,可以当做明文看待 (你可以直接把 id token 粘贴到 https://jwt.io/ 看到 payload 内容)
|
80
|
+
# 所以 payload 不可以直接相信,必须先验证后才能相信。
|
81
|
+
# 函数返回:
|
82
|
+
# 成功:返回用户信息
|
83
|
+
# 失败:返回 nil (比如解码失败 或 token 过期)
|
84
|
+
def self.decodeIdToken(id_token, appSecret)
|
85
|
+
# 如果解码出错,直接返回 false
|
86
|
+
begin
|
87
|
+
hmac_secret = appSecret
|
88
|
+
decoded = JWT.decode id_token, hmac_secret, true, { algorithm: 'HS256' }
|
89
|
+
rescue => error
|
90
|
+
# puts error.message
|
91
|
+
return nil
|
92
|
+
end
|
93
|
+
|
94
|
+
payload = decoded[0]
|
95
|
+
header = decoded[1]
|
96
|
+
|
97
|
+
# 从 payload 获得过期时间,然后判断是否过期
|
98
|
+
exp = payload["exp"] # 过期时间
|
99
|
+
current_timestamp = Time.now.to_i
|
100
|
+
if current_timestamp < exp
|
101
|
+
return payload # 没过期
|
102
|
+
else
|
103
|
+
return nil # 过期了
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
39
107
|
end
|
40
108
|
end
|
data/lib/authing_ruby/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authing_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 郑诚(Zheng Cheng)
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -189,6 +189,7 @@ files:
|
|
189
189
|
- lib/authing_ruby/graphql/mutations/resetPassword.gql
|
190
190
|
- lib/authing_ruby/graphql/mutations/sendEmail.gql
|
191
191
|
- lib/authing_ruby/graphql/mutations/updatePassword.gql
|
192
|
+
- lib/authing_ruby/graphql/mutations/updatePhone.gql
|
192
193
|
- lib/authing_ruby/graphql/mutations/updateUser.gql
|
193
194
|
- lib/authing_ruby/graphql/queries/accessToken.gql
|
194
195
|
- lib/authing_ruby/graphql/queries/checkLoginStatus.gql
|
@@ -209,6 +210,8 @@ files:
|
|
209
210
|
- lib/authing_ruby/test/helper.rb
|
210
211
|
- lib/authing_ruby/test/js_sdk_test/1.buildAuthorizeUrl.js
|
211
212
|
- lib/authing_ruby/test/js_sdk_test/2.buildAuthorizeUrl_PKCE.js
|
213
|
+
- lib/authing_ruby/test/js_sdk_test/2.registerByPhoneCode.js
|
214
|
+
- lib/authing_ruby/test/js_sdk_test/3.sendSMS.js
|
212
215
|
- lib/authing_ruby/test/js_sdk_test/README.md
|
213
216
|
- lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/CONTRIBUTION.md
|
214
217
|
- lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/LICENSE
|
@@ -591,6 +594,18 @@ files:
|
|
591
594
|
- lib/authing_ruby/test/js_sdk_test/node_modules/debug/src/debug.js
|
592
595
|
- lib/authing_ruby/test/js_sdk_test/node_modules/debug/src/index.js
|
593
596
|
- lib/authing_ruby/test/js_sdk_test/node_modules/debug/src/node.js
|
597
|
+
- lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/CHANGELOG.md
|
598
|
+
- lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/LICENSE
|
599
|
+
- lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/README.md
|
600
|
+
- lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/config.js
|
601
|
+
- lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/lib/cli-options.js
|
602
|
+
- lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/lib/env-options.js
|
603
|
+
- lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/lib/main.js
|
604
|
+
- lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/package.json
|
605
|
+
- lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/types/index.d.ts
|
606
|
+
- lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/types/test.ts
|
607
|
+
- lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/types/tsconfig.json
|
608
|
+
- lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/types/tslint.json
|
594
609
|
- lib/authing_ruby/test/js_sdk_test/node_modules/follow-redirects/LICENSE
|
595
610
|
- lib/authing_ruby/test/js_sdk_test/node_modules/follow-redirects/README.md
|
596
611
|
- lib/authing_ruby/test/js_sdk_test/node_modules/follow-redirects/debug.js
|
@@ -657,6 +672,7 @@ files:
|
|
657
672
|
- lib/authing_ruby/test/js_sdk_test/node_modules/ms/readme.md
|
658
673
|
- lib/authing_ruby/test/js_sdk_test/package-lock.json
|
659
674
|
- lib/authing_ruby/test/js_sdk_test/package.json
|
675
|
+
- lib/authing_ruby/test/js_sdk_test/yarn.lock
|
660
676
|
- lib/authing_ruby/test/mini_test/TestApplicationsManagementClient.rb
|
661
677
|
- lib/authing_ruby/test/mini_test/TestAuthenticationClient.rb
|
662
678
|
- lib/authing_ruby/test/mini_test/TestAuthenticationClientProtocal.rb
|
@@ -666,13 +682,14 @@ files:
|
|
666
682
|
- lib/authing_ruby/test/mini_test/TestNaiveHttpClient.rb
|
667
683
|
- lib/authing_ruby/test/mini_test/TestSMSandEmail.rb
|
668
684
|
- lib/authing_ruby/test/mini_test/TestUtils.rb
|
685
|
+
- lib/authing_ruby/test/sms.rb
|
669
686
|
- lib/authing_ruby/utils/utils.rb
|
670
687
|
- lib/authing_ruby/version.rb
|
671
688
|
homepage: https://github.com/1c7/authing_ruby
|
672
689
|
licenses:
|
673
690
|
- MIT
|
674
691
|
metadata: {}
|
675
|
-
post_install_message:
|
692
|
+
post_install_message:
|
676
693
|
rdoc_options: []
|
677
694
|
require_paths:
|
678
695
|
- lib
|
@@ -687,8 +704,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
687
704
|
- !ruby/object:Gem::Version
|
688
705
|
version: '0'
|
689
706
|
requirements: []
|
690
|
-
rubygems_version: 3.0.
|
691
|
-
signing_key:
|
707
|
+
rubygems_version: 3.0.9
|
708
|
+
signing_key:
|
692
709
|
specification_version: 4
|
693
710
|
summary: Authing 的 Ruby SDK
|
694
711
|
test_files: []
|