const setTokens = () => { let clientId = readlineSync.question('What is your Spotify Client ID? \n', { hideEchoBack: true }); let clientSecret = readlineSync.question('What is your Spotify Client Secret? \n', { hideEchoBack: true }); nconf.set('spotifyClientID', clientId); nconf.set('spotifyClientSecret', clientSecret); nconf.save(); printer.printConfig(); }
async info(timeoutMs = 60000) { const response = await this.client .info({ requestTimeout: timeoutMs }); // Update ES version in nconf nconf.set('env:ES_VERSION', response.version.number); nconf.set('env:ES_MAJOR', parseInt(response.version.number.substr(0, 1), 10)); this.env = nconf.get('env'); this.logElastic('info', `[INFO] found elastic v${this.env.ES_VERSION} ...`); }
it('should 401 if securemode is enabled and not logged in ', done => { nconf.set('messages:apiSecurity', true); nconf.save(); chai.request(server) .get('/api/messages/5') .end((err, res) => { should.not.exist(err); res.status.should.eql(401); res.type.should.eql('application/json'); nconf.set('messages:apiSecurity', false); done(); }); });
it('should 401 if securemode is enabled and not logged in ', done => { nconf.set('messages:apiSecurity', true); nconf.save(); chai.request(server) .get('/api/messages') .end((err, res) => { should.not.exist(err); res.status.should.eql(401); res.type.should.eql('application/json'); nconf.set('messages:apiSecurity', false); nconf.save(); done(); }); });