@verdaccio/api 9.0.0-next-9.2 → 9.0.0-next-9.4
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/build/_virtual/_rolldown/runtime.js +23 -0
- package/build/dist-tags.d.ts +4 -4
- package/build/dist-tags.js +52 -124
- package/build/dist-tags.js.map +1 -1
- package/build/dist-tags.mjs +52 -0
- package/build/dist-tags.mjs.map +1 -0
- package/build/index.d.ts +4 -4
- package/build/index.js +61 -78
- package/build/index.js.map +1 -1
- package/build/index.mjs +59 -0
- package/build/index.mjs.map +1 -0
- package/build/package.d.ts +3 -3
- package/build/package.js +69 -120
- package/build/package.js.map +1 -1
- package/build/package.mjs +69 -0
- package/build/package.mjs.map +1 -0
- package/build/ping.d.ts +1 -1
- package/build/ping.js +10 -11
- package/build/ping.js.map +1 -1
- package/build/ping.mjs +11 -0
- package/build/ping.mjs.map +1 -0
- package/build/publish.d.ts +4 -4
- package/build/publish.js +192 -268
- package/build/publish.js.map +1 -1
- package/build/publish.mjs +196 -0
- package/build/publish.mjs.map +1 -0
- package/build/search.d.ts +1 -1
- package/build/search.js +13 -17
- package/build/search.js.map +1 -1
- package/build/search.mjs +14 -0
- package/build/search.mjs.map +1 -0
- package/build/stars.d.ts +2 -2
- package/build/stars.js +21 -59
- package/build/stars.js.map +1 -1
- package/build/stars.mjs +21 -0
- package/build/stars.mjs.map +1 -0
- package/build/user.d.ts +3 -3
- package/build/user.js +106 -188
- package/build/user.js.map +1 -1
- package/build/user.mjs +106 -0
- package/build/user.mjs.map +1 -0
- package/build/v1/login.d.ts +4 -4
- package/build/v1/login.js +115 -246
- package/build/v1/login.js.map +1 -1
- package/build/v1/login.mjs +115 -0
- package/build/v1/login.mjs.map +1 -0
- package/build/v1/profile.d.ts +3 -3
- package/build/v1/profile.js +45 -67
- package/build/v1/profile.js.map +1 -1
- package/build/v1/profile.mjs +45 -0
- package/build/v1/profile.mjs.map +1 -0
- package/build/v1/search.d.ts +3 -3
- package/build/v1/search.js +64 -113
- package/build/v1/search.js.map +1 -1
- package/build/v1/search.mjs +64 -0
- package/build/v1/search.mjs.map +1 -0
- package/build/v1/token.d.ts +4 -4
- package/build/v1/token.js +100 -201
- package/build/v1/token.js.map +1 -1
- package/build/v1/token.mjs +102 -0
- package/build/v1/token.mjs.map +1 -0
- package/build/whoami.d.ts +1 -1
- package/build/whoami.js +20 -25
- package/build/whoami.js.map +1 -1
- package/build/whoami.mjs +20 -0
- package/build/whoami.mjs.map +1 -0
- package/package.json +25 -14
package/build/user.js
CHANGED
|
@@ -1,190 +1,108 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
token: token
|
|
105
|
-
}));
|
|
106
|
-
}
|
|
107
|
-
}, _callee);
|
|
108
|
-
}));
|
|
109
|
-
function callbackAuthenticate(_x, _x2) {
|
|
110
|
-
return _callbackAuthenticate.apply(this, arguments);
|
|
111
|
-
}
|
|
112
|
-
return callbackAuthenticate;
|
|
113
|
-
}());
|
|
114
|
-
} else {
|
|
115
|
-
var _config$server;
|
|
116
|
-
debug('adduser: %o', name);
|
|
117
|
-
if (_core.validationUtils.validatePassword(password, config === null || config === void 0 || (_config$server = config.server) === null || _config$server === void 0 ? void 0 : _config$server.passwordValidationRegex) === false) {
|
|
118
|
-
debug('adduser: invalid password');
|
|
119
|
-
return next(_core.errorUtils.getCode(_core.HTTP_STATUS.BAD_REQUEST, _core.API_ERROR.PASSWORD_SHORT));
|
|
120
|
-
}
|
|
121
|
-
auth.add_user(name, password, /*#__PURE__*/function () {
|
|
122
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(err, user) {
|
|
123
|
-
var token, _t;
|
|
124
|
-
return _regenerator().w(function (_context2) {
|
|
125
|
-
while (1) switch (_context2.n) {
|
|
126
|
-
case 0:
|
|
127
|
-
if (!err) {
|
|
128
|
-
_context2.n = 2;
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
if (!(err.status >= _core.HTTP_STATUS.BAD_REQUEST && err.status < _core.HTTP_STATUS.INTERNAL_ERROR)) {
|
|
132
|
-
_context2.n = 1;
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
debug('adduser: error on create user');
|
|
136
|
-
// With npm registering is the same as logging in,
|
|
137
|
-
// and npm accepts only an 409 error.
|
|
138
|
-
// So, changing status code here.
|
|
139
|
-
return _context2.a(2, next(_core.errorUtils.getCode(err.status, err.message) || _core.errorUtils.getConflict(err.message)));
|
|
140
|
-
case 1:
|
|
141
|
-
return _context2.a(2, next(err));
|
|
142
|
-
case 2:
|
|
143
|
-
if (!(name && password)) {
|
|
144
|
-
_context2.n = 4;
|
|
145
|
-
break;
|
|
146
|
-
}
|
|
147
|
-
_context2.n = 3;
|
|
148
|
-
return (0, _auth.getApiToken)(auth, config, user, password);
|
|
149
|
-
case 3:
|
|
150
|
-
_t = _context2.v;
|
|
151
|
-
_context2.n = 5;
|
|
152
|
-
break;
|
|
153
|
-
case 4:
|
|
154
|
-
_t = undefined;
|
|
155
|
-
case 5:
|
|
156
|
-
token = _t;
|
|
157
|
-
if (token) {
|
|
158
|
-
debug('adduser: new token %o', _core.cryptoUtils.mask(token, 4));
|
|
159
|
-
}
|
|
160
|
-
if (token) {
|
|
161
|
-
_context2.n = 6;
|
|
162
|
-
break;
|
|
163
|
-
}
|
|
164
|
-
return _context2.a(2, next(_core.errorUtils.getUnauthorized()));
|
|
165
|
-
case 6:
|
|
166
|
-
req.remote_user = user;
|
|
167
|
-
res.status(_core.HTTP_STATUS.CREATED);
|
|
168
|
-
res.set(_core.HEADERS.CACHE_CONTROL, 'no-cache, no-store');
|
|
169
|
-
debug('adduser: user has been created');
|
|
170
|
-
return _context2.a(2, next({
|
|
171
|
-
ok: "user '".concat(req.body.name, "' created"),
|
|
172
|
-
token: token
|
|
173
|
-
}));
|
|
174
|
-
}
|
|
175
|
-
}, _callee2);
|
|
176
|
-
}));
|
|
177
|
-
return function (_x3, _x4) {
|
|
178
|
-
return _ref.apply(this, arguments);
|
|
179
|
-
};
|
|
180
|
-
}());
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
route["delete"](_middleware.USER_API_ENDPOINTS.user_token, function (req, res, next) {
|
|
184
|
-
res.status(_core.HTTP_STATUS.OK);
|
|
185
|
-
next({
|
|
186
|
-
ok: _core.API_MESSAGE.LOGGED_OUT
|
|
187
|
-
});
|
|
188
|
-
});
|
|
1
|
+
const require_runtime = require("./_virtual/_rolldown/runtime.js");
|
|
2
|
+
let debug = require("debug");
|
|
3
|
+
debug = require_runtime.__toESM(debug);
|
|
4
|
+
let _verdaccio_middleware = require("@verdaccio/middleware");
|
|
5
|
+
let _verdaccio_core = require("@verdaccio/core");
|
|
6
|
+
let _verdaccio_auth = require("@verdaccio/auth");
|
|
7
|
+
let _verdaccio_config = require("@verdaccio/config");
|
|
8
|
+
//#region src/user.ts
|
|
9
|
+
var debug$1 = (0, debug.default)("verdaccio:api:user");
|
|
10
|
+
function user_default(route, auth, config, logger) {
|
|
11
|
+
route.get(_verdaccio_middleware.USER_API_ENDPOINTS.get_user, (0, _verdaccio_middleware.rateLimit)(config?.userRateLimit), function(req, res, next) {
|
|
12
|
+
debug$1("verifying user");
|
|
13
|
+
if (!req.remote_user || typeof req.remote_user.name !== "string" || req.remote_user.name === "") {
|
|
14
|
+
debug$1("user not logged in");
|
|
15
|
+
res.status(_verdaccio_core.HTTP_STATUS.OK);
|
|
16
|
+
return next({ ok: false });
|
|
17
|
+
}
|
|
18
|
+
const username = req.params.org_couchdb_user.split(":")[1];
|
|
19
|
+
const message = _verdaccio_core.authUtils.getAuthenticatedMessage(req.remote_user.name);
|
|
20
|
+
debug$1("user authenticated message %o", message);
|
|
21
|
+
res.status(_verdaccio_core.HTTP_STATUS.OK);
|
|
22
|
+
next({
|
|
23
|
+
name: username,
|
|
24
|
+
email: "",
|
|
25
|
+
ok: message
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* body example
|
|
31
|
+
* req.body = {
|
|
32
|
+
_id: "org.couchdb.user:jjjj",
|
|
33
|
+
name: "jjjj",
|
|
34
|
+
password: "jjjj",
|
|
35
|
+
type: "user",
|
|
36
|
+
roles: [],
|
|
37
|
+
date: "2022-07-08T15:51:04.002Z",
|
|
38
|
+
}
|
|
39
|
+
*
|
|
40
|
+
* @export
|
|
41
|
+
* @param {Router} route
|
|
42
|
+
* @param {Auth} auth
|
|
43
|
+
* @param {Config} config
|
|
44
|
+
*/
|
|
45
|
+
route.put(_verdaccio_middleware.USER_API_ENDPOINTS.add_user, (0, _verdaccio_middleware.rateLimit)(config?.userRateLimit), function(req, res, next) {
|
|
46
|
+
const { name, password } = req.body;
|
|
47
|
+
debug$1("login or adduser");
|
|
48
|
+
const remoteName = req?.remote_user?.name;
|
|
49
|
+
if (!_verdaccio_core.validationUtils.validateUserName(req.params.org_couchdb_user, name)) return next(_verdaccio_core.errorUtils.getBadRequest(_verdaccio_core.API_ERROR.USERNAME_MISMATCH));
|
|
50
|
+
if (typeof remoteName !== "undefined" && typeof name === "string" && remoteName === name) {
|
|
51
|
+
debug$1("login: no remote user detected");
|
|
52
|
+
auth.authenticate(name, password, async function callbackAuthenticate(err, user) {
|
|
53
|
+
if (err) {
|
|
54
|
+
logger.trace({
|
|
55
|
+
name,
|
|
56
|
+
err
|
|
57
|
+
}, "authenticating for user @{username} failed. Error: @{err.message}");
|
|
58
|
+
return next(_verdaccio_core.errorUtils.getCode(_verdaccio_core.HTTP_STATUS.UNAUTHORIZED, _verdaccio_core.API_ERROR.BAD_USERNAME_PASSWORD));
|
|
59
|
+
}
|
|
60
|
+
const token = await (0, _verdaccio_auth.getApiToken)(auth, config, (0, _verdaccio_config.createRemoteUser)(name, user?.groups || []), password);
|
|
61
|
+
debug$1("login: new token");
|
|
62
|
+
if (!token) return next(_verdaccio_core.errorUtils.getUnauthorized());
|
|
63
|
+
res.status(_verdaccio_core.HTTP_STATUS.CREATED);
|
|
64
|
+
res.set(_verdaccio_core.HEADERS.CACHE_CONTROL, "no-cache, no-store");
|
|
65
|
+
const message = _verdaccio_core.authUtils.getAuthenticatedMessage(req.remote_user.name);
|
|
66
|
+
debug$1("login: created user message %o", message);
|
|
67
|
+
return next({
|
|
68
|
+
ok: message,
|
|
69
|
+
token
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
} else {
|
|
73
|
+
debug$1("adduser: %o", name);
|
|
74
|
+
if (_verdaccio_core.validationUtils.validatePassword(password, config?.server?.passwordValidationRegex) === false) {
|
|
75
|
+
debug$1("adduser: invalid password");
|
|
76
|
+
return next(_verdaccio_core.errorUtils.getCode(_verdaccio_core.HTTP_STATUS.BAD_REQUEST, _verdaccio_core.API_ERROR.PASSWORD_SHORT));
|
|
77
|
+
}
|
|
78
|
+
auth.add_user(name, password, async function(err, user) {
|
|
79
|
+
if (err) {
|
|
80
|
+
if (err.status >= _verdaccio_core.HTTP_STATUS.BAD_REQUEST && err.status < _verdaccio_core.HTTP_STATUS.INTERNAL_ERROR) {
|
|
81
|
+
debug$1("adduser: error on create user");
|
|
82
|
+
return next(_verdaccio_core.errorUtils.getCode(err.status, err.message) || _verdaccio_core.errorUtils.getConflict(err.message));
|
|
83
|
+
}
|
|
84
|
+
return next(err);
|
|
85
|
+
}
|
|
86
|
+
const token = name && password ? await (0, _verdaccio_auth.getApiToken)(auth, config, user, password) : void 0;
|
|
87
|
+
if (token) debug$1("adduser: new token %o", _verdaccio_core.cryptoUtils.mask(token, 4));
|
|
88
|
+
if (!token) return next(_verdaccio_core.errorUtils.getUnauthorized());
|
|
89
|
+
req.remote_user = user;
|
|
90
|
+
res.status(_verdaccio_core.HTTP_STATUS.CREATED);
|
|
91
|
+
res.set(_verdaccio_core.HEADERS.CACHE_CONTROL, "no-cache, no-store");
|
|
92
|
+
debug$1("adduser: user has been created");
|
|
93
|
+
return next({
|
|
94
|
+
ok: `user '${req.body.name}' created`,
|
|
95
|
+
token
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
route.delete(_verdaccio_middleware.USER_API_ENDPOINTS.user_token, function(req, res, next) {
|
|
101
|
+
res.status(_verdaccio_core.HTTP_STATUS.OK);
|
|
102
|
+
next({ ok: _verdaccio_core.API_MESSAGE.LOGGED_OUT });
|
|
103
|
+
});
|
|
189
104
|
}
|
|
105
|
+
//#endregion
|
|
106
|
+
exports.default = user_default;
|
|
107
|
+
|
|
190
108
|
//# sourceMappingURL=user.js.map
|
package/build/user.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","names":["_debug","_interopRequireDefault","require","_auth","_config","_core","_middleware","e","__esModule","_regenerator","t","r","Symbol","n","iterator","o","toStringTag","i","c","prototype","Generator","u","Object","create","_regeneratorDefine2","f","p","y","G","v","a","d","bind","length","l","TypeError","call","done","value","GeneratorFunction","GeneratorFunctionPrototype","getPrototypeOf","setPrototypeOf","__proto__","displayName","w","m","defineProperty","_regeneratorDefine","_invoke","enumerable","configurable","writable","asyncGeneratorStep","Promise","resolve","then","_asyncToGenerator","arguments","apply","_next","_throw","debug","buildDebug","_default","route","auth","config","logger","get","USER_API_ENDPOINTS","get_user","rateLimit","userRateLimit","req","res","next","remote_user","name","status","HTTP_STATUS","OK","ok","username","params","org_couchdb_user","split","message","authUtils","getAuthenticatedMessage","email","put","add_user","_req$remote_user","_req$body","body","password","remoteName","validationUtils","validateUserName","errorUtils","getBadRequest","API_ERROR","USERNAME_MISMATCH","authenticate","_callbackAuthenticate","_callee","err","user","restoredRemoteUser","token","_context","trace","getCode","UNAUTHORIZED","BAD_USERNAME_PASSWORD","createRemoteUser","groups","getApiToken","getUnauthorized","CREATED","set","HEADERS","CACHE_CONTROL","callbackAuthenticate","_x","_x2","_config$server","validatePassword","server","passwordValidationRegex","BAD_REQUEST","PASSWORD_SHORT","_ref","_callee2","_t","_context2","INTERNAL_ERROR","getConflict","undefined","cryptoUtils","mask","concat","_x3","_x4","user_token","API_MESSAGE","LOGGED_OUT"],"sources":["../src/user.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport type { Response, Router } from 'express';\n\nimport type { Auth } from '@verdaccio/auth';\nimport { getApiToken } from '@verdaccio/auth';\nimport { createRemoteUser } from '@verdaccio/config';\nimport {\n API_ERROR,\n API_MESSAGE,\n HEADERS,\n HTTP_STATUS,\n authUtils,\n cryptoUtils,\n errorUtils,\n validationUtils,\n} from '@verdaccio/core';\nimport { USER_API_ENDPOINTS, rateLimit } from '@verdaccio/middleware';\nimport type { Config, Logger, RemoteUser } from '@verdaccio/types';\n\nimport type { $NextFunctionVer, $RequestExtend } from '../types/custom';\n\nconst debug = buildDebug('verdaccio:api:user');\n\nexport default function (route: Router, auth: Auth, config: Config, logger: Logger): void {\n route.get(\n USER_API_ENDPOINTS.get_user,\n rateLimit(config?.userRateLimit),\n function (req: $RequestExtend, res: Response, next: $NextFunctionVer): void {\n debug('verifying user');\n\n if (\n !req.remote_user ||\n typeof req.remote_user.name !== 'string' ||\n req.remote_user.name === ''\n ) {\n debug('user not logged in');\n res.status(HTTP_STATUS.OK);\n return next({ ok: false });\n }\n\n const username = req.params.org_couchdb_user.split(':')[1];\n const message = authUtils.getAuthenticatedMessage(req.remote_user.name);\n debug('user authenticated message %o', message);\n res.status(HTTP_STATUS.OK);\n next({\n // 'npm owner' requires user info\n // TODO: we don't have the email\n name: username,\n email: '',\n ok: message,\n });\n }\n );\n\n /**\n * \n * body example\n * req.body = {\n _id: \"org.couchdb.user:jjjj\",\n name: \"jjjj\",\n password: \"jjjj\",\n type: \"user\",\n roles: [],\n date: \"2022-07-08T15:51:04.002Z\",\n }\n * \n * @export\n * @param {Router} route\n * @param {Auth} auth\n * @param {Config} config\n */\n route.put(\n USER_API_ENDPOINTS.add_user,\n rateLimit(config?.userRateLimit),\n function (req: $RequestExtend, res: Response, next: $NextFunctionVer): void {\n const { name, password } = req.body;\n debug('login or adduser');\n const remoteName = req?.remote_user?.name;\n\n if (!validationUtils.validateUserName(req.params.org_couchdb_user, name)) {\n return next(errorUtils.getBadRequest(API_ERROR.USERNAME_MISMATCH));\n }\n\n if (typeof remoteName !== 'undefined' && typeof name === 'string' && remoteName === name) {\n debug('login: no remote user detected');\n auth.authenticate(\n name,\n password,\n async function callbackAuthenticate(err, user): Promise<void> {\n if (err) {\n logger.trace(\n { name, err },\n 'authenticating for user @{username} failed. Error: @{err.message}'\n );\n return next(\n errorUtils.getCode(HTTP_STATUS.UNAUTHORIZED, API_ERROR.BAD_USERNAME_PASSWORD)\n );\n }\n\n const restoredRemoteUser: RemoteUser = createRemoteUser(name, user?.groups || []);\n const token = await getApiToken(auth, config, restoredRemoteUser, password);\n debug('login: new token');\n if (!token) {\n return next(errorUtils.getUnauthorized());\n }\n\n res.status(HTTP_STATUS.CREATED);\n res.set(HEADERS.CACHE_CONTROL, 'no-cache, no-store');\n\n const message = authUtils.getAuthenticatedMessage(req.remote_user.name);\n debug('login: created user message %o', message);\n\n return next({\n ok: message,\n token,\n });\n }\n );\n } else {\n debug('adduser: %o', name);\n if (\n validationUtils.validatePassword(password, config?.server?.passwordValidationRegex) ===\n false\n ) {\n debug('adduser: invalid password');\n\n return next(errorUtils.getCode(HTTP_STATUS.BAD_REQUEST, API_ERROR.PASSWORD_SHORT));\n }\n\n auth.add_user(name, password, async function (err, user): Promise<void> {\n if (err) {\n if (err.status >= HTTP_STATUS.BAD_REQUEST && err.status < HTTP_STATUS.INTERNAL_ERROR) {\n debug('adduser: error on create user');\n // With npm registering is the same as logging in,\n // and npm accepts only an 409 error.\n // So, changing status code here.\n return next(\n errorUtils.getCode(err.status, err.message) || errorUtils.getConflict(err.message)\n );\n }\n return next(err);\n }\n\n const token =\n name && password\n ? await getApiToken(auth, config, user as RemoteUser, password)\n : undefined;\n if (token) {\n debug('adduser: new token %o', cryptoUtils.mask(token as string, 4));\n }\n if (!token) {\n return next(errorUtils.getUnauthorized());\n }\n\n req.remote_user = user;\n res.status(HTTP_STATUS.CREATED);\n res.set(HEADERS.CACHE_CONTROL, 'no-cache, no-store');\n debug('adduser: user has been created');\n return next({\n ok: `user '${req.body.name}' created`,\n token,\n });\n });\n }\n }\n );\n\n route.delete(\n USER_API_ENDPOINTS.user_token,\n function (req: $RequestExtend, res: Response, next: $NextFunctionVer): void {\n res.status(HTTP_STATUS.OK);\n next({\n ok: API_MESSAGE.LOGGED_OUT,\n });\n }\n );\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAUA,IAAAI,WAAA,GAAAJ,OAAA;AAAsE,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAAA,SAAAE,aAAA,IAftE,uKAAAF,CAAA,EAAAG,CAAA,EAAAC,CAAA,wBAAAC,MAAA,GAAAA,MAAA,OAAAC,CAAA,GAAAF,CAAA,CAAAG,QAAA,kBAAAC,CAAA,GAAAJ,CAAA,CAAAK,WAAA,8BAAAC,EAAAN,CAAA,EAAAE,CAAA,EAAAE,CAAA,EAAAE,CAAA,QAAAC,CAAA,GAAAL,CAAA,IAAAA,CAAA,CAAAM,SAAA,YAAAC,SAAA,GAAAP,CAAA,GAAAO,SAAA,EAAAC,CAAA,GAAAC,MAAA,CAAAC,MAAA,CAAAL,CAAA,CAAAC,SAAA,UAAAK,mBAAA,CAAAH,CAAA,uBAAAV,CAAA,EAAAE,CAAA,EAAAE,CAAA,QAAAE,CAAA,EAAAC,CAAA,EAAAG,CAAA,EAAAI,CAAA,MAAAC,CAAA,GAAAX,CAAA,QAAAY,CAAA,OAAAC,CAAA,KAAAF,CAAA,KAAAb,CAAA,KAAAgB,CAAA,EAAAtB,CAAA,EAAAuB,CAAA,EAAAC,CAAA,EAAAN,CAAA,EAAAM,CAAA,CAAAC,IAAA,CAAAzB,CAAA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AwB,QAAA;QAAA,CACH;QAAA,iBAAAS,GAAA,EAAAC,GAAA;UAAA,OAAAX,IAAA,CAAA1E,KAAA,OAAAD,SAAA;QAAA;MAAA,IAAC;IACJ;EACF,CACF,CAAC;EAEDO,KAAK,UAAO,CACVK,8BAAkB,CAAC2E,UAAU,EAC7B,UAAUvE,GAAmB,EAAEC,GAAa,EAAEC,IAAsB,EAAQ;IAC1ED,GAAG,CAACI,MAAM,CAACC,iBAAW,CAACC,EAAE,CAAC;IAC1BL,IAAI,CAAC;MACHM,EAAE,EAAEgE,iBAAW,CAACC;IAClB,CAAC,CAAC;EACJ,CACF,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"user.js","names":[],"sources":["../src/user.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport type { Response, Router } from 'express';\n\nimport type { Auth } from '@verdaccio/auth';\nimport { getApiToken } from '@verdaccio/auth';\nimport { createRemoteUser } from '@verdaccio/config';\nimport {\n API_ERROR,\n API_MESSAGE,\n HEADERS,\n HTTP_STATUS,\n authUtils,\n cryptoUtils,\n errorUtils,\n validationUtils,\n} from '@verdaccio/core';\nimport { USER_API_ENDPOINTS, rateLimit } from '@verdaccio/middleware';\nimport type { Config, Logger, RemoteUser } from '@verdaccio/types';\n\nimport type { $NextFunctionVer, $RequestExtend } from '../types/custom';\n\nconst debug = buildDebug('verdaccio:api:user');\n\nexport default function (route: Router, auth: Auth, config: Config, logger: Logger): void {\n route.get(\n USER_API_ENDPOINTS.get_user,\n rateLimit(config?.userRateLimit),\n function (req: $RequestExtend, res: Response, next: $NextFunctionVer): void {\n debug('verifying user');\n\n if (\n !req.remote_user ||\n typeof req.remote_user.name !== 'string' ||\n req.remote_user.name === ''\n ) {\n debug('user not logged in');\n res.status(HTTP_STATUS.OK);\n return next({ ok: false });\n }\n\n const username = req.params.org_couchdb_user.split(':')[1];\n const message = authUtils.getAuthenticatedMessage(req.remote_user.name);\n debug('user authenticated message %o', message);\n res.status(HTTP_STATUS.OK);\n next({\n // 'npm owner' requires user info\n // TODO: we don't have the email\n name: username,\n email: '',\n ok: message,\n });\n }\n );\n\n /**\n * \n * body example\n * req.body = {\n _id: \"org.couchdb.user:jjjj\",\n name: \"jjjj\",\n password: \"jjjj\",\n type: \"user\",\n roles: [],\n date: \"2022-07-08T15:51:04.002Z\",\n }\n * \n * @export\n * @param {Router} route\n * @param {Auth} auth\n * @param {Config} config\n */\n route.put(\n USER_API_ENDPOINTS.add_user,\n rateLimit(config?.userRateLimit),\n function (req: $RequestExtend, res: Response, next: $NextFunctionVer): void {\n const { name, password } = req.body;\n debug('login or adduser');\n const remoteName = req?.remote_user?.name;\n\n if (!validationUtils.validateUserName(req.params.org_couchdb_user, name)) {\n return next(errorUtils.getBadRequest(API_ERROR.USERNAME_MISMATCH));\n }\n\n if (typeof remoteName !== 'undefined' && typeof name === 'string' && remoteName === name) {\n debug('login: no remote user detected');\n auth.authenticate(\n name,\n password,\n async function callbackAuthenticate(err, user): Promise<void> {\n if (err) {\n logger.trace(\n { name, err },\n 'authenticating for user @{username} failed. Error: @{err.message}'\n );\n return next(\n errorUtils.getCode(HTTP_STATUS.UNAUTHORIZED, API_ERROR.BAD_USERNAME_PASSWORD)\n );\n }\n\n const restoredRemoteUser: RemoteUser = createRemoteUser(name, user?.groups || []);\n const token = await getApiToken(auth, config, restoredRemoteUser, password);\n debug('login: new token');\n if (!token) {\n return next(errorUtils.getUnauthorized());\n }\n\n res.status(HTTP_STATUS.CREATED);\n res.set(HEADERS.CACHE_CONTROL, 'no-cache, no-store');\n\n const message = authUtils.getAuthenticatedMessage(req.remote_user.name);\n debug('login: created user message %o', message);\n\n return next({\n ok: message,\n token,\n });\n }\n );\n } else {\n debug('adduser: %o', name);\n if (\n validationUtils.validatePassword(password, config?.server?.passwordValidationRegex) ===\n false\n ) {\n debug('adduser: invalid password');\n\n return next(errorUtils.getCode(HTTP_STATUS.BAD_REQUEST, API_ERROR.PASSWORD_SHORT));\n }\n\n auth.add_user(name, password, async function (err, user): Promise<void> {\n if (err) {\n if (err.status >= HTTP_STATUS.BAD_REQUEST && err.status < HTTP_STATUS.INTERNAL_ERROR) {\n debug('adduser: error on create user');\n // With npm registering is the same as logging in,\n // and npm accepts only an 409 error.\n // So, changing status code here.\n return next(\n errorUtils.getCode(err.status, err.message) || errorUtils.getConflict(err.message)\n );\n }\n return next(err);\n }\n\n const token =\n name && password\n ? await getApiToken(auth, config, user as RemoteUser, password)\n : undefined;\n if (token) {\n debug('adduser: new token %o', cryptoUtils.mask(token as string, 4));\n }\n if (!token) {\n return next(errorUtils.getUnauthorized());\n }\n\n req.remote_user = user;\n res.status(HTTP_STATUS.CREATED);\n res.set(HEADERS.CACHE_CONTROL, 'no-cache, no-store');\n debug('adduser: user has been created');\n return next({\n ok: `user '${req.body.name}' created`,\n token,\n });\n });\n }\n }\n );\n\n route.delete(\n USER_API_ENDPOINTS.user_token,\n function (req: $RequestExtend, res: Response, next: $NextFunctionVer): void {\n res.status(HTTP_STATUS.OK);\n next({\n ok: API_MESSAGE.LOGGED_OUT,\n });\n }\n );\n}\n"],"mappings":";;;;;;;;AAqBA,IAAM,WAAA,GAAA,MAAA,SAAmB,qBAAqB;AAE9C,SAAA,aAAyB,OAAe,MAAY,QAAgB,QAAsB;AACxF,OAAM,IACJ,sBAAA,mBAAmB,WAAA,GAAA,sBAAA,WACT,QAAQ,cAAc,EAChC,SAAU,KAAqB,KAAe,MAA8B;AAC1E,UAAM,iBAAiB;AAEvB,MACE,CAAC,IAAI,eACL,OAAO,IAAI,YAAY,SAAS,YAChC,IAAI,YAAY,SAAS,IACzB;AACA,WAAM,qBAAqB;AAC3B,OAAI,OAAO,gBAAA,YAAY,GAAG;AAC1B,UAAO,KAAK,EAAE,IAAI,OAAO,CAAC;;EAG5B,MAAM,WAAW,IAAI,OAAO,iBAAiB,MAAM,IAAI,CAAC;EACxD,MAAM,UAAU,gBAAA,UAAU,wBAAwB,IAAI,YAAY,KAAK;AACvE,UAAM,iCAAiC,QA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B,UAAU,QAAQ,QAAQ,wBAAwB,KACnF,OACA;AACA,YAAM,4BAA4B;AAElC,WAAO,KAAK,gBAAA,WAAW,QAAQ,gBAAA,YAAY,aAAa,gBAAA,UAAU,eAAe,CAAC;;AAGpF,QAAK,SAAS,MAAM,UAAU,eAAgB,KAAK,MAAqB;AACtE,QAAI,KAAK;AACP,SAAI,IAAI,UAAU,gBAAA,YAAY,eAAe,IAAI,SAAS,gBAAA,YAAY,gBAAgB;AACpF,cAAM,gCAAgC;AAItC,aAAO,KACL,gBAAA,WAAW,QAAQ,IAAI,QAAQ,IAAI,QAAQ,IAAI,gBAAA,WAAW,YAAY,IAAI,QAAQ,CACnF;;AAEH,YAAO,KAAK,IAAI;;IAGlB,MAAM,QACJ,QAAQ,WACJ,OAAA,GAAA,gBAAA,aAAkB,MAAM,QAAQ,MAAoB,SAAS,GAC7D,KAAA;AACN,QAAI,MACF,SAAM,yBAAyB,gBAAA,YAAY,KAAK,OAAiB,EAAE,CAAC;AAEtE,QAAI,CAAC,MACH,QAAO,KAAK,gBAAA,WAAW,iBAAiB,CAAC;AAG3C,QAAI,cAAc;AAClB,QAAI,OAAO,gBAAA,YAAY,QAAQ;AAC/B,QAAI,IAAI,gBAAA,QAAQ,eAAe,qBAAqB;AACpD,YAAM,iCAAiC;AACvC,WAAO,KAAK;KACV,IAAI,SAAS,IAAI,KAAK,KAAK;KAC3B;KACD,CAAC;KACF;;GAGP;AAED,OAAM,OACJ,sBAAA,mBAAmB,YACnB,SAAU,KAAqB,KAAe,MAA8B;AAC1E,MAAI,OAAO,gBAAA,YAAY,GAAG;AAC1B,OAAK,EACH,IAAI,gBAAA,YAAY,YACjB,CAAC;GAEL"}
|
package/build/user.mjs
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import buildDebug from "debug";
|
|
2
|
+
import { USER_API_ENDPOINTS, rateLimit } from "@verdaccio/middleware";
|
|
3
|
+
import { API_ERROR, API_MESSAGE, HEADERS, HTTP_STATUS, authUtils, cryptoUtils, errorUtils, validationUtils } from "@verdaccio/core";
|
|
4
|
+
import { getApiToken } from "@verdaccio/auth";
|
|
5
|
+
import { createRemoteUser } from "@verdaccio/config";
|
|
6
|
+
//#region src/user.ts
|
|
7
|
+
var debug = buildDebug("verdaccio:api:user");
|
|
8
|
+
function user_default(route, auth, config, logger) {
|
|
9
|
+
route.get(USER_API_ENDPOINTS.get_user, rateLimit(config?.userRateLimit), function(req, res, next) {
|
|
10
|
+
debug("verifying user");
|
|
11
|
+
if (!req.remote_user || typeof req.remote_user.name !== "string" || req.remote_user.name === "") {
|
|
12
|
+
debug("user not logged in");
|
|
13
|
+
res.status(HTTP_STATUS.OK);
|
|
14
|
+
return next({ ok: false });
|
|
15
|
+
}
|
|
16
|
+
const username = req.params.org_couchdb_user.split(":")[1];
|
|
17
|
+
const message = authUtils.getAuthenticatedMessage(req.remote_user.name);
|
|
18
|
+
debug("user authenticated message %o", message);
|
|
19
|
+
res.status(HTTP_STATUS.OK);
|
|
20
|
+
next({
|
|
21
|
+
name: username,
|
|
22
|
+
email: "",
|
|
23
|
+
ok: message
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* body example
|
|
29
|
+
* req.body = {
|
|
30
|
+
_id: "org.couchdb.user:jjjj",
|
|
31
|
+
name: "jjjj",
|
|
32
|
+
password: "jjjj",
|
|
33
|
+
type: "user",
|
|
34
|
+
roles: [],
|
|
35
|
+
date: "2022-07-08T15:51:04.002Z",
|
|
36
|
+
}
|
|
37
|
+
*
|
|
38
|
+
* @export
|
|
39
|
+
* @param {Router} route
|
|
40
|
+
* @param {Auth} auth
|
|
41
|
+
* @param {Config} config
|
|
42
|
+
*/
|
|
43
|
+
route.put(USER_API_ENDPOINTS.add_user, rateLimit(config?.userRateLimit), function(req, res, next) {
|
|
44
|
+
const { name, password } = req.body;
|
|
45
|
+
debug("login or adduser");
|
|
46
|
+
const remoteName = req?.remote_user?.name;
|
|
47
|
+
if (!validationUtils.validateUserName(req.params.org_couchdb_user, name)) return next(errorUtils.getBadRequest(API_ERROR.USERNAME_MISMATCH));
|
|
48
|
+
if (typeof remoteName !== "undefined" && typeof name === "string" && remoteName === name) {
|
|
49
|
+
debug("login: no remote user detected");
|
|
50
|
+
auth.authenticate(name, password, async function callbackAuthenticate(err, user) {
|
|
51
|
+
if (err) {
|
|
52
|
+
logger.trace({
|
|
53
|
+
name,
|
|
54
|
+
err
|
|
55
|
+
}, "authenticating for user @{username} failed. Error: @{err.message}");
|
|
56
|
+
return next(errorUtils.getCode(HTTP_STATUS.UNAUTHORIZED, API_ERROR.BAD_USERNAME_PASSWORD));
|
|
57
|
+
}
|
|
58
|
+
const token = await getApiToken(auth, config, createRemoteUser(name, user?.groups || []), password);
|
|
59
|
+
debug("login: new token");
|
|
60
|
+
if (!token) return next(errorUtils.getUnauthorized());
|
|
61
|
+
res.status(HTTP_STATUS.CREATED);
|
|
62
|
+
res.set(HEADERS.CACHE_CONTROL, "no-cache, no-store");
|
|
63
|
+
const message = authUtils.getAuthenticatedMessage(req.remote_user.name);
|
|
64
|
+
debug("login: created user message %o", message);
|
|
65
|
+
return next({
|
|
66
|
+
ok: message,
|
|
67
|
+
token
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
} else {
|
|
71
|
+
debug("adduser: %o", name);
|
|
72
|
+
if (validationUtils.validatePassword(password, config?.server?.passwordValidationRegex) === false) {
|
|
73
|
+
debug("adduser: invalid password");
|
|
74
|
+
return next(errorUtils.getCode(HTTP_STATUS.BAD_REQUEST, API_ERROR.PASSWORD_SHORT));
|
|
75
|
+
}
|
|
76
|
+
auth.add_user(name, password, async function(err, user) {
|
|
77
|
+
if (err) {
|
|
78
|
+
if (err.status >= HTTP_STATUS.BAD_REQUEST && err.status < HTTP_STATUS.INTERNAL_ERROR) {
|
|
79
|
+
debug("adduser: error on create user");
|
|
80
|
+
return next(errorUtils.getCode(err.status, err.message) || errorUtils.getConflict(err.message));
|
|
81
|
+
}
|
|
82
|
+
return next(err);
|
|
83
|
+
}
|
|
84
|
+
const token = name && password ? await getApiToken(auth, config, user, password) : void 0;
|
|
85
|
+
if (token) debug("adduser: new token %o", cryptoUtils.mask(token, 4));
|
|
86
|
+
if (!token) return next(errorUtils.getUnauthorized());
|
|
87
|
+
req.remote_user = user;
|
|
88
|
+
res.status(HTTP_STATUS.CREATED);
|
|
89
|
+
res.set(HEADERS.CACHE_CONTROL, "no-cache, no-store");
|
|
90
|
+
debug("adduser: user has been created");
|
|
91
|
+
return next({
|
|
92
|
+
ok: `user '${req.body.name}' created`,
|
|
93
|
+
token
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
route.delete(USER_API_ENDPOINTS.user_token, function(req, res, next) {
|
|
99
|
+
res.status(HTTP_STATUS.OK);
|
|
100
|
+
next({ ok: API_MESSAGE.LOGGED_OUT });
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
//#endregion
|
|
104
|
+
export { user_default as default };
|
|
105
|
+
|
|
106
|
+
//# sourceMappingURL=user.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.mjs","names":[],"sources":["../src/user.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport type { Response, Router } from 'express';\n\nimport type { Auth } from '@verdaccio/auth';\nimport { getApiToken } from '@verdaccio/auth';\nimport { createRemoteUser } from '@verdaccio/config';\nimport {\n API_ERROR,\n API_MESSAGE,\n HEADERS,\n HTTP_STATUS,\n authUtils,\n cryptoUtils,\n errorUtils,\n validationUtils,\n} from '@verdaccio/core';\nimport { USER_API_ENDPOINTS, rateLimit } from '@verdaccio/middleware';\nimport type { Config, Logger, RemoteUser } from '@verdaccio/types';\n\nimport type { $NextFunctionVer, $RequestExtend } from '../types/custom';\n\nconst debug = buildDebug('verdaccio:api:user');\n\nexport default function (route: Router, auth: Auth, config: Config, logger: Logger): void {\n route.get(\n USER_API_ENDPOINTS.get_user,\n rateLimit(config?.userRateLimit),\n function (req: $RequestExtend, res: Response, next: $NextFunctionVer): void {\n debug('verifying user');\n\n if (\n !req.remote_user ||\n typeof req.remote_user.name !== 'string' ||\n req.remote_user.name === ''\n ) {\n debug('user not logged in');\n res.status(HTTP_STATUS.OK);\n return next({ ok: false });\n }\n\n const username = req.params.org_couchdb_user.split(':')[1];\n const message = authUtils.getAuthenticatedMessage(req.remote_user.name);\n debug('user authenticated message %o', message);\n res.status(HTTP_STATUS.OK);\n next({\n // 'npm owner' requires user info\n // TODO: we don't have the email\n name: username,\n email: '',\n ok: message,\n });\n }\n );\n\n /**\n * \n * body example\n * req.body = {\n _id: \"org.couchdb.user:jjjj\",\n name: \"jjjj\",\n password: \"jjjj\",\n type: \"user\",\n roles: [],\n date: \"2022-07-08T15:51:04.002Z\",\n }\n * \n * @export\n * @param {Router} route\n * @param {Auth} auth\n * @param {Config} config\n */\n route.put(\n USER_API_ENDPOINTS.add_user,\n rateLimit(config?.userRateLimit),\n function (req: $RequestExtend, res: Response, next: $NextFunctionVer): void {\n const { name, password } = req.body;\n debug('login or adduser');\n const remoteName = req?.remote_user?.name;\n\n if (!validationUtils.validateUserName(req.params.org_couchdb_user, name)) {\n return next(errorUtils.getBadRequest(API_ERROR.USERNAME_MISMATCH));\n }\n\n if (typeof remoteName !== 'undefined' && typeof name === 'string' && remoteName === name) {\n debug('login: no remote user detected');\n auth.authenticate(\n name,\n password,\n async function callbackAuthenticate(err, user): Promise<void> {\n if (err) {\n logger.trace(\n { name, err },\n 'authenticating for user @{username} failed. Error: @{err.message}'\n );\n return next(\n errorUtils.getCode(HTTP_STATUS.UNAUTHORIZED, API_ERROR.BAD_USERNAME_PASSWORD)\n );\n }\n\n const restoredRemoteUser: RemoteUser = createRemoteUser(name, user?.groups || []);\n const token = await getApiToken(auth, config, restoredRemoteUser, password);\n debug('login: new token');\n if (!token) {\n return next(errorUtils.getUnauthorized());\n }\n\n res.status(HTTP_STATUS.CREATED);\n res.set(HEADERS.CACHE_CONTROL, 'no-cache, no-store');\n\n const message = authUtils.getAuthenticatedMessage(req.remote_user.name);\n debug('login: created user message %o', message);\n\n return next({\n ok: message,\n token,\n });\n }\n );\n } else {\n debug('adduser: %o', name);\n if (\n validationUtils.validatePassword(password, config?.server?.passwordValidationRegex) ===\n false\n ) {\n debug('adduser: invalid password');\n\n return next(errorUtils.getCode(HTTP_STATUS.BAD_REQUEST, API_ERROR.PASSWORD_SHORT));\n }\n\n auth.add_user(name, password, async function (err, user): Promise<void> {\n if (err) {\n if (err.status >= HTTP_STATUS.BAD_REQUEST && err.status < HTTP_STATUS.INTERNAL_ERROR) {\n debug('adduser: error on create user');\n // With npm registering is the same as logging in,\n // and npm accepts only an 409 error.\n // So, changing status code here.\n return next(\n errorUtils.getCode(err.status, err.message) || errorUtils.getConflict(err.message)\n );\n }\n return next(err);\n }\n\n const token =\n name && password\n ? await getApiToken(auth, config, user as RemoteUser, password)\n : undefined;\n if (token) {\n debug('adduser: new token %o', cryptoUtils.mask(token as string, 4));\n }\n if (!token) {\n return next(errorUtils.getUnauthorized());\n }\n\n req.remote_user = user;\n res.status(HTTP_STATUS.CREATED);\n res.set(HEADERS.CACHE_CONTROL, 'no-cache, no-store');\n debug('adduser: user has been created');\n return next({\n ok: `user '${req.body.name}' created`,\n token,\n });\n });\n }\n }\n );\n\n route.delete(\n USER_API_ENDPOINTS.user_token,\n function (req: $RequestExtend, res: Response, next: $NextFunctionVer): void {\n res.status(HTTP_STATUS.OK);\n next({\n ok: API_MESSAGE.LOGGED_OUT,\n });\n }\n );\n}\n"],"mappings":";;;;;;AAqBA,IAAM,QAAQ,WAAW,qBAAqB;AAE9C,SAAA,aAAyB,OAAe,MAAY,QAAgB,QAAsB;AACxF,OAAM,IACJ,mBAAmB,UACnB,UAAU,QAAQ,cAAc,EAChC,SAAU,KAAqB,KAAe,MAA8B;AAC1E,QAAM,iBAAiB;AAEvB,MACE,CAAC,IAAI,eACL,OAAO,IAAI,YAAY,SAAS,YACh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import { Storage } from '@verdaccio/store';
|
|
4
|
+
import { Config, Logger } from '@verdaccio/types';
|
|
5
5
|
export default function (route: Router, auth: Auth, storage: Storage, config: Config, logger: Logger): void;
|