diff --git a/examples/slack-reaction-listener/asyncapi.yaml b/examples/slack-reaction-listener/asyncapi.yaml index c1694a43a..268e0aba6 100644 --- a/examples/slack-reaction-listener/asyncapi.yaml +++ b/examples/slack-reaction-listener/asyncapi.yaml @@ -9,6 +9,9 @@ servers: Slack_WebSocket: host: wss-primary.slack.com protocol: wss + security: + - $ref: '#/components/securitySchemes/app_id' + - $ref: '#/components/securitySchemes/ticket' Slack_HTTPS: host: slack.com protocol: https @@ -96,6 +99,15 @@ operations: - $ref: "#/components/messages/SlackReactionAdded" - $ref: "#/components/messages/GenericErrorPayload" components: + securitySchemes: + ticket: + type: httpApiKey + name: ticket + in: query + app_id: + type: httpApiKey + name: app_id + in: query messages: slackAckEvent: payload: diff --git a/src/lib/wsHttpAuth.ts b/src/lib/wsHttpAuth.ts index 7cd1cc0f2..e765bae43 100644 --- a/src/lib/wsHttpAuth.ts +++ b/src/lib/wsHttpAuth.ts @@ -99,11 +99,12 @@ class GleeAuth extends EventEmitter { } private httpApiKeyLogic(scheme, headers, query, authKey) { - const loc = scheme[String(authKey)].json('in') + + const loc = scheme.in() if (loc == 'header') { - headers[scheme[String(authKey)].json('name')] = this.auth[String(authKey)] + headers[scheme.name()] = this.auth[String(authKey)] } else if (loc == 'query') { - query[scheme[String(authKey)].json('name')] = this.auth[String(authKey)] + query[scheme.name()] = this.auth[String(authKey)] } return { headers, query }