From 7751585698e7388dcaf0e101c55ee6ccb2a19a25 Mon Sep 17 00:00:00 2001 From: ChunHao <64747455+chuang8511@users.noreply.github.com> Date: Tue, 14 May 2024 16:46:15 +0100 Subject: [PATCH] fix(slack): add `instillSecret: true` to `token` field (#126) Because - We want the token is secret. This commit - make the token secret --- pkg/connector/slack/v0/config/definition.json | 5 +++-- pkg/connector/slack/v0/taskFunctions.go | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/connector/slack/v0/config/definition.json b/pkg/connector/slack/v0/config/definition.json index 5cbc8e7a..113a2eb4 100644 --- a/pkg/connector/slack/v0/config/definition.json +++ b/pkg/connector/slack/v0/config/definition.json @@ -22,13 +22,14 @@ "instillAcceptFormats": [ "string" ], - "instillCredentialField": false, + "instillSecret": true, "instillUIOrder": 0, "title": "token", "type": "string" } }, - "required": [], + "required": ["token"], + "instillEditOnNodeFields": ["token"], "title": "Slack Connection", "type": "object" } diff --git a/pkg/connector/slack/v0/taskFunctions.go b/pkg/connector/slack/v0/taskFunctions.go index de4b967a..0b79752b 100644 --- a/pkg/connector/slack/v0/taskFunctions.go +++ b/pkg/connector/slack/v0/taskFunctions.go @@ -77,6 +77,10 @@ func (e *execution) readMessage(in *structpb.Struct) (*structpb.Struct, error) { } wg.Wait() + if readTaskResp.Conversations == nil { + readTaskResp.Conversations = []Conversation{} + } + out, err := base.ConvertToStructpb(readTaskResp) if err != nil { return nil, err