Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// const helperFunctions = require('../auth-helpers');
const PipelineManager = require('coinstac-pipeline');
const path = require('path');
const axios = require('axios');
const config = require('../config');
const graphqlSchema = require('coinstac-graphql-schema');
const { pullImagesFromList, pruneImages } = require('coinstac-docker-manager');
const dbmap = require('/etc/coinstac/cstacDBMap'); // eslint-disable-line import/no-absolute-path, import/no-unresolved
const manager = PipelineManager.create({
mode: 'remote',
clientId: 'remote',
operatingDirectory: path.resolve(config.operatingDirectory, 'coinstac'),
mqttRemotePort: config.mqttServer.port,
mqttRemoteProtocol: config.mqttServer.protocol,
mqttRemoteURL: config.mqttServer.hostname,
});
const authenticateServer = () => {
return axios.post(
`${config.apiServer}/authenticate`,
dbmap.rethinkdbServer
)
.then((token) => {
this.id_token = token.data.id_token;
axios.defaults.headers.common.Authorization = `Bearer ${this.id_token}`;
initialize() {
return PipelineManager.create({
mode: 'local',
clientId: this.options.userId,
logger: this.logger,
operatingDirectory: path.join(this.appDirectory),
remotePort: this.options.fileServer.port,
remoteProtocol: this.options.fileServer.protocol,
remotePathname: this.options.fileServer.pathname,
remoteURL: this.options.fileServer.hostname,
mqttRemotePort: this.options.mqttServer.port,
mqttRemoteProtocol: this.options.mqttServer.protocol,
mqttRemoteURL: this.options.mqttServer.hostname,
}).then((manager) => {
this.pipelineManager = manager;
return manager;
});
}