@atproto/pds 0.5.0 → 0.5.2
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/CHANGELOG.md +27 -0
- package/dist/account-manager/account-manager.d.ts +35 -4
- package/dist/account-manager/account-manager.d.ts.map +1 -1
- package/dist/account-manager/account-manager.js +67 -6
- package/dist/account-manager/account-manager.js.map +1 -1
- package/dist/account-manager/helpers/account.d.ts +1 -1
- package/dist/account-manager/helpers/account.d.ts.map +1 -1
- package/dist/account-manager/helpers/account.js +10 -4
- package/dist/account-manager/helpers/account.js.map +1 -1
- package/dist/account-manager/oauth-store.d.ts +2 -1
- package/dist/account-manager/oauth-store.d.ts.map +1 -1
- package/dist/account-manager/oauth-store.js +61 -12
- package/dist/account-manager/oauth-store.js.map +1 -1
- package/dist/actor-store/record/reader.d.ts +1 -1
- package/dist/actor-store/record/reader.d.ts.map +1 -1
- package/dist/actor-store/record/reader.js.map +1 -1
- package/dist/api/app/bsky/actor/getPreferences.d.ts.map +1 -1
- package/dist/api/app/bsky/actor/getPreferences.js +7 -2
- package/dist/api/app/bsky/actor/getPreferences.js.map +1 -1
- package/dist/api/app/bsky/actor/putPreferences.d.ts.map +1 -1
- package/dist/api/app/bsky/actor/putPreferences.js +7 -2
- package/dist/api/app/bsky/actor/putPreferences.js.map +1 -1
- package/dist/api/com/atproto/admin/updateAccountHandle.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/updateAccountHandle.js +33 -43
- package/dist/api/com/atproto/admin/updateAccountHandle.js.map +1 -1
- package/dist/api/com/atproto/identity/updateHandle.d.ts.map +1 -1
- package/dist/api/com/atproto/identity/updateHandle.js +39 -61
- package/dist/api/com/atproto/identity/updateHandle.js.map +1 -1
- package/dist/api/com/atproto/repo/getRecord.js +3 -3
- package/dist/api/com/atproto/repo/getRecord.js.map +1 -1
- package/dist/api/com/atproto/repo/putRecord.js +2 -2
- package/dist/api/com/atproto/repo/putRecord.js.map +1 -1
- package/dist/api/com/atproto/server/getServiceAuth.d.ts.map +1 -1
- package/dist/api/com/atproto/server/getServiceAuth.js +4 -0
- package/dist/api/com/atproto/server/getServiceAuth.js.map +1 -1
- package/dist/config/config.d.ts +5 -2
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +50 -46
- package/dist/config/config.js.map +1 -1
- package/dist/config/env.d.ts +1 -0
- package/dist/config/env.d.ts.map +1 -1
- package/dist/config/env.js +1 -0
- package/dist/config/env.js.map +1 -1
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +3 -3
- package/dist/context.js.map +1 -1
- package/dist/lexicons/app/bsky/actor/defs.defs.d.ts +8 -0
- package/dist/lexicons/app/bsky/actor/defs.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/actor/defs.defs.js +3 -0
- package/dist/lexicons/app/bsky/actor/defs.defs.js.map +1 -1
- package/dist/lexicons/app/bsky/actor/profile.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/actor/status.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/draft/defs.defs.d.ts +22 -0
- package/dist/lexicons/app/bsky/draft/defs.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/draft/defs.defs.js +11 -0
- package/dist/lexicons/app/bsky/draft/defs.defs.js.map +1 -1
- package/dist/lexicons/app/bsky/embed/gallery.d.ts +3 -0
- package/dist/lexicons/app/bsky/embed/gallery.d.ts.map +1 -0
- package/dist/lexicons/app/bsky/embed/gallery.defs.d.ts +130 -0
- package/dist/lexicons/app/bsky/embed/gallery.defs.d.ts.map +1 -0
- package/dist/lexicons/app/bsky/embed/gallery.defs.js +47 -0
- package/dist/lexicons/app/bsky/embed/gallery.defs.js.map +1 -0
- package/dist/lexicons/app/bsky/embed/gallery.js +6 -0
- package/dist/lexicons/app/bsky/embed/gallery.js.map +1 -0
- package/dist/lexicons/app/bsky/embed/record.defs.d.ts +2 -1
- package/dist/lexicons/app/bsky/embed/record.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/embed/record.defs.js +2 -0
- package/dist/lexicons/app/bsky/embed/record.defs.js.map +1 -1
- package/dist/lexicons/app/bsky/embed/recordWithMedia.defs.d.ts +13 -12
- package/dist/lexicons/app/bsky/embed/recordWithMedia.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/embed/recordWithMedia.defs.js +3 -0
- package/dist/lexicons/app/bsky/embed/recordWithMedia.defs.js.map +1 -1
- package/dist/lexicons/app/bsky/embed.d.ts +1 -0
- package/dist/lexicons/app/bsky/embed.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/embed.js +1 -0
- package/dist/lexicons/app/bsky/embed.js.map +1 -1
- package/dist/lexicons/app/bsky/feed/defs.defs.d.ts +2 -1
- package/dist/lexicons/app/bsky/feed/defs.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/feed/defs.defs.js +2 -0
- package/dist/lexicons/app/bsky/feed/defs.defs.js.map +1 -1
- package/dist/lexicons/app/bsky/feed/generator.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/feed/like.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/feed/post.defs.d.ts +12 -11
- package/dist/lexicons/app/bsky/feed/post.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/feed/post.defs.js +2 -0
- package/dist/lexicons/app/bsky/feed/post.defs.js.map +1 -1
- package/dist/lexicons/app/bsky/feed/postgate.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/feed/repost.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/feed/threadgate.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/block.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/follow.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/list.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/listblock.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/listitem.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/starterpack.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/verification.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/labeler/service.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/notification/declaration.defs.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky/actor/declaration.defs.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky/actor/getStatus.defs.d.ts +2 -0
- package/dist/lexicons/chat/bsky/actor/getStatus.defs.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky/actor/getStatus.defs.js +1 -0
- package/dist/lexicons/chat/bsky/actor/getStatus.defs.js.map +1 -1
- package/dist/lexicons/chat/bsky/authFullChatClient.defs.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky/authFullChatClient.defs.js +1 -0
- package/dist/lexicons/chat/bsky/authFullChatClient.defs.js.map +1 -1
- package/dist/lexicons/chat/bsky/convo/defs.defs.d.ts +53 -14
- package/dist/lexicons/chat/bsky/convo/defs.defs.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky/convo/defs.defs.js +33 -5
- package/dist/lexicons/chat/bsky/convo/defs.defs.js.map +1 -1
- package/dist/lexicons/chat/bsky/convo/getConvoForMembers.defs.d.ts +1 -1
- package/dist/lexicons/chat/bsky/convo/getConvoForMembers.defs.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky/convo/getConvoForMembers.defs.js +1 -0
- package/dist/lexicons/chat/bsky/convo/getConvoForMembers.defs.js.map +1 -1
- package/dist/lexicons/chat/bsky/convo/getLog.defs.d.ts +2 -2
- package/dist/lexicons/chat/bsky/convo/getLog.defs.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky/convo/getLog.defs.js +3 -0
- package/dist/lexicons/chat/bsky/convo/getLog.defs.js.map +1 -1
- package/dist/lexicons/chat/bsky/embed/joinLink.d.ts +3 -0
- package/dist/lexicons/chat/bsky/embed/joinLink.d.ts.map +1 -0
- package/dist/lexicons/chat/bsky/embed/joinLink.defs.d.ts +99 -0
- package/dist/lexicons/chat/bsky/embed/joinLink.defs.d.ts.map +1 -0
- package/dist/lexicons/chat/bsky/embed/joinLink.defs.js +28 -0
- package/dist/lexicons/chat/bsky/embed/joinLink.defs.js.map +1 -0
- package/dist/lexicons/chat/bsky/embed/joinLink.js +6 -0
- package/dist/lexicons/chat/bsky/embed/joinLink.js.map +1 -0
- package/dist/lexicons/chat/bsky/embed.d.ts +2 -0
- package/dist/lexicons/chat/bsky/embed.d.ts.map +1 -0
- package/dist/lexicons/chat/bsky/embed.js +5 -0
- package/dist/lexicons/chat/bsky/embed.js.map +1 -0
- package/dist/lexicons/chat/bsky/group/addMembers.defs.d.ts +1 -1
- package/dist/lexicons/chat/bsky/group/addMembers.defs.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky/group/addMembers.defs.js +1 -0
- package/dist/lexicons/chat/bsky/group/addMembers.defs.js.map +1 -1
- package/dist/lexicons/chat/bsky/group/createGroup.defs.d.ts +1 -1
- package/dist/lexicons/chat/bsky/group/createGroup.defs.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky/group/createGroup.defs.js +1 -0
- package/dist/lexicons/chat/bsky/group/createGroup.defs.js.map +1 -1
- package/dist/lexicons/chat/bsky/group/getJoinLinkPreviews.defs.d.ts +1 -1
- package/dist/lexicons/chat/bsky/group/getJoinLinkPreviews.defs.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky/group/getJoinLinkPreviews.defs.js +1 -1
- package/dist/lexicons/chat/bsky/group/getJoinLinkPreviews.defs.js.map +1 -1
- package/dist/lexicons/chat/bsky/group/updateJoinRequestsRead.d.ts +3 -0
- package/dist/lexicons/chat/bsky/group/updateJoinRequestsRead.d.ts.map +1 -0
- package/dist/lexicons/chat/bsky/group/updateJoinRequestsRead.defs.d.ts +20 -0
- package/dist/lexicons/chat/bsky/group/updateJoinRequestsRead.defs.d.ts.map +1 -0
- package/dist/lexicons/chat/bsky/group/updateJoinRequestsRead.defs.js +19 -0
- package/dist/lexicons/chat/bsky/group/updateJoinRequestsRead.defs.js.map +1 -0
- package/dist/lexicons/chat/bsky/group/updateJoinRequestsRead.js +6 -0
- package/dist/lexicons/chat/bsky/group/updateJoinRequestsRead.js.map +1 -0
- package/dist/lexicons/chat/bsky/group/withdrawJoinRequest.d.ts +3 -0
- package/dist/lexicons/chat/bsky/group/withdrawJoinRequest.d.ts.map +1 -0
- package/dist/lexicons/chat/bsky/group/withdrawJoinRequest.defs.d.ts +20 -0
- package/dist/lexicons/chat/bsky/group/withdrawJoinRequest.defs.d.ts.map +1 -0
- package/dist/lexicons/chat/bsky/group/withdrawJoinRequest.defs.js +18 -0
- package/dist/lexicons/chat/bsky/group/withdrawJoinRequest.defs.js.map +1 -0
- package/dist/lexicons/chat/bsky/group/withdrawJoinRequest.js +6 -0
- package/dist/lexicons/chat/bsky/group/withdrawJoinRequest.js.map +1 -0
- package/dist/lexicons/chat/bsky/group.d.ts +2 -0
- package/dist/lexicons/chat/bsky/group.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky/group.js +2 -0
- package/dist/lexicons/chat/bsky/group.js.map +1 -1
- package/dist/lexicons/chat/bsky/moderation/defs.d.ts +2 -0
- package/dist/lexicons/chat/bsky/moderation/defs.d.ts.map +1 -0
- package/dist/lexicons/chat/bsky/moderation/defs.defs.d.ts +58 -0
- package/dist/lexicons/chat/bsky/moderation/defs.defs.d.ts.map +1 -0
- package/dist/lexicons/chat/bsky/moderation/defs.defs.js +38 -0
- package/dist/lexicons/chat/bsky/moderation/defs.defs.js.map +1 -0
- package/dist/lexicons/chat/bsky/moderation/defs.js +5 -0
- package/dist/lexicons/chat/bsky/moderation/defs.js.map +1 -0
- package/dist/lexicons/chat/bsky/moderation/getConvo.d.ts +3 -0
- package/dist/lexicons/chat/bsky/moderation/getConvo.d.ts.map +1 -0
- package/dist/lexicons/chat/bsky/moderation/getConvo.defs.d.ts +22 -0
- package/dist/lexicons/chat/bsky/moderation/getConvo.defs.d.ts.map +1 -0
- package/dist/lexicons/chat/bsky/moderation/getConvo.defs.js +18 -0
- package/dist/lexicons/chat/bsky/moderation/getConvo.defs.js.map +1 -0
- package/dist/lexicons/chat/bsky/moderation/getConvo.js +6 -0
- package/dist/lexicons/chat/bsky/moderation/getConvo.js.map +1 -0
- package/dist/lexicons/chat/bsky/moderation/getConvoMembers.d.ts +3 -0
- package/dist/lexicons/chat/bsky/moderation/getConvoMembers.d.ts.map +1 -0
- package/dist/lexicons/chat/bsky/moderation/getConvoMembers.defs.d.ts +28 -0
- package/dist/lexicons/chat/bsky/moderation/getConvoMembers.defs.d.ts.map +1 -0
- package/dist/lexicons/chat/bsky/moderation/getConvoMembers.defs.js +24 -0
- package/dist/lexicons/chat/bsky/moderation/getConvoMembers.defs.js.map +1 -0
- package/dist/lexicons/chat/bsky/moderation/getConvoMembers.js +6 -0
- package/dist/lexicons/chat/bsky/moderation/getConvoMembers.js.map +1 -0
- package/dist/lexicons/chat/bsky/moderation/getConvos.d.ts +3 -0
- package/dist/lexicons/chat/bsky/moderation/getConvos.d.ts.map +1 -0
- package/dist/lexicons/chat/bsky/moderation/getConvos.defs.d.ts +22 -0
- package/dist/lexicons/chat/bsky/moderation/getConvos.defs.d.ts.map +1 -0
- package/dist/lexicons/chat/bsky/moderation/getConvos.defs.js +22 -0
- package/dist/lexicons/chat/bsky/moderation/getConvos.defs.js.map +1 -0
- package/dist/lexicons/chat/bsky/moderation/getConvos.js +6 -0
- package/dist/lexicons/chat/bsky/moderation/getConvos.js.map +1 -0
- package/dist/lexicons/chat/bsky/moderation/subscribeModEvents.defs.d.ts +20 -2
- package/dist/lexicons/chat/bsky/moderation/subscribeModEvents.defs.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky/moderation/subscribeModEvents.defs.js +11 -0
- package/dist/lexicons/chat/bsky/moderation/subscribeModEvents.defs.js.map +1 -1
- package/dist/lexicons/chat/bsky/moderation.d.ts +4 -0
- package/dist/lexicons/chat/bsky/moderation.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky/moderation.js +4 -0
- package/dist/lexicons/chat/bsky/moderation.js.map +1 -1
- package/dist/lexicons/chat/bsky.d.ts +1 -0
- package/dist/lexicons/chat/bsky.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky.js +1 -0
- package/dist/lexicons/chat/bsky.js.map +1 -1
- package/dist/lexicons/com/atproto/lexicon/schema.defs.d.ts.map +1 -1
- package/dist/lexicons/com/atproto/server/getServiceAuth.defs.d.ts +2 -2
- package/dist/lexicons/com/atproto/server/getServiceAuth.defs.js +1 -1
- package/dist/lexicons/com/atproto/server/getServiceAuth.defs.js.map +1 -1
- package/dist/lexicons/com/germnetwork/declaration.defs.d.ts.map +1 -1
- package/dist/lexicons/site/standard/document.defs.d.ts.map +1 -1
- package/dist/lexicons/site/standard/graph/recommend.defs.d.ts.map +1 -1
- package/dist/lexicons/site/standard/graph/subscription.defs.d.ts.map +1 -1
- package/dist/lexicons/site/standard/publication.defs.d.ts.map +1 -1
- package/dist/lexicons/site/standard/theme/basic.defs.d.ts.map +1 -1
- package/dist/lexicons/tools/ozone/moderation/defs.defs.d.ts +11 -3
- package/dist/lexicons/tools/ozone/moderation/defs.defs.d.ts.map +1 -1
- package/dist/lexicons/tools/ozone/moderation/defs.defs.js +9 -0
- package/dist/lexicons/tools/ozone/moderation/defs.defs.js.map +1 -1
- package/dist/lexicons/tools/ozone/moderation/queryEvents.defs.d.ts +2 -2
- package/dist/lexicons/tools/ozone/moderation/queryEvents.defs.d.ts.map +1 -1
- package/dist/lexicons/tools/ozone/moderation/queryEvents.defs.js.map +1 -1
- package/dist/lexicons/tools/ozone/moderation/queryStatuses.defs.d.ts +2 -2
- package/dist/lexicons/tools/ozone/moderation/queryStatuses.defs.d.ts.map +1 -1
- package/dist/lexicons/tools/ozone/moderation/queryStatuses.defs.js.map +1 -1
- package/dist/mailer/index.d.ts +3 -3
- package/dist/mailer/index.d.ts.map +1 -1
- package/dist/mailer/index.js +18 -9
- package/dist/mailer/index.js.map +1 -1
- package/dist/mailer/templates/confirm-email.js +11 -3
- package/dist/mailer/templates/confirm-email.js.map +2 -2
- package/dist/mailer/templates/delete-account.js +2 -2
- package/dist/mailer/templates/delete-account.js.map +2 -2
- package/dist/mailer/templates/plc-operation.js +2 -2
- package/dist/mailer/templates/plc-operation.js.map +2 -2
- package/dist/mailer/templates/reset-password.js +2 -2
- package/dist/mailer/templates/reset-password.js.map +2 -2
- package/dist/mailer/templates/update-email.js +2 -2
- package/dist/mailer/templates/update-email.js.map +2 -2
- package/dist/mailer/templates.d.ts +11 -0
- package/dist/mailer/templates.d.ts.map +1 -1
- package/dist/mailer/templates.js.map +1 -1
- package/dist/pipethrough.d.ts +3 -0
- package/dist/pipethrough.d.ts.map +1 -1
- package/dist/pipethrough.js +25 -9
- package/dist/pipethrough.js.map +1 -1
- package/dist/read-after-write/viewer.d.ts +2 -2
- package/package.json +7 -6
- package/src/account-manager/account-manager.ts +105 -7
- package/src/account-manager/helpers/account.ts +15 -7
- package/src/account-manager/oauth-store.ts +76 -18
- package/src/actor-store/record/reader.ts +1 -1
- package/src/api/app/bsky/actor/getPreferences.ts +11 -2
- package/src/api/app/bsky/actor/putPreferences.ts +11 -2
- package/src/api/com/atproto/admin/updateAccountHandle.ts +37 -46
- package/src/api/com/atproto/identity/updateHandle.ts +45 -76
- package/src/api/com/atproto/repo/getRecord.ts +3 -3
- package/src/api/com/atproto/repo/putRecord.ts +2 -2
- package/src/api/com/atproto/server/getServiceAuth.ts +7 -0
- package/src/config/config.ts +69 -57
- package/src/config/env.ts +3 -0
- package/src/context.ts +13 -10
- package/src/mailer/index.ts +25 -9
- package/src/mailer/templates/confirm-email.hbs +18 -17
- package/src/mailer/templates/delete-account.hbs +6 -6
- package/src/mailer/templates/plc-operation.hbs +6 -6
- package/src/mailer/templates/reset-password.hbs +7 -7
- package/src/mailer/templates/update-email.hbs +6 -6
- package/src/mailer/templates.ts +12 -0
- package/src/pipethrough.ts +33 -12
- package/tests/_puppeteer.ts +8 -2
- package/tests/account-manager.test.ts +123 -50
- package/tests/app-passwords.test.ts +5 -5
- package/tests/get-service-auth.test.ts +81 -0
- package/tests/oauth.test.ts +5 -5
- package/tests/proxied/proxy-header.test.ts +1 -0
- package/tests/proxied/proxy-oauth-aud.test.ts +175 -0
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -4,14 +4,12 @@
|
|
|
4
4
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
|
5
5
|
<meta name="x-apple-disable-message-reformatting" />
|
|
6
6
|
<title>Confirm your email</title>
|
|
7
|
-
<meta
|
|
8
|
-
name="description"
|
|
9
|
-
content="To confirm your email, enter the code provided in the app."
|
|
10
|
-
/>
|
|
7
|
+
<meta name="description" content="{{token}} is your verification code." />
|
|
11
8
|
</head>
|
|
12
9
|
<div
|
|
13
10
|
style="display:none;overflow:hidden;line-height:1px;opacity:0;max-height:0;max-width:0"
|
|
14
|
-
>
|
|
11
|
+
>{{token}}
|
|
12
|
+
is your verification code.<div
|
|
15
13
|
> </div>
|
|
16
14
|
</div>
|
|
17
15
|
|
|
@@ -42,8 +40,8 @@
|
|
|
42
40
|
<tbody>
|
|
43
41
|
<tr>
|
|
44
42
|
<td><img
|
|
45
|
-
alt="
|
|
46
|
-
src="
|
|
43
|
+
alt="{{config.serviceName}}"
|
|
44
|
+
src="{{config.logoUrl}}"
|
|
47
45
|
style="display:block;outline:none;border:none;text-decoration:none;width:110px;margin:0 auto"
|
|
48
46
|
/></td>
|
|
49
47
|
</tr>
|
|
@@ -67,12 +65,15 @@
|
|
|
67
65
|
<p
|
|
68
66
|
style="font-size:16px;line-height:1.4;margin:0px 0px;letter-spacing:0.25px;color:hsl(211, 24%, 34.2%);font-family:-apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;padding-top:12px;padding-bottom:12px;padding-right:32px"
|
|
69
67
|
>To confirm this email for your account, please enter the
|
|
70
|
-
code below in the app
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
code below in the app{{#if
|
|
69
|
+
config.showBskyAppEmailConfirmationLink
|
|
70
|
+
}}
|
|
71
|
+
or<!-- -->
|
|
72
|
+
<a
|
|
73
|
+
href="https://bsky.app/intent/verify-email?code={{token}}"
|
|
74
|
+
style="color:{{config.primaryColor}};text-decoration:none;text-decoration-line:underline;font-size:16px;letter-spacing:0.25px"
|
|
75
|
+
target="_blank"
|
|
76
|
+
>click here</a>{{/if}}.</p><code
|
|
76
77
|
style="display:block;padding:16px;border-radius:8px;border-width:1px;border-style:solid;background-color:hsl(211, 20%, 95.3%);border-color:hsl(211, 20%, 85.89999999999999%);font-size:14px;letter-spacing:0.25px;font-family:monospace;text-transform:uppercase"
|
|
77
78
|
>{{token}}</code>
|
|
78
79
|
<p
|
|
@@ -109,17 +110,17 @@
|
|
|
109
110
|
<p
|
|
110
111
|
style="font-size:14px;line-height:1.4;margin:0px 0px;color:hsl(211, 20%, 53%);font-family:-apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;letter-spacing:0.25px"
|
|
111
112
|
><a
|
|
112
|
-
href="
|
|
113
|
+
href="{{config.homeUrl}}"
|
|
113
114
|
style="color:hsl(211, 20%, 53%);text-decoration:none;text-decoration-line:underline;font-family:-apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;margin:0px 0px;line-height:1.0;font-size:14px;letter-spacing:0.25px"
|
|
114
115
|
target="_blank"
|
|
115
|
-
>
|
|
116
|
+
>{{config.serviceName}}</a></p>
|
|
116
117
|
</td>
|
|
117
118
|
<td
|
|
118
119
|
data-id="__react-email-column"
|
|
119
120
|
style="width:24px"
|
|
120
121
|
><img
|
|
121
|
-
alt="
|
|
122
|
-
src="
|
|
122
|
+
alt="{{config.serviceName}}"
|
|
123
|
+
src="{{config.markUrl}}"
|
|
123
124
|
style="display:block;outline:none;border:none;text-decoration:none;width:24px"
|
|
124
125
|
/></td>
|
|
125
126
|
</tr>
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
<tbody>
|
|
44
44
|
<tr>
|
|
45
45
|
<td><img
|
|
46
|
-
alt="
|
|
47
|
-
src="
|
|
46
|
+
alt="{{config.serviceName}}"
|
|
47
|
+
src="{{config.logoUrl}}"
|
|
48
48
|
style="display:block;outline:none;border:none;text-decoration:none;width:110px;margin:0 auto"
|
|
49
49
|
/></td>
|
|
50
50
|
</tr>
|
|
@@ -108,17 +108,17 @@
|
|
|
108
108
|
<p
|
|
109
109
|
style="font-size:14px;line-height:1.4;margin:0px 0px;color:hsl(211, 20%, 53%);font-family:-apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;letter-spacing:0.25px"
|
|
110
110
|
><a
|
|
111
|
-
href="
|
|
111
|
+
href="{{config.homeUrl}}"
|
|
112
112
|
style="color:hsl(211, 20%, 53%);text-decoration:none;text-decoration-line:underline;font-family:-apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;margin:0px 0px;line-height:1.0;font-size:14px;letter-spacing:0.25px"
|
|
113
113
|
target="_blank"
|
|
114
|
-
>
|
|
114
|
+
>{{config.serviceName}}</a></p>
|
|
115
115
|
</td>
|
|
116
116
|
<td
|
|
117
117
|
data-id="__react-email-column"
|
|
118
118
|
style="width:24px"
|
|
119
119
|
><img
|
|
120
|
-
alt="
|
|
121
|
-
src="
|
|
120
|
+
alt="{{config.serviceName}}"
|
|
121
|
+
src="{{config.markUrl}}"
|
|
122
122
|
style="display:block;outline:none;border:none;text-decoration:none;width:24px"
|
|
123
123
|
/></td>
|
|
124
124
|
</tr>
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
<tbody>
|
|
43
43
|
<tr>
|
|
44
44
|
<td><img
|
|
45
|
-
alt="
|
|
46
|
-
src="
|
|
45
|
+
alt="{{config.serviceName}}"
|
|
46
|
+
src="{{config.logoUrl}}"
|
|
47
47
|
style="display:block;outline:none;border:none;text-decoration:none;width:110px;margin:0 auto"
|
|
48
48
|
/></td>
|
|
49
49
|
</tr>
|
|
@@ -105,17 +105,17 @@
|
|
|
105
105
|
<p
|
|
106
106
|
style="font-size:14px;line-height:1.4;margin:0px 0px;color:hsl(211, 20%, 53%);font-family:-apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;letter-spacing:0.25px"
|
|
107
107
|
><a
|
|
108
|
-
href="
|
|
108
|
+
href="{{config.homeUrl}}"
|
|
109
109
|
style="color:hsl(211, 20%, 53%);text-decoration:none;text-decoration-line:underline;font-family:-apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;margin:0px 0px;line-height:1.0;font-size:14px;letter-spacing:0.25px"
|
|
110
110
|
target="_blank"
|
|
111
|
-
>
|
|
111
|
+
>{{config.serviceName}}</a></p>
|
|
112
112
|
</td>
|
|
113
113
|
<td
|
|
114
114
|
data-id="__react-email-column"
|
|
115
115
|
style="width:24px"
|
|
116
116
|
><img
|
|
117
|
-
alt="
|
|
118
|
-
src="
|
|
117
|
+
alt="{{config.serviceName}}"
|
|
118
|
+
src="{{config.markUrl}}"
|
|
119
119
|
style="display:block;outline:none;border:none;text-decoration:none;width:24px"
|
|
120
120
|
/></td>
|
|
121
121
|
</tr>
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
<tbody>
|
|
43
43
|
<tr>
|
|
44
44
|
<td><img
|
|
45
|
-
alt="
|
|
46
|
-
src="
|
|
45
|
+
alt="{{config.serviceName}}"
|
|
46
|
+
src="{{config.logoUrl}}"
|
|
47
47
|
style="display:block;outline:none;border:none;text-decoration:none;width:110px;margin:0 auto"
|
|
48
48
|
/></td>
|
|
49
49
|
</tr>
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
style="font-size:16px;line-height:1.4;margin:0px 0px;letter-spacing:0.25px;color:hsl(211, 24%, 34.2%);font-family:-apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;padding-top:12px;padding-bottom:12px"
|
|
69
69
|
>We received a request to reset the password for the account<!-- -->
|
|
70
70
|
<span
|
|
71
|
-
style="color:
|
|
71
|
+
style="color:{{config.primaryColor}}"
|
|
72
72
|
>@<!-- -->{{handle}}<!-- -->.</span></p><code
|
|
73
73
|
style="display:block;padding:16px;border-radius:8px;border-width:1px;border-style:solid;background-color:hsl(211, 20%, 95.3%);border-color:hsl(211, 20%, 85.89999999999999%);font-size:14px;letter-spacing:0.25px;font-family:monospace;text-transform:uppercase"
|
|
74
74
|
>{{token}}</code>
|
|
@@ -106,17 +106,17 @@
|
|
|
106
106
|
<p
|
|
107
107
|
style="font-size:14px;line-height:1.4;margin:0px 0px;color:hsl(211, 20%, 53%);font-family:-apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;letter-spacing:0.25px"
|
|
108
108
|
><a
|
|
109
|
-
href="
|
|
109
|
+
href="{{config.homeUrl}}"
|
|
110
110
|
style="color:hsl(211, 20%, 53%);text-decoration:none;text-decoration-line:underline;font-family:-apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;margin:0px 0px;line-height:1.0;font-size:14px;letter-spacing:0.25px"
|
|
111
111
|
target="_blank"
|
|
112
|
-
>
|
|
112
|
+
>{{config.serviceName}}</a></p>
|
|
113
113
|
</td>
|
|
114
114
|
<td
|
|
115
115
|
data-id="__react-email-column"
|
|
116
116
|
style="width:24px"
|
|
117
117
|
><img
|
|
118
|
-
alt="
|
|
119
|
-
src="
|
|
118
|
+
alt="{{config.serviceName}}"
|
|
119
|
+
src="{{config.markUrl}}"
|
|
120
120
|
style="display:block;outline:none;border:none;text-decoration:none;width:24px"
|
|
121
121
|
/></td>
|
|
122
122
|
</tr>
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
<tbody>
|
|
44
44
|
<tr>
|
|
45
45
|
<td><img
|
|
46
|
-
alt="
|
|
47
|
-
src="
|
|
46
|
+
alt="{{config.serviceName}}"
|
|
47
|
+
src="{{config.logoUrl}}"
|
|
48
48
|
style="display:block;outline:none;border:none;text-decoration:none;width:110px;margin:0 auto"
|
|
49
49
|
/></td>
|
|
50
50
|
</tr>
|
|
@@ -105,17 +105,17 @@
|
|
|
105
105
|
<p
|
|
106
106
|
style="font-size:14px;line-height:1.4;margin:0px 0px;color:hsl(211, 20%, 53%);font-family:-apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;letter-spacing:0.25px"
|
|
107
107
|
><a
|
|
108
|
-
href="
|
|
108
|
+
href="{{config.homeUrl}}"
|
|
109
109
|
style="color:hsl(211, 20%, 53%);text-decoration:none;text-decoration-line:underline;font-family:-apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;margin:0px 0px;line-height:1.0;font-size:14px;letter-spacing:0.25px"
|
|
110
110
|
target="_blank"
|
|
111
|
-
>
|
|
111
|
+
>{{config.serviceName}}</a></p>
|
|
112
112
|
</td>
|
|
113
113
|
<td
|
|
114
114
|
data-id="__react-email-column"
|
|
115
115
|
style="width:24px"
|
|
116
116
|
><img
|
|
117
|
-
alt="
|
|
118
|
-
src="
|
|
117
|
+
alt="{{config.serviceName}}"
|
|
118
|
+
src="{{config.markUrl}}"
|
|
119
119
|
style="display:block;outline:none;border:none;text-decoration:none;width:24px"
|
|
120
120
|
/></td>
|
|
121
121
|
</tr>
|
package/src/mailer/templates.ts
CHANGED
|
@@ -3,3 +3,15 @@ export { default as deleteAccount } from './templates/delete-account.js'
|
|
|
3
3
|
export { default as confirmEmail } from './templates/confirm-email.js'
|
|
4
4
|
export { default as updateEmail } from './templates/update-email.js'
|
|
5
5
|
export { default as plcOperation } from './templates/plc-operation.js'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Common config variable that will be injected into all templates.
|
|
9
|
+
*/
|
|
10
|
+
export type Config = {
|
|
11
|
+
serviceName: string
|
|
12
|
+
homeUrl: string
|
|
13
|
+
logoUrl: string
|
|
14
|
+
markUrl: string
|
|
15
|
+
primaryColor: string
|
|
16
|
+
showBskyAppEmailConfirmationLink: boolean
|
|
17
|
+
}
|
package/src/pipethrough.ts
CHANGED
|
@@ -56,9 +56,23 @@ export const proxyHandler = (ctx: AppContext): CatchallHandler => {
|
|
|
56
56
|
throw new InvalidRequestError('Bad token method', 'InvalidToken')
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
const {
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
const {
|
|
60
|
+
url: origin,
|
|
61
|
+
did,
|
|
62
|
+
serviceId,
|
|
63
|
+
} = await parseProxyInfo(ctx, req, lxm)
|
|
64
|
+
// Phase 1 of service auth updates: the scope check sees the combined
|
|
65
|
+
// did#serviceId form (so OAuth callers' rpc:?aud=did#service scopes
|
|
66
|
+
// match), while the outbound service-auth JWT keeps bare-DID aud
|
|
67
|
+
// regardless of session type.
|
|
68
|
+
const scopeAud = `${did}#${serviceId}`
|
|
69
|
+
const tokenAud = did
|
|
70
|
+
|
|
71
|
+
const authResult = await performAuth({
|
|
72
|
+
req,
|
|
73
|
+
res,
|
|
74
|
+
params: { lxm, aud: scopeAud },
|
|
75
|
+
})
|
|
62
76
|
|
|
63
77
|
const { credentials } = excludeErrorResult(authResult)
|
|
64
78
|
|
|
@@ -80,7 +94,7 @@ export const proxyHandler = (ctx: AppContext): CatchallHandler => {
|
|
|
80
94
|
'content-encoding': body && req.headers['content-encoding'],
|
|
81
95
|
'content-length': body && req.headers['content-length'],
|
|
82
96
|
|
|
83
|
-
authorization: `Bearer ${await ctx.serviceAuthJwt(credentials.did,
|
|
97
|
+
authorization: `Bearer ${await ctx.serviceAuthJwt(credentials.did, tokenAud, lxm)}`,
|
|
84
98
|
}
|
|
85
99
|
|
|
86
100
|
const dispatchOptions: Dispatcher.RequestOptions = {
|
|
@@ -216,18 +230,25 @@ export function computeProxyTo(
|
|
|
216
230
|
throw new InvalidRequestError(`No service configured for ${lxm}`)
|
|
217
231
|
}
|
|
218
232
|
|
|
233
|
+
// Bare-DID portion of `proxyTo`, suitable as a service-auth JWT audience
|
|
234
|
+
// (Phase 1 of service auth updates).
|
|
235
|
+
export function bareDidFromProxyTo(proxyTo: string): string {
|
|
236
|
+
const hashIndex = proxyTo.indexOf('#')
|
|
237
|
+
return hashIndex === -1 ? proxyTo : proxyTo.slice(0, hashIndex)
|
|
238
|
+
}
|
|
239
|
+
|
|
219
240
|
export async function parseProxyInfo(
|
|
220
241
|
ctx: AppContext,
|
|
221
242
|
req: Request,
|
|
222
243
|
lxm: string,
|
|
223
|
-
): Promise<{ url: string; did: string }> {
|
|
244
|
+
): Promise<{ url: string; did: string; serviceId: string }> {
|
|
224
245
|
// /!\ Hot path
|
|
225
246
|
|
|
226
247
|
const proxyToHeader = req.header('atproto-proxy')
|
|
227
248
|
if (proxyToHeader) return parseProxyHeader(ctx, proxyToHeader)
|
|
228
249
|
|
|
229
|
-
const { serviceInfo } = defaultService(ctx, lxm)
|
|
230
|
-
if (serviceInfo) return serviceInfo
|
|
250
|
+
const { serviceId, serviceInfo } = defaultService(ctx, lxm)
|
|
251
|
+
if (serviceInfo) return { ...serviceInfo, serviceId }
|
|
231
252
|
|
|
232
253
|
throw new InvalidRequestError(`No service configured for ${lxm}`)
|
|
233
254
|
}
|
|
@@ -236,7 +257,7 @@ export const parseProxyHeader = async (
|
|
|
236
257
|
// Using subset of AppContext for testing purposes
|
|
237
258
|
ctx: Pick<AppContext, 'cfg' | 'idResolver'>,
|
|
238
259
|
proxyTo: string,
|
|
239
|
-
): Promise<{ did: string; url: string }> => {
|
|
260
|
+
): Promise<{ did: string; url: string; serviceId: string }> => {
|
|
240
261
|
// /!\ Hot path
|
|
241
262
|
|
|
242
263
|
const hashIndex = proxyTo.indexOf('#')
|
|
@@ -260,13 +281,14 @@ export const parseProxyHeader = async (
|
|
|
260
281
|
}
|
|
261
282
|
|
|
262
283
|
const did = proxyTo.slice(0, hashIndex)
|
|
284
|
+
const serviceId = proxyTo.slice(hashIndex + 1)
|
|
263
285
|
|
|
264
286
|
// Special case a configured appview, while still proxying correctly any other appview
|
|
265
287
|
if (
|
|
266
288
|
ctx.cfg.bskyAppView &&
|
|
267
289
|
proxyTo === `${ctx.cfg.bskyAppView.did}#bsky_appview`
|
|
268
290
|
) {
|
|
269
|
-
return { did, url: ctx.cfg.bskyAppView.url }
|
|
291
|
+
return { did, url: ctx.cfg.bskyAppView.url, serviceId }
|
|
270
292
|
}
|
|
271
293
|
|
|
272
294
|
const didDoc = await ctx.idResolver.did.resolve(did)
|
|
@@ -274,13 +296,12 @@ export const parseProxyHeader = async (
|
|
|
274
296
|
throw new InvalidRequestError('could not resolve proxy did')
|
|
275
297
|
}
|
|
276
298
|
|
|
277
|
-
const
|
|
278
|
-
const url = getServiceEndpoint(didDoc, { id: serviceId })
|
|
299
|
+
const url = getServiceEndpoint(didDoc, { id: `#${serviceId}` })
|
|
279
300
|
if (!url) {
|
|
280
301
|
throw new InvalidRequestError('could not resolve proxy did service url')
|
|
281
302
|
}
|
|
282
303
|
|
|
283
|
-
return { did, url }
|
|
304
|
+
return { did, url, serviceId }
|
|
284
305
|
}
|
|
285
306
|
|
|
286
307
|
/**
|
package/tests/_puppeteer.ts
CHANGED
|
@@ -85,6 +85,8 @@ export class PageHelper implements AsyncDisposable {
|
|
|
85
85
|
async typeIn(selector: string, text: string) {
|
|
86
86
|
const elementHandle = await this.getVisibleElement(selector)
|
|
87
87
|
elementHandle.focus()
|
|
88
|
+
await elementHandle.click({ clickCount: 3 }) // Select all existing text
|
|
89
|
+
await elementHandle.press('Backspace') // Clear the input
|
|
88
90
|
await elementHandle.type(text)
|
|
89
91
|
return elementHandle
|
|
90
92
|
}
|
|
@@ -93,16 +95,20 @@ export class PageHelper implements AsyncDisposable {
|
|
|
93
95
|
return this.typeIn(`input[name=${JSON.stringify(name)}]`, text)
|
|
94
96
|
}
|
|
95
97
|
|
|
96
|
-
async ensureTextVisibility(text: string, tag = 'p') {
|
|
98
|
+
async ensureTextVisibility(text: string, tag = 'p', timeout = 5_000) {
|
|
97
99
|
await this.page.waitForSelector(
|
|
98
100
|
`${tag}::-p-text(${JSON.stringify(text)})`,
|
|
99
101
|
{
|
|
100
102
|
visible: true,
|
|
101
|
-
timeout
|
|
103
|
+
timeout,
|
|
102
104
|
},
|
|
103
105
|
)
|
|
104
106
|
}
|
|
105
107
|
|
|
108
|
+
async ensureNotification(text: string) {
|
|
109
|
+
return this.ensureTextVisibility(text, 'div')
|
|
110
|
+
}
|
|
111
|
+
|
|
106
112
|
protected async getVisibleElement(selector: string) {
|
|
107
113
|
const elementHandle = await this.page.waitForSelector(selector, {
|
|
108
114
|
visible: true,
|