mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-24 21:15:51 +01:00
build: update dependencies (#1630)
* chore: update dependencies * chore: update secrets
This commit is contained in:
parent
5189254fbb
commit
7fe943f7bc
@ -12,6 +12,7 @@
|
||||
"@typescript-eslint/array-type": ["warn"],
|
||||
"@typescript-eslint/no-explicit-any": 0,
|
||||
"@typescript-eslint/indent": 0,
|
||||
"@typescript-eslint/interface-name-prefix": 0
|
||||
"@typescript-eslint/interface-name-prefix": 0,
|
||||
"import/order": 0
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
"files": null,
|
||||
"lines": null
|
||||
},
|
||||
"generated_at": "2019-08-03T08:33:13Z",
|
||||
"generated_at": "2019-12-23T08:20:53Z",
|
||||
"plugins_used": [
|
||||
{
|
||||
"name": "AWSKeyDetector"
|
||||
@ -265,12 +265,12 @@
|
||||
"test/unit/modules/api/api.spec.ts": [
|
||||
{
|
||||
"hashed_secret": "97752a468368b0d6b192140d6a140c38fd0cbd8b",
|
||||
"line_number": 293,
|
||||
"line_number": 305,
|
||||
"type": "Secret Keyword"
|
||||
},
|
||||
{
|
||||
"hashed_secret": "364bdf2ed77a8544d3b711a03b69eeadcc63c9d7",
|
||||
"line_number": 802,
|
||||
"line_number": 829,
|
||||
"type": "Secret Keyword"
|
||||
}
|
||||
],
|
||||
@ -326,7 +326,7 @@
|
||||
},
|
||||
{
|
||||
"hashed_secret": "195a8aef5c5b2397fdbf5fb429a517b089745309",
|
||||
"line_number": 96,
|
||||
"line_number": 97,
|
||||
"type": "Secret Keyword"
|
||||
}
|
||||
],
|
||||
@ -345,7 +345,7 @@
|
||||
},
|
||||
{
|
||||
"hashed_secret": "fed915afaba64ebcdfeb805d59ea09a33275c423",
|
||||
"line_number": 178,
|
||||
"line_number": 205,
|
||||
"type": "Secret Keyword"
|
||||
}
|
||||
],
|
||||
|
42
package.json
42
package.json
@ -20,10 +20,10 @@
|
||||
"url": "https://opencollective.com/verdaccio"
|
||||
},
|
||||
"dependencies": {
|
||||
"@verdaccio/commons-api": "8.3.0",
|
||||
"@verdaccio/local-storage": "8.4.2",
|
||||
"@verdaccio/readme": "8.4.2",
|
||||
"@verdaccio/streams": "8.2.0",
|
||||
"@verdaccio/commons-api": "8.5.0",
|
||||
"@verdaccio/local-storage": "8.5.0",
|
||||
"@verdaccio/readme": "8.5.0",
|
||||
"@verdaccio/streams": "8.5.0",
|
||||
"@verdaccio/ui-theme": "0.3.9",
|
||||
"JSONStream": "1.3.5",
|
||||
"async": "3.1.0",
|
||||
@ -31,7 +31,7 @@
|
||||
"bunyan": "1.8.12",
|
||||
"commander": "3.0.2",
|
||||
"compression": "1.7.4",
|
||||
"cookies": "0.7.3",
|
||||
"cookies": "0.8.0",
|
||||
"cors": "2.8.5",
|
||||
"dayjs": "1.8.17",
|
||||
"envinfo": "7.5.0",
|
||||
@ -51,9 +51,9 @@
|
||||
"mv": "2.1.1",
|
||||
"pkginfo": "0.4.1",
|
||||
"request": "2.87.0",
|
||||
"semver": "6.3.0",
|
||||
"verdaccio-audit": "8.1.4",
|
||||
"verdaccio-htpasswd": "8.2.0"
|
||||
"semver": "7.1.1",
|
||||
"verdaccio-audit": "8.5.0",
|
||||
"verdaccio-htpasswd": "8.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "8.2.0",
|
||||
@ -63,21 +63,21 @@
|
||||
"@types/bunyan": "1.8.6",
|
||||
"@types/express": "4.17.1",
|
||||
"@types/http-errors": "1.6.3",
|
||||
"@types/jest": "24.0.23",
|
||||
"@types/lodash": "4.14.148",
|
||||
"@types/jest": "24.0.24",
|
||||
"@types/lodash": "4.14.149",
|
||||
"@types/mime": "2.0.1",
|
||||
"@types/minimatch": "3.0.3",
|
||||
"@types/node": "12.7.8",
|
||||
"@types/node": "12.12.21",
|
||||
"@types/request": "2.48.3",
|
||||
"@types/semver": "6.2.0",
|
||||
"@typescript-eslint/eslint-plugin": "2.11.0",
|
||||
"@verdaccio/babel-preset": "8.1.0",
|
||||
"@verdaccio/eslint-config": "8.1.0",
|
||||
"@verdaccio/types": "8.1.0",
|
||||
"@typescript-eslint/eslint-plugin": "2.12.0",
|
||||
"@verdaccio/babel-preset": "8.5.0",
|
||||
"@verdaccio/eslint-config": "8.5.0",
|
||||
"@verdaccio/types": "8.5.0",
|
||||
"codecov": "3.6.1",
|
||||
"cross-env": "6.0.3",
|
||||
"detect-secrets": "1.0.5",
|
||||
"eslint": "5.16.0",
|
||||
"eslint": "6.8.0",
|
||||
"fs-extra": "8.1.0",
|
||||
"get-stdin": "7.0.0",
|
||||
"husky": "2.7.0",
|
||||
@ -87,15 +87,15 @@
|
||||
"jest-junit": "9.0.0",
|
||||
"lint-staged": "8.2.1",
|
||||
"nock": "11.7.0",
|
||||
"prettier": "1.18.2",
|
||||
"prettier": "1.19.1",
|
||||
"puppeteer": "1.8.0",
|
||||
"rimraf": "3.0.0",
|
||||
"standard-version": "7.0.0",
|
||||
"standard-version": "7.0.1",
|
||||
"supertest": "4.0.2",
|
||||
"typescript": "3.7.1-rc",
|
||||
"verdaccio": "latest",
|
||||
"verdaccio-auth-memory": "8.3.0",
|
||||
"verdaccio-memory": "8.2.0"
|
||||
"verdaccio": "4.4.0",
|
||||
"verdaccio-auth-memory": "8.5.0",
|
||||
"verdaccio-memory": "8.5.0"
|
||||
},
|
||||
"keywords": [
|
||||
"private",
|
||||
|
@ -19,7 +19,7 @@ import {
|
||||
import { convertPayloadToBase64, ErrorCode } from './utils';
|
||||
import { getMatchedPackagesSpec } from './config-utils';
|
||||
|
||||
import { Config, Logger, Callback, IPluginAuth, RemoteUser, JWTSignOptions, Security, AuthPluginPackage } from '@verdaccio/types';
|
||||
import { Config, Logger, Callback, IPluginAuth, RemoteUser, JWTSignOptions, Security, AuthPluginPackage, AllowAccess, PackageAccess } from '@verdaccio/types';
|
||||
import { NextFunction } from 'express';
|
||||
import { $RequestExtend, $ResponseExtend, IAuth, AESPayload } from '../../types';
|
||||
|
||||
@ -150,7 +150,9 @@ class Auth implements IAuth {
|
||||
let method = 'adduser';
|
||||
if (_.isFunction(plugin[method]) === false) {
|
||||
method = 'add_user';
|
||||
self.logger.warn('the plugin method add_user in the auth plugin is deprecated and will be removed in next major release, notify to the plugin author');
|
||||
}
|
||||
|
||||
if (_.isFunction(plugin[method]) === false) {
|
||||
next();
|
||||
} else {
|
||||
@ -175,7 +177,8 @@ class Auth implements IAuth {
|
||||
*/
|
||||
public allow_access({ packageName, packageVersion }: AuthPluginPackage, user: RemoteUser, callback: Callback): void {
|
||||
const plugins = this.plugins.slice(0);
|
||||
const pkg = Object.assign({ name: packageName, version: packageVersion }, getMatchedPackagesSpec(packageName, this.config.packages));
|
||||
const pkgAllowAcces: AllowAccess = { name: packageName, version: packageVersion };
|
||||
const pkg = Object.assign({}, pkgAllowAcces, getMatchedPackagesSpec(packageName, this.config.packages)) as AllowAccess & PackageAccess;
|
||||
const self = this;
|
||||
this.logger.trace({ packageName }, 'allow access for @{packageName}');
|
||||
|
||||
|
@ -39,6 +39,7 @@ export function handleNotify(metadata: Package, notifyEntry, remoteUser: RemoteU
|
||||
notifyEntry.headers.map(function(item): void {
|
||||
if (Object.is(item, item)) {
|
||||
for (const key in item) {
|
||||
/* eslint no-prototype-builtins: 0 */
|
||||
if (item.hasOwnProperty(key)) {
|
||||
header[key] = item[key];
|
||||
}
|
||||
|
@ -25,6 +25,10 @@
|
||||
],
|
||||
"no-useless-escape": 0,
|
||||
"@typescript-eslint/explicit-function-return-type": 0,
|
||||
"@typescript-eslint/no-empty-function": 0
|
||||
"@typescript-eslint/no-empty-function": 0,
|
||||
"handle-callback-err": 0,
|
||||
"import/order": 0,
|
||||
"prefer-const": 0,
|
||||
"prefer-promise-reject-errors": 1
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
/* eslint new-cap: 0 */
|
||||
|
||||
const { yellow } = require('kleur');
|
||||
const NodeEnvironment = require('jest-environment-node');
|
||||
const puppeteer = require('puppeteer');
|
||||
|
@ -26,7 +26,7 @@ export default function (server, server2, server3) {
|
||||
|
||||
describe('storage tarball cache test', () => {
|
||||
|
||||
//more info #131
|
||||
// more info #131
|
||||
beforeAll(function () {
|
||||
return server.addPackage(PKG_GH131);
|
||||
});
|
||||
|
@ -7,7 +7,7 @@ export default function (server, server2, server3) {
|
||||
|
||||
describe('uplink connection timeouts', () => {
|
||||
|
||||
//more info: https://github.com/verdaccio/verdaccio/pull/1331
|
||||
// more info: https://github.com/verdaccio/verdaccio/pull/1331
|
||||
|
||||
jest.setTimeout(20000);
|
||||
beforeAll(async () => {
|
||||
|
@ -1,139 +0,0 @@
|
||||
// @flow
|
||||
|
||||
// this file is not aim to be tested, just to check flow definitions
|
||||
|
||||
import Config from '../../../../src/lib/config';
|
||||
import LoggerApi from '../../../../src/lib/logger';
|
||||
import {generatePackageTemplate} from '../../../../src/lib/storage-utils';
|
||||
import { UploadTarball, ReadTarball } from '@verdaccio/streams';
|
||||
|
||||
import {
|
||||
Callback,
|
||||
Config as AppConfig,
|
||||
Logger,
|
||||
Package,
|
||||
// PluginOptions
|
||||
} from '@verdaccio/types';
|
||||
|
||||
import {
|
||||
IPluginStorage,
|
||||
IPackageStorageManager,
|
||||
IPackageStorage
|
||||
} from '@verdaccio/local-storage';
|
||||
import { IUploadTarball, IReadTarball } from '@verdaccio/streams';
|
||||
|
||||
class PackageStorage implements IPackageStorageManager {
|
||||
path: string;
|
||||
logger: Logger;
|
||||
|
||||
constructor(path: string, logger: Logger) {
|
||||
this.path = path;
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
updatePackage(name: string, updateHandler: Callback,
|
||||
onWrite: Callback,
|
||||
transformPackage: Function,
|
||||
onEnd: Callback) {
|
||||
onEnd();
|
||||
}
|
||||
|
||||
deletePackage(fileName: string, callback: Callback) {
|
||||
callback();
|
||||
}
|
||||
|
||||
removePackage(callback: Callback): void {
|
||||
callback();
|
||||
}
|
||||
|
||||
createPackage(name: string, value: Package, cb: Callback) {
|
||||
cb();
|
||||
}
|
||||
|
||||
savePackage(name: string, value: Package, cb: Callback) {
|
||||
cb();
|
||||
}
|
||||
|
||||
readPackage(name: string, cb: Callback) {
|
||||
cb();
|
||||
}
|
||||
|
||||
writeTarball(name: string): IUploadTarball {
|
||||
const uploadStream = new UploadTarball();
|
||||
|
||||
return uploadStream;
|
||||
}
|
||||
|
||||
readTarball(name: string): IReadTarball {
|
||||
const readTarballStream: IReadTarball = new ReadTarball();
|
||||
|
||||
return readTarballStream;
|
||||
}
|
||||
}
|
||||
|
||||
class ExampleStoragePlugin implements IPluginStorage {
|
||||
logger: Logger;
|
||||
config: AppConfig;
|
||||
|
||||
constructor(config: AppConfig, logger: Logger) {
|
||||
this.config = config;
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
getSecret(): Promise<any> {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
setSecret(secret: string): Promise<any> {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
add(name: string, cb: Callback) {
|
||||
cb();
|
||||
}
|
||||
|
||||
remove(name: string, cb: Callback) {
|
||||
cb();
|
||||
}
|
||||
|
||||
get(cb: Callback) {
|
||||
cb();
|
||||
}
|
||||
|
||||
getPackageStorage(packageInfo: string): IPackageStorage {
|
||||
return new PackageStorage(packageInfo, this.logger);
|
||||
}
|
||||
|
||||
search(onPackage: Callback, onEnd: Callback, validateName: any): void {
|
||||
onPackage(onEnd());
|
||||
}
|
||||
}
|
||||
|
||||
export default ExampleStoragePlugin;
|
||||
|
||||
const config1: AppConfig = new Config({
|
||||
storage: './storage',
|
||||
self_path: '/home/sotrage'
|
||||
});
|
||||
|
||||
|
||||
const storage = new ExampleStoragePlugin(config1, LoggerApi.logger.child());
|
||||
|
||||
storage.add('test', () => {});
|
||||
storage.remove('test', () => {});
|
||||
storage.getSecret().then(() => {});
|
||||
storage.setSecret('newSecret').then(() => {});
|
||||
storage.search(() => {}, () => {}, 'validateName');
|
||||
storage.get(() => {});
|
||||
|
||||
const storageManager: IPackageStorage = storage.getPackageStorage('test');
|
||||
|
||||
if (storageManager) {
|
||||
storageManager.createPackage('test', generatePackageTemplate('test'), () => {});
|
||||
storageManager.savePackage('fileName', generatePackageTemplate('test'), () => {});
|
||||
storageManager.updatePackage('pkgFileName', () =>{}, () => {}, () => {}, () => {});
|
||||
storageManager.deletePackage('test', () => {});
|
||||
storageManager.removePackage(() => {});
|
||||
storageManager.readPackage('test', () => {});
|
||||
storageManager.writeTarball('test');
|
||||
}
|
@ -114,9 +114,9 @@ export function addUser(request: any, user: string, credentials: any,
|
||||
}
|
||||
|
||||
export async function getNewToken(request: any, credentials: any): Promise<string> {
|
||||
/* eslint no-async-promise-executor: 0 */
|
||||
return new Promise(async (resolve) => {
|
||||
const [err, res] = await
|
||||
addUser(request, credentials.name, credentials);
|
||||
const [err, res] = await addUser(request, credentials.name, credentials);
|
||||
expect(err).toBeNull();
|
||||
const {token, ok} = res.body;
|
||||
expect(ok).toBeDefined();
|
||||
|
@ -258,7 +258,8 @@ describe('endpoint unit test', () => {
|
||||
}
|
||||
|
||||
expect(res.body.error).toBeDefined();
|
||||
//FIXME: message is not 100% accurate
|
||||
// FIXME: message is not 100% accurate
|
||||
/* eslint new-cap: 0 */
|
||||
expect(res.body.error).toMatch(API_ERROR.PASSWORD_SHORT());
|
||||
done();
|
||||
});
|
||||
@ -596,7 +597,7 @@ describe('endpoint unit test', () => {
|
||||
.del('/-/package/jquery/dist-tags/verdaccio-tag')
|
||||
.set('accept-encoding', HEADERS.JSON)
|
||||
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
|
||||
//.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
// .expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
.expect(HTTP_STATUS.CREATED)
|
||||
.end(function(err, res) {
|
||||
if (err) {
|
||||
@ -620,14 +621,14 @@ describe('endpoint unit test', () => {
|
||||
.get('/-/all/since?stale=update_after&startkey=' + cacheTime)
|
||||
// .set('accept-encoding', HEADERS.JSON)
|
||||
// .set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
|
||||
//.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
// .expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
.expect(HTTP_STATUS.OK)
|
||||
.end(function(err) {
|
||||
if (err) {
|
||||
expect(err).toBeNull();
|
||||
return done(err);
|
||||
}
|
||||
//TODO: we have to catch the stream check whether it returns something
|
||||
// TODO: we have to catch the stream check whether it returns something
|
||||
// we should not spend much time on this api since is deprecated somehow.
|
||||
done();
|
||||
});
|
||||
|
@ -23,7 +23,7 @@ describe('api endpoint app.param()', () => {
|
||||
if (m[1] === 'set') continue;
|
||||
|
||||
let inner = m[2].slice(1, m[2].length-1);
|
||||
var t;
|
||||
let t;
|
||||
|
||||
inner.split('/').forEach(function(x) {
|
||||
t = x.match(/^:([^?:]*)\??$/);
|
||||
|
@ -86,6 +86,7 @@ describe('endpoint user profile', () => {
|
||||
const [, resp] = await postProfile(request(app), body, token, HTTP_STATUS.UNAUTHORIZED);
|
||||
|
||||
expect(resp.error).not.toBeNull();
|
||||
/* eslint new-cap: 0 */
|
||||
expect(resp.error.text).toMatch(API_ERROR.PASSWORD_SHORT());
|
||||
done();
|
||||
});
|
||||
|
@ -19,12 +19,12 @@ const checkDefaultUplink = (config) => {
|
||||
};
|
||||
|
||||
const checkDefaultConfPackages = (config) => {
|
||||
//auth
|
||||
// auth
|
||||
expect(_.isObject(config.auth)).toBeTruthy();
|
||||
expect(_.isObject(config.auth.htpasswd)).toBeTruthy();
|
||||
expect(config.auth.htpasswd.file).toMatch(/htpasswd/);
|
||||
|
||||
//web
|
||||
// web
|
||||
expect(_.isObject(config.web)).toBeTruthy();
|
||||
expect(config.web.title).toBe(WEB_TITLE);
|
||||
expect(config.web.enable).toBeUndefined();
|
||||
@ -56,7 +56,7 @@ const checkDefaultConfPackages = (config) => {
|
||||
expect(config.logs[0].type).toEqual('stdout');
|
||||
expect(config.logs[0].format).toEqual('pretty');
|
||||
expect(config.logs[0].level).toEqual('http');
|
||||
//must not be enabled by default
|
||||
// must not be enabled by default
|
||||
expect(config.notify).toBeUndefined();
|
||||
expect(config.store).toBeUndefined();
|
||||
expect(config.publish).toBeUndefined();
|
||||
@ -69,6 +69,7 @@ const checkDefaultConfPackages = (config) => {
|
||||
|
||||
describe('Config file', () => {
|
||||
beforeAll(function() {
|
||||
/* eslint no-invalid-this: 0 */
|
||||
// @ts-ignore
|
||||
this.config = new Config(parseConfigFile(resolveConf('default')));
|
||||
});
|
||||
|
@ -26,7 +26,7 @@ describe('Notifications:: Notify', () => {
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
//FUTURE: we should add some sort of health check of all props, (not implemented yet)
|
||||
// FUTURE: we should add some sort of health check of all props, (not implemented yet)
|
||||
|
||||
test("should not fails if config is not provided", async () => {
|
||||
// @ts-ignore
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"rules": {
|
||||
"@typescript-eslint/no-empty-function": 0
|
||||
"@typescript-eslint/no-empty-function": 0,
|
||||
"no-var": 0
|
||||
}
|
||||
}
|
||||
|
@ -120,8 +120,8 @@ describe('UpStorge', () => {
|
||||
const stream = proxy.fetchTarball(tarball);
|
||||
expect(proxy.failed_requests).toBe(0);
|
||||
|
||||
//to test a uplink is offline we have to be try 3 times
|
||||
//the default failed request are set to 2
|
||||
// to test a uplink is offline we have to be try 3 times
|
||||
// the default failed request are set to 2
|
||||
process.nextTick(function() {
|
||||
stream.on('error', function(err) {
|
||||
expect(err).not.toBeNull();
|
||||
|
@ -86,7 +86,7 @@ describe('endpoint web unit test', () => {
|
||||
});
|
||||
});
|
||||
|
||||
//FIXME: disabled, we need to inspect why fails randomly
|
||||
// FIXME: disabled, we need to inspect why fails randomly
|
||||
test.skip('should display scoped readme 404', (done) => {
|
||||
request(app)
|
||||
.get('/-/verdaccio/package/readme/@scope/404')
|
||||
@ -183,7 +183,7 @@ describe('endpoint web unit test', () => {
|
||||
.get('/-/verdaccio/search/forbidden-place')
|
||||
.expect(HTTP_STATUS.OK)
|
||||
.end(function(err, res) {
|
||||
//this is expected since we are not logged
|
||||
// this is expected since we are not logged
|
||||
// and forbidden-place is allow_access: 'nobody'
|
||||
expect(res.body).toHaveLength(0);
|
||||
done();
|
||||
|
BIN
yarn.lock
BIN
yarn.lock
Binary file not shown.
Loading…
Reference in New Issue
Block a user