From d5d1dd77cd1bb6845c828f63b9146f762bd270dd Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2019 10:09:18 +0000 Subject: [PATCH 1/2] Bump eslint-config-standard from 13.0.1 to 14.0.0 in /backend Bumps [eslint-config-standard](https://github.com/standard/eslint-config-standard) from 13.0.1 to 14.0.0. - [Release notes](https://github.com/standard/eslint-config-standard/releases) - [Changelog](https://github.com/standard/eslint-config-standard/blob/master/CHANGELOG.md) - [Commits](https://github.com/standard/eslint-config-standard/compare/v13.0.1...v14.0.0) Signed-off-by: dependabot-preview[bot] --- backend/package.json | 2 +- backend/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/package.json b/backend/package.json index b5a9ecac4..49ab84d7c 100644 --- a/backend/package.json +++ b/backend/package.json @@ -116,7 +116,7 @@ "cucumber": "~5.1.0", "eslint": "~6.2.0", "eslint-config-prettier": "~6.1.0", - "eslint-config-standard": "~13.0.1", + "eslint-config-standard": "~14.0.0", "eslint-plugin-import": "~2.18.2", "eslint-plugin-jest": "~22.15.1", "eslint-plugin-node": "~9.1.0", diff --git a/backend/yarn.lock b/backend/yarn.lock index 9650de0cb..ad8a8778e 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -3274,10 +3274,10 @@ eslint-config-prettier@~6.1.0: dependencies: get-stdin "^6.0.0" -eslint-config-standard@~13.0.1: - version "13.0.1" - resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-13.0.1.tgz#c9c6ffe0cfb8a51535bc5c7ec9f70eafb8c6b2c0" - integrity sha512-zLKp4QOgq6JFgRm1dDCVv1Iu0P5uZ4v5Wa4DTOkg2RFMxdCX/9Qf7lz9ezRj2dBRa955cWQF/O/LWEiYWAHbTw== +eslint-config-standard@~14.0.0: + version "14.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-14.0.0.tgz#1de7bf5af37542dc6eef879ab7eb5e5e0f830747" + integrity sha512-bV6e2LFvJEetrLjVAy4KWPOUsIhPWr040c649MigTPR6yUtaGuOt6CEAyNeez2lRiC+2+vjGWa02byjs25EB3A== eslint-import-resolver-node@^0.3.2: version "0.3.2" From c3edc92436e474b257831f191888a98b4a42024f Mon Sep 17 00:00:00 2001 From: roschaefer Date: Tue, 20 Aug 2019 14:06:24 +0200 Subject: [PATCH 2/2] Fix lint --- backend/src/activitypub/ActivityPub.js | 15 ++++++++------- backend/src/activitypub/security/index.js | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/backend/src/activitypub/ActivityPub.js b/backend/src/activitypub/ActivityPub.js index cd16f620e..01e95d4f4 100644 --- a/backend/src/activitypub/ActivityPub.js +++ b/backend/src/activitypub/ActivityPub.js @@ -102,27 +102,27 @@ export default class ActivityPub { handleUndoActivity(activity) { debug('inside UNDO') switch (activity.object.type) { - case 'Follow': + case 'Follow': { const followActivity = activity.object return this.dataSource.undoFollowActivity(followActivity.actor, followActivity.object) - case 'Like': + } + case 'Like': { return this.dataSource.deleteShouted(activity) - default: + } } } handleCreateActivity(activity) { debug('inside create') switch (activity.object.type) { - case 'Article': - case 'Note': + case 'Note': { const articleObject = activity.object if (articleObject.inReplyTo) { return this.dataSource.createComment(activity) } else { return this.dataSource.createPost(activity) } - default: + } } } @@ -159,13 +159,14 @@ export default class ActivityPub { async handleAcceptActivity(activity) { debug('inside accept') switch (activity.object.type) { - case 'Follow': + case 'Follow': { const followObject = activity.object const followingCollectionPage = await this.collections.getFollowingCollectionPage( followObject.actor, ) followingCollectionPage.orderedItems.push(followObject.object) await this.dataSource.saveFollowingCollectionPage(followingCollectionPage) + } } } diff --git a/backend/src/activitypub/security/index.js b/backend/src/activitypub/security/index.js index 05642ed26..9e0a63d22 100644 --- a/backend/src/activitypub/security/index.js +++ b/backend/src/activitypub/security/index.js @@ -51,7 +51,7 @@ export function createSignature(options) { // verifying export function verifySignature(url, headers) { return new Promise((resolve, reject) => { - const signatureHeader = headers['signature'] ? headers['signature'] : headers['Signature'] + const signatureHeader = headers.signature ? headers.signature : headers.Signature if (!signatureHeader) { debug('No Signature header present!') resolve(false)