mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Ok, so here is the plan. Let's give both our cucumber features and your cypress tests a prominent place to live. That would be the root level folder of our application. Second, let's revive formerly dead code step by step. Ie. move code from the former location `backend/features/` to `features/` when it is ready. All edge cases should be tested with unit tests in `backend/`, see my `webfinger.spec.js` as an example.
25 lines
967 B
JavaScript
25 lines
967 B
JavaScript
import { activityPub } from '../ActivityPub'
|
|
|
|
export function createActor(name, pubkey) {
|
|
return {
|
|
'@context': ['https://www.w3.org/ns/activitystreams', 'https://w3id.org/security/v1'],
|
|
id: `${activityPub.endpoint}/activitypub/users/${name}`,
|
|
type: 'Person',
|
|
preferredUsername: `${name}`,
|
|
name: `${name}`,
|
|
following: `${activityPub.endpoint}/activitypub/users/${name}/following`,
|
|
followers: `${activityPub.endpoint}/activitypub/users/${name}/followers`,
|
|
inbox: `${activityPub.endpoint}/activitypub/users/${name}/inbox`,
|
|
outbox: `${activityPub.endpoint}/activitypub/users/${name}/outbox`,
|
|
url: `${activityPub.endpoint}/activitypub/@${name}`,
|
|
endpoints: {
|
|
sharedInbox: `${activityPub.endpoint}/activitypub/inbox`,
|
|
},
|
|
publicKey: {
|
|
id: `${activityPub.endpoint}/activitypub/users/${name}#main-key`,
|
|
owner: `${activityPub.endpoint}/activitypub/users/${name}`,
|
|
publicKeyPem: pubkey,
|
|
},
|
|
}
|
|
}
|