mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
remove activity pub middleware
This commit is contained in:
parent
6adffd7c6b
commit
ec4eff86f7
@ -1,56 +0,0 @@
|
|||||||
import { generateRsaKeyPair } from '../activitypub/security'
|
|
||||||
import { activityPub } from '../activitypub/ActivityPub'
|
|
||||||
// import as from 'activitystrea.ms'
|
|
||||||
|
|
||||||
// const debug = require('debug')('backend:schema')
|
|
||||||
|
|
||||||
export default {
|
|
||||||
Mutation: {
|
|
||||||
// CreatePost: async (resolve, root, args, context, info) => {
|
|
||||||
// args.activityId = activityPub.generateStatusId(context.user.slug)
|
|
||||||
// args.objectId = activityPub.generateStatusId(context.user.slug)
|
|
||||||
|
|
||||||
// const post = await resolve(root, args, context, info)
|
|
||||||
|
|
||||||
// const { user: author } = context
|
|
||||||
// const actorId = author.actorId
|
|
||||||
// debug(`actorId = ${actorId}`)
|
|
||||||
// const createActivity = await new Promise((resolve, reject) => {
|
|
||||||
// as.create()
|
|
||||||
// .id(`${actorId}/status/${args.activityId}`)
|
|
||||||
// .actor(`${actorId}`)
|
|
||||||
// .object(
|
|
||||||
// as
|
|
||||||
// .article()
|
|
||||||
// .id(`${actorId}/status/${post.id}`)
|
|
||||||
// .content(post.content)
|
|
||||||
// .to('https://www.w3.org/ns/activitystreams#Public')
|
|
||||||
// .publishedNow()
|
|
||||||
// .attributedTo(`${actorId}`),
|
|
||||||
// )
|
|
||||||
// .prettyWrite((err, doc) => {
|
|
||||||
// if (err) {
|
|
||||||
// reject(err)
|
|
||||||
// } else {
|
|
||||||
// debug(doc)
|
|
||||||
// const parsedDoc = JSON.parse(doc)
|
|
||||||
// parsedDoc.send = true
|
|
||||||
// resolve(JSON.stringify(parsedDoc))
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
// try {
|
|
||||||
// await activityPub.sendActivity(createActivity)
|
|
||||||
// } catch (e) {
|
|
||||||
// debug(`error sending post activity\n${e}`)
|
|
||||||
// }
|
|
||||||
// return post
|
|
||||||
// },
|
|
||||||
SignupVerification: async (resolve, root, args, context, info) => {
|
|
||||||
const keys = generateRsaKeyPair()
|
|
||||||
Object.assign(args, keys)
|
|
||||||
args.actorId = `${activityPub.host}/activitypub/users/${args.slug}`
|
|
||||||
return resolve(root, args, context, info)
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@ -1,7 +1,5 @@
|
|||||||
import { applyMiddleware } from 'graphql-middleware'
|
import { applyMiddleware } from 'graphql-middleware'
|
||||||
import CONFIG from './../config'
|
import CONFIG from './../config'
|
||||||
|
|
||||||
import activityPub from './activityPubMiddleware'
|
|
||||||
import softDelete from './softDelete/softDeleteMiddleware'
|
import softDelete from './softDelete/softDeleteMiddleware'
|
||||||
import sluggify from './sluggifyMiddleware'
|
import sluggify from './sluggifyMiddleware'
|
||||||
import excerpt from './excerptMiddleware'
|
import excerpt from './excerptMiddleware'
|
||||||
@ -22,7 +20,6 @@ export default (schema) => {
|
|||||||
sentry,
|
sentry,
|
||||||
permissions,
|
permissions,
|
||||||
xss,
|
xss,
|
||||||
activityPub,
|
|
||||||
validation,
|
validation,
|
||||||
sluggify,
|
sluggify,
|
||||||
excerpt,
|
excerpt,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user