The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/app/apps/server/bridges/cloud.ts

23 lines
884 B

import { Meteor } from 'meteor/meteor';
import { CloudWorkspaceBridge } from '@rocket.chat/apps-engine/server/bridges/CloudWorkspaceBridge';
import { IWorkspaceToken } from '@rocket.chat/apps-engine/definition/cloud/IWorkspaceToken';
import { getWorkspaceAccessTokenWithScope } from '../../../cloud/server';
import { AppServerOrchestrator } from '../orchestrator';
const boundGetWorkspaceAccessToken = Meteor.bindEnvironment(getWorkspaceAccessTokenWithScope);
export class AppCloudBridge extends CloudWorkspaceBridge {
// eslint-disable-next-line no-empty-function
constructor(private readonly orch: AppServerOrchestrator) {
super();
}
public async getWorkspaceToken(scope: string, appId: string): Promise<IWorkspaceToken> {
this.orch.debugLog(`App ${ appId } is getting the workspace's token`);
const token = boundGetWorkspaceAccessToken(scope);
return token;
}
}