@evanp/activitypub-bot 0.28.2 → 0.28.3

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.
@@ -11,7 +11,8 @@ router.get('/', async (req, res) => {
11
11
 
12
12
  router.get('/actor', async (req, res) => {
13
13
  const homepage = `${req.protocol}://${req.get('host')}/`
14
- const { formatter } = req.app.locals
14
+ const { formatter, keyStorage } = req.app.locals
15
+ const publicKeyPem = await keyStorage.getPublicKey(null)
15
16
  const server = await as2.import({
16
17
  '@context': [
17
18
  'https://www.w3.org/ns/activitystreams',
@@ -19,7 +20,14 @@ router.get('/actor', async (req, res) => {
19
20
  ],
20
21
  id: formatter.format({ server: true }),
21
22
  type: 'Service',
22
- publicKey: formatter.format({ server: true, type: 'publickey' }),
23
+ to: 'as:Public',
24
+ publicKey: {
25
+ publicKeyPem,
26
+ id: formatter.format({ server: true, type: 'publickey' }),
27
+ owner: formatter.format({ server: true }),
28
+ type: 'CryptographicKey',
29
+ to: 'as:Public'
30
+ },
23
31
  url: {
24
32
  type: 'Link',
25
33
  mediaType: 'text/html',
@@ -44,7 +52,7 @@ router.get('/publickey', async (req, res) => {
44
52
  id: formatter.format({ server: true, type: 'publickey' }),
45
53
  owner: formatter.format({ server: true }),
46
54
  type: 'CryptographicKey',
47
- to: 'https://www.w3.org/ns/activitystreams#Public'
55
+ to: 'as:Public'
48
56
  })
49
57
  res.status(200)
50
58
  res.type(as2.mediaType)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evanp/activitypub-bot",
3
- "version": "0.28.2",
3
+ "version": "0.28.3",
4
4
  "description": "server-side ActivityPub bot framework",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",