Skip to content

Commit 389d394

Browse files
author
ace-n
committed
Address comments
1 parent c0430bc commit 389d394

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

functions/slack_slash_command/composer.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,13 @@
22
"require": {
33
"google/cloud-functions-framework": "^0.6",
44
"google/apiclient": "^2.8"
5+
},
6+
"scripts": {
7+
"post-update-cmd": "Google\\Task\\Composer::cleanup"
8+
},
9+
"extra": {
10+
"google/apiclient-services": [
11+
"Kgsearch"
12+
]
513
}
614
}

functions/slack_slash_command/index.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ function isValidSlackWebhook(ServerRequestInterface $request): bool
4747

4848
// Compute signature
4949
$plaintext = 'v0:' . $timestamp . ':' . (string) $request->getBody();
50-
//var_dump($plaintext);
5150
$hash = 'v0=' . hash_hmac('sha256', $plaintext, $SLACK_SECRET);
5251

5352
return $hash === $signature;
@@ -109,7 +108,6 @@ function formatSlackMessage($kgResponse, $query): string
109108
*/
110109
function searchKnowledgeGraph($query): Google_Service_Kgsearch_SearchResponse
111110
{
112-
113111
/**
114112
* PHP Functions Framework does not support "global"/instance-scoped
115113
* constants, so we fetch these values within PHP functions themselves.
@@ -135,7 +133,6 @@ function searchKnowledgeGraph($query): Google_Service_Kgsearch_SearchResponse
135133
*/
136134
function receiveRequest(ServerRequestInterface $request): ResponseInterface
137135
{
138-
139136
// Validate request
140137
if ($request->getMethod() !== 'POST') {
141138
// [] = empty headers

0 commit comments

Comments
 (0)