Skip to content

Commit

Permalink
fix(api-gateway): Debug API, allow subscribe to pre-aggregations queu…
Browse files Browse the repository at this point in the history
…e events only by playground JWT (#3144)
  • Loading branch information
RusovDmitriy committed Jul 22, 2021
1 parent 1ea8229 commit 700080f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/cubejs-api-gateway/src/SubscriptionServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export class SubscriptionServer {
...params,
connectionId,
context,
signedWithPlaygroundAuthSecret: authContext.signedWithPlaygroundAuthSecret,
isSubscription,
res: this.resultFn(connectionId, message.messageId),
subscriptionState: async () => {
Expand Down
9 changes: 8 additions & 1 deletion packages/cubejs-api-gateway/src/gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,14 @@ export class ApiGateway {
}
}

public subscribeQueueEvents({ context, connectionId, res }) {
public subscribeQueueEvents({ context, signedWithPlaygroundAuthSecret, connectionId, res }) {
if (this.enforceSecurityChecks && !signedWithPlaygroundAuthSecret) {
throw new CubejsHandlerError(
403,
'Forbidden',
'Only for signed with playground auth secret'
);
}
return this.getAdapterApi(context).subscribeQueueEvents(connectionId, res);
}

Expand Down

0 comments on commit 700080f

Please sign in to comment.