@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 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
- configTemplate: './docs/config-template.json',
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="M16.9107 12.5628C16.9186 11.874 17.1013 11.1984 17.4415 10.5994C17.7817 10.0004 18.2684 9.49755 18.8559 9.13791C18.4824 8.60614 17.9908 8.16818 17.4196 7.85839C16.8484 7.54861 16.2131 7.37543 15.5637 7.35246C14.1618 7.21035 12.8283 8.1777 12.118 8.1777C11.4072 8.1777 10.3099 7.37333 9.14719 7.39552C8.38414 7.41674 7.6397 7.63582 6.98679 8.03129C6.33389 8.42677 5.79492 8.98507 5.4227 9.65151C3.83654 12.4057 5.01783 16.4858 6.56357 18.7206C7.31998 19.8131 8.22163 21.0436 9.40557 20.9988C10.5465 20.954 10.9771 20.2619 12.3546 20.2619C13.7325 20.2619 14.1201 20.9988 15.3253 20.9766C16.552 20.9539 17.3305 19.8615 18.0808 18.7649C18.6178 17.9764 19.0374 17.114 19.3265 16.2049C18.6123 15.8998 18.003 15.3925 17.5737 14.7453C17.1444 14.0981 16.9139 13.3394 16.9107 12.5628ZM14.6455 5.87397C15.3249 5.0772 15.6614 4.04404 15.5818 3C14.5561 3.09949 13.6074 3.5876 12.9302 4.36423C12.5923 4.74047 12.3336 5.18089 12.1696 5.65924C12.0055 6.13759 11.9394 6.64407 11.9753 7.1485C12.4884 7.15558 12.9962 7.04428 13.4593 6.82323C13.9224 6.60219 14.3283 6.27736 14.6455 5.87397Z" fill="white"/>
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="M16.9107 12.5628C16.9186 11.874 17.1013 11.1984 17.4415 10.5994C17.7817 10.0004 18.2684 9.49755 18.8559 9.13791C18.4824 8.60614 17.9908 8.16818 17.4196 7.85839C16.8484 7.54861 16.2131 7.37543 15.5637 7.35246C14.1618 7.21035 12.8283 8.1777 12.118 8.1777C11.4072 8.1777 10.3099 7.37333 9.14719 7.39552C8.38414 7.41674 7.6397 7.63582 6.98679 8.03129C6.33389 8.42677 5.79492 8.98507 5.4227 9.65151C3.83654 12.4057 5.01783 16.4858 6.56357 18.7206C7.31998 19.8131 8.22163 21.0436 9.40557 20.9988C10.5465 20.954 10.9771 20.2619 12.3546 20.2619C13.7325 20.2619 14.1201 20.9988 15.3253 20.9766C16.552 20.9539 17.3305 19.8615 18.0808 18.7649C18.6178 17.9764 19.0374 17.114 19.3265 16.2049C18.6123 15.8998 18.003 15.3925 17.5737 14.7453C17.1444 14.0981 16.9139 13.3394 16.9107 12.5628ZM14.6455 5.87397C15.3249 5.0772 15.6614 4.04404 15.5818 3C14.5561 3.09949 13.6074 3.5876 12.9302 4.36423C12.5923 4.74047 12.3336 5.18089 12.1696 5.65924C12.0055 6.13759 11.9394 6.64407 11.9753 7.1485C12.4884 7.15558 12.9962 7.04428 13.4593 6.82323C13.9224 6.60219 14.3283 6.27736 14.6455 5.87397Z" fill="black"/>
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.0",
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.18",
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",
@@ -1,3 +0,0 @@
1
- {
2
- "clientId": "<client-id>"
3
- }