@verdaccio/server 6.0.0-6-next.29 → 6.0.0-6-next.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +1 -1
- package/CHANGELOG.md +91 -0
- package/build/debug/index.d.ts +1 -1
- package/build/debug/index.js +1 -1
- package/build/debug/index.js.map +1 -1
- package/build/env.js.map +1 -1
- package/build/index.js.map +1 -1
- package/build/server.d.ts +2 -2
- package/build/server.js +5 -3
- package/build/server.js.map +1 -1
- package/build/utils.d.ts +1 -0
- package/build/utils.js +19 -0
- package/build/utils.js.map +1 -0
- package/jest.config.js +7 -2
- package/package.json +70 -71
- package/src/debug/index.ts +2 -2
- package/src/server.ts +8 -7
- package/src/utils.ts +11 -0
- package/test/_helper.ts +29 -0
- package/test/config/conf.yaml +28 -0
- package/test/config/no_debug.yaml +26 -0
- package/test/config/powered-custom.yaml +29 -0
- package/test/config/powered-disabled.yaml +29 -0
- package/test/config/web-disabled.yaml +27 -0
- package/test/server.spec.ts +113 -0
- package/tsconfig.build.json +1 -1
- package/tsconfig.json +14 -14
- package/jest.setup.js +0 -1
- package/test/.eslintrc +0 -8
- package/test/README.md +0 -12
- package/test/api/api.spec.yaml +0 -87
- package/test/api/helpers/publish-api.js +0 -60
- package/test/api/helpers/utils.ts +0 -149
- package/test/api/htpasswd +0 -10
- package/test/api/index.spec.ts +0 -862
- package/test/api/mock/store/@jquery/jquery/jquery-1.5.1.tgz +0 -0
- package/test/api/mock/store/@jquery/jquery/package.json +0 -76
- package/test/api/mock/store/corrupted-package/package.json +0 -12
- package/test/api/mock/store/jquery/jquery-1.5.1.tgz +0 -0
- package/test/api/mock/store/jquery/package.json +0 -4919
- package/test/api/mock/store/npm_test/package.json +0 -75
- package/test/api/mock/store/vue/package.json +0 -25169
- package/test/api/plugin/filter.ts +0 -25
- package/test/basic/basic.yaml +0 -14
- package/test/basic/index.spec.ts +0 -64
- package/test/jwt/index.spec.ts +0 -163
- package/test/jwt/jwt.yaml +0 -35
- package/test/jwt/mock/store/vue/package.json +0 -25169
- package/test/package-access/index.spec.ts +0 -100
- package/test/package-access/mock/store/.gitkeep +0 -0
- package/test/package-access/mock/store/jquery/jquery-1.5.1.tgz +0 -0
- package/test/package-access/mock/store/jquery/package.json +0 -4919
- package/test/package-access/mock/store/vue/package.json +0 -25169
- package/test/package-access/pkg.access.yaml +0 -12
- package/test/profile/index.spec.ts +0 -129
- package/test/profile/mock/store/.gitkeep +0 -0
- package/test/profile/profile.yaml +0 -21
- package/test/storage/index.spec.ts +0 -219
- package/test/storage/mock/store/@jquery/jquery/jquery-1.5.1.tgz +0 -0
- package/test/storage/mock/store/@jquery/jquery/package.json +0 -76
- package/test/storage/mock/store/corrupted-package/package.json +0 -12
- package/test/storage/mock/store/jquery/jquery-1.5.1.tgz +0 -0
- package/test/storage/mock/store/jquery/package.json +0 -4919
- package/test/storage/mock/store/npm_test/package.json +0 -75
- package/test/storage/store.spec.yaml +0 -24
- package/test/token/index.spec.ts +0 -227
- package/test/token/mock/store/.gitkeep +0 -0
- package/test/token/token.spec.yaml +0 -26
- package/test/web/index.spec.ts +0 -157
- package/test/web/mock/store/.gitkeep +0 -0
- package/test/web/partials/forbidden-place.js +0 -50
- package/test/web/partials/publish-api.js +0 -50
- package/test/web/web.yaml +0 -20
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
import request from 'supertest';
|
|
3
|
-
|
|
4
|
-
import { HEADERS, HTTP_STATUS } from '@verdaccio/core';
|
|
5
|
-
import { logger, setup } from '@verdaccio/logger';
|
|
6
|
-
import { DOMAIN_SERVERS, configExample, generateRamdonStorage, mockServer } from '@verdaccio/mock';
|
|
7
|
-
|
|
8
|
-
import endPointAPI from '../../src';
|
|
9
|
-
|
|
10
|
-
setup([]);
|
|
11
|
-
|
|
12
|
-
describe('api with no limited access configuration', () => {
|
|
13
|
-
let app;
|
|
14
|
-
let mockRegistry;
|
|
15
|
-
const store = generateRamdonStorage();
|
|
16
|
-
jest.setTimeout(10000);
|
|
17
|
-
|
|
18
|
-
beforeAll(async () => {
|
|
19
|
-
const mockServerPort = 55530;
|
|
20
|
-
const configForTest = configExample(
|
|
21
|
-
{
|
|
22
|
-
config_path: store,
|
|
23
|
-
uplinks: {
|
|
24
|
-
remote: {
|
|
25
|
-
url: `http://${DOMAIN_SERVERS}:${mockServerPort}`,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
'pkg.access.yaml',
|
|
30
|
-
__dirname
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
app = await endPointAPI(configForTest);
|
|
34
|
-
const binPath = require.resolve('verdaccio/bin/verdaccio');
|
|
35
|
-
const storePath = path.join(__dirname, '/mock/store');
|
|
36
|
-
mockRegistry = await mockServer(mockServerPort, { storePath, silence: true }).init(binPath);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
afterAll(function () {
|
|
40
|
-
const [registry, pid] = mockRegistry;
|
|
41
|
-
registry.stop();
|
|
42
|
-
logger.info(`registry ${pid} has been stopped`);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
describe('test proxy packages partially restricted', () => {
|
|
46
|
-
test('should test fails on fetch endpoint /-/not-found', () => {
|
|
47
|
-
return new Promise((resolve, reject) => {
|
|
48
|
-
request(app)
|
|
49
|
-
// @ts-ignore
|
|
50
|
-
.get('/not-found-for-sure')
|
|
51
|
-
.set(HEADERS.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
|
52
|
-
.expect(HEADERS.CONTENT_TYPE, /json/)
|
|
53
|
-
.expect(HTTP_STATUS.NOT_FOUND)
|
|
54
|
-
.end(function (err) {
|
|
55
|
-
if (err) {
|
|
56
|
-
return reject(err);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
resolve(null);
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
test('should test fetch endpoint /-/jquery', () => {
|
|
65
|
-
return new Promise((resolve, reject) => {
|
|
66
|
-
request(app)
|
|
67
|
-
// @ts-ignore
|
|
68
|
-
.get('/jquery')
|
|
69
|
-
.set(HEADERS.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
|
70
|
-
.expect(HEADERS.CONTENT_TYPE, /json/)
|
|
71
|
-
.expect(HTTP_STATUS.OK)
|
|
72
|
-
.end(function (err) {
|
|
73
|
-
if (err) {
|
|
74
|
-
return reject(err);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
resolve(null);
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
test('should success on fetch endpoint /-/vue', () => {
|
|
83
|
-
return new Promise((resolve, reject) => {
|
|
84
|
-
request(app)
|
|
85
|
-
// @ts-ignore
|
|
86
|
-
.get('/vue')
|
|
87
|
-
.set(HEADERS.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
|
88
|
-
.expect(HEADERS.CONTENT_TYPE, /json/)
|
|
89
|
-
.expect(HTTP_STATUS.OK)
|
|
90
|
-
.end(function (err) {
|
|
91
|
-
if (err) {
|
|
92
|
-
return reject(err);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
resolve(null);
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
});
|
|
File without changes
|
|
Binary file
|