@verdaccio/server 6.0.0-6-next.30 → 6.0.0-6-next.33

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.
Files changed (73) hide show
  1. package/.babelrc +1 -1
  2. package/CHANGELOG.md +88 -0
  3. package/build/debug/index.d.ts +1 -1
  4. package/build/debug/index.js +1 -1
  5. package/build/debug/index.js.map +1 -1
  6. package/build/env.js.map +1 -1
  7. package/build/index.js.map +1 -1
  8. package/build/server.d.ts +2 -2
  9. package/build/server.js +5 -3
  10. package/build/server.js.map +1 -1
  11. package/build/utils.d.ts +1 -0
  12. package/build/utils.js +19 -0
  13. package/build/utils.js.map +1 -0
  14. package/jest.config.js +7 -2
  15. package/package.json +70 -71
  16. package/src/debug/index.ts +2 -2
  17. package/src/server.ts +8 -7
  18. package/src/utils.ts +11 -0
  19. package/test/_helper.ts +29 -0
  20. package/test/config/conf.yaml +28 -0
  21. package/test/config/no_debug.yaml +26 -0
  22. package/test/config/powered-custom.yaml +29 -0
  23. package/test/config/powered-disabled.yaml +29 -0
  24. package/test/config/web-disabled.yaml +27 -0
  25. package/test/server.spec.ts +113 -0
  26. package/tsconfig.build.json +1 -1
  27. package/tsconfig.json +14 -14
  28. package/jest.setup.js +0 -1
  29. package/test/.eslintrc +0 -8
  30. package/test/README.md +0 -12
  31. package/test/api/api.spec.yaml +0 -87
  32. package/test/api/helpers/publish-api.js +0 -60
  33. package/test/api/helpers/utils.ts +0 -149
  34. package/test/api/htpasswd +0 -10
  35. package/test/api/index.spec.ts +0 -862
  36. package/test/api/mock/store/@jquery/jquery/jquery-1.5.1.tgz +0 -0
  37. package/test/api/mock/store/@jquery/jquery/package.json +0 -76
  38. package/test/api/mock/store/corrupted-package/package.json +0 -12
  39. package/test/api/mock/store/jquery/jquery-1.5.1.tgz +0 -0
  40. package/test/api/mock/store/jquery/package.json +0 -4919
  41. package/test/api/mock/store/npm_test/package.json +0 -75
  42. package/test/api/mock/store/vue/package.json +0 -25169
  43. package/test/api/plugin/filter.ts +0 -25
  44. package/test/basic/basic.yaml +0 -14
  45. package/test/basic/index.spec.ts +0 -64
  46. package/test/jwt/index.spec.ts +0 -163
  47. package/test/jwt/jwt.yaml +0 -35
  48. package/test/jwt/mock/store/vue/package.json +0 -25169
  49. package/test/package-access/index.spec.ts +0 -100
  50. package/test/package-access/mock/store/.gitkeep +0 -0
  51. package/test/package-access/mock/store/jquery/jquery-1.5.1.tgz +0 -0
  52. package/test/package-access/mock/store/jquery/package.json +0 -4919
  53. package/test/package-access/mock/store/vue/package.json +0 -25169
  54. package/test/package-access/pkg.access.yaml +0 -12
  55. package/test/profile/index.spec.ts +0 -129
  56. package/test/profile/mock/store/.gitkeep +0 -0
  57. package/test/profile/profile.yaml +0 -21
  58. package/test/storage/index.spec.ts +0 -219
  59. package/test/storage/mock/store/@jquery/jquery/jquery-1.5.1.tgz +0 -0
  60. package/test/storage/mock/store/@jquery/jquery/package.json +0 -76
  61. package/test/storage/mock/store/corrupted-package/package.json +0 -12
  62. package/test/storage/mock/store/jquery/jquery-1.5.1.tgz +0 -0
  63. package/test/storage/mock/store/jquery/package.json +0 -4919
  64. package/test/storage/mock/store/npm_test/package.json +0 -75
  65. package/test/storage/store.spec.yaml +0 -24
  66. package/test/token/index.spec.ts +0 -227
  67. package/test/token/mock/store/.gitkeep +0 -0
  68. package/test/token/token.spec.yaml +0 -26
  69. package/test/web/index.spec.ts +0 -157
  70. package/test/web/mock/store/.gitkeep +0 -0
  71. package/test/web/partials/forbidden-place.js +0 -50
  72. package/test/web/partials/publish-api.js +0 -50
  73. 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