@verdaccio/middleware 8.0.0-next-8.30 → 8.0.0-next-8.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/build/index.d.ts +1 -0
- package/build/index.js +8 -0
- package/build/index.js.map +1 -1
- package/build/middlewares/allow.js +0 -2
- package/build/middlewares/allow.js.map +1 -1
- package/build/middlewares/antiLoop.d.ts +2 -2
- package/build/middlewares/antiLoop.js.map +1 -1
- package/build/middlewares/encode-pkg.d.ts +1 -1
- package/build/middlewares/encode-pkg.js.map +1 -1
- package/build/middlewares/error.d.ts +1 -1
- package/build/middlewares/error.js.map +1 -1
- package/build/middlewares/final.d.ts +2 -2
- package/build/middlewares/final.js.map +1 -1
- package/build/middlewares/json.d.ts +1 -1
- package/build/middlewares/json.js.map +1 -1
- package/build/middlewares/log.d.ts +1 -1
- package/build/middlewares/log.js +0 -1
- package/build/middlewares/log.js.map +1 -1
- package/build/middlewares/make-url-relative.d.ts +1 -1
- package/build/middlewares/make-url-relative.js.map +1 -1
- package/build/middlewares/match.js.map +1 -1
- package/build/middlewares/media.js.map +1 -1
- package/build/middlewares/rate-limit.d.ts +1 -1
- package/build/middlewares/rate-limit.js.map +1 -1
- package/build/middlewares/request-options.d.ts +3 -0
- package/build/middlewares/request-options.js +30 -0
- package/build/middlewares/request-options.js.map +1 -0
- package/build/middlewares/user-agent.d.ts +1 -1
- package/build/middlewares/user-agent.js.map +1 -1
- package/build/middlewares/web/utils/renderHTML.d.ts +3 -3
- package/build/middlewares/web/utils/renderHTML.js +2 -2
- package/build/middlewares/web/utils/renderHTML.js.map +1 -1
- package/build/middlewares/web/utils/template.d.ts +4 -4
- package/build/middlewares/web/utils/template.js +0 -3
- package/build/middlewares/web/utils/template.js.map +1 -1
- package/build/middlewares/web/web-api.d.ts +2 -1
- package/build/middlewares/web/web-api.js +0 -1
- package/build/middlewares/web/web-api.js.map +1 -1
- package/build/middlewares/web/web-middleware.js +0 -1
- package/build/middlewares/web/web-middleware.js.map +1 -1
- package/build/types.d.ts +1 -1
- package/build/types.js.map +1 -1
- package/package.json +6 -6
package/build/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export { rateLimit } from './middlewares/rate-limit';
|
|
|
11
11
|
export { userAgent } from './middlewares/user-agent';
|
|
12
12
|
export { webMiddleware, renderWebMiddleware, setSecurityWebHeaders } from './middlewares/web';
|
|
13
13
|
export { errorReportingMiddleware, handleError } from './middlewares/error';
|
|
14
|
+
export { getRequestOptions } from './middlewares/request-options';
|
|
14
15
|
export { log, LOG_STATUS_MESSAGE, LOG_VERDACCIO_BYTES, LOG_VERDACCIO_ERROR, } from './middlewares/log';
|
|
15
16
|
export * from './types';
|
|
16
17
|
export * from './middlewares/api_urls';
|
package/build/index.js
CHANGED
|
@@ -21,6 +21,7 @@ var _exportNames = {
|
|
|
21
21
|
setSecurityWebHeaders: true,
|
|
22
22
|
errorReportingMiddleware: true,
|
|
23
23
|
handleError: true,
|
|
24
|
+
getRequestOptions: true,
|
|
24
25
|
log: true,
|
|
25
26
|
LOG_STATUS_MESSAGE: true,
|
|
26
27
|
LOG_VERDACCIO_BYTES: true,
|
|
@@ -80,6 +81,12 @@ Object.defineProperty(exports, "final", {
|
|
|
80
81
|
return _final.final;
|
|
81
82
|
}
|
|
82
83
|
});
|
|
84
|
+
Object.defineProperty(exports, "getRequestOptions", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _requestOptions.getRequestOptions;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
83
90
|
Object.defineProperty(exports, "handleError", {
|
|
84
91
|
enumerable: true,
|
|
85
92
|
get: function () {
|
|
@@ -165,6 +172,7 @@ var _rateLimit = require("./middlewares/rate-limit");
|
|
|
165
172
|
var _userAgent = require("./middlewares/user-agent");
|
|
166
173
|
var _web = require("./middlewares/web");
|
|
167
174
|
var _error = require("./middlewares/error");
|
|
175
|
+
var _requestOptions = require("./middlewares/request-options");
|
|
168
176
|
var _log = require("./middlewares/log");
|
|
169
177
|
var _types = require("./types");
|
|
170
178
|
Object.keys(_types).forEach(function (key) {
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_match","require","_validation","_media","_makeUrlRelative","_encodePkg","_json","_antiLoop","_final","_allow","_rateLimit","_userAgent","_web","_error","_log","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_api_urls","_webUrls"],"sources":["../src/index.ts"],"sourcesContent":["export { match } from './middlewares/match';\nexport { validateName, validatePackage } from './middlewares/validation';\nexport { media } from './middlewares/media';\nexport { makeURLrelative } from './middlewares/make-url-relative';\nexport { encodeScopePackage } from './middlewares/encode-pkg';\nexport { expectJson } from './middlewares/json';\nexport { antiLoop } from './middlewares/antiLoop';\nexport { final } from './middlewares/final';\nexport { allow } from './middlewares/allow';\nexport { rateLimit } from './middlewares/rate-limit';\nexport { userAgent } from './middlewares/user-agent';\nexport { webMiddleware, renderWebMiddleware, setSecurityWebHeaders } from './middlewares/web';\nexport { errorReportingMiddleware, handleError } from './middlewares/error';\nexport {\n log,\n LOG_STATUS_MESSAGE,\n LOG_VERDACCIO_BYTES,\n LOG_VERDACCIO_ERROR,\n} from './middlewares/log';\nexport * from './types';\nexport * from './middlewares/api_urls';\nexport * from './middlewares/web/web-urls';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_match","require","_validation","_media","_makeUrlRelative","_encodePkg","_json","_antiLoop","_final","_allow","_rateLimit","_userAgent","_web","_error","_requestOptions","_log","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_api_urls","_webUrls"],"sources":["../src/index.ts"],"sourcesContent":["export { match } from './middlewares/match';\nexport { validateName, validatePackage } from './middlewares/validation';\nexport { media } from './middlewares/media';\nexport { makeURLrelative } from './middlewares/make-url-relative';\nexport { encodeScopePackage } from './middlewares/encode-pkg';\nexport { expectJson } from './middlewares/json';\nexport { antiLoop } from './middlewares/antiLoop';\nexport { final } from './middlewares/final';\nexport { allow } from './middlewares/allow';\nexport { rateLimit } from './middlewares/rate-limit';\nexport { userAgent } from './middlewares/user-agent';\nexport { webMiddleware, renderWebMiddleware, setSecurityWebHeaders } from './middlewares/web';\nexport { errorReportingMiddleware, handleError } from './middlewares/error';\nexport { getRequestOptions } from './middlewares/request-options';\nexport {\n log,\n LOG_STATUS_MESSAGE,\n LOG_VERDACCIO_BYTES,\n LOG_VERDACCIO_ERROR,\n} from './middlewares/log';\nexport * from './types';\nexport * from './middlewares/api_urls';\nexport * from './middlewares/web/web-urls';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AACA,IAAAW,IAAA,GAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AACA,IAAAa,eAAA,GAAAb,OAAA;AACA,IAAAc,IAAA,GAAAd,OAAA;AAMA,IAAAe,MAAA,GAAAf,OAAA;AAAAgB,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,M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 @@ var _core = require("@verdaccio/core");
|
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
const debug = (0, _debug.default)('verdaccio:middleware:allow');
|
|
11
11
|
function allow(auth, options = {
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13
12
|
beforeAll: (_a, _b) => {},
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
15
13
|
afterAll: (_a, _b) => {}
|
|
16
14
|
}) {
|
|
17
15
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allow.js","names":["_debug","_interopRequireDefault","require","_core","e","__esModule","default","debug","buildDebug","allow","auth","options","beforeAll","_a","_b","afterAll","action","req","res","next","pause","packageName","params","scope","package","packageVersion","filename","tarballUtils","getVersionFromTarball","version","undefined","remote_user","name","user","error","allowed","resume","errorUtils","getInternalError","API_ERROR","PLUGIN_ERROR"],"sources":["../../src/middlewares/allow.ts"],"sourcesContent":["import buildDebug from 'debug';\n\nimport { API_ERROR, errorUtils, tarballUtils } from '@verdaccio/core';\n\nimport { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';\n\nconst debug = buildDebug('verdaccio:middleware:allow');\n\nexport function allow<T>(\n auth: T,\n options = {\n
|
|
1
|
+
{"version":3,"file":"allow.js","names":["_debug","_interopRequireDefault","require","_core","e","__esModule","default","debug","buildDebug","allow","auth","options","beforeAll","_a","_b","afterAll","action","req","res","next","pause","packageName","params","scope","package","packageVersion","filename","tarballUtils","getVersionFromTarball","version","undefined","remote_user","name","user","error","allowed","resume","errorUtils","getInternalError","API_ERROR","PLUGIN_ERROR"],"sources":["../../src/middlewares/allow.ts"],"sourcesContent":["import buildDebug from 'debug';\n\nimport { API_ERROR, errorUtils, tarballUtils } from '@verdaccio/core';\n\nimport type { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';\n\nconst debug = buildDebug('verdaccio:middleware:allow');\n\nexport function allow<T>(\n auth: T,\n options = {\n beforeAll: (_a: any, _b: any) => {},\n\n afterAll: (_a: any, _b: any) => {},\n }\n): Function {\n const { beforeAll, afterAll } = options;\n return function (action: string): Function {\n return function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {\n req.pause();\n const packageName = req.params.scope\n ? `${req.params.scope}/${req.params.package}`\n : req.params.package;\n const packageVersion = req.params.filename\n ? tarballUtils.getVersionFromTarball(req.params.filename)\n : req.params.version\n ? req.params.version\n : undefined;\n const remote_user = req.remote_user;\n debug(\n 'check if user %o can %o package %o version %o',\n remote_user?.name,\n action,\n packageName,\n packageVersion\n );\n beforeAll?.(\n { action, user: remote_user?.name },\n `[middleware/allow][@{action}] allow for @{user}`\n );\n auth['allow_' + action](\n { packageName, packageVersion },\n remote_user,\n function (error, allowed): void {\n req.resume();\n if (error) {\n debug('user is NOT allowed to %o', action);\n next(error);\n } else if (allowed) {\n debug('user is allowed to %o', action);\n afterAll?.(\n { action, user: remote_user?.name },\n `[middleware/allow][@{action}] allowed for @{user}`\n );\n next();\n } else {\n // last plugin (that's our built-in one) returns either\n // cb(err) or cb(null, true), so this should never happen\n throw errorUtils.getInternalError(API_ERROR.PLUGIN_ERROR);\n }\n }\n );\n };\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AAAsE,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAItE,MAAMG,KAAK,GAAG,IAAAC,cAAU,EAAC,4BAA4B,CAAC;AAE/C,SAASC,KAAKA,CACnBC,IAAO,EACPC,OAAO,GAAG;EACRC,SAAS,EAAEA,CAACC,EAAO,EAAEC,EAAO,KAAK,CAAC,CAAC;EAEnCC,QAAQ,EAAEA,CAACF,EAAO,EAAEC,EAAO,KAAK,CAAC;AACnC,CAAC,EACS;EACV,M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,EAAEF,WAAW,EAAEC;UAAK,CAAC,EACnC,mDACF,CAAC;UACDb,IAAI,CAAC,CAAC;QACR,CAAC,MAAM;UACL;UACA;UACA,MAAMkB,gBAAU,CAACC,gBAAgB,CAACC,eAAS,CAACC,YAAY,CAAC;QAC3D;MACF,CACF,CAAC;IACH,CAAC;EACH,CAAC;AACH","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Config } from '@verdaccio/types';
|
|
2
|
-
import { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';
|
|
1
|
+
import type { Config } from '@verdaccio/types';
|
|
2
|
+
import type { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* A middleware that avoid a registry points itself as proxy and avoid create infinite loops.
|
|
5
5
|
* @param config
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"antiLoop.js","names":["_core","require","antiLoop","config","req","res","next","headers","via","arr","get","split","Array","isArray","i","length","parts","trim","serverId","server_id","errorUtils","getCode","HTTP_STATUS","LOOP_DETECTED"],"sources":["../../src/middlewares/antiLoop.ts"],"sourcesContent":["import { HTTP_STATUS, errorUtils } from '@verdaccio/core';\nimport { Config } from '@verdaccio/types';\n\nimport { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';\n\n/**\n * A middleware that avoid a registry points itself as proxy and avoid create infinite loops.\n * @param config\n * @returns\n */\nexport function antiLoop(config: Config) {\n return function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {\n if (req?.headers?.via != null) {\n const arr = req.get('via')?.split(',');\n if (Array.isArray(arr)) {\n for (let i = 0; i < arr.length; i++) {\n // the \"via\" header must contain a specific value, this has to be in sync\n // with the proxy request\n // match eg: Server 1 or Server 2\n\n // RFC 7230: Via = 1*( \",\" OWS Via-value )\n // Via-value = received-protocol RWS received-by [ RWS comment ]\n // received-protocol = [ protocol-name \"/\" ] protocol-version\n // received-by = ( uri-host [ \":\" port ] ) / pseudonym\n\n // Split the trimmed header value into parts\n const parts = arr[i].trim().split(/\\s+/);\n // Check if we have at least protocol/version and received-by parts\n if (parts.length >= 2) {\n // Get the received-by value (server id), removing any comment\n const serverId = parts[1].split('(')[0].trim();\n if (serverId === config.server_id) {\n return next(errorUtils.getCode(HTTP_STATUS.LOOP_DETECTED, 'loop detected'));\n }\n }\n }\n }\n }\n next();\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAKA;AACA;AACA;AACA;AACA;AACO,SAASC,QAAQA,CAACC,MAAc,EAAE;EACvC,OAAO,UAAUC,GAAmB,EAAEC,GAAoB,EAAEC,IAAsB,EAAQ;IACxF,IAAIF,GAAG,EAAEG,OAAO,EAAEC,GAAG,IAAI,IAAI,EAAE;MAC7B,MAAMC,GAAG,GAAGL,GAAG,CAACM,GAAG,CAAC,KAAK,CAAC,EAAEC,KAAK,CAAC,GAAG,CAAC;MACtC,IAAIC,KAAK,CAACC,OAAO,CAACJ,GAAG,CAAC,EAAE;QACtB,KAAK,IAAIK,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGL,GAAG,CAACM,MAAM,EAAED,CAAC,EAAE,EAAE;UACnC;UACA;UACA;;UAEA;UACA;UACA;UACA;;UAEA;UACA,MAAME,KAAK,GAAGP,GAAG,CAACK,CAAC,CAAC,CAACG,IAAI,CAAC,CAAC,CAACN,KAAK,CAAC,KAAK,CAAC;UACxC;UACA,IAAIK,KAAK,CAACD,MAAM,IAAI,CAAC,EAAE;YACrB;YACA,MAAMG,QAAQ,GAAGF,KAAK,CAAC,CAAC,CAAC,CAACL,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAACM,IAAI,CAAC,CAAC;YAC9C,IAAIC,QAAQ,KAAKf,MAAM,CAACgB,SAAS,EAAE;cACjC,OAAOb,IAAI,CAACc,gBAAU,CAACC,OAAO,CAACC,iBAAW,CAACC,aAAa,EAAE,eAAe,CAAC,CAAC;YAC7E;UACF;QACF;MACF;IACF;IACAjB,IAAI,CAAC,CAAC;EACR,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"antiLoop.js","names":["_core","require","antiLoop","config","req","res","next","headers","via","arr","get","split","Array","isArray","i","length","parts","trim","serverId","server_id","errorUtils","getCode","HTTP_STATUS","LOOP_DETECTED"],"sources":["../../src/middlewares/antiLoop.ts"],"sourcesContent":["import { HTTP_STATUS, errorUtils } from '@verdaccio/core';\nimport type { Config } from '@verdaccio/types';\n\nimport type { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';\n\n/**\n * A middleware that avoid a registry points itself as proxy and avoid create infinite loops.\n * @param config\n * @returns\n */\nexport function antiLoop(config: Config) {\n return function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {\n if (req?.headers?.via != null) {\n const arr = req.get('via')?.split(',');\n if (Array.isArray(arr)) {\n for (let i = 0; i < arr.length; i++) {\n // the \"via\" header must contain a specific value, this has to be in sync\n // with the proxy request\n // match eg: Server 1 or Server 2\n\n // RFC 7230: Via = 1*( \",\" OWS Via-value )\n // Via-value = received-protocol RWS received-by [ RWS comment ]\n // received-protocol = [ protocol-name \"/\" ] protocol-version\n // received-by = ( uri-host [ \":\" port ] ) / pseudonym\n\n // Split the trimmed header value into parts\n const parts = arr[i].trim().split(/\\s+/);\n // Check if we have at least protocol/version and received-by parts\n if (parts.length >= 2) {\n // Get the received-by value (server id), removing any comment\n const serverId = parts[1].split('(')[0].trim();\n if (serverId === config.server_id) {\n return next(errorUtils.getCode(HTTP_STATUS.LOOP_DETECTED, 'loop detected'));\n }\n }\n }\n }\n }\n next();\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAKA;AACA;AACA;AACA;AACA;AACO,SAASC,QAAQA,CAACC,MAAc,EAAE;EACvC,OAAO,UAAUC,GAAmB,EAAEC,GAAoB,EAAEC,IAAsB,EAAQ;IACxF,IAAIF,GAAG,EAAEG,OAAO,EAAEC,GAAG,IAAI,IAAI,EAAE;MAC7B,MAAMC,GAAG,GAAGL,GAAG,CAACM,GAAG,CAAC,KAAK,CAAC,EAAEC,KAAK,CAAC,GAAG,CAAC;MACtC,IAAIC,KAAK,CAACC,OAAO,CAACJ,GAAG,CAAC,EAAE;QACtB,KAAK,IAAIK,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGL,GAAG,CAACM,MAAM,EAAED,CAAC,EAAE,EAAE;UACnC;UACA;UACA;;UAEA;UACA;UACA;UACA;;UAEA;UACA,MAAME,KAAK,GAAGP,GAAG,CAACK,CAAC,CAAC,CAACG,IAAI,CAAC,CAAC,CAACN,KAAK,CAAC,KAAK,CAAC;UACxC;UACA,IAAIK,KAAK,CAACD,MAAM,IAAI,CAAC,EAAE;YACrB;YACA,MAAMG,QAAQ,GAAGF,KAAK,CAAC,CAAC,CAAC,CAACL,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAACM,IAAI,CAAC,CAAC;YAC9C,IAAIC,QAAQ,KAAKf,MAAM,CAACgB,SAAS,EAAE;cACjC,OAAOb,IAAI,CAACc,gBAAU,CAACC,OAAO,CAACC,iBAAW,CAACC,aAAa,EAAE,eAAe,CAAC,CAAC;YAC7E;UACF;QACF;MACF;IACF;IACAjB,IAAI,CAAC,CAAC;EACR,CAAC;AACH","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encode-pkg.js","names":["_debug","_interopRequireDefault","require","_core","e","__esModule","default","debug","buildDebug","encodeScopePackage","req","res","next","original","url","startsWith","errorUtils","getBadRequest","replace"],"sources":["../../src/middlewares/encode-pkg.ts"],"sourcesContent":["import buildDebug from 'debug';\n\nimport { errorUtils } from '@verdaccio/core';\n\nimport { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';\n\nconst debug = buildDebug('verdaccio:middleware:encode');\n\n/**\n * Encode / in a scoped package name to be matched as a single parameter in routes\n * @param req\n * @param res\n * @param next\n */\nexport function encodeScopePackage(\n req: $RequestExtend,\n res: $ResponseExtend,\n next: $NextFunctionVer\n): void {\n const original = req.url;\n\n // Expect relative URLs i.e. should call makeURLrelative before this middleware\n if (!req.url.startsWith('/')) {\n return next(errorUtils.getBadRequest(`Invalid URL: ${req.url} (must be relative)`));\n }\n\n // If the @ sign is encoded, we need to decode it first\n // e.g.: /%40org/pkg/1.2.3 -> /@org/pkg/1.2.3\n // For scoped packages, encode the slash to make it a single path segment/parameter\n // e.g.: /@org/pkg/1.2.3 -> /@org%2Fpkg/1.2.3, /@org%2Fpkg/1.2.3 -> /@org%2Fpkg/1.2.3\n // also handle cases for dist-tags where package is in the middle of the path and not at the beginning\n // e.g.: /-/package/@org/pkg/dist-tags/latest -> /-/package/@org%2Fpkg/dist-tags/latest\n req.url = req.url.replace(/\\/%40/, '/@').replace(/(\\/@[^\\/%]+)\\/(?!$)/, '$1%2F');\n\n if (original !== req.url) {\n debug('encodeScopePackage: %o -> %o', original, req.url);\n } else {\n debug('encodeScopePackage: %o (unchanged)', original);\n }\n next();\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AAA6C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAI7C,MAAMG,KAAK,GAAG,IAAAC,cAAU,EAAC,6BAA6B,CAAC;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,kBAAkBA,CAChCC,GAAmB,EACnBC,GAAoB,EACpBC,IAAsB,EAChB;EACN,MAAMC,QAAQ,GAAGH,GAAG,CAACI,GAAG;;EAExB;EACA,IAAI,CAACJ,GAAG,CAACI,GAAG,CAACC,UAAU,CAAC,GAAG,CAAC,EAAE;IAC5B,OAAOH,IAAI,CAACI,gBAAU,CAACC,aAAa,CAAC,gBAAgBP,GAAG,CAACI,GAAG,qBAAqB,CAAC,CAAC;EACrF;;EAEA;EACA;EACA;EACA;EACA;EACA;EACAJ,GAAG,CAACI,GAAG,GAAGJ,GAAG,CAACI,GAAG,CAACI,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAACA,OAAO,CAAC,qBAAqB,EAAE,OAAO,CAAC;EAEhF,IAAIL,QAAQ,KAAKH,GAAG,CAACI,GAAG,EAAE;IACxBP,KAAK,CAAC,8BAA8B,EAAEM,QAAQ,EAAEH,GAAG,CAACI,GAAG,CAAC;EAC1D,CAAC,MAAM;IACLP,KAAK,CAAC,oCAAoC,EAAEM,QAAQ,CAAC;EACvD;EACAD,IAAI,CAAC,CAAC;AACR","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"encode-pkg.js","names":["_debug","_interopRequireDefault","require","_core","e","__esModule","default","debug","buildDebug","encodeScopePackage","req","res","next","original","url","startsWith","errorUtils","getBadRequest","replace"],"sources":["../../src/middlewares/encode-pkg.ts"],"sourcesContent":["import buildDebug from 'debug';\n\nimport { errorUtils } from '@verdaccio/core';\n\nimport type { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';\n\nconst debug = buildDebug('verdaccio:middleware:encode');\n\n/**\n * Encode / in a scoped package name to be matched as a single parameter in routes\n * @param req\n * @param res\n * @param next\n */\nexport function encodeScopePackage(\n req: $RequestExtend,\n res: $ResponseExtend,\n next: $NextFunctionVer\n): void {\n const original = req.url;\n\n // Expect relative URLs i.e. should call makeURLrelative before this middleware\n if (!req.url.startsWith('/')) {\n return next(errorUtils.getBadRequest(`Invalid URL: ${req.url} (must be relative)`));\n }\n\n // If the @ sign is encoded, we need to decode it first\n // e.g.: /%40org/pkg/1.2.3 -> /@org/pkg/1.2.3\n // For scoped packages, encode the slash to make it a single path segment/parameter\n // e.g.: /@org/pkg/1.2.3 -> /@org%2Fpkg/1.2.3, /@org%2Fpkg/1.2.3 -> /@org%2Fpkg/1.2.3\n // also handle cases for dist-tags where package is in the middle of the path and not at the beginning\n // e.g.: /-/package/@org/pkg/dist-tags/latest -> /-/package/@org%2Fpkg/dist-tags/latest\n req.url = req.url.replace(/\\/%40/, '/@').replace(/(\\/@[^\\/%]+)\\/(?!$)/, '$1%2F');\n\n if (original !== req.url) {\n debug('encodeScopePackage: %o -> %o', original, req.url);\n } else {\n debug('encodeScopePackage: %o (unchanged)', original);\n }\n next();\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AAA6C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAI7C,MAAMG,KAAK,GAAG,IAAAC,cAAU,EAAC,6BAA6B,CAAC;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,kBAAkBA,CAChCC,GAAmB,EACnBC,GAAoB,EACpBC,IAAsB,EAChB;EACN,MAAMC,QAAQ,GAAGH,GAAG,CAACI,GAAG;;EAExB;EACA,IAAI,CAACJ,GAAG,CAACI,GAAG,CAACC,UAAU,CAAC,GAAG,CAAC,EAAE;IAC5B,OAAOH,IAAI,CAACI,gBAAU,CAACC,aAAa,CAAC,gBAAgBP,GAAG,CAACI,GAAG,qBAAqB,CAAC,CAAC;EACrF;;EAEA;EACA;EACA;EACA;EACA;EACA;EACAJ,GAAG,CAACI,GAAG,GAAGJ,GAAG,CAACI,GAAG,CAACI,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAACA,OAAO,CAAC,qBAAqB,EAAE,OAAO,CAAC;EAEhF,IAAIL,QAAQ,KAAKH,GAAG,CAACI,GAAG,EAAE;IACxBP,KAAK,CAAC,8BAA8B,EAAEM,QAAQ,EAAEH,GAAG,CAACI,GAAG,CAAC;EAC1D,CAAC,MAAM;IACLP,KAAK,CAAC,oCAAoC,EAAEM,QAAQ,CAAC;EACvD;EACAD,IAAI,CAAC,CAAC;AACR","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HttpError } from 'http-errors';
|
|
2
2
|
import type { Logger } from '@verdaccio/types';
|
|
3
|
-
import { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';
|
|
3
|
+
import type { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';
|
|
4
4
|
export declare const handleError: (logger: Logger) => (err: HttpError, req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer) => any;
|
|
5
5
|
export declare const errorReportingMiddleware: (logger: Logger) => (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","names":["_debug","_interopRequireDefault","require","_lodash","_core","e","__esModule","default","debug","buildDebug","handleError","logger","err","req","res","next","_","isError","code","statusCode","HTTP_STATUS","NOT_MODIFIED","isFunction","locals","report_error","errorReportingMiddleware","noop","exports","status","BAD_REQUEST","isNil","headersSent","message","error","API_ERROR","UNKNOWN_ERROR","send","destroy","INTERNAL_ERROR","INTERNAL_SERVER_ERROR"],"sources":["../../src/middlewares/error.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport type { HttpError } from 'http-errors';\nimport _ from 'lodash';\n\nimport { API_ERROR, HTTP_STATUS
|
|
1
|
+
{"version":3,"file":"error.js","names":["_debug","_interopRequireDefault","require","_lodash","_core","e","__esModule","default","debug","buildDebug","handleError","logger","err","req","res","next","_","isError","code","statusCode","HTTP_STATUS","NOT_MODIFIED","isFunction","locals","report_error","errorReportingMiddleware","noop","exports","status","BAD_REQUEST","isNil","headersSent","message","error","API_ERROR","UNKNOWN_ERROR","send","destroy","INTERNAL_ERROR","INTERNAL_SERVER_ERROR"],"sources":["../../src/middlewares/error.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport type { HttpError } from 'http-errors';\nimport _ from 'lodash';\n\nimport type { VerdaccioError } from '@verdaccio/core';\nimport { API_ERROR, HTTP_STATUS } from '@verdaccio/core';\nimport type { Logger } from '@verdaccio/types';\n\nimport type { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';\n\nconst debug = buildDebug('verdaccio:middleware:error');\n\nexport const handleError = (logger: Logger) =>\n function handleError(\n err: HttpError,\n req: $RequestExtend,\n res: $ResponseExtend,\n next: $NextFunctionVer\n ) {\n debug('error handler init');\n if (_.isError(err)) {\n debug('is native error');\n if (err.code === 'ECONNABORT' && res.statusCode === HTTP_STATUS.NOT_MODIFIED) {\n return next();\n }\n if (_.isFunction(res.locals.report_error) === false) {\n debug('is locals error report ref');\n // in case of very early error this middleware may not be loaded before error is generated\n // fixing that\n errorReportingMiddleware(logger)(req, res, _.noop);\n }\n debug('set locals error report ref');\n res.locals.report_error(err);\n } else {\n // Fall to Middleware.final\n debug('no error to report, jump next layer');\n return next(err);\n }\n };\n\n// Middleware\nexport const errorReportingMiddleware = (logger: Logger) =>\n function errorReportingMiddleware(\n req: $RequestExtend,\n res: $ResponseExtend,\n next: $NextFunctionVer\n ): void {\n debug('error report middleware start');\n res.locals.report_error =\n res.locals.report_error ||\n function (err: VerdaccioError): void {\n if (err.status && err.status >= HTTP_STATUS.BAD_REQUEST && err.status < 600) {\n debug('is error > 409 %o', err?.status);\n if (_.isNil(res.headersSent) === false) {\n debug('send status %o', err?.status);\n res.status(err.status);\n debug('next layer %o', err?.message);\n next({ error: err.message || API_ERROR.UNKNOWN_ERROR });\n }\n } else {\n debug('is error < 409 %o', err?.status);\n logger.error({ err: err }, 'unexpected error: @{!err.message}\\n@{err.stack}');\n if (!res.status || !res.send) {\n // TODO: decide which debug keep\n logger.error('this is an error in express.js, please report this');\n debug('this is an error in express.js, please report this, destroy response %o', err);\n res.destroy();\n } else if (!res.headersSent) {\n debug('send internal error %o', err);\n res.status(HTTP_STATUS.INTERNAL_ERROR);\n next({ error: API_ERROR.INTERNAL_SERVER_ERROR });\n } else {\n // socket should be already closed\n debug('this should not happen, otherwise report %o', err);\n }\n }\n };\n\n debug('error report middleware end (skip next layer) next()');\n next();\n };\n"],"mappings":";;;;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ACc,MAAM,CAACR,iBAAW,CAACkB,cAAc,CAAC;QACtCvB,IAAI,CAAC;UAAEkB,KAAK,EAAEC,eAAS,CAACK;QAAsB,CAAC,CAAC;MAClD,CAAC,MAAM;QACL;QACA/B,KAAK,CAAC,6CAA6C,EAAEI,GAAG,CAAC;MAC3D;IACF;EACF,CAAC;EAEHJ,KAAK,CAAC,sDAAsD,CAAC;EAC7DO,IAAI,CAAC,CAAC;AACR,CAAC;AAACY,OAAA,CAAAF,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Manifest } from '@verdaccio/types';
|
|
2
|
-
import { $NextFunctionVer, $RequestExtend, $ResponseExtend, MiddlewareError } from '../types';
|
|
1
|
+
import type { Manifest } from '@verdaccio/types';
|
|
2
|
+
import type { $NextFunctionVer, $RequestExtend, $ResponseExtend, MiddlewareError } from '../types';
|
|
3
3
|
export type FinalBody = Manifest | MiddlewareError | string;
|
|
4
4
|
export declare function final(body: FinalBody, req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"final.js","names":["_debug","_interopRequireDefault","require","_lodash","_core","e","__esModule","default","debug","buildDebug","final","body","req","res","next","statusCode","HTTP_STATUS","UNAUTHORIZED","getHeader","HEADERS","WWW_AUTH","header","TOKEN_BASIC","TOKEN_BEARER","_","isString","isObject","get","CONTENT_TYPE","JSON","isNil","error","locals","_verdaccio_error","stringify","undefined","OK","MULTIPLE_CHOICES","etag","cryptoUtils","stringToMD5","ETAG","err","message","match","socket","destroy","send"],"sources":["../../src/middlewares/final.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport _ from 'lodash';\n\nimport { HEADERS, HTTP_STATUS, TOKEN_BASIC, TOKEN_BEARER, cryptoUtils } from '@verdaccio/core';\nimport { Manifest } from '@verdaccio/types';\n\nimport { $NextFunctionVer, $RequestExtend, $ResponseExtend, MiddlewareError } from '../types';\n\nexport type FinalBody = Manifest | MiddlewareError | string;\n\nconst debug = buildDebug('verdaccio:middleware:final');\n\nexport function final(\n body: FinalBody,\n req: $RequestExtend,\n res: $ResponseExtend,\n // if we remove `next` breaks test\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n next: $NextFunctionVer\n): void {\n if (res.statusCode === HTTP_STATUS.UNAUTHORIZED && !res.getHeader(HEADERS.WWW_AUTH)) {\n debug('set auth header support');\n res.header(HEADERS.WWW_AUTH, `${TOKEN_BASIC}, ${TOKEN_BEARER}`);\n }\n\n try {\n if (_.isString(body) || _.isObject(body)) {\n if (!res.get(HEADERS.CONTENT_TYPE)) {\n debug('set json type header support');\n res.header(HEADERS.CONTENT_TYPE, HEADERS.JSON);\n }\n\n if (typeof body === 'object' && _.isNil(body) === false) {\n if (typeof (body as MiddlewareError).error === 'string') {\n debug('set verdaccio_error method');\n res.locals._verdaccio_error = (body as MiddlewareError).error;\n }\n body = JSON.stringify(body, undefined, ' ') + '\\n';\n }\n\n // don't send etags with errors\n if (\n !res.statusCode ||\n (res.statusCode >= HTTP_STATUS.OK && res.statusCode < HTTP_STATUS.MULTIPLE_CHOICES)\n ) {\n const etag = cryptoUtils.stringToMD5(body as string);\n debug('set etag header %s', etag);\n res.header(HEADERS.ETAG, '\"' + etag + '\"');\n }\n } else {\n debug('this line should never be visible, if does report');\n // send(null), send(204), etc.\n }\n } catch (err: any) {\n // if verdaccio sends headers first, and then calls res.send()\n // as an error handler, we can't report error properly,\n // and should just close socket\n if (err.message.match(/set headers after they are sent/)) {\n debug('set headers after they are sent');\n if (_.isNil(res.socket) === false) {\n debug('force destroy socket');\n res.socket?.destroy();\n }\n return;\n }\n throw err;\n }\n\n res.send(body);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,KAAA,GAAAF,OAAA;AAA+F,SAAAD,uBAAAI,CAAA,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AACE,UAAU,IAAIC,iBAAW,CAACoB,EAAE,IAAIvB,GAAG,CAACE,UAAU,GAAGC,iBAAW,CAACqB,gBAAiB,EACnF;QACA,MAAMC,IAAI,GAAGC,iBAAW,CAACC,WAAW,CAAC7B,IAAc,CAAC;QACpDH,KAAK,CAAC,oBAAoB,EAAE8B,IAAI,CAAC;QACjCzB,GAAG,CAACQ,MAAM,CAACF,aAAO,CAACsB,IAAI,EAAE,GAAG,GAAGH,IAAI,GAAG,GAAG,CAAC;MAC5C;IACF,CAAC,MAAM;MACL9B,KAAK,CAAC,mDAAmD,CAAC;MAC1D;IACF;EACF,CAAC,CAAC,OAAOkC,GAAQ,EAAE;IACjB;IACA;IACA;IACA,IAAIA,GAAG,CAACC,OAAO,CAACC,KAAK,CAAC,iCAAiC,CAAC,EAAE;MACxDpC,KAAK,CAAC,iCAAiC,CAAC;MACxC,IAAIgB,eAAC,CAACM,KAAK,CAACjB,GAAG,CAACgC,MAAM,CAAC,KAAK,KAAK,EAAE;QACjCrC,KAAK,CAAC,sBAAsB,CAAC;QAC7BK,GAAG,CAACgC,MAAM,EAAEC,OAAO,CAAC,CAAC;MACvB;MACA;IACF;IACA,MAAMJ,GAAG;EACX;EAEA7B,GAAG,CAACkC,IAAI,CAACpC,IAAI,CAAC;AAChB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"final.js","names":["_debug","_interopRequireDefault","require","_lodash","_core","e","__esModule","default","debug","buildDebug","final","body","req","res","next","statusCode","HTTP_STATUS","UNAUTHORIZED","getHeader","HEADERS","WWW_AUTH","header","TOKEN_BASIC","TOKEN_BEARER","_","isString","isObject","get","CONTENT_TYPE","JSON","isNil","error","locals","_verdaccio_error","stringify","undefined","OK","MULTIPLE_CHOICES","etag","cryptoUtils","stringToMD5","ETAG","err","message","match","socket","destroy","send"],"sources":["../../src/middlewares/final.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport _ from 'lodash';\n\nimport { HEADERS, HTTP_STATUS, TOKEN_BASIC, TOKEN_BEARER, cryptoUtils } from '@verdaccio/core';\nimport type { Manifest } from '@verdaccio/types';\n\nimport type { $NextFunctionVer, $RequestExtend, $ResponseExtend, MiddlewareError } from '../types';\n\nexport type FinalBody = Manifest | MiddlewareError | string;\n\nconst debug = buildDebug('verdaccio:middleware:final');\n\nexport function final(\n body: FinalBody,\n req: $RequestExtend,\n res: $ResponseExtend,\n // if we remove `next` breaks test\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n next: $NextFunctionVer\n): void {\n if (res.statusCode === HTTP_STATUS.UNAUTHORIZED && !res.getHeader(HEADERS.WWW_AUTH)) {\n debug('set auth header support');\n res.header(HEADERS.WWW_AUTH, `${TOKEN_BASIC}, ${TOKEN_BEARER}`);\n }\n\n try {\n if (_.isString(body) || _.isObject(body)) {\n if (!res.get(HEADERS.CONTENT_TYPE)) {\n debug('set json type header support');\n res.header(HEADERS.CONTENT_TYPE, HEADERS.JSON);\n }\n\n if (typeof body === 'object' && _.isNil(body) === false) {\n if (typeof (body as MiddlewareError).error === 'string') {\n debug('set verdaccio_error method');\n res.locals._verdaccio_error = (body as MiddlewareError).error;\n }\n body = JSON.stringify(body, undefined, ' ') + '\\n';\n }\n\n // don't send etags with errors\n if (\n !res.statusCode ||\n (res.statusCode >= HTTP_STATUS.OK && res.statusCode < HTTP_STATUS.MULTIPLE_CHOICES)\n ) {\n const etag = cryptoUtils.stringToMD5(body as string);\n debug('set etag header %s', etag);\n res.header(HEADERS.ETAG, '\"' + etag + '\"');\n }\n } else {\n debug('this line should never be visible, if does report');\n // send(null), send(204), etc.\n }\n } catch (err: any) {\n // if verdaccio sends headers first, and then calls res.send()\n // as an error handler, we can't report error properly,\n // and should just close socket\n if (err.message.match(/set headers after they are sent/)) {\n debug('set headers after they are sent');\n if (_.isNil(res.socket) === false) {\n debug('force destroy socket');\n res.socket?.destroy();\n }\n return;\n }\n throw err;\n }\n\n res.send(body);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA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S,CAACvB,IAAI,EAAEwB,SAAS,EAAE,IAAI,CAAC,GAAG,IAAI;MACrD;;MAEA;MACA,IACE,CAACtB,GAAG,CAACE,UAAU,IACdF,GAAG,CAACE,UAAU,IAAIC,iBAAW,CAACoB,EAAE,IAAIvB,GAAG,CAACE,UAAU,GAAGC,iBAAW,CAACqB,gBAAiB,EACnF;QACA,MAAMC,IAAI,GAAGC,iBAAW,CAACC,WAAW,CAAC7B,IAAc,CAAC;QACpDH,KAAK,CAAC,oBAAoB,EAAE8B,IAAI,CAAC;QACjCzB,GAAG,CAACQ,MAAM,CAACF,aAAO,CAACsB,IAAI,EAAE,GAAG,GAAGH,IAAI,GAAG,GAAG,CAAC;MAC5C;IACF,CAAC,MAAM;MACL9B,KAAK,CAAC,mDAAmD,CAAC;MAC1D;IACF;EACF,CAAC,CAAC,OAAOkC,GAAQ,EAAE;IACjB;IACA;IACA;IACA,IAAIA,GAAG,CAACC,OAAO,CAACC,KAAK,CAAC,iCAAiC,CAAC,EAAE;MACxDpC,KAAK,CAAC,iCAAiC,CAAC;MACxC,IAAIgB,eAAC,CAACM,KAAK,CAACjB,GAAG,CAACgC,MAAM,CAAC,KAAK,KAAK,EAAE;QACjCrC,KAAK,CAAC,sBAAsB,CAAC;QAC7BK,GAAG,CAACgC,MAAM,EAAEC,OAAO,CAAC,CAAC;MACvB;MACA;IACF;IACA,MAAMJ,GAAG;EACX;EAEA7B,GAAG,CAACkC,IAAI,CAACpC,IAAI,CAAC;AAChB","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';
|
|
1
|
+
import type { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';
|
|
2
2
|
export declare function expectJson(req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.js","names":["_core","require","expectJson","req","res","next","validationUtils","isObject","body","errorUtils","getBadRequest"],"sources":["../../src/middlewares/json.ts"],"sourcesContent":["import { errorUtils, validationUtils } from '@verdaccio/core';\n\nimport { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';\n\nexport function expectJson(\n req: $RequestExtend,\n res: $ResponseExtend,\n next: $NextFunctionVer\n): void {\n if (!validationUtils.isObject(req.body)) {\n return next(errorUtils.getBadRequest(\"can't parse incoming json\"));\n }\n next();\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAIO,SAASC,UAAUA,CACxBC,GAAmB,EACnBC,GAAoB,EACpBC,IAAsB,EAChB;EACN,IAAI,CAACC,qBAAe,CAACC,QAAQ,CAACJ,GAAG,CAACK,IAAI,CAAC,EAAE;IACvC,OAAOH,IAAI,CAACI,gBAAU,CAACC,aAAa,CAAC,2BAA2B,CAAC,CAAC;EACpE;EACAL,IAAI,CAAC,CAAC;AACR","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"json.js","names":["_core","require","expectJson","req","res","next","validationUtils","isObject","body","errorUtils","getBadRequest"],"sources":["../../src/middlewares/json.ts"],"sourcesContent":["import { errorUtils, validationUtils } from '@verdaccio/core';\n\nimport type { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';\n\nexport function expectJson(\n req: $RequestExtend,\n res: $ResponseExtend,\n next: $NextFunctionVer\n): void {\n if (!validationUtils.isObject(req.body)) {\n return next(errorUtils.getBadRequest(\"can't parse incoming json\"));\n }\n next();\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAIO,SAASC,UAAUA,CACxBC,GAAmB,EACnBC,GAAoB,EACpBC,IAAsB,EAChB;EACN,IAAI,CAACC,qBAAe,CAACC,QAAQ,CAACJ,GAAG,CAACK,IAAI,CAAC,EAAE;IACvC,OAAOH,IAAI,CAACI,gBAAU,CAACC,aAAa,CAAC,2BAA2B,CAAC,CAAC;EACpE;EACAL,IAAI,CAAC,CAAC;AACR","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';
|
|
1
|
+
import type { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';
|
|
2
2
|
export declare const LOG_STATUS_MESSAGE = "@{status}, user: @{user}(@{remoteIP}), req: '@{request.method} @{request.url}'";
|
|
3
3
|
export declare const LOG_VERDACCIO_ERROR = "@{status}, user: @{user}(@{remoteIP}), req: '@{request.method} @{request.url}', error: @{!error}";
|
|
4
4
|
export declare const LOG_VERDACCIO_BYTES = "@{status}, user: @{user}(@{remoteIP}), req: '@{request.method} @{request.url}', bytes: @{bytes.in}/@{bytes.out}";
|
package/build/middlewares/log.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","names":["_lodash","_interopRequireDefault","require","_core","e","__esModule","default","LOG_STATUS_MESSAGE","exports","LOG_VERDACCIO_ERROR","LOG_VERDACCIO_BYTES","log","logger","req","res","next","child","sub","_auth","headers","authorization","_","isNil","_cookie","get","cookie","url","originalUrl","info","ip","bytesin","on","chunk","length","bytesout","_write","write","buf","apply","arguments","forwardedFor","HEADERS","FORWARDED_FOR","remoteAddress","connection","remoteIP","message","locals","_verdaccio_error","http","request","method","user","remote_user","name","status","statusCode","error","bytes","in","out","_end","end"],"sources":["../../src/middlewares/log.ts"],"sourcesContent":["import _ from 'lodash';\n\nimport { HEADERS } from '@verdaccio/core';\n\nimport { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';\n\n// FIXME: deprecated, moved to @verdaccio/dev-commons\nexport const LOG_STATUS_MESSAGE =\n \"@{status}, user: @{user}(@{remoteIP}), req: '@{request.method} @{request.url}'\";\nexport const LOG_VERDACCIO_ERROR = `${LOG_STATUS_MESSAGE}, error: @{!error}`;\nexport const LOG_VERDACCIO_BYTES = `${LOG_STATUS_MESSAGE}, bytes: @{bytes.in}/@{bytes.out}`;\n\nexport const log = (logger) => {\n return function log(req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {\n // logger\n req.log = logger.child({ sub: 'in' });\n\n const _auth = req.headers.authorization;\n if (_.isNil(_auth) === false) {\n req.headers.authorization = '<Classified>';\n }\n\n const _cookie = req.get('cookie');\n if (_.isNil(_cookie) === false) {\n req.headers.cookie = '<Classified>';\n }\n\n req.url = req.originalUrl;\n req.log.info({ req: req, ip: req.ip }, \"@{ip} requested '@{req.method} @{req.url}'\");\n req.originalUrl = req.url;\n\n if (_.isNil(_auth) === false) {\n req.headers.authorization = _auth;\n }\n\n if (_.isNil(_cookie) === false) {\n req.headers.cookie = _cookie;\n }\n\n let bytesin = 0;\n req.on('data', function (chunk): void {\n bytesin += chunk.length;\n });\n\n let bytesout = 0;\n const _write = res.write;\n // FIXME: res.write should return boolean\n // @ts-ignore\n res.write = function (buf): boolean {\n bytesout += buf.length;\n /* eslint prefer-rest-params: \"off\" */\n // @ts-ignore\n _write.apply(res, arguments);\n };\n\n const log = function (): void {\n const forwardedFor = req.get(HEADERS.FORWARDED_FOR);\n const remoteAddress = req.connection.remoteAddress;\n const remoteIP = forwardedFor ? `${forwardedFor} via ${remoteAddress}` : remoteAddress;\n let message;\n if (res.locals._verdaccio_error) {\n message = LOG_VERDACCIO_ERROR;\n } else {\n message = LOG_VERDACCIO_BYTES;\n }\n\n req.url = req.originalUrl;\n req.log.http(\n {\n request: {\n method: req.method,\n url: req.url,\n },\n user: req.remote_user?.name || null,\n remoteIP,\n status: res.statusCode,\n error: res.locals._verdaccio_error,\n bytes: {\n in: bytesin,\n out: bytesout,\n },\n },\n message\n );\n req.originalUrl = req.url;\n };\n\n req.on('close', function (): void {\n log();\n });\n\n const _end = res.end;\n // @ts-ignore\n res.end = function (buf): void {\n if (buf) {\n bytesout += buf.length;\n }\n
|
|
1
|
+
{"version":3,"file":"log.js","names":["_lodash","_interopRequireDefault","require","_core","e","__esModule","default","LOG_STATUS_MESSAGE","exports","LOG_VERDACCIO_ERROR","LOG_VERDACCIO_BYTES","log","logger","req","res","next","child","sub","_auth","headers","authorization","_","isNil","_cookie","get","cookie","url","originalUrl","info","ip","bytesin","on","chunk","length","bytesout","_write","write","buf","apply","arguments","forwardedFor","HEADERS","FORWARDED_FOR","remoteAddress","connection","remoteIP","message","locals","_verdaccio_error","http","request","method","user","remote_user","name","status","statusCode","error","bytes","in","out","_end","end"],"sources":["../../src/middlewares/log.ts"],"sourcesContent":["import _ from 'lodash';\n\nimport { HEADERS } from '@verdaccio/core';\n\nimport type { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';\n\n// FIXME: deprecated, moved to @verdaccio/dev-commons\nexport const LOG_STATUS_MESSAGE =\n \"@{status}, user: @{user}(@{remoteIP}), req: '@{request.method} @{request.url}'\";\nexport const LOG_VERDACCIO_ERROR = `${LOG_STATUS_MESSAGE}, error: @{!error}`;\nexport const LOG_VERDACCIO_BYTES = `${LOG_STATUS_MESSAGE}, bytes: @{bytes.in}/@{bytes.out}`;\n\nexport const log = (logger) => {\n return function log(req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {\n // logger\n req.log = logger.child({ sub: 'in' });\n\n const _auth = req.headers.authorization;\n if (_.isNil(_auth) === false) {\n req.headers.authorization = '<Classified>';\n }\n\n const _cookie = req.get('cookie');\n if (_.isNil(_cookie) === false) {\n req.headers.cookie = '<Classified>';\n }\n\n req.url = req.originalUrl;\n req.log.info({ req: req, ip: req.ip }, \"@{ip} requested '@{req.method} @{req.url}'\");\n req.originalUrl = req.url;\n\n if (_.isNil(_auth) === false) {\n req.headers.authorization = _auth;\n }\n\n if (_.isNil(_cookie) === false) {\n req.headers.cookie = _cookie;\n }\n\n let bytesin = 0;\n req.on('data', function (chunk): void {\n bytesin += chunk.length;\n });\n\n let bytesout = 0;\n const _write = res.write;\n // FIXME: res.write should return boolean\n // @ts-ignore\n res.write = function (buf): boolean {\n bytesout += buf.length;\n /* eslint prefer-rest-params: \"off\" */\n // @ts-ignore\n _write.apply(res, arguments);\n };\n\n const log = function (): void {\n const forwardedFor = req.get(HEADERS.FORWARDED_FOR);\n const remoteAddress = req.connection.remoteAddress;\n const remoteIP = forwardedFor ? `${forwardedFor} via ${remoteAddress}` : remoteAddress;\n let message;\n if (res.locals._verdaccio_error) {\n message = LOG_VERDACCIO_ERROR;\n } else {\n message = LOG_VERDACCIO_BYTES;\n }\n\n req.url = req.originalUrl;\n req.log.http(\n {\n request: {\n method: req.method,\n url: req.url,\n },\n user: req.remote_user?.name || null,\n remoteIP,\n status: res.statusCode,\n error: res.locals._verdaccio_error,\n bytes: {\n in: bytesin,\n out: bytesout,\n },\n },\n message\n );\n req.originalUrl = req.url;\n };\n\n req.on('close', function (): void {\n log();\n });\n\n const _end = res.end;\n // @ts-ignore\n res.end = function (buf): void {\n if (buf) {\n bytesout += buf.length;\n }\n // @ts-ignore\n _end.apply(res, arguments);\n log();\n };\n next();\n };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AAA0C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAI1C;AACO,MAAMG,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAC7B,gFAAgF;AAC3E,MAAME,mBAAmB,GAAAD,OAAA,CAAAC,mBAAA,GAAG,GAAGF,kBAAkB,oBAAoB;AACrE,MAAMG,mBAAmB,GAAAF,OAAA,CAAAE,mBAAA,GAAG,GAAGH,kBAAkB,mCAAmC;AAEpF,MAAMI,GAAG,GAAIC,MAAM,IAAK;EAC7B,OAAO,SAASD,GAAGA,CAACE,GAAmB,EAAEC,GAAoB,EAAEC,IAAsB,EAAQ;IAC3F;IACAF,GAAG,CAACF,GAAG,GAAGC,MAAM,CAACI,KAAK,CAAC;MAAEC,GAAG,EAAE;IAAK,CAAC,CAAC;IAErC,MAAMC,KAAK,GAAGL,GAAG,CAACM,OAAO,CAACC,aA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AM;MACxB;MACA;MACA4B,IAAI,CAACvB,KAAK,CAACxB,GAAG,EAAEyB,SAAS,CAAC;MAC1B5B,GAAG,CAAC,CAAC;IACP,CAAC;IACDI,IAAI,CAAC,CAAC;EACR,CAAC;AACH,CAAC;AAACP,OAAA,CAAAG,GAAA,GAAAA,GAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-url-relative.js","names":["_debug","_interopRequireDefault","require","_nodeUrl","_core","e","__esModule","default","debug","buildDebug","makeURLrelative","req","res","next","original","url","URL","protocol","headers","host","error","errorUtils","getBadRequest","pathname","search","hash"],"sources":["../../src/middlewares/make-url-relative.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport { URL } from 'node:url';\n\nimport { errorUtils } from '@verdaccio/core';\n\nimport { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';\n\nconst debug = buildDebug('verdaccio:middleware:make-url-relative');\n\n/**\n * Removes the host from the URL and turns it into a relative URL.\n * @param req\n * @param res\n * @param next\n */\nexport function makeURLrelative(\n req: $RequestExtend,\n res: $ResponseExtend,\n next: $NextFunctionVer\n): void {\n const original = req.url;\n\n // npm requests can contain the full URL, including the hostname, for example:\n // tarball downloads. Removing the hostname makes the URL relative and allows\n // the application to handle requests in a more consistent way.\n\n let url;\n try {\n // In productive use, the URL is absolute (and base will be ignored)\n // In tests, the URL might brelative (and base will be used)\n // https://nodejs.org/docs/latest/api/url.html#new-urlinput-base\n url = new URL(req.url, `${req.protocol}://${req.headers.host}/`);\n } catch (error) {\n return next(errorUtils.getBadRequest(`Invalid URL: ${req.url} (${error})`));\n }\n\n // Rebuild the URL without hostname\n req.url = url.pathname + url.search + url.hash;\n\n if (original !== req.url) {\n debug('makeURLrelative: %o -> %o', original, req.url);\n } else {\n debug('makeURLrelative: %o (unchanged)', original);\n }\n next();\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,KAAA,GAAAF,OAAA;AAA6C,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAI7C,MAAMG,KAAK,GAAG,IAAAC,cAAU,EAAC,wCAAwC,CAAC;;AAElE;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,eAAeA,CAC7BC,GAAmB,EACnBC,GAAoB,EACpBC,IAAsB,EAChB;EACN,MAAMC,QAAQ,GAAGH,GAAG,CAACI,GAAG;;EAExB;EACA;EACA;;EAEA,IAAIA,GAAG;EACP,IAAI;IACF;IACA;IACA;IACAA,GAAG,GAAG,IAAIC,YAAG,CAACL,GAAG,CAACI,GAAG,EAAE,GAAGJ,GAAG,CAACM,QAAQ,MAAMN,GAAG,CAACO,OAAO,CAACC,IAAI,GAAG,CAAC;EAClE,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd,OAAOP,IAAI,CAACQ,gBAAU,CAACC,aAAa,CAAC,gBAAgBX,GAAG,CAACI,GAAG,KAAKK,KAAK,GAAG,CAAC,CAAC;EAC7E;;EAEA;EACAT,GAAG,CAACI,GAAG,GAAGA,GAAG,CAACQ,QAAQ,GAAGR,GAAG,CAACS,MAAM,GAAGT,GAAG,CAACU,IAAI;EAE9C,IAAIX,QAAQ,KAAKH,GAAG,CAACI,GAAG,EAAE;IACxBP,KAAK,CAAC,2BAA2B,EAAEM,QAAQ,EAAEH,GAAG,CAACI,GAAG,CAAC;EACvD,CAAC,MAAM;IACLP,KAAK,CAAC,iCAAiC,EAAEM,QAAQ,CAAC;EACpD;EACAD,IAAI,CAAC,CAAC;AACR","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"make-url-relative.js","names":["_debug","_interopRequireDefault","require","_nodeUrl","_core","e","__esModule","default","debug","buildDebug","makeURLrelative","req","res","next","original","url","URL","protocol","headers","host","error","errorUtils","getBadRequest","pathname","search","hash"],"sources":["../../src/middlewares/make-url-relative.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport { URL } from 'node:url';\n\nimport { errorUtils } from '@verdaccio/core';\n\nimport type { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';\n\nconst debug = buildDebug('verdaccio:middleware:make-url-relative');\n\n/**\n * Removes the host from the URL and turns it into a relative URL.\n * @param req\n * @param res\n * @param next\n */\nexport function makeURLrelative(\n req: $RequestExtend,\n res: $ResponseExtend,\n next: $NextFunctionVer\n): void {\n const original = req.url;\n\n // npm requests can contain the full URL, including the hostname, for example:\n // tarball downloads. Removing the hostname makes the URL relative and allows\n // the application to handle requests in a more consistent way.\n\n let url;\n try {\n // In productive use, the URL is absolute (and base will be ignored)\n // In tests, the URL might brelative (and base will be used)\n // https://nodejs.org/docs/latest/api/url.html#new-urlinput-base\n url = new URL(req.url, `${req.protocol}://${req.headers.host}/`);\n } catch (error) {\n return next(errorUtils.getBadRequest(`Invalid URL: ${req.url} (${error})`));\n }\n\n // Rebuild the URL without hostname\n req.url = url.pathname + url.search + url.hash;\n\n if (original !== req.url) {\n debug('makeURLrelative: %o -> %o', original, req.url);\n } else {\n debug('makeURLrelative: %o (unchanged)', original);\n }\n next();\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,KAAA,GAAAF,OAAA;AAA6C,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAI7C,MAAMG,KAAK,GAAG,IAAAC,cAAU,EAAC,wCAAwC,CAAC;;AAElE;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,eAAeA,CAC7BC,GAAmB,EACnBC,GAAoB,EACpBC,IAAsB,EAChB;EACN,MAAMC,QAAQ,GAAGH,GAAG,CAACI,GAAG;;EAExB;EACA;EACA;;EAEA,IAAIA,GAAG;EACP,IAAI;IACF;IACA;IACA;IACAA,GAAG,GAAG,IAAIC,YAAG,CAACL,GAAG,CAACI,GAAG,EAAE,GAAGJ,GAAG,CAACM,QAAQ,MAAMN,GAAG,CAACO,OAAO,CAACC,IAAI,GAAG,CAAC;EAClE,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd,OAAOP,IAAI,CAACQ,gBAAU,CAACC,aAAa,CAAC,gBAAgBX,GAAG,CAACI,GAAG,KAAKK,KAAK,GAAG,CAAC,CAAC;EAC7E;;EAEA;EACAT,GAAG,CAACI,GAAG,GAAGA,GAAG,CAACQ,QAAQ,GAAGR,GAAG,CAACS,MAAM,GAAGT,GAAG,CAACU,IAAI;EAE9C,IAAIX,QAAQ,KAAKH,GAAG,CAACI,GAAG,EAAE;IACxBP,KAAK,CAAC,2BAA2B,EAAEM,QAAQ,EAAEH,GAAG,CAACI,GAAG,CAAC;EACvD,CAAC,MAAM;IACLP,KAAK,CAAC,iCAAiC,EAAEM,QAAQ,CAAC;EACpD;EACAD,IAAI,CAAC,CAAC;AACR","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"match.js","names":["match","regexp","req","res","next","value","exec"],"sources":["../../src/middlewares/match.ts"],"sourcesContent":["import { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';\n\nexport function match(regexp: RegExp): any {\n return function (\n req: $RequestExtend,\n res: $ResponseExtend,\n next: $NextFunctionVer,\n value: string\n ): void {\n if (regexp.exec(value)) {\n next();\n } else {\n next('route');\n }\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,KAAKA,CAACC,MAAc,EAAO;EACzC,OAAO,UACLC,GAAmB,EACnBC,GAAoB,EACpBC,IAAsB,EACtBC,KAAa,EACP;IACN,IAAIJ,MAAM,CAACK,IAAI,CAACD,KAAK,CAAC,EAAE;MACtBD,IAAI,CAAC,CAAC;IACR,CAAC,MAAM;MACLA,IAAI,CAAC,OAAO,CAAC;IACf;EACF,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"match.js","names":["match","regexp","req","res","next","value","exec"],"sources":["../../src/middlewares/match.ts"],"sourcesContent":["import type { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';\n\nexport function match(regexp: RegExp): any {\n return function (\n req: $RequestExtend,\n res: $ResponseExtend,\n next: $NextFunctionVer,\n value: string\n ): void {\n if (regexp.exec(value)) {\n next();\n } else {\n next('route');\n }\n };\n}\n"],"mappings":";;;;;;AAEO,SAASA,KAAKA,CAACC,MAAc,EAAO;EACzC,OAAO,UACLC,GAAmB,EACnBC,GAAoB,EACpBC,IAAsB,EACtBC,KAAa,EACP;IACN,IAAIJ,MAAM,CAACK,IAAI,CAACD,KAAK,CAAC,EAAE;MACtBD,IAAI,CAAC,CAAC;IACR,CAAC,MAAM;MACLA,IAAI,CAAC,OAAO,CAAC;IACf;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.js","names":["_core","require","media","expect","req","res","next","header","headers","HEADER_TYPE","CONTENT_TYPE","errorUtils","getCode","HTTP_STATUS","UNSUPPORTED_MEDIA","split","trim","get"],"sources":["../../src/middlewares/media.ts"],"sourcesContent":["import { HEADER_TYPE, HTTP_STATUS, errorUtils } from '@verdaccio/core';\n\nimport { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';\n\nexport function media(expect: string | null): any {\n return function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {\n const header = req.headers[HEADER_TYPE.CONTENT_TYPE];\n if (!header) {\n next(\n errorUtils.getCode(\n HTTP_STATUS.UNSUPPORTED_MEDIA,\n 'content-type is missing, expect: ' + expect\n )\n );\n return;\n }\n\n if (typeof header !== 'string' || header.split(';')[0].trim() !== expect) {\n next(\n errorUtils.getCode(\n HTTP_STATUS.UNSUPPORTED_MEDIA,\n 'wrong content-type, expect: ' + expect + ', got: ' + req.get[HEADER_TYPE.CONTENT_TYPE]\n )\n );\n } else {\n next();\n }\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAIO,SAASC,KAAKA,CAACC,MAAqB,EAAO;EAChD,OAAO,UAAUC,GAAmB,EAAEC,GAAoB,EAAEC,IAAsB,EAAQ;IACxF,MAAMC,MAAM,GAAGH,GAAG,CAACI,OAAO,CAACC,iBAAW,CAACC,YAAY,CAAC;IACpD,IAAI,CAACH,MAAM,EAAE;MACXD,IAAI,CACFK,gBAAU,CAACC,OAAO,CAChBC,iBAAW,CAACC,iBAAiB,EAC7B,mCAAmC,GAAGX,MACxC,CACF,CAAC;MACD;IACF;IAEA,IAAI,OAAOI,MAAM,KAAK,QAAQ,IAAIA,MAAM,CAACQ,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,CAAC,KAAKb,MAAM,EAAE;MACxEG,IAAI,CACFK,gBAAU,CAACC,OAAO,CAChBC,iBAAW,CAACC,iBAAiB,EAC7B,8BAA8B,GAAGX,MAAM,GAAG,SAAS,GAAGC,GAAG,CAACa,GAAG,CAACR,iBAAW,CAACC,YAAY,CACxF,CACF,CAAC;IACH,CAAC,MAAM;MACLJ,IAAI,CAAC,CAAC;IACR;EACF,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"media.js","names":["_core","require","media","expect","req","res","next","header","headers","HEADER_TYPE","CONTENT_TYPE","errorUtils","getCode","HTTP_STATUS","UNSUPPORTED_MEDIA","split","trim","get"],"sources":["../../src/middlewares/media.ts"],"sourcesContent":["import { HEADER_TYPE, HTTP_STATUS, errorUtils } from '@verdaccio/core';\n\nimport type { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';\n\nexport function media(expect: string | null): any {\n return function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {\n const header = req.headers[HEADER_TYPE.CONTENT_TYPE];\n if (!header) {\n next(\n errorUtils.getCode(\n HTTP_STATUS.UNSUPPORTED_MEDIA,\n 'content-type is missing, expect: ' + expect\n )\n );\n return;\n }\n\n if (typeof header !== 'string' || header.split(';')[0].trim() !== expect) {\n next(\n errorUtils.getCode(\n HTTP_STATUS.UNSUPPORTED_MEDIA,\n 'wrong content-type, expect: ' + expect + ', got: ' + req.get[HEADER_TYPE.CONTENT_TYPE]\n )\n );\n } else {\n next();\n }\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAIO,SAASC,KAAKA,CAACC,MAAqB,EAAO;EAChD,OAAO,UAAUC,GAAmB,EAAEC,GAAoB,EAAEC,IAAsB,EAAQ;IACxF,MAAMC,MAAM,GAAGH,GAAG,CAACI,OAAO,CAACC,iBAAW,CAACC,YAAY,CAAC;IACpD,IAAI,CAACH,MAAM,EAAE;MACXD,IAAI,CACFK,gBAAU,CAACC,OAAO,CAChBC,iBAAW,CAACC,iBAAiB,EAC7B,mCAAmC,GAAGX,MACxC,CACF,CAAC;MACD;IACF;IAEA,IAAI,OAAOI,MAAM,KAAK,QAAQ,IAAIA,MAAM,CAACQ,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,CAAC,KAAKb,MAAM,EAAE;MACxEG,IAAI,CACFK,gBAAU,CAACC,OAAO,CAChBC,iBAAW,CAACC,iBAAiB,EAC7B,8BAA8B,GAAGX,MAAM,GAAG,SAAS,GAAGC,GAAG,CAACa,GAAG,CAACR,iBAAW,CAACC,YAAY,CACxF,CACF,CAAC;IACH,CAAC,MAAM;MACLJ,IAAI,CAAC,CAAC;IACR;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RateLimit as RateLimitType } from '@verdaccio/types';
|
|
1
|
+
import type { RateLimit as RateLimitType } from '@verdaccio/types';
|
|
2
2
|
export declare function rateLimit(rateLimitOptions?: RateLimitType): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rate-limit.js","names":["_expressRateLimit","_interopRequireDefault","require","e","__esModule","default","rateLimit","rateLimitOptions","limiter","RateLimit"],"sources":["../../src/middlewares/rate-limit.ts"],"sourcesContent":["import RateLimit from 'express-rate-limit';\n\nimport { RateLimit as RateLimitType } from '@verdaccio/types';\n\nexport function rateLimit(rateLimitOptions?: RateLimitType) {\n const limiter = new RateLimit(rateLimitOptions);\n return limiter;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAIpC,SAASG,SAASA,CAACC,gBAAgC,EAAE;EAC1D,MAAMC,OAAO,GAAG,IAAIC,yBAAS,CAACF,gBAAgB,CAAC;EAC/C,OAAOC,OAAO;AAChB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"rate-limit.js","names":["_expressRateLimit","_interopRequireDefault","require","e","__esModule","default","rateLimit","rateLimitOptions","limiter","RateLimit"],"sources":["../../src/middlewares/rate-limit.ts"],"sourcesContent":["import RateLimit from 'express-rate-limit';\n\nimport type { RateLimit as RateLimitType } from '@verdaccio/types';\n\nexport function rateLimit(rateLimitOptions?: RateLimitType) {\n const limiter = new RateLimit(rateLimitOptions);\n return limiter;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAIpC,SAASG,SAASA,CAACC,gBAAgC,EAAE;EAC1D,MAAMC,OAAO,GAAG,IAAIC,yBAAS,CAACF,gBAAgB,CAAC;EAC/C,OAAOC,OAAO;AAChB","ignoreList":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getRequestOptions = getRequestOptions;
|
|
7
|
+
var _debug = _interopRequireDefault(require("debug"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const debug = (0, _debug.default)('verdaccio:middleware:request-options');
|
|
10
|
+
function getRequestOptions(req) {
|
|
11
|
+
const requestOptions = {
|
|
12
|
+
// FIXME: decide if host should contain port or not
|
|
13
|
+
//
|
|
14
|
+
// Express 4:
|
|
15
|
+
// - req.host is marked as deprecated since it does not include the port
|
|
16
|
+
// - use req.headers['host'] instead, which includes the port
|
|
17
|
+
// Express 5:
|
|
18
|
+
// - req.host is fully supported and includes the port
|
|
19
|
+
// - https://expressjs.com/en/api.html#req.host
|
|
20
|
+
host: req.host,
|
|
21
|
+
protocol: req.protocol,
|
|
22
|
+
headers: req.headers,
|
|
23
|
+
remoteAddress: req.socket.remoteAddress,
|
|
24
|
+
byPassCache: req.query.write === 'true',
|
|
25
|
+
username: req.remote_user?.name ?? undefined
|
|
26
|
+
};
|
|
27
|
+
debug('request options: %o', requestOptions);
|
|
28
|
+
return requestOptions;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=request-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-options.js","names":["_debug","_interopRequireDefault","require","e","__esModule","default","debug","buildDebug","getRequestOptions","req","requestOptions","host","protocol","headers","remoteAddress","socket","byPassCache","query","write","username","remote_user","name","undefined"],"sources":["../../src/middlewares/request-options.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport type { IncomingHttpHeaders } from 'node:http';\n\nimport type { RequestOptions } from '@verdaccio/url';\n\nimport type { $RequestExtend } from '../types';\n\nconst debug = buildDebug('verdaccio:middleware:request-options');\n\nexport function getRequestOptions(req: $RequestExtend): RequestOptions {\n const requestOptions = {\n // FIXME: decide if host should contain port or not\n //\n // Express 4:\n // - req.host is marked as deprecated since it does not include the port\n // - use req.headers['host'] instead, which includes the port\n // Express 5:\n // - req.host is fully supported and includes the port\n // - https://expressjs.com/en/api.html#req.host\n host: req.host,\n protocol: req.protocol,\n headers: req.headers as IncomingHttpHeaders,\n remoteAddress: req.socket.remoteAddress,\n byPassCache: req.query.write === 'true',\n username: req.remote_user?.name ?? undefined,\n };\n\n debug('request options: %o', requestOptions);\n\n return requestOptions;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA+B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAO/B,MAAMG,KAAK,GAAG,IAAAC,cAAU,EAAC,sCAAsC,CAAC;AAEzD,SAASC,iBAAiBA,CAACC,GAAmB,EAAkB;EACrE,MAAMC,cAAc,GAAG;IACrB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACAC,IAAI,EAAEF,GAAG,CAACE,IAAI;IACdC,QAAQ,EAAEH,GAAG,CAACG,QAAQ;IACtBC,OAAO,EAAEJ,GAAG,CAACI,OAA8B;IAC3CC,aAAa,EAAEL,GAAG,CAACM,MAAM,CAACD,aAAa;IACvCE,WAAW,EAAEP,GAAG,CAACQ,KAAK,CAACC,KAAK,KAAK,MAAM;IACvCC,QAAQ,EAAEV,GAAG,CAACW,WAAW,EAAEC,IAAI,IAAIC;EACrC,CAAC;EAEDhB,KAAK,CAAC,qBAAqB,EAAEI,cAAc,CAAC;EAE5C,OAAOA,cAAc;AACvB","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';
|
|
1
|
+
import type { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';
|
|
2
2
|
export declare function userAgent(config: any): (_req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-agent.js","names":["_config","require","_core","userAgent","config","_req","res","next","setHeader","HEADERS","POWERED_BY","getUserAgent","user_agent"],"sources":["../../src/middlewares/user-agent.ts"],"sourcesContent":["import { getUserAgent } from '@verdaccio/config';\nimport { HEADERS } from '@verdaccio/core';\n\nimport { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';\n\nexport function userAgent(config) {\n return function (_req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {\n res.setHeader(HEADERS.POWERED_BY, getUserAgent(config?.user_agent));\n next();\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAIO,SAASE,SAASA,CAACC,MAAM,EAAE;EAChC,OAAO,UAAUC,IAAoB,EAAEC,GAAoB,EAAEC,IAAsB,EAAQ;IACzFD,GAAG,CAACE,SAAS,CAACC,aAAO,CAACC,UAAU,EAAE,IAAAC,oBAAY,EAACP,MAAM,EAAEQ,UAAU,CAAC,CAAC;IACnEL,IAAI,CAAC,CAAC;EACR,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"user-agent.js","names":["_config","require","_core","userAgent","config","_req","res","next","setHeader","HEADERS","POWERED_BY","getUserAgent","user_agent"],"sources":["../../src/middlewares/user-agent.ts"],"sourcesContent":["import { getUserAgent } from '@verdaccio/config';\nimport { HEADERS } from '@verdaccio/core';\n\nimport type { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';\n\nexport function userAgent(config) {\n return function (_req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {\n res.setHeader(HEADERS.POWERED_BY, getUserAgent(config?.user_agent));\n next();\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAIO,SAASE,SAASA,CAACC,MAAM,EAAE;EAChC,OAAO,UAAUC,IAAoB,EAAEC,GAAoB,EAAEC,IAAsB,EAAQ;IACzFD,GAAG,CAACE,SAAS,CAACC,aAAO,CAACC,UAAU,EAAE,IAAAC,oBAAY,EAACP,MAAM,EAAEQ,UAAU,CAAC,CAAC;IACnEL,IAAI,CAAC,CAAC;EACR,CAAC;AACH","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Response } from 'express';
|
|
2
|
-
import { ConfigYaml } from '@verdaccio/types';
|
|
2
|
+
import type { ConfigYaml } from '@verdaccio/types';
|
|
3
3
|
import type { RequestOptions } from '@verdaccio/url';
|
|
4
4
|
import type { Manifest } from './manifest';
|
|
5
|
-
import type {
|
|
5
|
+
import type { AssetManifest } from './template';
|
|
6
6
|
export declare function resolveLogo(logo: string | undefined, url_prefix: string | undefined, requestOptions: RequestOptions): string;
|
|
7
|
-
export default function renderHTML(config: ConfigYaml, manifest:
|
|
7
|
+
export default function renderHTML(config: ConfigYaml, manifest: AssetManifest, manifestFiles: Manifest | null | undefined, requestOptions: RequestOptions, res: Response): void;
|
|
@@ -22,7 +22,7 @@ const cache = new _lruCache.default({
|
|
|
22
22
|
});
|
|
23
23
|
const debug = (0, _debug.default)('verdaccio:web:render');
|
|
24
24
|
const defaultManifestFiles = {
|
|
25
|
-
js: ['
|
|
25
|
+
js: ['vendors.js', 'main.js'],
|
|
26
26
|
ico: 'favicon.ico',
|
|
27
27
|
css: []
|
|
28
28
|
};
|
|
@@ -114,7 +114,7 @@ function renderHTML(config, manifest, manifestFiles, requestOptions, res) {
|
|
|
114
114
|
hideDeprecatedVersions
|
|
115
115
|
};
|
|
116
116
|
let webPage;
|
|
117
|
-
|
|
117
|
+
const cacheKey = `template:${JSON.stringify(options)}`;
|
|
118
118
|
try {
|
|
119
119
|
webPage = cache.get(cacheKey);
|
|
120
120
|
if (!webPage) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderHTML.js","names":["_debug","_interopRequireDefault","require","_lruCache","_nodePath","_nodeUrl","_config","_core","_url","_template","_webUtils","e","__esModule","default","DEFAULT_LANGUAGE","cache","LRU","max","ttl","debug","buildDebug","defaultManifestFiles","js","ico","css","resolveLogo","logo","url_prefix","requestOptions","isLocalFile","isURLhasValidProtocol","getPublicUrl","path","basename","renderHTML","config","manifest","manifestFiles","res","base","URL","pathname","language","i18n","web","hideDeprecatedVersions","needHtmlCache","undefined","includes","html_cache","darkMode","title","WEB_TITLE","login","hasLogin","scope","favicon","logoDark","pkgManagers","version","locals","app_version","flags","experiments","primaryColor","validatePrimaryColor","primary_color","scriptsBodyAfter","metaScripts","scriptsbodyBefore","showInfo","showSettings","showThemeSwitch","showFooter","showSearch","showDownloadTarball","showRaw","showUplinks","Object","assign","bodyBefore","scriptsBodyBefore","options","webPage","cacheKey","JSON","stringify","get","renderTemplate","set","error","Error","stack","setHeader","HEADERS","TEXT_HTML","send"],"sources":["../../../../src/middlewares/web/utils/renderHTML.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport type { Response } from 'express';\nimport LRU from 'lru-cache';\nimport path from 'node:path';\nimport { URL } from 'node:url';\n\nimport { WEB_TITLE } from '@verdaccio/config';\nimport { HEADERS } from '@verdaccio/core';\nimport { ConfigYaml, TemplateUIOptions } from '@verdaccio/types';\nimport type { RequestOptions } from '@verdaccio/url';\nimport { getPublicUrl, isURLhasValidProtocol } from '@verdaccio/url';\n\nimport type { Manifest } from './manifest';\nimport renderTemplate from './template';\nimport type {
|
|
1
|
+
{"version":3,"file":"renderHTML.js","names":["_debug","_interopRequireDefault","require","_lruCache","_nodePath","_nodeUrl","_config","_core","_url","_template","_webUtils","e","__esModule","default","DEFAULT_LANGUAGE","cache","LRU","max","ttl","debug","buildDebug","defaultManifestFiles","js","ico","css","resolveLogo","logo","url_prefix","requestOptions","isLocalFile","isURLhasValidProtocol","getPublicUrl","path","basename","renderHTML","config","manifest","manifestFiles","res","base","URL","pathname","language","i18n","web","hideDeprecatedVersions","needHtmlCache","undefined","includes","html_cache","darkMode","title","WEB_TITLE","login","hasLogin","scope","favicon","logoDark","pkgManagers","version","locals","app_version","flags","experiments","primaryColor","validatePrimaryColor","primary_color","scriptsBodyAfter","metaScripts","scriptsbodyBefore","showInfo","showSettings","showThemeSwitch","showFooter","showSearch","showDownloadTarball","showRaw","showUplinks","Object","assign","bodyBefore","scriptsBodyBefore","options","webPage","cacheKey","JSON","stringify","get","renderTemplate","set","error","Error","stack","setHeader","HEADERS","TEXT_HTML","send"],"sources":["../../../../src/middlewares/web/utils/renderHTML.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport type { Response } from 'express';\nimport LRU from 'lru-cache';\nimport path from 'node:path';\nimport { URL } from 'node:url';\n\nimport { WEB_TITLE } from '@verdaccio/config';\nimport { HEADERS } from '@verdaccio/core';\nimport type { ConfigYaml, TemplateUIOptions } from '@verdaccio/types';\nimport type { RequestOptions } from '@verdaccio/url';\nimport { getPublicUrl, isURLhasValidProtocol } from '@verdaccio/url';\n\nimport type { Manifest } from './manifest';\nimport renderTemplate from './template';\nimport type { AssetManifest } from './template';\nimport { hasLogin, validatePrimaryColor } from './web-utils';\n\nconst DEFAULT_LANGUAGE = 'es-US';\nconst cache = new LRU({ max: 500, ttl: 1000 * 60 * 60 });\n\nconst debug = buildDebug('verdaccio:web:render');\n\nconst defaultManifestFiles: Manifest = {\n js: ['vendors.js', 'main.js'],\n ico: 'favicon.ico',\n css: [],\n};\n\nexport function resolveLogo(\n logo: string | undefined,\n url_prefix: string | undefined,\n requestOptions: RequestOptions\n) {\n if (typeof logo !== 'string') {\n return '';\n }\n const isLocalFile = logo && !isURLhasValidProtocol(logo);\n\n if (isLocalFile) {\n return `${getPublicUrl(url_prefix, requestOptions)}-/static/${path.basename(logo)}`;\n } else if (isURLhasValidProtocol(logo)) {\n return logo;\n } else {\n return '';\n }\n}\n\nexport default function renderHTML(\n config: ConfigYaml,\n manifest: AssetManifest,\n manifestFiles: Manifest | null | undefined,\n requestOptions: RequestOptions,\n res: Response\n) {\n const { url_prefix } = config;\n const base = getPublicUrl(config?.url_prefix, requestOptions);\n const basename = new URL(base).pathname;\n const language = config?.i18n?.web ?? DEFAULT_LANGUAGE;\n const hideDeprecatedVersions = config?.web?.hideDeprecatedVersions ?? false;\n // @ts-ignore\n const needHtmlCache = [undefined, null].includes(config?.web?.html_cache)\n ? true\n : config?.web?.html_cache;\n const darkMode = config?.web?.darkMode ?? false;\n const title = config?.web?.title ?? WEB_TITLE;\n const login = hasLogin(config);\n const scope = config?.web?.scope ?? '';\n const favicon = resolveLogo(config?.web?.favicon, config?.url_prefix, requestOptions);\n const logo = resolveLogo(config?.web?.logo, config?.url_prefix, requestOptions);\n const logoDark = resolveLogo(config?.web?.logoDark, config?.url_prefix, requestOptions);\n const pkgManagers = config?.web?.pkgManagers ?? ['yarn', 'pnpm', 'npm'];\n const version = res.locals.app_version ?? '';\n const flags = {\n ...config.flags,\n // legacy from 5.x\n ...config.experiments,\n };\n const primaryColor =\n validatePrimaryColor(config?.web?.primary_color ?? config?.web?.primaryColor) ?? '#4b5e40';\n const {\n scriptsBodyAfter,\n metaScripts,\n scriptsbodyBefore, // deprecated\n showInfo,\n showSettings,\n showThemeSwitch,\n showFooter,\n showSearch,\n showDownloadTarball,\n showRaw,\n showUplinks,\n } = Object.assign(\n {},\n {\n scriptsBodyAfter: [],\n bodyBefore: [],\n metaScripts: [],\n },\n config?.web\n );\n // Fallback\n let scriptsBodyBefore = config?.web?.scriptsBodyBefore;\n if (scriptsbodyBefore && !scriptsBodyBefore) {\n scriptsBodyBefore = scriptsbodyBefore;\n }\n const options: TemplateUIOptions = {\n showInfo,\n showSettings,\n showThemeSwitch,\n showFooter,\n showSearch,\n showDownloadTarball,\n showRaw,\n showUplinks,\n darkMode,\n url_prefix,\n basename,\n base,\n primaryColor,\n version,\n logo,\n logoDark,\n favicon,\n flags,\n login,\n pkgManagers,\n title,\n scope,\n language,\n hideDeprecatedVersions,\n };\n\n let webPage;\n\n const cacheKey = `template:${JSON.stringify(options)}`;\n\n try {\n webPage = cache.get(cacheKey);\n if (!webPage) {\n webPage = renderTemplate(\n {\n manifest: manifestFiles ?? defaultManifestFiles,\n options,\n scriptsBodyAfter,\n metaScripts,\n scriptsBodyBefore,\n },\n manifest\n );\n\n if (needHtmlCache) {\n cache.set(cacheKey, webPage);\n debug('set template cache');\n }\n } else {\n debug('reuse template cache');\n }\n } catch (error: any) {\n throw new Error(`theme could not be load, stack ${error.stack}`);\n }\n res.setHeader('Content-Type', HEADERS.TEXT_HTML);\n res.send(webPage);\n debug('web rendered');\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAGA,IAAAM,IAAA,GAAAN,OAAA;AAGA,IAAAO,SAAA,GAAAR,sBAAA,CAAAC,OAAA;AAEA,IAAAQ,SAAA,GAAAR,OAAA;AAA6D,SAAAD,uBAAAU,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE7D,MAAMG,gBAAgB,GAAG,OAAO;AAChC,MAAMC,KAAK,GAAG,IAAIC,iBAAG,CAAC;EAAEC,GAAG,EAAE,GAAG;EAAEC,GAAG,EAAE,IAAI,GAAG,EAAE,GAAG;AAAG,CAAC,CAAC;AAExD,MAAMC,KAAK,GAAG,IAAAC,cAAU,EAAC,sBAAsB,CAAC;AAEhD,MAAMC,oBAA8B,GAAG;EACrCC,EAAE,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC;EAC7BC,GAAG,EAAE,aAAa;EAClBC,GAAG,EAAE;AACP,CAAC;AAEM,SAASC,WAAWA,CACzBC,IAAwB,EACxBC,UAA8B,EAC9BC,cAA8B,EAC9B;EACA,IAAI,OAAOF,IAAI,KAAK,QAAQ,EAAE;IAC5B,OAAO,EAAE;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+1,5 @@
|
|
|
1
|
-
import { TemplateUIOptions } from '@verdaccio/types';
|
|
2
|
-
import { Manifest } from './manifest';
|
|
1
|
+
import type { TemplateUIOptions } from '@verdaccio/types';
|
|
2
|
+
import type { Manifest } from './manifest';
|
|
3
3
|
export type Template = {
|
|
4
4
|
manifest: Manifest;
|
|
5
5
|
options: TemplateUIOptions;
|
|
@@ -7,7 +7,7 @@ export type Template = {
|
|
|
7
7
|
scriptsBodyAfter?: string[];
|
|
8
8
|
scriptsBodyBefore?: string[];
|
|
9
9
|
};
|
|
10
|
-
export interface
|
|
10
|
+
export interface AssetManifest {
|
|
11
11
|
[key: string]: string;
|
|
12
12
|
}
|
|
13
|
-
export default function renderTemplate(template: Template, manifest:
|
|
13
|
+
export default function renderTemplate(template: Template, manifest: AssetManifest): string;
|
|
@@ -8,9 +8,6 @@ var _debug = _interopRequireDefault(require("debug"));
|
|
|
8
8
|
var _manifest = require("./manifest");
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
const debug = (0, _debug.default)('verdaccio:web:render:template');
|
|
11
|
-
|
|
12
|
-
// the outcome of the Webpack Manifest Plugin
|
|
13
|
-
|
|
14
11
|
function renderTemplate(template, manifest) {
|
|
15
12
|
debug('template %o', template);
|
|
16
13
|
debug('manifest %o', manifest);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","names":["_debug","_interopRequireDefault","require","_manifest","e","__esModule","default","debug","buildDebug","renderTemplate","template","manifest","options","base","title","JSON","stringify","metaScripts","join","scriptsBodyBefore","getManifestValue","js","map","item","scriptsBodyAfter"],"sources":["../../../../src/middlewares/web/utils/template.ts"],"sourcesContent":["import buildDebug from 'debug';\n\nimport { TemplateUIOptions } from '@verdaccio/types';\n\nimport { Manifest
|
|
1
|
+
{"version":3,"file":"template.js","names":["_debug","_interopRequireDefault","require","_manifest","e","__esModule","default","debug","buildDebug","renderTemplate","template","manifest","options","base","title","JSON","stringify","metaScripts","join","scriptsBodyBefore","getManifestValue","js","map","item","scriptsBodyAfter"],"sources":["../../../../src/middlewares/web/utils/template.ts"],"sourcesContent":["import buildDebug from 'debug';\n\nimport type { TemplateUIOptions } from '@verdaccio/types';\n\nimport type { Manifest } from './manifest';\nimport { getManifestValue } from './manifest';\n\nconst debug = buildDebug('verdaccio:web:render:template');\n\nexport type Template = {\n manifest: Manifest;\n options: TemplateUIOptions;\n metaScripts?: string[];\n scriptsBodyAfter?: string[];\n scriptsBodyBefore?: string[];\n};\n\nexport interface AssetManifest {\n [key: string]: string;\n}\n\nexport default function renderTemplate(template: Template, manifest: AssetManifest) {\n debug('template %o', template);\n debug('manifest %o', manifest);\n\n return `\n <!DOCTYPE html>\n <html lang=\"en-us\">\n <head>\n <meta charset=\"utf-8\">\n <base href=\"${template?.options.base}\">\n <title>${template?.options?.title ?? ''}</title>\n <link rel=\"icon\" href=\"${template?.options.base}-/static/favicon.ico\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <script>\n window.__VERDACCIO_BASENAME_UI_OPTIONS=${JSON.stringify(template.options)}\n </script>\n ${template?.metaScripts ? template.metaScripts.join('') : ''}\n </head>\n <body class=\"body\">\n ${template?.scriptsBodyBefore ? template.scriptsBodyBefore.join('') : ''}\n <div id=\"root\"></div>\n ${getManifestValue(template.manifest.js, manifest, template?.options.base)\n .map((item) => `<script defer=\"defer\" src=\"${item}\"></script>`)\n .join(`\\n `)}\n ${template?.scriptsBodyAfter ? template.scriptsBodyAfter.join('') : ''}\n </body>\n </html>\n `;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AAA8C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9C,MAAMG,KAAK,GAAG,IAAAC,cAAU,EAAC,+BAA+B,CAAC;AAc1C,SAASC,cAAcA,CAACC,QAAkB,EAAEC,QAAuB,EAAE;EAClFJ,KAAK,CAAC,aAAa,EAAEG,QAAQ,CAAC;EAC9BH,KAAK,CAAC,aAAa,EAAEI,QAAQ,CAAC;EAE9B,OAAO;AACT;AACA;AACA;AACA;AACA,sBAAsBD,QAAQ,EAAEE,OAAO,CAACC,IAAI;AAC5C,iBAAiBH,QAAQ,EAAEE,OAAO,EAAEE,KAAK,IAAI,EAAE;AAC/C,iCAAiCJ,QAAQ,EAAEE,OAAO,CAACC,IAAI;AACvD;AACA;AACA,qDAAqDE,IAAI,CAACC,SAAS,CAACN,QAAQ,CAACE,OAAO,CAAC;AACrF;AACA,UAAUF,QAAQ,EAAEO,WAAW,GAAGP,QAAQ,CAACO,WAAW,CAACC,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE;AACpE;AACA;AACA,UAAUR,QAAQ,EAAES,iBAAiB,GAAGT,QAAQ,CAACS,iBAAiB,CAACD,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE;AAChF;AACA,UAAU,IAAAE,0BAAgB,EAACV,QAAQ,CAACC,QAAQ,CAACU,EAAE,EAAEV,QAAQ,EAAED,QAAQ,EAAEE,OAAO,CAACC,IAAI,CAAC,CACvES,GAAG,CAAEC,IAAI,IAAK,8BAA8BA,IAAI,aAAa,CAAC,CAC9DL,IAAI,CAAC,YAAY,CAAC;AAC7B,UAAUR,QAAQ,EAAEc,gBAAgB,GAAGd,QAAQ,CAACc,gBAAgB,CAACN,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE;AAC9E;AACA;AACA,GAAG;AACH","ignoreList":[]}
|
|
@@ -9,7 +9,6 @@ var _validation = require("../validation");
|
|
|
9
9
|
var _security = require("./security");
|
|
10
10
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
11
|
function webAPIMiddleware(tokenMiddleware, webEndpointsApi) {
|
|
12
|
-
// eslint-disable-next-line new-cap
|
|
13
12
|
const route = (0, _express.Router)();
|
|
14
13
|
// validate all of these params as a package name
|
|
15
14
|
// this might be too harsh, so ask if it causes trouble=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-api.js","names":["_express","_interopRequireWildcard","require","_validation","_security","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","webAPIMiddleware","tokenMiddleware","webEndpointsApi","route","Router","param","validatePackage","validateName","use","express","urlencoded","extended","setSecurityWebHeaders"],"sources":["../../../src/middlewares/web/web-api.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"web-api.js","names":["_express","_interopRequireWildcard","require","_validation","_security","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","webAPIMiddleware","tokenMiddleware","webEndpointsApi","route","Router","param","validatePackage","validateName","use","express","urlencoded","extended","setSecurityWebHeaders"],"sources":["../../../src/middlewares/web/web-api.ts"],"sourcesContent":["import type { RequestHandler } from 'express';\nimport express, { Router } from 'express';\n\nimport { validateName, validatePackage } from '../validation';\nimport { setSecurityWebHeaders } from './security';\n\nexport function webAPIMiddleware(\n tokenMiddleware: RequestHandler,\n webEndpointsApi: RequestHandler\n): Router {\n const route = Router();\n // validate all of these params as a package name\n // this might be too harsh, so ask if it causes trouble=\n route.param('package', validatePackage);\n route.param('filename', validateName);\n route.param('version', validateName);\n route.use(express.urlencoded({ extended: false }));\n route.use(setSecurityWebHeaders);\n\n if (typeof tokenMiddleware === 'function') {\n route.use(tokenMiddleware);\n }\n\n if (typeof webEndpointsApi === 'function') {\n route.use(webEndpointsApi);\n }\n\n return route;\n}\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAAmD,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,CAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAE5C,SAASkB,gBAAgBA,CAC9BC,eAA+B,EAC/BC,eAA+B,EACvB;EACR,MAAMC,KAAK,GAAG,IAAAC,eAAM,EAAC,CAAC;EACtB;EACA;EACAD,KAAK,CAACE,KAAK,CAAC,SAAS,EAAEC,2BAAe,CAAC;EACvCH,KAAK,CAACE,KAAK,CAAC,UAAU,EAAEE,wBAAY,CAAC;EACrCJ,KAAK,CAACE,KAAK,CAAC,SAAS,EAAEE,wBAAY,CAAC;EACpCJ,KAAK,CAACK,GAAG,CAACC,gBAAO,CAACC,UAAU,CAAC;IAAEC,QAAQ,EAAE;EAAM,CAAC,CAAC,CAAC;EAClDR,KAAK,CAACK,GAAG,CAACI,+BAAqB,CAAC;EAEhC,IAAI,OAAOX,eAAe,KAAK,UAAU,EAAE;IACzCE,KAAK,CAACK,GAAG,CAACP,eAAe,CAAC;EAC5B;EAEA,IAAI,OAAOC,eAAe,KAAK,UAAU,EAAE;IACzCC,KAAK,CAACK,GAAG,CAACN,eAAe,CAAC;EAC5B;EAEA,OAAOC,KAAK;AACd","ignoreList":[]}
|
|
@@ -10,7 +10,6 @@ var _webApi = require("./web-api");
|
|
|
10
10
|
var _webUrls = require("./web-urls");
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
var _default = (config, middlewares, pluginOptions) => {
|
|
13
|
-
// eslint-disable-next-line new-cap
|
|
14
13
|
const router = _express.default.Router();
|
|
15
14
|
const {
|
|
16
15
|
tokenMiddleware,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-middleware.js","names":["_express","_interopRequireDefault","require","_renderWeb","_webApi","_webUrls","e","__esModule","default","_default","config","middlewares","pluginOptions","router","express","Router","tokenMiddleware","webEndpointsApi","use","WebUrlsNamespace","root","renderWebMiddleware","endpoints","webAPIMiddleware","exports"],"sources":["../../../src/middlewares/web/web-middleware.ts"],"sourcesContent":["import express from 'express';\n\nimport { renderWebMiddleware } from './render-web';\nimport { webAPIMiddleware } from './web-api';\nimport { WebUrlsNamespace } from './web-urls';\n\nexport default (config, middlewares, pluginOptions): any => {\n
|
|
1
|
+
{"version":3,"file":"web-middleware.js","names":["_express","_interopRequireDefault","require","_renderWeb","_webApi","_webUrls","e","__esModule","default","_default","config","middlewares","pluginOptions","router","express","Router","tokenMiddleware","webEndpointsApi","use","WebUrlsNamespace","root","renderWebMiddleware","endpoints","webAPIMiddleware","exports"],"sources":["../../../src/middlewares/web/web-middleware.ts"],"sourcesContent":["import express from 'express';\n\nimport { renderWebMiddleware } from './render-web';\nimport { webAPIMiddleware } from './web-api';\nimport { WebUrlsNamespace } from './web-urls';\n\nexport default (config, middlewares, pluginOptions): any => {\n const router = express.Router();\n const { tokenMiddleware, webEndpointsApi } = middlewares;\n // render web\n router.use(WebUrlsNamespace.root, renderWebMiddleware(config, tokenMiddleware, pluginOptions));\n // web endpoints: search, packages, readme, sidebar, etc\n router.use(WebUrlsNamespace.endpoints, webAPIMiddleware(tokenMiddleware, webEndpointsApi));\n return router;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAA8C,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAE/BA,CAACC,MAAM,EAAEC,WAAW,EAAEC,aAAa,KAAU;EAC1D,MAAMC,MAAM,GAAGC,gBAAO,CAACC,MAAM,CAAC,CAAC;EAC/B,MAAM;IAAEC,eAAe;IAAEC;EAAgB,CAAC,GAAGN,WAAW;EACxD;EACAE,MAAM,CAACK,GAAG,CAACC,yBAAgB,CAACC,IAAI,EAAE,IAAAC,8BAAmB,EAACX,MAAM,EAAEM,eAAe,EAAEJ,aAAa,CAAC,CAAC;EAC9F;EACAC,MAAM,CAACK,GAAG,CAACC,yBAAgB,CAACG,SAAS,EAAE,IAAAC,wBAAgB,EAACP,eAAe,EAAEC,eAAe,CAAC,CAAC;EAC1F,OAAOJ,MAAM;AACf,CAAC;AAAAW,OAAA,CAAAhB,OAAA,GAAAC,QAAA","ignoreList":[]}
|
package/build/types.d.ts
CHANGED
package/build/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["import type { NextFunction, Request, Response } from 'express';\n\nimport { Logger, RemoteUser } from '@verdaccio/types';\n\nexport type $RequestExtend = Request & { remote_user?: RemoteUser; log: Logger };\nexport type $ResponseExtend = Response & { cookies?: any };\nexport type $NextFunctionVer = NextFunction & any;\n\nexport interface MiddlewareError {\n error: string;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["import type { NextFunction, Request, Response } from 'express';\n\nimport type { Logger, RemoteUser } from '@verdaccio/types';\n\nexport type $RequestExtend = Request & { remote_user?: RemoteUser; log: Logger };\nexport type $ResponseExtend = Response & { cookies?: any };\nexport type $NextFunctionVer = NextFunction & any;\n\nexport interface MiddlewareError {\n error: string;\n}\n"],"mappings":"","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verdaccio/middleware",
|
|
3
|
-
"version": "8.0.0-next-8.
|
|
3
|
+
"version": "8.0.0-next-8.32",
|
|
4
4
|
"description": "Verdaccio Express Middleware",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"node": ">=18"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@verdaccio/config": "8.0.0-next-8.
|
|
37
|
-
"@verdaccio/core": "8.0.0-next-8.
|
|
38
|
-
"@verdaccio/url": "13.0.0-next-8.
|
|
36
|
+
"@verdaccio/config": "8.0.0-next-8.32",
|
|
37
|
+
"@verdaccio/core": "8.0.0-next-8.32",
|
|
38
|
+
"@verdaccio/url": "13.0.0-next-8.32",
|
|
39
39
|
"debug": "4.4.3",
|
|
40
40
|
"express": "4.22.1",
|
|
41
41
|
"express-rate-limit": "5.5.1",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"url": "https://opencollective.com/verdaccio"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@verdaccio/logger": "8.0.0-next-8.
|
|
51
|
-
"@verdaccio/types": "13.0.0-next-8.
|
|
50
|
+
"@verdaccio/logger": "8.0.0-next-8.32",
|
|
51
|
+
"@verdaccio/types": "13.0.0-next-8.11",
|
|
52
52
|
"http-errors": "2.0.1",
|
|
53
53
|
"supertest": "7.1.4",
|
|
54
54
|
"jsdom": "26.1.0",
|