From 6fd3989118aaea7fbe720f5d9682bc59f801b064 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Thu, 30 Apr 2020 16:19:49 +0200 Subject: [PATCH 1/6] Add zoom meeting whitelist This allows to only record meetings for certain whitelisted meeting ids --- integrations/zoom.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/integrations/zoom.js b/integrations/zoom.js index 7819d12..689ef11 100644 --- a/integrations/zoom.js +++ b/integrations/zoom.js @@ -87,7 +87,11 @@ module.exports = async function(robot, kredits) { const payload = data.payload; const object = payload.object; - if (eventName === 'meeting.ended') { + + if (eventName === 'meeting.ended' && ( + !process.env.KREDITS_ZOOM_MEETING_WHITELIST || + process.env.KREDITS_ZOOM_MEETING_WHITELIST.split(',').includes(object.id) + )) { handleZoomMeetingEnded(object); } From 634dc207e686764e55c7dc520a9c4e0ccf60c122 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Thu, 14 May 2020 09:45:42 +0200 Subject: [PATCH 2/6] Update integrations/zoom.js Co-authored-by: Sebastian Kippe --- integrations/zoom.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/integrations/zoom.js b/integrations/zoom.js index 689ef11..8b4d897 100644 --- a/integrations/zoom.js +++ b/integrations/zoom.js @@ -89,8 +89,7 @@ module.exports = async function(robot, kredits) { if (eventName === 'meeting.ended' && ( - !process.env.KREDITS_ZOOM_MEETING_WHITELIST || - process.env.KREDITS_ZOOM_MEETING_WHITELIST.split(',').includes(object.id) + process.env.KREDITS_ZOOM_MEETING_WHITELIST?.split(',').includes(object.id) )) { handleZoomMeetingEnded(object); } From d82e2e925658959a4d88a4667595907a8d16ee1f Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Thu, 14 May 2020 10:00:00 +0200 Subject: [PATCH 3/6] Revert "Update integrations/zoom.js" This reverts commit 634dc207e686764e55c7dc520a9c4e0ccf60c122. --- integrations/zoom.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/integrations/zoom.js b/integrations/zoom.js index 8b4d897..689ef11 100644 --- a/integrations/zoom.js +++ b/integrations/zoom.js @@ -89,7 +89,8 @@ module.exports = async function(robot, kredits) { if (eventName === 'meeting.ended' && ( - process.env.KREDITS_ZOOM_MEETING_WHITELIST?.split(',').includes(object.id) + !process.env.KREDITS_ZOOM_MEETING_WHITELIST || + process.env.KREDITS_ZOOM_MEETING_WHITELIST.split(',').includes(object.id) )) { handleZoomMeetingEnded(object); } From fb1a471303aac740b903c3620f414b6389073819 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Thu, 14 May 2020 10:33:13 +0200 Subject: [PATCH 4/6] Make kredits amount for zoom calls configurable defaults to 500 - a general small contribution --- integrations/zoom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrations/zoom.js b/integrations/zoom.js index 689ef11..dfddf59 100644 --- a/integrations/zoom.js +++ b/integrations/zoom.js @@ -8,7 +8,7 @@ module.exports = async function(robot, kredits) { const { Contributor, Contribution } = kredits; - const kreditsContributionAmount = 500; + const kreditsContributionAmount = process.env.KREDITS_ZOOM_CONTRIBUTION_AMOUNT || 500; const kreditsContributionKind = 'community'; const zoomAccessToken = process.env.KREDITS_ZOOM_JWT; From fca017c61a12ad992967af0626d47719d00050a9 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Thu, 14 May 2020 10:38:51 +0200 Subject: [PATCH 5/6] Add readme for zoom integration --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index cc640e0..7ebdde8 100644 --- a/README.md +++ b/README.md @@ -116,3 +116,29 @@ wiki's API on its own. [kredits-contracts]: https://github.com/67P/kredits-contracts [GitHub OAuth app]: https://developer.github.com/apps/about-apps/#about-oauth-apps + + +### Zoom + +The Zoom integation creates contributions for meeting participations. + +Every meeting that is longer than 15 minutes and with more than 2 participants will be registered. +An optional meeting whitelist can be configured to create contributions only for specific meetings. + + +#### Setup + +A Zoom app has to be setup and an [event webhook subscription](https://marketplace.zoom.us/docs/api-reference/webhook-reference/meeting-events/meeting-ending") +on `meeting.ended` has to be configured to the following URL: + + https://your-hubot.example.com/incoming/kredits/zoom/{webhook_token} + +#### Config + +| Key | Description | +| --- | --- | +| `KREDITS_ZOOM_JWT` | The JWT for the Zoom application (required) +| `KREDITS_ZOOM_MEETING_WHITELIST` | Comma separated list of meeting names for which kredits should be tracked (optional) +| `KREDITS_ZOOM_CONTRIBUTION_AMOUNT` | The amount of kredits issued for each meeting. (default: 500) + +[Zoom apps](https://marketplace.zoom.us/user/build) From 95290a7715ceb6328f44eaba7fc2baf8b28932c3 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Thu, 14 May 2020 12:13:38 +0200 Subject: [PATCH 6/6] Apply suggestions from code review Co-authored-by: Sebastian Kippe --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7ebdde8..be384cb 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ wiki's API on its own. ### Zoom -The Zoom integation creates contributions for meeting participations. +The Zoom integration creates contributions for meeting participations. Every meeting that is longer than 15 minutes and with more than 2 participants will be registered. An optional meeting whitelist can be configured to create contributions only for specific meetings. @@ -128,7 +128,7 @@ An optional meeting whitelist can be configured to create contributions only for #### Setup -A Zoom app has to be setup and an [event webhook subscription](https://marketplace.zoom.us/docs/api-reference/webhook-reference/meeting-events/meeting-ending") +A Zoom JWT app has to be set up and an [event webhook subscription](https://marketplace.zoom.us/docs/api-reference/webhook-reference/meeting-events/meeting-ending") on `meeting.ended` has to be configured to the following URL: https://your-hubot.example.com/incoming/kredits/zoom/{webhook_token}