@verdaccio/auth 8.0.0-next-8.11 → 8.0.0-next-8.13

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 (39) hide show
  1. package/README.md +30 -24
  2. package/package.json +16 -12
  3. package/.babelrc +0 -3
  4. package/CHANGELOG.md +0 -1755
  5. package/src/auth.ts +0 -607
  6. package/src/index.ts +0 -3
  7. package/src/signature-legacy.ts +0 -66
  8. package/src/types.ts +0 -46
  9. package/src/utils.ts +0 -252
  10. package/test/auth-utils-middleware.spec.ts +0 -260
  11. package/test/auth-utils.spec.ts +0 -362
  12. package/test/auth.spec.ts +0 -722
  13. package/test/helper/plugin.ts +0 -43
  14. package/test/partials/config/yaml/security/security-basic.yaml +0 -12
  15. package/test/partials/config/yaml/security/security-empty.yaml +0 -1
  16. package/test/partials/config/yaml/security/security-jwt-legacy-enabled.yaml +0 -10
  17. package/test/partials/config/yaml/security/security-jwt.yaml +0 -6
  18. package/test/partials/config/yaml/security/security-legacy-disabled.yaml +0 -3
  19. package/test/partials/config/yaml/security/security-legacy.yaml +0 -3
  20. package/test/partials/config/yaml/security/security-missing.yaml +0 -0
  21. package/test/partials/config/yaml/security/security-no-legacy.yaml +0 -9
  22. package/test/partials/plugin/verdaccio-access-ok/access.js +0 -9
  23. package/test/partials/plugin/verdaccio-access-ok/package.json +0 -5
  24. package/test/partials/plugin/verdaccio-adduser/adduser.js +0 -25
  25. package/test/partials/plugin/verdaccio-adduser/package.json +0 -5
  26. package/test/partials/plugin/verdaccio-adduser-legacy/adduser.js +0 -25
  27. package/test/partials/plugin/verdaccio-adduser-legacy/package.json +0 -5
  28. package/test/partials/plugin/verdaccio-change-password/change.js +0 -32
  29. package/test/partials/plugin/verdaccio-change-password/package.json +0 -5
  30. package/test/partials/plugin/verdaccio-fail/fail.js +0 -14
  31. package/test/partials/plugin/verdaccio-fail/package.json +0 -5
  32. package/test/partials/plugin/verdaccio-fail-invalid-method/fail.js +0 -11
  33. package/test/partials/plugin/verdaccio-fail-invalid-method/package.json +0 -5
  34. package/test/partials/plugin/verdaccio-passthroug/package.json +0 -5
  35. package/test/partials/plugin/verdaccio-passthroug/passthroug.js +0 -9
  36. package/test/partials/plugin/verdaccio-success/package.json +0 -5
  37. package/test/partials/plugin/verdaccio-success/success.js +0 -9
  38. package/tsconfig.build.json +0 -9
  39. package/tsconfig.json +0 -32
@@ -1,43 +0,0 @@
1
- import path from 'path';
2
-
3
- import { getDefaultConfig } from '@verdaccio/config';
4
-
5
- export const authProfileConf = {
6
- ...getDefaultConfig(),
7
- plugins: path.join(__dirname, '../partials/plugin'),
8
- auth: {
9
- success: {},
10
- },
11
- };
12
-
13
- export const authChangePasswordConf = {
14
- ...getDefaultConfig(),
15
- plugins: path.join(__dirname, '../partials/plugin'),
16
- auth: {
17
- 'change-password': {},
18
- },
19
- };
20
-
21
- export const authPluginFailureConf = {
22
- ...getDefaultConfig(),
23
- plugins: path.join(__dirname, '../partials/plugin'),
24
- auth: {
25
- fail: {},
26
- },
27
- };
28
-
29
- export const authPluginPassThrougConf = {
30
- ...getDefaultConfig(),
31
- plugins: path.join(__dirname, '../partials/plugin'),
32
- auth: {
33
- passthroug: {},
34
- },
35
- };
36
-
37
- export const authFailInvalidMethod = {
38
- ...getDefaultConfig(),
39
- plugins: path.join(__dirname, '../partials/plugin'),
40
- auth: {
41
- 'fail-invalid-method': {},
42
- },
43
- };
@@ -1,12 +0,0 @@
1
- security:
2
- api:
3
- legacy: true # use AES algorithm
4
- # jwt enables json web token and disable legacy
5
- # jwt: https://github.com/auth0/node-jsonwebtoken#jwtsignpayload-secretorprivatekey-options-callback
6
- sign:
7
- expiresIn: 7d # 7 days by default
8
- # verify:
9
- web:
10
- sign:
11
- expiresIn: 7d # 7 days by default
12
- # verify: https://github.com/auth0/node-jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback
@@ -1,10 +0,0 @@
1
- security:
2
- api:
3
- legacy: true
4
- jwt:
5
- sign:
6
- expiresIn: 7d
7
- notBefore: 0
8
- web:
9
- sign:
10
- expiresIn: 7d
@@ -1,6 +0,0 @@
1
- security:
2
- api:
3
- jwt:
4
- sign:
5
- expiresIn: 7d
6
- notBefore: 0
@@ -1,3 +0,0 @@
1
- security:
2
- api:
3
- legacy: false
@@ -1,3 +0,0 @@
1
- security:
2
- api:
3
- legacy: true
@@ -1,9 +0,0 @@
1
- security:
2
- api:
3
- legacy: false
4
- sign:
5
- expiresIn: 7d
6
- notBefore: 0
7
- web:
8
- sign:
9
- expiresIn: 7d
@@ -1,9 +0,0 @@
1
- module.exports = function () {
2
- return {
3
- authenticate(user, pass, callback) {
4
- // https://verdaccio.org/docs/en/dev-plugins#onsuccess
5
- // this is a successful login and return a simple group
6
- callback(null, ['test']);
7
- },
8
- };
9
- };
@@ -1,5 +0,0 @@
1
- {
2
- "name": "verdaccio-access-ok",
3
- "main": "access.js",
4
- "version": "1.0.0"
5
- }
@@ -1,25 +0,0 @@
1
- module.exports = function () {
2
- return {
3
- authenticate(user, pass, callback) {
4
- // https://verdaccio.org/docs/en/dev-plugins#onsuccess
5
- // this is a successful login and return a simple group
6
- callback(null, ['test']);
7
- },
8
- adduser(user, password, cb) {
9
- if (user === 'fail') {
10
- return cb(Error('bad username'));
11
- }
12
-
13
- if (user === 'password') {
14
- return cb(Error('bad password'));
15
- }
16
-
17
- if (user === 'skip') {
18
- // if wants to the next plugin
19
- return cb(null, false);
20
- }
21
-
22
- cb(null, true);
23
- },
24
- };
25
- };
@@ -1,5 +0,0 @@
1
- {
2
- "name": "verdaccio-adduser",
3
- "main": "adduser.js",
4
- "version": "1.0.0"
5
- }
@@ -1,25 +0,0 @@
1
- module.exports = function () {
2
- return {
3
- authenticate(user, pass, callback) {
4
- // https://verdaccio.org/docs/en/dev-plugins#onsuccess
5
- // this is a successful login and return a simple group
6
- callback(null, ['test']);
7
- },
8
- add_user(user, password, cb) {
9
- if (user === 'fail') {
10
- return cb(Error('bad username'));
11
- }
12
-
13
- if (user === 'password') {
14
- return cb(Error('bad password'));
15
- }
16
-
17
- if (user === 'skip') {
18
- // if wants to the next plugin
19
- return cb(null, false);
20
- }
21
-
22
- cb(null, true);
23
- },
24
- };
25
- };
@@ -1,5 +0,0 @@
1
- {
2
- "name": "verdaccio-adduser-legacy",
3
- "main": "adduser.js",
4
- "version": "1.0.0"
5
- }
@@ -1,32 +0,0 @@
1
- module.exports = function () {
2
- return {
3
- users: [],
4
- authenticate(user, pass, callback) {
5
- // https://verdaccio.org/docs/en/dev-plugins#onsuccess
6
- // this is a successful login and return a simple group
7
- callback(null, ['test']);
8
- },
9
- changePassword(user, password, newPassword, cb) {
10
- if (password === newPassword) {
11
- return cb(Error('error password equal'));
12
- }
13
- return cb(null, true);
14
- },
15
- adduser(user, password, cb) {
16
- if (user === 'fail') {
17
- return cb(Error('bad username'));
18
- }
19
-
20
- if (user === 'password') {
21
- return cb(Error('bad password'));
22
- }
23
-
24
- if (user === 'skip') {
25
- // if wants to the next plugin
26
- return cb(null, false);
27
- }
28
-
29
- cb(null, true);
30
- },
31
- };
32
- };
@@ -1,5 +0,0 @@
1
- {
2
- "name": "verdaccio-change-password",
3
- "main": "change.js",
4
- "version": "1.0.0"
5
- }
@@ -1,14 +0,0 @@
1
- const { errorUtils } = require('@verdaccio/core');
2
-
3
- module.exports = function () {
4
- return {
5
- authenticate(user, pass, callback) {
6
- /* user and pass are used here to forward errors
7
- and success types respectively for testing purposes */
8
- callback(errorUtils.getInternalError(), false);
9
- },
10
- adduser(user, password, cb) {
11
- return cb(null, false);
12
- },
13
- };
14
- };
@@ -1,5 +0,0 @@
1
- {
2
- "name": "verdaccio-fail",
3
- "main": "fail.js",
4
- "version": "1.0.0"
5
- }
@@ -1,11 +0,0 @@
1
- const { errorUtils } = require('@verdaccio/core');
2
-
3
- module.exports = function () {
4
- return {
5
- authenticateFake(user, pass, callback) {
6
- /* user and pass are used here to forward errors
7
- and success types respectively for testing purposes */
8
- callback(errorUtils.getInternalError(), false);
9
- },
10
- };
11
- };
@@ -1,5 +0,0 @@
1
- {
2
- "name": "verdaccio-fail",
3
- "main": "fail.js",
4
- "version": "1.0.0"
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "verdaccio-passthroug",
3
- "main": "passthroug.js",
4
- "version": "1.0.0"
5
- }
@@ -1,9 +0,0 @@
1
- module.exports = function () {
2
- return {
3
- authenticate(user, pass, callback) {
4
- /* user and pass are used here to forward errors
5
- and success types respectively for testing purposes */
6
- callback(user, pass);
7
- },
8
- };
9
- };
@@ -1,5 +0,0 @@
1
- {
2
- "name": "verdaccio-success",
3
- "main": "success.js",
4
- "version": "1.0.0"
5
- }
@@ -1,9 +0,0 @@
1
- module.exports = function () {
2
- return {
3
- authenticate(user, pass, callback) {
4
- // https://verdaccio.org/docs/en/dev-plugins#onsuccess
5
- // this is a successful login and return a simple group
6
- callback(null, ['test']);
7
- },
8
- };
9
- };
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "compilerOptions": {
4
- "rootDir": "./src",
5
- "outDir": "./build",
6
- "noImplicitAny": false
7
- },
8
- "include": ["src/**/*"]
9
- }
package/tsconfig.json DELETED
@@ -1,32 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.reference",
3
- "compilerOptions": {
4
- "rootDir": "./src",
5
- "outDir": "./build",
6
- "noImplicitAny": true
7
- },
8
- "include": ["src/**/*.ts"],
9
- "references": [
10
- {
11
- "path": "../config"
12
- },
13
- {
14
- "path": "../plugins/htpasswd"
15
- },
16
- {
17
- "path": "../core/core"
18
- },
19
- {
20
- "path": "../loaders"
21
- },
22
- {
23
- "path": "../signature"
24
- },
25
- {
26
- "path": "../logger/logger"
27
- },
28
- {
29
- "path": "../utils"
30
- }
31
- ]
32
- }