@evanp/activitypub-bot 0.38.3 → 0.38.4
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/lib/activitystreams.js +90 -0
- package/lib/app.js +2 -0
- package/package.json +1 -1
package/lib/activitystreams.js
CHANGED
|
@@ -89,6 +89,96 @@ as2.registerContext('https://w3id.org/security/v1', {
|
|
|
89
89
|
}
|
|
90
90
|
})
|
|
91
91
|
|
|
92
|
+
// This URL redirects to a dead domain (web-payments.org).
|
|
93
|
+
as2.registerContext('https://w3id.org/identity/v1', {
|
|
94
|
+
'@context': {
|
|
95
|
+
id: '@id',
|
|
96
|
+
type: '@type',
|
|
97
|
+
|
|
98
|
+
cred: 'https://w3id.org/credentials#',
|
|
99
|
+
dc: 'http://purl.org/dc/terms/',
|
|
100
|
+
identity: 'https://w3id.org/identity#',
|
|
101
|
+
perm: 'https://w3id.org/permissions#',
|
|
102
|
+
ps: 'https://w3id.org/payswarm#',
|
|
103
|
+
rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
|
|
104
|
+
rdfs: 'http://www.w3.org/2000/01/rdf-schema#',
|
|
105
|
+
sec: 'https://w3id.org/security#',
|
|
106
|
+
schema: 'http://schema.org/',
|
|
107
|
+
xsd: 'http://www.w3.org/2001/XMLSchema#',
|
|
108
|
+
|
|
109
|
+
Group: 'https://www.w3.org/ns/activitystreams#Group',
|
|
110
|
+
|
|
111
|
+
claim: { '@id': 'cred:claim', '@type': '@id' },
|
|
112
|
+
credential: { '@id': 'cred:credential', '@type': '@id' },
|
|
113
|
+
issued: { '@id': 'cred:issued', '@type': 'xsd:dateTime' },
|
|
114
|
+
issuer: { '@id': 'cred:issuer', '@type': '@id' },
|
|
115
|
+
recipient: { '@id': 'cred:recipient', '@type': '@id' },
|
|
116
|
+
Credential: 'cred:Credential',
|
|
117
|
+
CryptographicKeyCredential: 'cred:CryptographicKeyCredential',
|
|
118
|
+
|
|
119
|
+
about: { '@id': 'schema:about', '@type': '@id' },
|
|
120
|
+
address: { '@id': 'schema:address', '@type': '@id' },
|
|
121
|
+
addressCountry: 'schema:addressCountry',
|
|
122
|
+
addressLocality: 'schema:addressLocality',
|
|
123
|
+
addressRegion: 'schema:addressRegion',
|
|
124
|
+
comment: 'rdfs:comment',
|
|
125
|
+
created: { '@id': 'dc:created', '@type': 'xsd:dateTime' },
|
|
126
|
+
creator: { '@id': 'dc:creator', '@type': '@id' },
|
|
127
|
+
description: 'schema:description',
|
|
128
|
+
email: 'schema:email',
|
|
129
|
+
familyName: 'schema:familyName',
|
|
130
|
+
givenName: 'schema:givenName',
|
|
131
|
+
image: { '@id': 'schema:image', '@type': '@id' },
|
|
132
|
+
label: 'rdfs:label',
|
|
133
|
+
name: 'schema:name',
|
|
134
|
+
postalCode: 'schema:postalCode',
|
|
135
|
+
streetAddress: 'schema:streetAddress',
|
|
136
|
+
title: 'dc:title',
|
|
137
|
+
url: { '@id': 'schema:url', '@type': '@id' },
|
|
138
|
+
Person: 'schema:Person',
|
|
139
|
+
PostalAddress: 'schema:PostalAddress',
|
|
140
|
+
Organization: 'schema:Organization',
|
|
141
|
+
|
|
142
|
+
identityService: { '@id': 'identity:identityService', '@type': '@id' },
|
|
143
|
+
idp: { '@id': 'identity:idp', '@type': '@id' },
|
|
144
|
+
Identity: 'identity:Identity',
|
|
145
|
+
|
|
146
|
+
paymentProcessor: 'ps:processor',
|
|
147
|
+
preferences: { '@id': 'ps:preferences', '@type': '@vocab' },
|
|
148
|
+
|
|
149
|
+
cipherAlgorithm: 'sec:cipherAlgorithm',
|
|
150
|
+
cipherData: 'sec:cipherData',
|
|
151
|
+
cipherKey: 'sec:cipherKey',
|
|
152
|
+
digestAlgorithm: 'sec:digestAlgorithm',
|
|
153
|
+
digestValue: 'sec:digestValue',
|
|
154
|
+
domain: 'sec:domain',
|
|
155
|
+
expires: { '@id': 'sec:expiration', '@type': 'xsd:dateTime' },
|
|
156
|
+
initializationVector: 'sec:initializationVector',
|
|
157
|
+
member: { '@id': 'schema:member', '@type': '@id' },
|
|
158
|
+
memberOf: { '@id': 'schema:memberOf', '@type': '@id' },
|
|
159
|
+
nonce: 'sec:nonce',
|
|
160
|
+
normalizationAlgorithm: 'sec:normalizationAlgorithm',
|
|
161
|
+
owner: { '@id': 'sec:owner', '@type': '@id' },
|
|
162
|
+
password: 'sec:password',
|
|
163
|
+
privateKey: { '@id': 'sec:privateKey', '@type': '@id' },
|
|
164
|
+
privateKeyPem: 'sec:privateKeyPem',
|
|
165
|
+
publicKey: { '@id': 'sec:publicKey', '@type': '@id' },
|
|
166
|
+
publicKeyPem: 'sec:publicKeyPem',
|
|
167
|
+
publicKeyService: { '@id': 'sec:publicKeyService', '@type': '@id' },
|
|
168
|
+
revoked: { '@id': 'sec:revoked', '@type': 'xsd:dateTime' },
|
|
169
|
+
signature: 'sec:signature',
|
|
170
|
+
signatureAlgorithm: 'sec:signingAlgorithm',
|
|
171
|
+
signatureValue: 'sec:signatureValue',
|
|
172
|
+
CryptographicKey: 'sec:Key',
|
|
173
|
+
EncryptedMessage: 'sec:EncryptedMessage',
|
|
174
|
+
GraphSignature2012: 'sec:GraphSignature2012',
|
|
175
|
+
LinkedDataSignature2015: 'sec:LinkedDataSignature2015',
|
|
176
|
+
|
|
177
|
+
accessControl: { '@id': 'perm:accessControl', '@type': '@id' },
|
|
178
|
+
writePermission: { '@id': 'perm:writePermission', '@type': '@id' }
|
|
179
|
+
}
|
|
180
|
+
})
|
|
181
|
+
|
|
92
182
|
as2.registerContext('https://w3id.org/security/data-integrity/v1', {
|
|
93
183
|
'@context': {
|
|
94
184
|
id: '@id',
|
package/lib/app.js
CHANGED
|
@@ -184,6 +184,8 @@ export async function makeApp ({ databaseUrl, origin, bots, logLevel = 'silent',
|
|
|
184
184
|
profileFileName
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
+
app.disable('x-powered-by')
|
|
188
|
+
|
|
187
189
|
app.use(async (req, res, next) => {
|
|
188
190
|
let id = req.get('x-request-id')
|
|
189
191
|
if (!id || !id.match(UUID_REGEXP)) {
|