@logto/connector-apple 1.0.0-beta.18 → 1.0.0-beta.20
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.
- package/README.md +0 -22
- package/lib/index.js +10 -2
- package/logo-dark.svg +1 -1
- package/logo.svg +1 -1
- package/package.json +2 -2
- package/docs/config-template.json +0 -3
package/README.md
CHANGED
|
@@ -11,14 +11,12 @@ Apple 社交登录 Logto 官方连接器 [中文文档](#apple-连接器)
|
|
|
11
11
|
- [Enable Sign in with Apple for your app](#enable-sign-in-with-apple-for-your-app)
|
|
12
12
|
- [Create an identifier](#create-an-identifier)
|
|
13
13
|
- [Enable Sign in with Apple for your identifier](#enable-sign-in-with-apple-for-your-identifier)
|
|
14
|
-
- [Compose the connector JSON](#compose-the-connector-json)
|
|
15
14
|
- [Test Apple connector](#test-apple-connector)
|
|
16
15
|
- [Apple 连接器](#apple-连接器)
|
|
17
16
|
- [开始上手](#开始上手)
|
|
18
17
|
- [为你的应用启用「通过 Apple 登录」](#为你的应用启用通过-apple-登录)
|
|
19
18
|
- [创建一个 identifier](#创建一个-identifier)
|
|
20
19
|
- [为你的 identifier 启用「通过 Apple 登录」](#为你的-identifier-启用通过-apple-登录)
|
|
21
|
-
- [编写连接器的 JSON](#编写连接器的-json)
|
|
22
20
|
- [测试 Apple 连接器](#测试-apple-连接器)
|
|
23
21
|
|
|
24
22
|
## Get started
|
|
@@ -71,16 +69,6 @@ Click "Next" then "Done" to close the modal. Click "Continue" on the top-right c
|
|
|
71
69
|
>
|
|
72
70
|
> If you want to test locally, you need to edit `/etc/hosts` file to map localhost to a custom domain and set up a local HTTPS environment. [mkcert](https://github.com/FiloSottile/mkcert) can help you for setting up local HTTPS.
|
|
73
71
|
|
|
74
|
-
## Compose the connector JSON
|
|
75
|
-
|
|
76
|
-
You need to use the identifier that fills in the [Create an identifier](#create-an-identifier) section to compose the JSON:
|
|
77
|
-
|
|
78
|
-
```json
|
|
79
|
-
{
|
|
80
|
-
"clientId": "io.logto.test"
|
|
81
|
-
}
|
|
82
|
-
```
|
|
83
|
-
|
|
84
72
|
> ℹ️ **Note**
|
|
85
73
|
>
|
|
86
74
|
> This connector doesn't support customizing `scope` (e.g., name, email) yet since Apple requires `form_post` response mode when `scope` is not empty, which is incompatible with the current connector design.
|
|
@@ -143,16 +131,6 @@ That's it. The Apple connector should be available in both web and native apps.
|
|
|
143
131
|
>
|
|
144
132
|
> 如果你想在本地进行测试,你需要编辑 `/etc/hosts` 文件以映射 localhost 到一个自定义域名,并设置一个本地的 HTTPS 环境。[mkcert](https://github.com/FiloSottile/mkcert) 可以帮助你设置本地 HTTPS。
|
|
145
133
|
|
|
146
|
-
## 编写连接器的 JSON
|
|
147
|
-
|
|
148
|
-
你需要使用在 [创建一个 identifier](#创建一个-identifier) 章节中填写的 identifier 来编写此 JSON:
|
|
149
|
-
|
|
150
|
-
```json
|
|
151
|
-
{
|
|
152
|
-
"clientId": "io.logto.test"
|
|
153
|
-
}
|
|
154
|
-
```
|
|
155
|
-
|
|
156
134
|
> ℹ️ **Note**
|
|
157
135
|
>
|
|
158
136
|
> 本连接器暂时不支持自定义 `scope`(例如 name,email)。因为在 `scope` 非空时,Apple 要求 `response_mode` 为 `form_post`,与现在连接器的设计不兼容。
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConnectorPlatform, ConnectorType, validateConfig, ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
|
|
1
|
+
import { ConnectorPlatform, ConnectorConfigFormItemType, ConnectorType, validateConfig, ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
|
|
2
2
|
import * as crypto from 'crypto';
|
|
3
3
|
import { randomFillSync, KeyObject, createPublicKey, generateKeyPair, pbkdf2, createPrivateKey, createSecretKey, constants } from 'crypto';
|
|
4
4
|
import { z } from 'zod';
|
|
@@ -3549,7 +3549,15 @@ const defaultMetadata = {
|
|
|
3549
3549
|
ko: 'Apple은 하드웨어와 소프트웨어의 다국적 공급자 입니다.',
|
|
3550
3550
|
},
|
|
3551
3551
|
readme: './README.md',
|
|
3552
|
-
|
|
3552
|
+
formItems: [
|
|
3553
|
+
{
|
|
3554
|
+
key: 'clientId',
|
|
3555
|
+
type: ConnectorConfigFormItemType.Text,
|
|
3556
|
+
required: true,
|
|
3557
|
+
label: 'Client ID',
|
|
3558
|
+
placeholder: '<client-id>',
|
|
3559
|
+
},
|
|
3560
|
+
],
|
|
3553
3561
|
};
|
|
3554
3562
|
|
|
3555
3563
|
const appleConfigGuard = z.object({
|
package/logo-dark.svg
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="
|
|
2
|
+
<path d="M18.548 12.7505C18.5586 11.832 18.8022 10.9313 19.2558 10.1326C19.7094 9.3339 20.3583 8.6634 21.1417 8.18388C20.6437 7.47486 19.9882 6.89091 19.2266 6.47786C18.465 6.06481 17.618 5.83391 16.7521 5.80328C14.8829 5.6138 13.1049 6.90359 12.1578 6.90359C11.2101 6.90359 9.74697 5.83111 8.19675 5.8607C7.17936 5.88898 6.18677 6.18109 5.31623 6.70839C4.44569 7.23569 3.72706 7.9801 3.23077 8.86868C1.1159 12.5409 2.69095 17.9811 4.75194 20.9608C5.76048 22.4175 6.96267 24.0582 8.54126 23.9984C10.0625 23.9386 10.6366 23.0159 12.4733 23.0159C14.3105 23.0159 14.8273 23.9984 16.4343 23.9688C18.0698 23.9386 19.1079 22.482 20.1082 21.0199C20.8242 19.9685 21.3837 18.8187 21.7692 17.6065C20.8169 17.1998 20.0045 16.5233 19.4321 15.6604C18.8597 14.7975 18.5524 13.7859 18.548 12.7505ZM15.5278 3.83196C16.4336 2.76959 16.8824 1.39205 16.7762 0C15.4087 0.132651 14.1437 0.783462 13.2408 1.81897C12.7902 2.32062 12.4453 2.90785 12.2266 3.54565C12.0078 4.18345 11.9197 4.85876 11.9676 5.53133C12.6517 5.54078 13.3288 5.39237 13.9463 5.09765C14.5637 4.80292 15.1049 4.36981 15.5278 3.83196Z" fill="white"/>
|
|
3
3
|
</svg>
|
package/logo.svg
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="
|
|
2
|
+
<path d="M18.548 12.7505C18.5586 11.832 18.8022 10.9313 19.2558 10.1326C19.7094 9.3339 20.3583 8.6634 21.1417 8.18388C20.6437 7.47486 19.9882 6.89091 19.2266 6.47786C18.465 6.06481 17.618 5.83391 16.7521 5.80328C14.8829 5.6138 13.1049 6.90359 12.1578 6.90359C11.2101 6.90359 9.74697 5.83111 8.19675 5.8607C7.17936 5.88898 6.18677 6.18109 5.31623 6.70839C4.44569 7.23569 3.72706 7.9801 3.23077 8.86868C1.1159 12.5409 2.69095 17.9811 4.75194 20.9608C5.76048 22.4175 6.96267 24.0582 8.54126 23.9984C10.0625 23.9386 10.6366 23.0159 12.4733 23.0159C14.3105 23.0159 14.8273 23.9984 16.4343 23.9688C18.0698 23.9386 19.1079 22.482 20.1082 21.0199C20.8242 19.9685 21.3837 18.8187 21.7692 17.6065C20.8169 17.1998 20.0045 16.5233 19.4321 15.6604C18.8597 14.7975 18.5524 13.7859 18.548 12.7505ZM15.5278 3.83196C16.4336 2.76959 16.8824 1.39205 16.7762 0C15.4087 0.132651 14.1437 0.783462 13.2408 1.81897C12.7902 2.32062 12.4453 2.90785 12.2266 3.54565C12.0078 4.18345 11.9197 4.85876 11.9676 5.53133C12.6517 5.54078 13.3288 5.39237 13.9463 5.09765C14.5637 4.80292 15.1049 4.36981 15.5278 3.83196Z" fill="black"/>
|
|
3
3
|
</svg>
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"logo-dark.svg"
|
|
12
12
|
],
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@logto/connector-kit": "1.0.0-rc.
|
|
14
|
+
"@logto/connector-kit": "1.0.0-rc.2",
|
|
15
15
|
"@silverhand/essentials": "2.1.0",
|
|
16
16
|
"got": "^12.5.3",
|
|
17
17
|
"snakecase-keys": "^5.1.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"access": "public"
|
|
54
54
|
},
|
|
55
55
|
"name": "@logto/connector-apple",
|
|
56
|
-
"version": "1.0.0-beta.
|
|
56
|
+
"version": "1.0.0-beta.20",
|
|
57
57
|
"description": "Apple web connector implementation.",
|
|
58
58
|
"scripts": {
|
|
59
59
|
"package:sync": "cd ../../ && pnpm package:sync",
|