@alanszp/express-common-fn 12.0.2 → 13.0.0
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/dist/commonErrorsHandler.d.ts +3 -0
- package/dist/commonErrorsHandler.js +3 -0
- package/dist/commonErrorsHandler.js.map +1 -1
- package/package.json +6 -9
- package/.gitignore +0 -3
- package/.npmignore +0 -3
- package/node_modules/@alanszp/audit/.gitignore +0 -3
- package/node_modules/@alanszp/audit/.npmignore +0 -3
- package/node_modules/@alanszp/audit/LICENSE +0 -21
- package/node_modules/@alanszp/audit/dist/audit.d.ts +0 -9
- package/node_modules/@alanszp/audit/dist/audit.js +0 -25
- package/node_modules/@alanszp/audit/dist/audit.js.map +0 -1
- package/node_modules/@alanszp/audit/dist/auditWithState.d.ts +0 -10
- package/node_modules/@alanszp/audit/dist/auditWithState.js +0 -22
- package/node_modules/@alanszp/audit/dist/auditWithState.js.map +0 -1
- package/node_modules/@alanszp/audit/dist/errors/AuditError.d.ts +0 -3
- package/node_modules/@alanszp/audit/dist/errors/AuditError.js +0 -8
- package/node_modules/@alanszp/audit/dist/errors/AuditError.js.map +0 -1
- package/node_modules/@alanszp/audit/dist/errors/MissingAuditFieldsError.d.ts +0 -9
- package/node_modules/@alanszp/audit/dist/errors/MissingAuditFieldsError.js +0 -23
- package/node_modules/@alanszp/audit/dist/errors/MissingAuditFieldsError.js.map +0 -1
- package/node_modules/@alanszp/audit/dist/errors/index.d.ts +0 -2
- package/node_modules/@alanszp/audit/dist/errors/index.js +0 -19
- package/node_modules/@alanszp/audit/dist/errors/index.js.map +0 -1
- package/node_modules/@alanszp/audit/dist/factory.d.ts +0 -4
- package/node_modules/@alanszp/audit/dist/factory.js +0 -16
- package/node_modules/@alanszp/audit/dist/factory.js.map +0 -1
- package/node_modules/@alanszp/audit/dist/index.d.ts +0 -5
- package/node_modules/@alanszp/audit/dist/index.js +0 -22
- package/node_modules/@alanszp/audit/dist/index.js.map +0 -1
- package/node_modules/@alanszp/audit/dist/interfaces.d.ts +0 -22
- package/node_modules/@alanszp/audit/dist/interfaces.js +0 -18
- package/node_modules/@alanszp/audit/dist/interfaces.js.map +0 -1
- package/node_modules/@alanszp/audit/node_modules/@types/node/LICENSE +0 -21
- package/node_modules/@alanszp/audit/node_modules/@types/node/README.md +0 -15
- package/node_modules/@alanszp/audit/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/node_modules/@alanszp/audit/node_modules/@types/node/assert.d.ts +0 -996
- package/node_modules/@alanszp/audit/node_modules/@types/node/async_hooks.d.ts +0 -539
- package/node_modules/@alanszp/audit/node_modules/@types/node/buffer.d.ts +0 -2362
- package/node_modules/@alanszp/audit/node_modules/@types/node/child_process.d.ts +0 -1540
- package/node_modules/@alanszp/audit/node_modules/@types/node/cluster.d.ts +0 -432
- package/node_modules/@alanszp/audit/node_modules/@types/node/console.d.ts +0 -415
- package/node_modules/@alanszp/audit/node_modules/@types/node/constants.d.ts +0 -19
- package/node_modules/@alanszp/audit/node_modules/@types/node/crypto.d.ts +0 -4487
- package/node_modules/@alanszp/audit/node_modules/@types/node/dgram.d.ts +0 -596
- package/node_modules/@alanszp/audit/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
- package/node_modules/@alanszp/audit/node_modules/@types/node/dns/promises.d.ts +0 -425
- package/node_modules/@alanszp/audit/node_modules/@types/node/dns.d.ts +0 -809
- package/node_modules/@alanszp/audit/node_modules/@types/node/dom-events.d.ts +0 -122
- package/node_modules/@alanszp/audit/node_modules/@types/node/domain.d.ts +0 -170
- package/node_modules/@alanszp/audit/node_modules/@types/node/events.d.ts +0 -879
- package/node_modules/@alanszp/audit/node_modules/@types/node/fs/promises.d.ts +0 -1239
- package/node_modules/@alanszp/audit/node_modules/@types/node/fs.d.ts +0 -4311
- package/node_modules/@alanszp/audit/node_modules/@types/node/globals.d.ts +0 -411
- package/node_modules/@alanszp/audit/node_modules/@types/node/globals.global.d.ts +0 -1
- package/node_modules/@alanszp/audit/node_modules/@types/node/http.d.ts +0 -1887
- package/node_modules/@alanszp/audit/node_modules/@types/node/http2.d.ts +0 -2382
- package/node_modules/@alanszp/audit/node_modules/@types/node/https.d.ts +0 -550
- package/node_modules/@alanszp/audit/node_modules/@types/node/index.d.ts +0 -88
- package/node_modules/@alanszp/audit/node_modules/@types/node/inspector.d.ts +0 -2747
- package/node_modules/@alanszp/audit/node_modules/@types/node/module.d.ts +0 -315
- package/node_modules/@alanszp/audit/node_modules/@types/node/net.d.ts +0 -949
- package/node_modules/@alanszp/audit/node_modules/@types/node/os.d.ts +0 -478
- package/node_modules/@alanszp/audit/node_modules/@types/node/package.json +0 -229
- package/node_modules/@alanszp/audit/node_modules/@types/node/path.d.ts +0 -191
- package/node_modules/@alanszp/audit/node_modules/@types/node/perf_hooks.d.ts +0 -645
- package/node_modules/@alanszp/audit/node_modules/@types/node/process.d.ts +0 -1561
- package/node_modules/@alanszp/audit/node_modules/@types/node/punycode.d.ts +0 -117
- package/node_modules/@alanszp/audit/node_modules/@types/node/querystring.d.ts +0 -141
- package/node_modules/@alanszp/audit/node_modules/@types/node/readline/promises.d.ts +0 -150
- package/node_modules/@alanszp/audit/node_modules/@types/node/readline.d.ts +0 -539
- package/node_modules/@alanszp/audit/node_modules/@types/node/repl.d.ts +0 -430
- package/node_modules/@alanszp/audit/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/node_modules/@alanszp/audit/node_modules/@types/node/stream/promises.d.ts +0 -83
- package/node_modules/@alanszp/audit/node_modules/@types/node/stream/web.d.ts +0 -366
- package/node_modules/@alanszp/audit/node_modules/@types/node/stream.d.ts +0 -1701
- package/node_modules/@alanszp/audit/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/node_modules/@alanszp/audit/node_modules/@types/node/test.d.ts +0 -1465
- package/node_modules/@alanszp/audit/node_modules/@types/node/timers/promises.d.ts +0 -93
- package/node_modules/@alanszp/audit/node_modules/@types/node/timers.d.ts +0 -240
- package/node_modules/@alanszp/audit/node_modules/@types/node/tls.d.ts +0 -1210
- package/node_modules/@alanszp/audit/node_modules/@types/node/trace_events.d.ts +0 -182
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/console.d.ts +0 -415
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/events.d.ts +0 -879
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/https.d.ts +0 -550
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/index.d.ts +0 -88
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/module.d.ts +0 -315
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/net.d.ts +0 -949
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/os.d.ts +0 -478
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/path.d.ts +0 -191
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/url.d.ts +0 -927
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
- package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
- package/node_modules/@alanszp/audit/node_modules/@types/node/tty.d.ts +0 -208
- package/node_modules/@alanszp/audit/node_modules/@types/node/url.d.ts +0 -927
- package/node_modules/@alanszp/audit/node_modules/@types/node/util.d.ts +0 -2183
- package/node_modules/@alanszp/audit/node_modules/@types/node/v8.d.ts +0 -764
- package/node_modules/@alanszp/audit/node_modules/@types/node/vm.d.ts +0 -903
- package/node_modules/@alanszp/audit/node_modules/@types/node/wasi.d.ts +0 -179
- package/node_modules/@alanszp/audit/node_modules/@types/node/worker_threads.d.ts +0 -691
- package/node_modules/@alanszp/audit/node_modules/@types/node/zlib.d.ts +0 -517
- package/node_modules/@alanszp/audit/package.json +0 -32
- package/node_modules/@alanszp/audit/src/audit.ts +0 -31
- package/node_modules/@alanszp/audit/src/auditWithState.ts +0 -27
- package/node_modules/@alanszp/audit/src/errors/AuditError.ts +0 -3
- package/node_modules/@alanszp/audit/src/errors/MissingAuditFieldsError.ts +0 -25
- package/node_modules/@alanszp/audit/src/errors/index.ts +0 -2
- package/node_modules/@alanszp/audit/src/factory.ts +0 -16
- package/node_modules/@alanszp/audit/src/index.ts +0 -5
- package/node_modules/@alanszp/audit/src/interfaces.ts +0 -38
- package/node_modules/@alanszp/audit/tsconfig.json +0 -15
- package/node_modules/@alanszp/errors/.gitignore +0 -3
- package/node_modules/@alanszp/errors/.npmignore +0 -3
- package/node_modules/@alanszp/errors/LICENSE +0 -21
- package/node_modules/@alanszp/errors/dist/BaseError.d.ts +0 -3
- package/node_modules/@alanszp/errors/dist/BaseError.js +0 -18
- package/node_modules/@alanszp/errors/dist/BaseError.js.map +0 -1
- package/node_modules/@alanszp/errors/dist/HttpRenderableError.d.ts +0 -4
- package/node_modules/@alanszp/errors/dist/HttpRenderableError.js +0 -8
- package/node_modules/@alanszp/errors/dist/HttpRenderableError.js.map +0 -1
- package/node_modules/@alanszp/errors/dist/InternalServerError.d.ts +0 -8
- package/node_modules/@alanszp/errors/dist/InternalServerError.js +0 -24
- package/node_modules/@alanszp/errors/dist/InternalServerError.js.map +0 -1
- package/node_modules/@alanszp/errors/dist/RenderableError.d.ts +0 -15
- package/node_modules/@alanszp/errors/dist/RenderableError.js +0 -27
- package/node_modules/@alanszp/errors/dist/RenderableError.js.map +0 -1
- package/node_modules/@alanszp/errors/dist/index.d.ts +0 -4
- package/node_modules/@alanszp/errors/dist/index.js +0 -17
- package/node_modules/@alanszp/errors/dist/index.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/.gitignore +0 -3
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/.npmignore +0 -3
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/LICENSE +0 -21
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/appIdentifier.d.ts +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/appIdentifier.js +0 -10
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/appIdentifier.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/index.d.ts +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/index.js +0 -18
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/index.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/assignKey.d.ts +0 -2
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/assignKey.js +0 -20
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/assignKey.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/index.d.ts +0 -2
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/index.js +0 -19
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/index.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/keepOrUpdate.d.ts +0 -3
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/keepOrUpdate.js +0 -26
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/keepOrUpdate.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/types.d.ts +0 -6
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/types.js +0 -3
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/types.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/index.d.ts +0 -4
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/index.js +0 -21
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/index.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/ListResult.d.ts +0 -7
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/ListResult.js +0 -8
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/ListResult.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Orderable.d.ts +0 -11
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Orderable.js +0 -13
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Orderable.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Paginable.d.ts +0 -14
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Paginable.js +0 -22
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Paginable.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/index.d.ts +0 -3
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/index.js +0 -20
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/index.js.map +0 -1
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/package.json +0 -25
- package/node_modules/@alanszp/errors/node_modules/@alanszp/core/tsconfig.json +0 -15
- package/node_modules/@alanszp/errors/node_modules/@types/node/LICENSE +0 -21
- package/node_modules/@alanszp/errors/node_modules/@types/node/README.md +0 -15
- package/node_modules/@alanszp/errors/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/node_modules/@alanszp/errors/node_modules/@types/node/assert.d.ts +0 -996
- package/node_modules/@alanszp/errors/node_modules/@types/node/async_hooks.d.ts +0 -539
- package/node_modules/@alanszp/errors/node_modules/@types/node/buffer.d.ts +0 -2362
- package/node_modules/@alanszp/errors/node_modules/@types/node/child_process.d.ts +0 -1540
- package/node_modules/@alanszp/errors/node_modules/@types/node/cluster.d.ts +0 -432
- package/node_modules/@alanszp/errors/node_modules/@types/node/console.d.ts +0 -415
- package/node_modules/@alanszp/errors/node_modules/@types/node/constants.d.ts +0 -19
- package/node_modules/@alanszp/errors/node_modules/@types/node/crypto.d.ts +0 -4487
- package/node_modules/@alanszp/errors/node_modules/@types/node/dgram.d.ts +0 -596
- package/node_modules/@alanszp/errors/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
- package/node_modules/@alanszp/errors/node_modules/@types/node/dns/promises.d.ts +0 -425
- package/node_modules/@alanszp/errors/node_modules/@types/node/dns.d.ts +0 -809
- package/node_modules/@alanszp/errors/node_modules/@types/node/dom-events.d.ts +0 -122
- package/node_modules/@alanszp/errors/node_modules/@types/node/domain.d.ts +0 -170
- package/node_modules/@alanszp/errors/node_modules/@types/node/events.d.ts +0 -879
- package/node_modules/@alanszp/errors/node_modules/@types/node/fs/promises.d.ts +0 -1239
- package/node_modules/@alanszp/errors/node_modules/@types/node/fs.d.ts +0 -4311
- package/node_modules/@alanszp/errors/node_modules/@types/node/globals.d.ts +0 -411
- package/node_modules/@alanszp/errors/node_modules/@types/node/globals.global.d.ts +0 -1
- package/node_modules/@alanszp/errors/node_modules/@types/node/http.d.ts +0 -1887
- package/node_modules/@alanszp/errors/node_modules/@types/node/http2.d.ts +0 -2382
- package/node_modules/@alanszp/errors/node_modules/@types/node/https.d.ts +0 -550
- package/node_modules/@alanszp/errors/node_modules/@types/node/index.d.ts +0 -88
- package/node_modules/@alanszp/errors/node_modules/@types/node/inspector.d.ts +0 -2747
- package/node_modules/@alanszp/errors/node_modules/@types/node/module.d.ts +0 -315
- package/node_modules/@alanszp/errors/node_modules/@types/node/net.d.ts +0 -949
- package/node_modules/@alanszp/errors/node_modules/@types/node/os.d.ts +0 -478
- package/node_modules/@alanszp/errors/node_modules/@types/node/package.json +0 -229
- package/node_modules/@alanszp/errors/node_modules/@types/node/path.d.ts +0 -191
- package/node_modules/@alanszp/errors/node_modules/@types/node/perf_hooks.d.ts +0 -645
- package/node_modules/@alanszp/errors/node_modules/@types/node/process.d.ts +0 -1561
- package/node_modules/@alanszp/errors/node_modules/@types/node/punycode.d.ts +0 -117
- package/node_modules/@alanszp/errors/node_modules/@types/node/querystring.d.ts +0 -141
- package/node_modules/@alanszp/errors/node_modules/@types/node/readline/promises.d.ts +0 -150
- package/node_modules/@alanszp/errors/node_modules/@types/node/readline.d.ts +0 -539
- package/node_modules/@alanszp/errors/node_modules/@types/node/repl.d.ts +0 -430
- package/node_modules/@alanszp/errors/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/node_modules/@alanszp/errors/node_modules/@types/node/stream/promises.d.ts +0 -83
- package/node_modules/@alanszp/errors/node_modules/@types/node/stream/web.d.ts +0 -366
- package/node_modules/@alanszp/errors/node_modules/@types/node/stream.d.ts +0 -1701
- package/node_modules/@alanszp/errors/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/node_modules/@alanszp/errors/node_modules/@types/node/test.d.ts +0 -1465
- package/node_modules/@alanszp/errors/node_modules/@types/node/timers/promises.d.ts +0 -93
- package/node_modules/@alanszp/errors/node_modules/@types/node/timers.d.ts +0 -240
- package/node_modules/@alanszp/errors/node_modules/@types/node/tls.d.ts +0 -1210
- package/node_modules/@alanszp/errors/node_modules/@types/node/trace_events.d.ts +0 -182
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/console.d.ts +0 -415
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/events.d.ts +0 -879
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/https.d.ts +0 -550
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/index.d.ts +0 -88
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/module.d.ts +0 -315
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/net.d.ts +0 -949
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/os.d.ts +0 -478
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/path.d.ts +0 -191
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/url.d.ts +0 -927
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
- package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
- package/node_modules/@alanszp/errors/node_modules/@types/node/tty.d.ts +0 -208
- package/node_modules/@alanszp/errors/node_modules/@types/node/url.d.ts +0 -927
- package/node_modules/@alanszp/errors/node_modules/@types/node/util.d.ts +0 -2183
- package/node_modules/@alanszp/errors/node_modules/@types/node/v8.d.ts +0 -764
- package/node_modules/@alanszp/errors/node_modules/@types/node/vm.d.ts +0 -903
- package/node_modules/@alanszp/errors/node_modules/@types/node/wasi.d.ts +0 -179
- package/node_modules/@alanszp/errors/node_modules/@types/node/worker_threads.d.ts +0 -691
- package/node_modules/@alanszp/errors/node_modules/@types/node/zlib.d.ts +0 -517
- package/node_modules/@alanszp/errors/package.json +0 -33
- package/node_modules/@alanszp/errors/src/BaseError.ts +0 -14
- package/node_modules/@alanszp/errors/src/HttpRenderableError.ts +0 -5
- package/node_modules/@alanszp/errors/src/InternalServerError.ts +0 -32
- package/node_modules/@alanszp/errors/src/RenderableError.ts +0 -37
- package/node_modules/@alanszp/errors/src/index.ts +0 -4
- package/node_modules/@alanszp/errors/tsconfig.json +0 -15
- package/node_modules/@alanszp/express/.gitignore +0 -3
- package/node_modules/@alanszp/express/.npmignore +0 -3
- package/node_modules/@alanszp/express/LICENSE +0 -21
- package/node_modules/@alanszp/express/babel.config.js +0 -7
- package/node_modules/@alanszp/express/dist/helpers/getIp.d.ts +0 -2
- package/node_modules/@alanszp/express/dist/helpers/getIp.js +0 -9
- package/node_modules/@alanszp/express/dist/helpers/getIp.js.map +0 -1
- package/node_modules/@alanszp/express/dist/helpers/getRequestLogger.d.ts +0 -2
- package/node_modules/@alanszp/express/dist/helpers/getRequestLogger.js +0 -10
- package/node_modules/@alanszp/express/dist/helpers/getRequestLogger.js.map +0 -1
- package/node_modules/@alanszp/express/dist/helpers/now.d.ts +0 -1
- package/node_modules/@alanszp/express/dist/helpers/now.js +0 -8
- package/node_modules/@alanszp/express/dist/helpers/now.js.map +0 -1
- package/node_modules/@alanszp/express/dist/helpers/renderErrorJson.d.ts +0 -4
- package/node_modules/@alanszp/express/dist/helpers/renderErrorJson.js +0 -32
- package/node_modules/@alanszp/express/dist/helpers/renderErrorJson.js.map +0 -1
- package/node_modules/@alanszp/express/dist/index.d.ts +0 -10
- package/node_modules/@alanszp/express/dist/index.js +0 -23
- package/node_modules/@alanszp/express/dist/index.js.map +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/accessLogger.d.ts +0 -3
- package/node_modules/@alanszp/express/dist/middlewares/accessLogger.js +0 -30
- package/node_modules/@alanszp/express/dist/middlewares/accessLogger.js.map +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/auditLog.d.ts +0 -8
- package/node_modules/@alanszp/express/dist/middlewares/auditLog.js +0 -44
- package/node_modules/@alanszp/express/dist/middlewares/auditLog.js.map +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/authedForOrg.d.ts +0 -3
- package/node_modules/@alanszp/express/dist/middlewares/authedForOrg.js +0 -45
- package/node_modules/@alanszp/express/dist/middlewares/authedForOrg.js.map +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.d.ts +0 -25
- package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.js +0 -115
- package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.js.map +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.test.d.ts +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.test.js +0 -308
- package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.test.js.map +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/createContext.d.ts +0 -6
- package/node_modules/@alanszp/express/dist/middlewares/createContext.js +0 -35
- package/node_modules/@alanszp/express/dist/middlewares/createContext.js.map +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/createContext.test.d.ts +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/createContext.test.js +0 -50
- package/node_modules/@alanszp/express/dist/middlewares/createContext.test.js.map +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/hasRoles.d.ts +0 -3
- package/node_modules/@alanszp/express/dist/middlewares/hasRoles.js +0 -21
- package/node_modules/@alanszp/express/dist/middlewares/hasRoles.js.map +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/jsonBodyParser.d.ts +0 -4
- package/node_modules/@alanszp/express/dist/middlewares/jsonBodyParser.js +0 -22
- package/node_modules/@alanszp/express/dist/middlewares/jsonBodyParser.js.map +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/returnInternalServerError.d.ts +0 -4
- package/node_modules/@alanszp/express/dist/middlewares/returnInternalServerError.js +0 -10
- package/node_modules/@alanszp/express/dist/middlewares/returnInternalServerError.js.map +0 -1
- package/node_modules/@alanszp/express/dist/middlewares/returnNotFound.d.ts +0 -3
- package/node_modules/@alanszp/express/dist/middlewares/returnNotFound.js +0 -9
- package/node_modules/@alanszp/express/dist/middlewares/returnNotFound.js.map +0 -1
- package/node_modules/@alanszp/express/dist/test/mocks/authOptionsMocks.d.ts +0 -8
- package/node_modules/@alanszp/express/dist/test/mocks/authOptionsMocks.js +0 -30
- package/node_modules/@alanszp/express/dist/test/mocks/authOptionsMocks.js.map +0 -1
- package/node_modules/@alanszp/express/dist/test/mocks/expressMocks.d.ts +0 -6
- package/node_modules/@alanszp/express/dist/test/mocks/expressMocks.js +0 -26
- package/node_modules/@alanszp/express/dist/test/mocks/expressMocks.js.map +0 -1
- package/node_modules/@alanszp/express/dist/test/mocks/jwtUserMocks.d.ts +0 -3
- package/node_modules/@alanszp/express/dist/test/mocks/jwtUserMocks.js +0 -21
- package/node_modules/@alanszp/express/dist/test/mocks/jwtUserMocks.js.map +0 -1
- package/node_modules/@alanszp/express/dist/test/setup.d.ts +0 -1
- package/node_modules/@alanszp/express/dist/test/setup.js +0 -5
- package/node_modules/@alanszp/express/dist/test/setup.js.map +0 -1
- package/node_modules/@alanszp/express/dist/test/setup.test.d.ts +0 -1
- package/node_modules/@alanszp/express/dist/test/setup.test.js +0 -14
- package/node_modules/@alanszp/express/dist/test/setup.test.js.map +0 -1
- package/node_modules/@alanszp/express/dist/types/AuthMethod.d.ts +0 -10
- package/node_modules/@alanszp/express/dist/types/AuthMethod.js +0 -3
- package/node_modules/@alanszp/express/dist/types/AuthMethod.js.map +0 -1
- package/node_modules/@alanszp/express/dist/types/GenericRequest.d.ts +0 -2
- package/node_modules/@alanszp/express/dist/types/GenericRequest.js +0 -3
- package/node_modules/@alanszp/express/dist/types/GenericRequest.js.map +0 -1
- package/node_modules/@alanszp/express/jest.config.js +0 -10
- package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/LICENSE +0 -21
- package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/README.md +0 -5
- package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/build/index.d.ts +0 -93
- package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/build/index.js +0 -37
- package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/build/jasmineUtils.js +0 -282
- package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/build/types.js +0 -1
- package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/build/utils.js +0 -457
- package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/package.json +0 -33
- package/node_modules/@alanszp/express/node_modules/@jest/types/LICENSE +0 -21
- package/node_modules/@alanszp/express/node_modules/@jest/types/README.md +0 -30
- package/node_modules/@alanszp/express/node_modules/@jest/types/build/Circus.js +0 -1
- package/node_modules/@alanszp/express/node_modules/@jest/types/build/Config.js +0 -1
- package/node_modules/@alanszp/express/node_modules/@jest/types/build/Global.js +0 -1
- package/node_modules/@alanszp/express/node_modules/@jest/types/build/TestResult.js +0 -1
- package/node_modules/@alanszp/express/node_modules/@jest/types/build/Transform.js +0 -1
- package/node_modules/@alanszp/express/node_modules/@jest/types/build/index.d.ts +0 -1166
- package/node_modules/@alanszp/express/node_modules/@jest/types/build/index.js +0 -1
- package/node_modules/@alanszp/express/node_modules/@jest/types/package.json +0 -38
- package/node_modules/@alanszp/express/node_modules/@types/jest/LICENSE +0 -21
- package/node_modules/@alanszp/express/node_modules/@types/jest/README.md +0 -17
- package/node_modules/@alanszp/express/node_modules/@types/jest/index.d.ts +0 -1608
- package/node_modules/@alanszp/express/node_modules/@types/jest/package.json +0 -159
- package/node_modules/@alanszp/express/node_modules/@types/node/LICENSE +0 -21
- package/node_modules/@alanszp/express/node_modules/@types/node/README.md +0 -15
- package/node_modules/@alanszp/express/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/node_modules/@alanszp/express/node_modules/@types/node/assert.d.ts +0 -996
- package/node_modules/@alanszp/express/node_modules/@types/node/async_hooks.d.ts +0 -539
- package/node_modules/@alanszp/express/node_modules/@types/node/buffer.d.ts +0 -2362
- package/node_modules/@alanszp/express/node_modules/@types/node/child_process.d.ts +0 -1540
- package/node_modules/@alanszp/express/node_modules/@types/node/cluster.d.ts +0 -432
- package/node_modules/@alanszp/express/node_modules/@types/node/console.d.ts +0 -415
- package/node_modules/@alanszp/express/node_modules/@types/node/constants.d.ts +0 -19
- package/node_modules/@alanszp/express/node_modules/@types/node/crypto.d.ts +0 -4487
- package/node_modules/@alanszp/express/node_modules/@types/node/dgram.d.ts +0 -596
- package/node_modules/@alanszp/express/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
- package/node_modules/@alanszp/express/node_modules/@types/node/dns/promises.d.ts +0 -425
- package/node_modules/@alanszp/express/node_modules/@types/node/dns.d.ts +0 -809
- package/node_modules/@alanszp/express/node_modules/@types/node/dom-events.d.ts +0 -122
- package/node_modules/@alanszp/express/node_modules/@types/node/domain.d.ts +0 -170
- package/node_modules/@alanszp/express/node_modules/@types/node/events.d.ts +0 -879
- package/node_modules/@alanszp/express/node_modules/@types/node/fs/promises.d.ts +0 -1239
- package/node_modules/@alanszp/express/node_modules/@types/node/fs.d.ts +0 -4311
- package/node_modules/@alanszp/express/node_modules/@types/node/globals.d.ts +0 -411
- package/node_modules/@alanszp/express/node_modules/@types/node/globals.global.d.ts +0 -1
- package/node_modules/@alanszp/express/node_modules/@types/node/http.d.ts +0 -1887
- package/node_modules/@alanszp/express/node_modules/@types/node/http2.d.ts +0 -2382
- package/node_modules/@alanszp/express/node_modules/@types/node/https.d.ts +0 -550
- package/node_modules/@alanszp/express/node_modules/@types/node/index.d.ts +0 -88
- package/node_modules/@alanszp/express/node_modules/@types/node/inspector.d.ts +0 -2747
- package/node_modules/@alanszp/express/node_modules/@types/node/module.d.ts +0 -315
- package/node_modules/@alanszp/express/node_modules/@types/node/net.d.ts +0 -949
- package/node_modules/@alanszp/express/node_modules/@types/node/os.d.ts +0 -478
- package/node_modules/@alanszp/express/node_modules/@types/node/package.json +0 -229
- package/node_modules/@alanszp/express/node_modules/@types/node/path.d.ts +0 -191
- package/node_modules/@alanszp/express/node_modules/@types/node/perf_hooks.d.ts +0 -645
- package/node_modules/@alanszp/express/node_modules/@types/node/process.d.ts +0 -1561
- package/node_modules/@alanszp/express/node_modules/@types/node/punycode.d.ts +0 -117
- package/node_modules/@alanszp/express/node_modules/@types/node/querystring.d.ts +0 -141
- package/node_modules/@alanszp/express/node_modules/@types/node/readline/promises.d.ts +0 -150
- package/node_modules/@alanszp/express/node_modules/@types/node/readline.d.ts +0 -539
- package/node_modules/@alanszp/express/node_modules/@types/node/repl.d.ts +0 -430
- package/node_modules/@alanszp/express/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/node_modules/@alanszp/express/node_modules/@types/node/stream/promises.d.ts +0 -83
- package/node_modules/@alanszp/express/node_modules/@types/node/stream/web.d.ts +0 -366
- package/node_modules/@alanszp/express/node_modules/@types/node/stream.d.ts +0 -1701
- package/node_modules/@alanszp/express/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/node_modules/@alanszp/express/node_modules/@types/node/test.d.ts +0 -1465
- package/node_modules/@alanszp/express/node_modules/@types/node/timers/promises.d.ts +0 -93
- package/node_modules/@alanszp/express/node_modules/@types/node/timers.d.ts +0 -240
- package/node_modules/@alanszp/express/node_modules/@types/node/tls.d.ts +0 -1210
- package/node_modules/@alanszp/express/node_modules/@types/node/trace_events.d.ts +0 -182
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/console.d.ts +0 -415
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/events.d.ts +0 -879
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/https.d.ts +0 -550
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/index.d.ts +0 -88
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/module.d.ts +0 -315
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/net.d.ts +0 -949
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/os.d.ts +0 -478
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/path.d.ts +0 -191
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/url.d.ts +0 -927
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
- package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
- package/node_modules/@alanszp/express/node_modules/@types/node/tty.d.ts +0 -208
- package/node_modules/@alanszp/express/node_modules/@types/node/url.d.ts +0 -927
- package/node_modules/@alanszp/express/node_modules/@types/node/util.d.ts +0 -2183
- package/node_modules/@alanszp/express/node_modules/@types/node/v8.d.ts +0 -764
- package/node_modules/@alanszp/express/node_modules/@types/node/vm.d.ts +0 -903
- package/node_modules/@alanszp/express/node_modules/@types/node/wasi.d.ts +0 -179
- package/node_modules/@alanszp/express/node_modules/@types/node/worker_threads.d.ts +0 -691
- package/node_modules/@alanszp/express/node_modules/@types/node/zlib.d.ts +0 -517
- package/node_modules/@alanszp/express/package.json +0 -49
- package/node_modules/@alanszp/express/src/helpers/getIp.ts +0 -5
- package/node_modules/@alanszp/express/src/helpers/getRequestLogger.ts +0 -6
- package/node_modules/@alanszp/express/src/helpers/now.ts +0 -3
- package/node_modules/@alanszp/express/src/helpers/renderErrorJson.ts +0 -29
- package/node_modules/@alanszp/express/src/index.ts +0 -10
- package/node_modules/@alanszp/express/src/middlewares/accessLogger.ts +0 -34
- package/node_modules/@alanszp/express/src/middlewares/auditLog.ts +0 -52
- package/node_modules/@alanszp/express/src/middlewares/authedForOrg.ts +0 -50
- package/node_modules/@alanszp/express/src/middlewares/authenticateUser.test.ts +0 -403
- package/node_modules/@alanszp/express/src/middlewares/authenticateUser.ts +0 -171
- package/node_modules/@alanszp/express/src/middlewares/createContext.test.ts +0 -85
- package/node_modules/@alanszp/express/src/middlewares/createContext.ts +0 -49
- package/node_modules/@alanszp/express/src/middlewares/hasRoles.ts +0 -24
- package/node_modules/@alanszp/express/src/middlewares/jsonBodyParser.ts +0 -22
- package/node_modules/@alanszp/express/src/middlewares/returnInternalServerError.ts +0 -15
- package/node_modules/@alanszp/express/src/middlewares/returnNotFound.ts +0 -11
- package/node_modules/@alanszp/express/src/test/mocks/authOptionsMocks.ts +0 -35
- package/node_modules/@alanszp/express/src/test/mocks/expressMocks.ts +0 -33
- package/node_modules/@alanszp/express/src/test/mocks/jwtUserMocks.ts +0 -19
- package/node_modules/@alanszp/express/src/test/setup.test.ts +0 -15
- package/node_modules/@alanszp/express/src/test/setup.ts +0 -3
- package/node_modules/@alanszp/express/src/types/AuthMethod.ts +0 -27
- package/node_modules/@alanszp/express/src/types/GenericRequest.ts +0 -3
- package/node_modules/@alanszp/express/src/types/custom.d.ts +0 -20
- package/node_modules/@alanszp/express/tsconfig.json +0 -18
- package/node_modules/@alanszp/jwt/.gitignore +0 -3
- package/node_modules/@alanszp/jwt/.npmignore +0 -3
- package/node_modules/@alanszp/jwt/LICENSE +0 -21
- package/node_modules/@alanszp/jwt/dist/JWTUser.d.ts +0 -31
- package/node_modules/@alanszp/jwt/dist/JWTUser.js +0 -62
- package/node_modules/@alanszp/jwt/dist/JWTUser.js.map +0 -1
- package/node_modules/@alanszp/jwt/dist/index.d.ts +0 -3
- package/node_modules/@alanszp/jwt/dist/index.js +0 -16
- package/node_modules/@alanszp/jwt/dist/index.js.map +0 -1
- package/node_modules/@alanszp/jwt/dist/jwt.d.ts +0 -11
- package/node_modules/@alanszp/jwt/dist/jwt.js +0 -67
- package/node_modules/@alanszp/jwt/dist/jwt.js.map +0 -1
- package/node_modules/@alanszp/jwt/dist/types.d.ts +0 -26
- package/node_modules/@alanszp/jwt/dist/types.js +0 -3
- package/node_modules/@alanszp/jwt/dist/types.js.map +0 -1
- package/node_modules/@alanszp/jwt/node_modules/@types/node/LICENSE +0 -21
- package/node_modules/@alanszp/jwt/node_modules/@types/node/README.md +0 -15
- package/node_modules/@alanszp/jwt/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/node_modules/@alanszp/jwt/node_modules/@types/node/assert.d.ts +0 -996
- package/node_modules/@alanszp/jwt/node_modules/@types/node/async_hooks.d.ts +0 -539
- package/node_modules/@alanszp/jwt/node_modules/@types/node/buffer.d.ts +0 -2362
- package/node_modules/@alanszp/jwt/node_modules/@types/node/child_process.d.ts +0 -1540
- package/node_modules/@alanszp/jwt/node_modules/@types/node/cluster.d.ts +0 -432
- package/node_modules/@alanszp/jwt/node_modules/@types/node/console.d.ts +0 -415
- package/node_modules/@alanszp/jwt/node_modules/@types/node/constants.d.ts +0 -19
- package/node_modules/@alanszp/jwt/node_modules/@types/node/crypto.d.ts +0 -4487
- package/node_modules/@alanszp/jwt/node_modules/@types/node/dgram.d.ts +0 -596
- package/node_modules/@alanszp/jwt/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
- package/node_modules/@alanszp/jwt/node_modules/@types/node/dns/promises.d.ts +0 -425
- package/node_modules/@alanszp/jwt/node_modules/@types/node/dns.d.ts +0 -809
- package/node_modules/@alanszp/jwt/node_modules/@types/node/dom-events.d.ts +0 -122
- package/node_modules/@alanszp/jwt/node_modules/@types/node/domain.d.ts +0 -170
- package/node_modules/@alanszp/jwt/node_modules/@types/node/events.d.ts +0 -879
- package/node_modules/@alanszp/jwt/node_modules/@types/node/fs/promises.d.ts +0 -1239
- package/node_modules/@alanszp/jwt/node_modules/@types/node/fs.d.ts +0 -4311
- package/node_modules/@alanszp/jwt/node_modules/@types/node/globals.d.ts +0 -411
- package/node_modules/@alanszp/jwt/node_modules/@types/node/globals.global.d.ts +0 -1
- package/node_modules/@alanszp/jwt/node_modules/@types/node/http.d.ts +0 -1887
- package/node_modules/@alanszp/jwt/node_modules/@types/node/http2.d.ts +0 -2382
- package/node_modules/@alanszp/jwt/node_modules/@types/node/https.d.ts +0 -550
- package/node_modules/@alanszp/jwt/node_modules/@types/node/index.d.ts +0 -88
- package/node_modules/@alanszp/jwt/node_modules/@types/node/inspector.d.ts +0 -2747
- package/node_modules/@alanszp/jwt/node_modules/@types/node/module.d.ts +0 -315
- package/node_modules/@alanszp/jwt/node_modules/@types/node/net.d.ts +0 -949
- package/node_modules/@alanszp/jwt/node_modules/@types/node/os.d.ts +0 -478
- package/node_modules/@alanszp/jwt/node_modules/@types/node/package.json +0 -229
- package/node_modules/@alanszp/jwt/node_modules/@types/node/path.d.ts +0 -191
- package/node_modules/@alanszp/jwt/node_modules/@types/node/perf_hooks.d.ts +0 -645
- package/node_modules/@alanszp/jwt/node_modules/@types/node/process.d.ts +0 -1561
- package/node_modules/@alanszp/jwt/node_modules/@types/node/punycode.d.ts +0 -117
- package/node_modules/@alanszp/jwt/node_modules/@types/node/querystring.d.ts +0 -141
- package/node_modules/@alanszp/jwt/node_modules/@types/node/readline/promises.d.ts +0 -150
- package/node_modules/@alanszp/jwt/node_modules/@types/node/readline.d.ts +0 -539
- package/node_modules/@alanszp/jwt/node_modules/@types/node/repl.d.ts +0 -430
- package/node_modules/@alanszp/jwt/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/node_modules/@alanszp/jwt/node_modules/@types/node/stream/promises.d.ts +0 -83
- package/node_modules/@alanszp/jwt/node_modules/@types/node/stream/web.d.ts +0 -366
- package/node_modules/@alanszp/jwt/node_modules/@types/node/stream.d.ts +0 -1701
- package/node_modules/@alanszp/jwt/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/node_modules/@alanszp/jwt/node_modules/@types/node/test.d.ts +0 -1465
- package/node_modules/@alanszp/jwt/node_modules/@types/node/timers/promises.d.ts +0 -93
- package/node_modules/@alanszp/jwt/node_modules/@types/node/timers.d.ts +0 -240
- package/node_modules/@alanszp/jwt/node_modules/@types/node/tls.d.ts +0 -1210
- package/node_modules/@alanszp/jwt/node_modules/@types/node/trace_events.d.ts +0 -182
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/console.d.ts +0 -415
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/events.d.ts +0 -879
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/https.d.ts +0 -550
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/index.d.ts +0 -88
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/module.d.ts +0 -315
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/net.d.ts +0 -949
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/os.d.ts +0 -478
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/path.d.ts +0 -191
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/url.d.ts +0 -927
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
- package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
- package/node_modules/@alanszp/jwt/node_modules/@types/node/tty.d.ts +0 -208
- package/node_modules/@alanszp/jwt/node_modules/@types/node/url.d.ts +0 -927
- package/node_modules/@alanszp/jwt/node_modules/@types/node/util.d.ts +0 -2183
- package/node_modules/@alanszp/jwt/node_modules/@types/node/v8.d.ts +0 -764
- package/node_modules/@alanszp/jwt/node_modules/@types/node/vm.d.ts +0 -903
- package/node_modules/@alanszp/jwt/node_modules/@types/node/wasi.d.ts +0 -179
- package/node_modules/@alanszp/jwt/node_modules/@types/node/worker_threads.d.ts +0 -691
- package/node_modules/@alanszp/jwt/node_modules/@types/node/zlib.d.ts +0 -517
- package/node_modules/@alanszp/jwt/package.json +0 -29
- package/node_modules/@alanszp/jwt/src/JWTUser.ts +0 -85
- package/node_modules/@alanszp/jwt/src/index.ts +0 -3
- package/node_modules/@alanszp/jwt/src/jwt.ts +0 -81
- package/node_modules/@alanszp/jwt/src/types.ts +0 -31
- package/node_modules/@alanszp/jwt/tsconfig.json +0 -15
- package/node_modules/@alanszp/logger/.gitignore +0 -3
- package/node_modules/@alanszp/logger/.npmignore +0 -3
- package/node_modules/@alanszp/logger/LICENSE +0 -21
- package/node_modules/@alanszp/logger/dist/config.d.ts +0 -28
- package/node_modules/@alanszp/logger/dist/config.js +0 -3
- package/node_modules/@alanszp/logger/dist/config.js.map +0 -1
- package/node_modules/@alanszp/logger/dist/factory.d.ts +0 -5
- package/node_modules/@alanszp/logger/dist/factory.js +0 -55
- package/node_modules/@alanszp/logger/dist/factory.js.map +0 -1
- package/node_modules/@alanszp/logger/dist/index.d.ts +0 -5
- package/node_modules/@alanszp/logger/dist/index.js +0 -20
- package/node_modules/@alanszp/logger/dist/index.js.map +0 -1
- package/node_modules/@alanszp/logger/dist/interfaces.d.ts +0 -23
- package/node_modules/@alanszp/logger/dist/interfaces.js +0 -18
- package/node_modules/@alanszp/logger/dist/interfaces.js.map +0 -1
- package/node_modules/@alanszp/logger/dist/logger.d.ts +0 -14
- package/node_modules/@alanszp/logger/dist/logger.js +0 -45
- package/node_modules/@alanszp/logger/dist/logger.js.map +0 -1
- package/node_modules/@alanszp/logger/dist/mock.d.ts +0 -11
- package/node_modules/@alanszp/logger/dist/mock.js +0 -32
- package/node_modules/@alanszp/logger/dist/mock.js.map +0 -1
- package/node_modules/@alanszp/logger/dist/serializer.d.ts +0 -5
- package/node_modules/@alanszp/logger/dist/serializer.js +0 -67
- package/node_modules/@alanszp/logger/dist/serializer.js.map +0 -1
- package/node_modules/@alanszp/logger/dist/slackBunyan.d.ts +0 -16
- package/node_modules/@alanszp/logger/dist/slackBunyan.js +0 -108
- package/node_modules/@alanszp/logger/dist/slackBunyan.js.map +0 -1
- package/node_modules/@alanszp/logger/node_modules/@types/node/LICENSE +0 -21
- package/node_modules/@alanszp/logger/node_modules/@types/node/README.md +0 -15
- package/node_modules/@alanszp/logger/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/node_modules/@alanszp/logger/node_modules/@types/node/assert.d.ts +0 -996
- package/node_modules/@alanszp/logger/node_modules/@types/node/async_hooks.d.ts +0 -539
- package/node_modules/@alanszp/logger/node_modules/@types/node/buffer.d.ts +0 -2362
- package/node_modules/@alanszp/logger/node_modules/@types/node/child_process.d.ts +0 -1540
- package/node_modules/@alanszp/logger/node_modules/@types/node/cluster.d.ts +0 -432
- package/node_modules/@alanszp/logger/node_modules/@types/node/console.d.ts +0 -415
- package/node_modules/@alanszp/logger/node_modules/@types/node/constants.d.ts +0 -19
- package/node_modules/@alanszp/logger/node_modules/@types/node/crypto.d.ts +0 -4487
- package/node_modules/@alanszp/logger/node_modules/@types/node/dgram.d.ts +0 -596
- package/node_modules/@alanszp/logger/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
- package/node_modules/@alanszp/logger/node_modules/@types/node/dns/promises.d.ts +0 -425
- package/node_modules/@alanszp/logger/node_modules/@types/node/dns.d.ts +0 -809
- package/node_modules/@alanszp/logger/node_modules/@types/node/dom-events.d.ts +0 -122
- package/node_modules/@alanszp/logger/node_modules/@types/node/domain.d.ts +0 -170
- package/node_modules/@alanszp/logger/node_modules/@types/node/events.d.ts +0 -879
- package/node_modules/@alanszp/logger/node_modules/@types/node/fs/promises.d.ts +0 -1239
- package/node_modules/@alanszp/logger/node_modules/@types/node/fs.d.ts +0 -4311
- package/node_modules/@alanszp/logger/node_modules/@types/node/globals.d.ts +0 -411
- package/node_modules/@alanszp/logger/node_modules/@types/node/globals.global.d.ts +0 -1
- package/node_modules/@alanszp/logger/node_modules/@types/node/http.d.ts +0 -1887
- package/node_modules/@alanszp/logger/node_modules/@types/node/http2.d.ts +0 -2382
- package/node_modules/@alanszp/logger/node_modules/@types/node/https.d.ts +0 -550
- package/node_modules/@alanszp/logger/node_modules/@types/node/index.d.ts +0 -88
- package/node_modules/@alanszp/logger/node_modules/@types/node/inspector.d.ts +0 -2747
- package/node_modules/@alanszp/logger/node_modules/@types/node/module.d.ts +0 -315
- package/node_modules/@alanszp/logger/node_modules/@types/node/net.d.ts +0 -949
- package/node_modules/@alanszp/logger/node_modules/@types/node/os.d.ts +0 -478
- package/node_modules/@alanszp/logger/node_modules/@types/node/package.json +0 -229
- package/node_modules/@alanszp/logger/node_modules/@types/node/path.d.ts +0 -191
- package/node_modules/@alanszp/logger/node_modules/@types/node/perf_hooks.d.ts +0 -645
- package/node_modules/@alanszp/logger/node_modules/@types/node/process.d.ts +0 -1561
- package/node_modules/@alanszp/logger/node_modules/@types/node/punycode.d.ts +0 -117
- package/node_modules/@alanszp/logger/node_modules/@types/node/querystring.d.ts +0 -141
- package/node_modules/@alanszp/logger/node_modules/@types/node/readline/promises.d.ts +0 -150
- package/node_modules/@alanszp/logger/node_modules/@types/node/readline.d.ts +0 -539
- package/node_modules/@alanszp/logger/node_modules/@types/node/repl.d.ts +0 -430
- package/node_modules/@alanszp/logger/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/node_modules/@alanszp/logger/node_modules/@types/node/stream/promises.d.ts +0 -83
- package/node_modules/@alanszp/logger/node_modules/@types/node/stream/web.d.ts +0 -366
- package/node_modules/@alanszp/logger/node_modules/@types/node/stream.d.ts +0 -1701
- package/node_modules/@alanszp/logger/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/node_modules/@alanszp/logger/node_modules/@types/node/test.d.ts +0 -1465
- package/node_modules/@alanszp/logger/node_modules/@types/node/timers/promises.d.ts +0 -93
- package/node_modules/@alanszp/logger/node_modules/@types/node/timers.d.ts +0 -240
- package/node_modules/@alanszp/logger/node_modules/@types/node/tls.d.ts +0 -1210
- package/node_modules/@alanszp/logger/node_modules/@types/node/trace_events.d.ts +0 -182
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/console.d.ts +0 -415
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/events.d.ts +0 -879
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/https.d.ts +0 -550
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/index.d.ts +0 -88
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/module.d.ts +0 -315
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/net.d.ts +0 -949
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/os.d.ts +0 -478
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/path.d.ts +0 -191
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/url.d.ts +0 -927
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
- package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
- package/node_modules/@alanszp/logger/node_modules/@types/node/tty.d.ts +0 -208
- package/node_modules/@alanszp/logger/node_modules/@types/node/url.d.ts +0 -927
- package/node_modules/@alanszp/logger/node_modules/@types/node/util.d.ts +0 -2183
- package/node_modules/@alanszp/logger/node_modules/@types/node/v8.d.ts +0 -764
- package/node_modules/@alanszp/logger/node_modules/@types/node/vm.d.ts +0 -903
- package/node_modules/@alanszp/logger/node_modules/@types/node/wasi.d.ts +0 -179
- package/node_modules/@alanszp/logger/node_modules/@types/node/worker_threads.d.ts +0 -691
- package/node_modules/@alanszp/logger/node_modules/@types/node/zlib.d.ts +0 -517
- package/node_modules/@alanszp/logger/package.json +0 -35
- package/node_modules/@alanszp/logger/src/config.ts +0 -34
- package/node_modules/@alanszp/logger/src/factory.ts +0 -68
- package/node_modules/@alanszp/logger/src/index.ts +0 -5
- package/node_modules/@alanszp/logger/src/interfaces.ts +0 -26
- package/node_modules/@alanszp/logger/src/logger.ts +0 -54
- package/node_modules/@alanszp/logger/src/mock.ts +0 -35
- package/node_modules/@alanszp/logger/src/serializer.ts +0 -65
- package/node_modules/@alanszp/logger/src/slackBunyan.ts +0 -133
- package/node_modules/@alanszp/logger/tsconfig.json +0 -15
- package/node_modules/@types/node/LICENSE +0 -21
- package/node_modules/@types/node/README.md +0 -15
- package/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/node_modules/@types/node/assert.d.ts +0 -996
- package/node_modules/@types/node/async_hooks.d.ts +0 -539
- package/node_modules/@types/node/buffer.d.ts +0 -2362
- package/node_modules/@types/node/child_process.d.ts +0 -1540
- package/node_modules/@types/node/cluster.d.ts +0 -432
- package/node_modules/@types/node/console.d.ts +0 -415
- package/node_modules/@types/node/constants.d.ts +0 -19
- package/node_modules/@types/node/crypto.d.ts +0 -4487
- package/node_modules/@types/node/dgram.d.ts +0 -596
- package/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
- package/node_modules/@types/node/dns/promises.d.ts +0 -425
- package/node_modules/@types/node/dns.d.ts +0 -809
- package/node_modules/@types/node/dom-events.d.ts +0 -122
- package/node_modules/@types/node/domain.d.ts +0 -170
- package/node_modules/@types/node/events.d.ts +0 -879
- package/node_modules/@types/node/fs/promises.d.ts +0 -1239
- package/node_modules/@types/node/fs.d.ts +0 -4311
- package/node_modules/@types/node/globals.d.ts +0 -411
- package/node_modules/@types/node/globals.global.d.ts +0 -1
- package/node_modules/@types/node/http.d.ts +0 -1887
- package/node_modules/@types/node/http2.d.ts +0 -2382
- package/node_modules/@types/node/https.d.ts +0 -550
- package/node_modules/@types/node/index.d.ts +0 -88
- package/node_modules/@types/node/inspector.d.ts +0 -2747
- package/node_modules/@types/node/module.d.ts +0 -315
- package/node_modules/@types/node/net.d.ts +0 -949
- package/node_modules/@types/node/os.d.ts +0 -478
- package/node_modules/@types/node/package.json +0 -229
- package/node_modules/@types/node/path.d.ts +0 -191
- package/node_modules/@types/node/perf_hooks.d.ts +0 -645
- package/node_modules/@types/node/process.d.ts +0 -1561
- package/node_modules/@types/node/punycode.d.ts +0 -117
- package/node_modules/@types/node/querystring.d.ts +0 -141
- package/node_modules/@types/node/readline/promises.d.ts +0 -150
- package/node_modules/@types/node/readline.d.ts +0 -539
- package/node_modules/@types/node/repl.d.ts +0 -430
- package/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/node_modules/@types/node/stream/promises.d.ts +0 -83
- package/node_modules/@types/node/stream/web.d.ts +0 -366
- package/node_modules/@types/node/stream.d.ts +0 -1701
- package/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/node_modules/@types/node/test.d.ts +0 -1465
- package/node_modules/@types/node/timers/promises.d.ts +0 -93
- package/node_modules/@types/node/timers.d.ts +0 -240
- package/node_modules/@types/node/tls.d.ts +0 -1210
- package/node_modules/@types/node/trace_events.d.ts +0 -182
- package/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
- package/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
- package/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
- package/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
- package/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
- package/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
- package/node_modules/@types/node/ts4.8/console.d.ts +0 -415
- package/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
- package/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
- package/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
- package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
- package/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
- package/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
- package/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
- package/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
- package/node_modules/@types/node/ts4.8/events.d.ts +0 -879
- package/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
- package/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
- package/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
- package/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
- package/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
- package/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
- package/node_modules/@types/node/ts4.8/https.d.ts +0 -550
- package/node_modules/@types/node/ts4.8/index.d.ts +0 -88
- package/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
- package/node_modules/@types/node/ts4.8/module.d.ts +0 -315
- package/node_modules/@types/node/ts4.8/net.d.ts +0 -949
- package/node_modules/@types/node/ts4.8/os.d.ts +0 -478
- package/node_modules/@types/node/ts4.8/path.d.ts +0 -191
- package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
- package/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
- package/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
- package/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
- package/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
- package/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
- package/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
- package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
- package/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
- package/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
- package/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
- package/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
- package/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
- package/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
- package/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
- package/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
- package/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
- package/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
- package/node_modules/@types/node/ts4.8/url.d.ts +0 -927
- package/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
- package/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
- package/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
- package/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
- package/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
- package/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
- package/node_modules/@types/node/tty.d.ts +0 -208
- package/node_modules/@types/node/url.d.ts +0 -927
- package/node_modules/@types/node/util.d.ts +0 -2183
- package/node_modules/@types/node/v8.d.ts +0 -764
- package/node_modules/@types/node/vm.d.ts +0 -903
- package/node_modules/@types/node/wasi.d.ts +0 -179
- package/node_modules/@types/node/worker_threads.d.ts +0 -691
- package/node_modules/@types/node/zlib.d.ts +0 -517
- package/src/commonErrorsHandler.ts +0 -105
- package/src/index.ts +0 -1
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { NextFunction, Response, Request } from "express";
|
|
2
|
-
import { AuditBody } from "@alanszp/audit";
|
|
3
|
-
import { getIp } from "../helpers/getIp";
|
|
4
|
-
import { GenericRequest } from "../types/GenericRequest";
|
|
5
|
-
|
|
6
|
-
export type AuditBodyModifier = (
|
|
7
|
-
req: Request<Record<string, string>, unknown, unknown>,
|
|
8
|
-
res: Response
|
|
9
|
-
) => Promise<Partial<AuditBody>> | Partial<AuditBody>;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Configures the audit log to execute AFTER the response is sent.
|
|
13
|
-
*/
|
|
14
|
-
export function auditLog(action: string, bodyModifier?: AuditBodyModifier) {
|
|
15
|
-
return function writeAuditLogMiddleware(
|
|
16
|
-
req: GenericRequest,
|
|
17
|
-
res: Response,
|
|
18
|
-
next: NextFunction
|
|
19
|
-
): void {
|
|
20
|
-
res.on("finish", async function writeAuditLog() {
|
|
21
|
-
try {
|
|
22
|
-
const audit = req.context.audit;
|
|
23
|
-
|
|
24
|
-
const partialBody = bodyModifier
|
|
25
|
-
? await Promise.resolve(bodyModifier(req, res))
|
|
26
|
-
: ({} as Partial<AuditBody>);
|
|
27
|
-
|
|
28
|
-
if (req.context.jwtUser) {
|
|
29
|
-
partialBody.orgRef = req.context.jwtUser.organizationReference;
|
|
30
|
-
partialBody.actorRef = req.context.jwtUser.id;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
partialBody.ip = getIp(req) || "no-ip";
|
|
34
|
-
|
|
35
|
-
audit.log({
|
|
36
|
-
succeed:
|
|
37
|
-
res.statusCode === 304 ||
|
|
38
|
-
(res.statusCode >= 200 && res.statusCode < 300),
|
|
39
|
-
...partialBody,
|
|
40
|
-
lid: req.context.lifecycleId ?? undefined,
|
|
41
|
-
lch: req.context.lifecycleChain ?? undefined,
|
|
42
|
-
cid: req.context.contextId ?? undefined,
|
|
43
|
-
action,
|
|
44
|
-
});
|
|
45
|
-
} catch (error: unknown) {
|
|
46
|
-
req.context.log.error("auditLog.writeLog.error", { action, error });
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
next();
|
|
51
|
-
};
|
|
52
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { NextFunction, Response } from "express";
|
|
2
|
-
import { getRequestLogger } from "../helpers/getRequestLogger";
|
|
3
|
-
import { GenericRequest } from "../types/GenericRequest";
|
|
4
|
-
import { render401Error, render404Error } from "../helpers/renderErrorJson";
|
|
5
|
-
|
|
6
|
-
function response401(res: Response): void {
|
|
7
|
-
res.status(401).json(render401Error(["jwt"]));
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function authForOrg(
|
|
11
|
-
req: GenericRequest,
|
|
12
|
-
res: Response,
|
|
13
|
-
next: NextFunction
|
|
14
|
-
): void {
|
|
15
|
-
const { orgReference } = req.params;
|
|
16
|
-
const logger = getRequestLogger(req).child({ org: orgReference });
|
|
17
|
-
try {
|
|
18
|
-
if (!orgReference) {
|
|
19
|
-
logger.error("middleware.authForOrg.error.noOrgReferenceInPath");
|
|
20
|
-
return response401(res);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (!req.context?.jwtUser?.organizationReference) {
|
|
24
|
-
logger.info("middleware.authForOrg.error.noOrgInJwt", {
|
|
25
|
-
jwtUser: req.context?.jwtUser || null,
|
|
26
|
-
});
|
|
27
|
-
return response401(res);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const jwtOrg = req.context.jwtUser.organizationReference;
|
|
31
|
-
if (jwtOrg !== orgReference) {
|
|
32
|
-
if (jwtOrg === "lara") {
|
|
33
|
-
req.context.jwtUser.organizationReference = orgReference;
|
|
34
|
-
return next();
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
logger.info("middleware.authForOrg.error.nonMatch", {
|
|
38
|
-
jwtOrg,
|
|
39
|
-
});
|
|
40
|
-
return response401(res);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return next();
|
|
44
|
-
} catch (error: unknown) {
|
|
45
|
-
logger.info("middleware.authForOrg.error.noOrganization", {
|
|
46
|
-
error,
|
|
47
|
-
});
|
|
48
|
-
res.status(404).json(render404Error());
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1,403 +0,0 @@
|
|
|
1
|
-
import { AuthMethods, createAuthContext } from "./authenticateUser";
|
|
2
|
-
import { verifyJWT } from "@alanszp/jwt";
|
|
3
|
-
import {
|
|
4
|
-
mockNext,
|
|
5
|
-
mockRequest,
|
|
6
|
-
mockResponse,
|
|
7
|
-
} from "../test/mocks/expressMocks";
|
|
8
|
-
import { laraJwtUserMock, userJwtUserMock } from "../test/mocks/jwtUserMocks";
|
|
9
|
-
import {
|
|
10
|
-
apiKeyAuthOptions,
|
|
11
|
-
bothMethodsAuthOptions,
|
|
12
|
-
jwtAuthOptions,
|
|
13
|
-
verifyOptions,
|
|
14
|
-
} from "../test/mocks/authOptionsMocks";
|
|
15
|
-
|
|
16
|
-
jest.mock("@alanszp/jwt");
|
|
17
|
-
|
|
18
|
-
describe("AuthenticateUser", () => {
|
|
19
|
-
describe("authentication with only JWT", () => {
|
|
20
|
-
describe("when jwt verifies correctly", () => {
|
|
21
|
-
it("should authenticate correctly and call next", async () => {
|
|
22
|
-
(verifyJWT as jest.Mock).mockResolvedValueOnce(userJwtUserMock);
|
|
23
|
-
|
|
24
|
-
const req = mockRequest("Bearer token");
|
|
25
|
-
const res = mockResponse();
|
|
26
|
-
const next = mockNext();
|
|
27
|
-
|
|
28
|
-
await createAuthContext(jwtAuthOptions)([AuthMethods.JWT])(
|
|
29
|
-
req,
|
|
30
|
-
res,
|
|
31
|
-
next
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
expect(verifyJWT).toBeCalledWith("publicKey", "token", verifyOptions);
|
|
35
|
-
expect(res.status).toHaveBeenCalledTimes(0);
|
|
36
|
-
expect(res.json).toHaveBeenCalledTimes(0);
|
|
37
|
-
expect(req.context.jwtUser).toMatchObject(userJwtUserMock);
|
|
38
|
-
expect(req.context.authenticated).toStrictEqual(["jwt"]);
|
|
39
|
-
expect(next).toBeCalledWith();
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
describe("when jwt verifies incorrectly", () => {
|
|
44
|
-
it("should not authenticate, should not call next, and it should return 401", async () => {
|
|
45
|
-
(verifyJWT as jest.Mock).mockResolvedValueOnce(undefined);
|
|
46
|
-
|
|
47
|
-
const req = mockRequest("Bearer token");
|
|
48
|
-
const res = mockResponse();
|
|
49
|
-
const next = mockNext();
|
|
50
|
-
|
|
51
|
-
await createAuthContext(jwtAuthOptions)([AuthMethods.JWT])(
|
|
52
|
-
req,
|
|
53
|
-
res,
|
|
54
|
-
next
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
expect(verifyJWT).toBeCalledWith("publicKey", "token", verifyOptions);
|
|
58
|
-
expect(res.status).toHaveBeenCalledWith(401);
|
|
59
|
-
expect(res.json).toHaveBeenCalledTimes(1);
|
|
60
|
-
expect(req.context.jwtUser).toBe(undefined);
|
|
61
|
-
expect(req.context.authenticated).toEqual([]);
|
|
62
|
-
expect(next).toHaveBeenCalledTimes(0);
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
describe("when jwt doesn't exist", () => {
|
|
67
|
-
it("should not verify JWT, should not authenticate, should not call next, and it should return 401", async () => {
|
|
68
|
-
const req = mockRequest("aa");
|
|
69
|
-
const res = mockResponse();
|
|
70
|
-
const next = mockNext();
|
|
71
|
-
|
|
72
|
-
await createAuthContext(jwtAuthOptions)([AuthMethods.JWT])(
|
|
73
|
-
req,
|
|
74
|
-
res,
|
|
75
|
-
next
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
expect(verifyJWT).toHaveBeenCalledTimes(0);
|
|
79
|
-
expect(res.status).toHaveBeenCalledWith(401);
|
|
80
|
-
expect(res.json).toHaveBeenCalledTimes(1);
|
|
81
|
-
expect(req.context.jwtUser).toBe(undefined);
|
|
82
|
-
expect(req.context.authenticated).toEqual([]);
|
|
83
|
-
expect(next).toHaveBeenCalledTimes(0);
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
describe("authentication with only API KEY", () => {
|
|
89
|
-
describe("when api key verifies correctly", () => {
|
|
90
|
-
it("should authenticate correctly and call next", async () => {
|
|
91
|
-
const req = mockRequest("token");
|
|
92
|
-
const res = mockResponse();
|
|
93
|
-
const next = mockNext();
|
|
94
|
-
|
|
95
|
-
await createAuthContext(apiKeyAuthOptions)([AuthMethods.API_KEY])(
|
|
96
|
-
req,
|
|
97
|
-
res,
|
|
98
|
-
next
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
expect(verifyJWT).toHaveBeenCalledTimes(0);
|
|
102
|
-
expect(res.status).toHaveBeenCalledTimes(0);
|
|
103
|
-
expect(res.json).toHaveBeenCalledTimes(0);
|
|
104
|
-
expect(req.context.jwtUser).toMatchObject(laraJwtUserMock);
|
|
105
|
-
expect(req.context.authenticated).toStrictEqual(["api_key"]);
|
|
106
|
-
expect(next).toBeCalledWith();
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
describe("when api key verifies incorrectly", () => {
|
|
111
|
-
it("should not authenticate, should not call next, and it should return 401", async () => {
|
|
112
|
-
const req = mockRequest("invalidToken");
|
|
113
|
-
const res = mockResponse();
|
|
114
|
-
const next = mockNext();
|
|
115
|
-
|
|
116
|
-
await createAuthContext(apiKeyAuthOptions)([AuthMethods.API_KEY])(
|
|
117
|
-
req,
|
|
118
|
-
res,
|
|
119
|
-
next
|
|
120
|
-
);
|
|
121
|
-
|
|
122
|
-
expect(verifyJWT).toHaveBeenCalledTimes(0);
|
|
123
|
-
expect(res.status).toHaveBeenCalledWith(401);
|
|
124
|
-
expect(res.json).toHaveBeenCalledTimes(1);
|
|
125
|
-
expect(req.context.jwtUser).toBe(undefined);
|
|
126
|
-
expect(req.context.authenticated).toEqual([]);
|
|
127
|
-
expect(next).toHaveBeenCalledTimes(0);
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
describe("when api key doesn't exist", () => {
|
|
132
|
-
it("should not verify api key, should not authenticate, should not call next, and it should return 401", async () => {
|
|
133
|
-
const req = mockRequest(undefined as any);
|
|
134
|
-
const res = mockResponse();
|
|
135
|
-
const next = mockNext();
|
|
136
|
-
|
|
137
|
-
await createAuthContext(apiKeyAuthOptions)([AuthMethods.API_KEY])(
|
|
138
|
-
req,
|
|
139
|
-
res,
|
|
140
|
-
next
|
|
141
|
-
);
|
|
142
|
-
|
|
143
|
-
expect(verifyJWT).toHaveBeenCalledTimes(0);
|
|
144
|
-
expect(res.status).toHaveBeenCalledWith(401);
|
|
145
|
-
expect(res.json).toHaveBeenCalledTimes(1);
|
|
146
|
-
expect(req.context.jwtUser).toBe(undefined);
|
|
147
|
-
expect(req.context.authenticated).toEqual([]);
|
|
148
|
-
expect(next).toHaveBeenCalledTimes(0);
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
describe("authentication with JWT and API KEY", () => {
|
|
154
|
-
describe("using both methods", () => {
|
|
155
|
-
describe("when api key verifies correctly", () => {
|
|
156
|
-
it("should authenticate correctly and call next", async () => {
|
|
157
|
-
const req = mockRequest("token");
|
|
158
|
-
const res = mockResponse();
|
|
159
|
-
const next = mockNext();
|
|
160
|
-
|
|
161
|
-
await createAuthContext(bothMethodsAuthOptions)([
|
|
162
|
-
AuthMethods.API_KEY,
|
|
163
|
-
AuthMethods.JWT,
|
|
164
|
-
])(req, res, next);
|
|
165
|
-
|
|
166
|
-
expect(verifyJWT).toHaveBeenCalledTimes(0);
|
|
167
|
-
expect(res.status).toHaveBeenCalledTimes(0);
|
|
168
|
-
expect(res.json).toHaveBeenCalledTimes(0);
|
|
169
|
-
expect(req.context.jwtUser).toMatchObject(laraJwtUserMock);
|
|
170
|
-
expect(req.context.authenticated).toStrictEqual(["api_key"]);
|
|
171
|
-
expect(next).toHaveBeenCalledWith();
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
describe("when api key verifies incorrectly", () => {
|
|
176
|
-
it("should not authenticate, should not call next, and it should return 401", async () => {
|
|
177
|
-
const req = mockRequest("invalidToken");
|
|
178
|
-
const res = mockResponse();
|
|
179
|
-
const next = mockNext();
|
|
180
|
-
|
|
181
|
-
await createAuthContext(bothMethodsAuthOptions)([
|
|
182
|
-
AuthMethods.API_KEY,
|
|
183
|
-
AuthMethods.JWT,
|
|
184
|
-
])(req, res, next);
|
|
185
|
-
|
|
186
|
-
expect(verifyJWT).toHaveBeenCalledTimes(0);
|
|
187
|
-
expect(res.status).toHaveBeenCalledWith(401);
|
|
188
|
-
expect(res.json).toHaveBeenCalledTimes(1);
|
|
189
|
-
expect(req.context.jwtUser).toBe(undefined);
|
|
190
|
-
expect(req.context.authenticated).toEqual([]);
|
|
191
|
-
expect(next).toHaveBeenCalledTimes(0);
|
|
192
|
-
});
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
describe("when jwt verifies correctly", () => {
|
|
196
|
-
it("should authenticate correctly and call next", async () => {
|
|
197
|
-
(verifyJWT as jest.Mock).mockResolvedValueOnce(userJwtUserMock);
|
|
198
|
-
|
|
199
|
-
const req = mockRequest("Bearer token");
|
|
200
|
-
const res = mockResponse();
|
|
201
|
-
const next = mockNext();
|
|
202
|
-
|
|
203
|
-
await createAuthContext(bothMethodsAuthOptions)([
|
|
204
|
-
AuthMethods.API_KEY,
|
|
205
|
-
AuthMethods.JWT,
|
|
206
|
-
])(req, res, next);
|
|
207
|
-
|
|
208
|
-
expect(verifyJWT).toBeCalledWith("publicKey", "token", {
|
|
209
|
-
issuer: "issuer",
|
|
210
|
-
audience: "audience",
|
|
211
|
-
});
|
|
212
|
-
expect(res.status).toHaveBeenCalledTimes(0);
|
|
213
|
-
expect(res.json).toHaveBeenCalledTimes(0);
|
|
214
|
-
|
|
215
|
-
expect(req.context.jwtUser).toMatchObject(userJwtUserMock);
|
|
216
|
-
|
|
217
|
-
expect(req.context.authenticated).toStrictEqual(["jwt"]);
|
|
218
|
-
|
|
219
|
-
expect(next).toHaveBeenCalledWith();
|
|
220
|
-
});
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
describe("when jwt verifies incorrectly", () => {
|
|
224
|
-
it("should not authenticate, should not call next, and it should return 401", async () => {
|
|
225
|
-
(verifyJWT as jest.Mock).mockResolvedValueOnce(undefined);
|
|
226
|
-
|
|
227
|
-
const req = mockRequest("Bearer token");
|
|
228
|
-
const res = mockResponse();
|
|
229
|
-
const next = mockNext();
|
|
230
|
-
|
|
231
|
-
await createAuthContext(bothMethodsAuthOptions)([
|
|
232
|
-
AuthMethods.API_KEY,
|
|
233
|
-
AuthMethods.JWT,
|
|
234
|
-
])(req, res, next);
|
|
235
|
-
|
|
236
|
-
expect(verifyJWT).toBeCalledWith("publicKey", "token", {
|
|
237
|
-
issuer: "issuer",
|
|
238
|
-
audience: "audience",
|
|
239
|
-
});
|
|
240
|
-
expect(res.status).toHaveBeenCalledWith(401);
|
|
241
|
-
expect(res.json).toHaveBeenCalledTimes(1);
|
|
242
|
-
expect(req.context.jwtUser).toBe(undefined);
|
|
243
|
-
expect(req.context.authenticated).toEqual([]);
|
|
244
|
-
expect(next).toHaveBeenCalledTimes(0);
|
|
245
|
-
});
|
|
246
|
-
});
|
|
247
|
-
|
|
248
|
-
describe("when jwt doesnt exist", () => {
|
|
249
|
-
it("should not authenticate, should not call next, and it should return 401", async () => {
|
|
250
|
-
const req = mockRequest(undefined as any);
|
|
251
|
-
const res = mockResponse();
|
|
252
|
-
const next = mockNext();
|
|
253
|
-
|
|
254
|
-
await createAuthContext(bothMethodsAuthOptions)([
|
|
255
|
-
AuthMethods.API_KEY,
|
|
256
|
-
AuthMethods.JWT,
|
|
257
|
-
])(req, res, next);
|
|
258
|
-
|
|
259
|
-
expect(verifyJWT).toHaveBeenCalledTimes(0);
|
|
260
|
-
expect(res.status).toHaveBeenCalledWith(401);
|
|
261
|
-
expect(res.json).toHaveBeenCalledTimes(1);
|
|
262
|
-
expect(req.context.jwtUser).toBe(undefined);
|
|
263
|
-
expect(req.context.authenticated).toEqual([]);
|
|
264
|
-
expect(next).toHaveBeenCalledTimes(0);
|
|
265
|
-
});
|
|
266
|
-
});
|
|
267
|
-
});
|
|
268
|
-
|
|
269
|
-
describe("using jwt method", () => {
|
|
270
|
-
describe("when jwt verifies correctly", () => {
|
|
271
|
-
it("should authenticate correctly and call next", async () => {
|
|
272
|
-
(verifyJWT as jest.Mock).mockResolvedValueOnce(userJwtUserMock);
|
|
273
|
-
|
|
274
|
-
const req = mockRequest("Bearer token");
|
|
275
|
-
const res = mockResponse();
|
|
276
|
-
const next = mockNext();
|
|
277
|
-
|
|
278
|
-
await createAuthContext(bothMethodsAuthOptions)([AuthMethods.JWT])(
|
|
279
|
-
req,
|
|
280
|
-
res,
|
|
281
|
-
next
|
|
282
|
-
);
|
|
283
|
-
|
|
284
|
-
expect(verifyJWT).toBeCalledWith("publicKey", "token", {
|
|
285
|
-
issuer: "issuer",
|
|
286
|
-
audience: "audience",
|
|
287
|
-
});
|
|
288
|
-
expect(res.status).toHaveBeenCalledTimes(0);
|
|
289
|
-
expect(res.json).toHaveBeenCalledTimes(0);
|
|
290
|
-
expect(req.context.jwtUser).toMatchObject(userJwtUserMock);
|
|
291
|
-
expect(req.context.authenticated).toStrictEqual(["jwt"]);
|
|
292
|
-
expect(next).toHaveBeenCalledWith();
|
|
293
|
-
});
|
|
294
|
-
});
|
|
295
|
-
|
|
296
|
-
describe("when jwt verifies incorrectly", () => {
|
|
297
|
-
it("should not authenticate, should not call next, and it should return 401", async () => {
|
|
298
|
-
(verifyJWT as jest.Mock).mockResolvedValueOnce(undefined);
|
|
299
|
-
|
|
300
|
-
const req = mockRequest("Bearer invalidToken");
|
|
301
|
-
const res = mockResponse();
|
|
302
|
-
const next = mockNext();
|
|
303
|
-
|
|
304
|
-
await createAuthContext(bothMethodsAuthOptions)([AuthMethods.JWT])(
|
|
305
|
-
req,
|
|
306
|
-
res,
|
|
307
|
-
next
|
|
308
|
-
);
|
|
309
|
-
|
|
310
|
-
expect(verifyJWT).toBeCalledWith("publicKey", "invalidToken", {
|
|
311
|
-
issuer: "issuer",
|
|
312
|
-
audience: "audience",
|
|
313
|
-
});
|
|
314
|
-
expect(res.status).toHaveBeenCalledWith(401);
|
|
315
|
-
expect(res.json).toHaveBeenCalledTimes(1);
|
|
316
|
-
expect(req.context.jwtUser).toBe(undefined);
|
|
317
|
-
expect(req.context.authenticated).toEqual([]);
|
|
318
|
-
expect(next).toHaveBeenCalledTimes(0);
|
|
319
|
-
});
|
|
320
|
-
});
|
|
321
|
-
|
|
322
|
-
describe("when api key verifies correctly", () => {
|
|
323
|
-
it("should authenticate correctly and call next", async () => {
|
|
324
|
-
const req = mockRequest("token");
|
|
325
|
-
const res = mockResponse();
|
|
326
|
-
const next = mockNext();
|
|
327
|
-
|
|
328
|
-
await createAuthContext(bothMethodsAuthOptions)([
|
|
329
|
-
AuthMethods.API_KEY,
|
|
330
|
-
])(req, res, next);
|
|
331
|
-
|
|
332
|
-
expect(verifyJWT).toHaveBeenCalledTimes(0);
|
|
333
|
-
expect(res.status).toHaveBeenCalledTimes(0);
|
|
334
|
-
expect(res.json).toHaveBeenCalledTimes(0);
|
|
335
|
-
|
|
336
|
-
expect(req.context.jwtUser).toMatchObject(laraJwtUserMock);
|
|
337
|
-
expect(req.context.authenticated).toStrictEqual(["api_key"]);
|
|
338
|
-
expect(next).toHaveBeenCalledWith();
|
|
339
|
-
});
|
|
340
|
-
});
|
|
341
|
-
|
|
342
|
-
describe("when api key verifies incorrectly", () => {
|
|
343
|
-
it("should not authenticate, should not call next, and it should return 401", async () => {
|
|
344
|
-
const req = mockRequest("invalidToken");
|
|
345
|
-
const res = mockResponse();
|
|
346
|
-
const next = mockNext();
|
|
347
|
-
|
|
348
|
-
await createAuthContext(bothMethodsAuthOptions)([
|
|
349
|
-
AuthMethods.API_KEY,
|
|
350
|
-
AuthMethods.JWT,
|
|
351
|
-
])(req, res, next);
|
|
352
|
-
|
|
353
|
-
expect(verifyJWT).toHaveBeenCalledTimes(0);
|
|
354
|
-
expect(res.status).toHaveBeenCalledWith(401);
|
|
355
|
-
expect(res.json).toHaveBeenCalledTimes(1);
|
|
356
|
-
expect(req.context.jwtUser).toBe(undefined);
|
|
357
|
-
expect(req.context.authenticated).toEqual([]);
|
|
358
|
-
expect(next).toHaveBeenCalledTimes(0);
|
|
359
|
-
});
|
|
360
|
-
});
|
|
361
|
-
|
|
362
|
-
describe("when jwt doesnt exist", () => {
|
|
363
|
-
it("should not authenticate, should not call next, and it should return 401", async () => {
|
|
364
|
-
const req = mockRequest("aaa");
|
|
365
|
-
const res = mockResponse();
|
|
366
|
-
const next = mockNext();
|
|
367
|
-
|
|
368
|
-
await createAuthContext(bothMethodsAuthOptions)([AuthMethods.JWT])(
|
|
369
|
-
req,
|
|
370
|
-
res,
|
|
371
|
-
next
|
|
372
|
-
);
|
|
373
|
-
|
|
374
|
-
expect(verifyJWT).toHaveBeenCalledTimes(0);
|
|
375
|
-
expect(res.status).toHaveBeenCalledWith(401);
|
|
376
|
-
expect(res.json).toHaveBeenCalledTimes(1);
|
|
377
|
-
expect(req.context.jwtUser).toBe(undefined);
|
|
378
|
-
expect(req.context.authenticated).toEqual([]);
|
|
379
|
-
expect(next).toHaveBeenCalledTimes(0);
|
|
380
|
-
});
|
|
381
|
-
});
|
|
382
|
-
|
|
383
|
-
describe("when api key doesnt exist", () => {
|
|
384
|
-
it("should not authenticate, should not call next, and it should return 401", async () => {
|
|
385
|
-
const req = mockRequest(undefined as any);
|
|
386
|
-
const res = mockResponse();
|
|
387
|
-
const next = mockNext();
|
|
388
|
-
|
|
389
|
-
await createAuthContext(bothMethodsAuthOptions)([
|
|
390
|
-
AuthMethods.API_KEY,
|
|
391
|
-
])(req, res, next);
|
|
392
|
-
|
|
393
|
-
expect(verifyJWT).toHaveBeenCalledTimes(0);
|
|
394
|
-
expect(res.status).toHaveBeenCalledWith(401);
|
|
395
|
-
expect(res.json).toHaveBeenCalledTimes(1);
|
|
396
|
-
expect(req.context.jwtUser).toBe(undefined);
|
|
397
|
-
expect(req.context.authenticated).toEqual([]);
|
|
398
|
-
expect(next).toHaveBeenCalledTimes(0);
|
|
399
|
-
});
|
|
400
|
-
});
|
|
401
|
-
});
|
|
402
|
-
});
|
|
403
|
-
});
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { JWTUser, verifyJWT, VerifyOptions } from "@alanszp/jwt";
|
|
2
|
-
import { NextFunction, Response } from "express";
|
|
3
|
-
import { getRequestLogger } from "../helpers/getRequestLogger";
|
|
4
|
-
import { GenericRequest } from "../types/GenericRequest";
|
|
5
|
-
import { ILogger } from "@alanszp/logger";
|
|
6
|
-
import { compact, isEmpty, omit } from "lodash";
|
|
7
|
-
import { render401Error } from "../helpers/renderErrorJson";
|
|
8
|
-
|
|
9
|
-
function parseAuthorizationHeader(
|
|
10
|
-
authorization: string | undefined
|
|
11
|
-
): string | undefined {
|
|
12
|
-
if (!authorization) return undefined;
|
|
13
|
-
const [bearer, jwt, ...other] = authorization.split(" ");
|
|
14
|
-
|
|
15
|
-
if (bearer !== "Bearer" || other.length > 0) return undefined;
|
|
16
|
-
|
|
17
|
-
return jwt;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export enum AuthMethods {
|
|
21
|
-
JWT = "JWT",
|
|
22
|
-
API_KEY = "API_KEY",
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface JWTVerifyOptions extends Partial<VerifyOptions> {
|
|
26
|
-
publicKey: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface JWTOptions {
|
|
30
|
-
jwtVerifyOptions: JWTVerifyOptions;
|
|
31
|
-
types: [AuthMethods.JWT];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface ApiKeyOptions {
|
|
35
|
-
validApiKeys: string[];
|
|
36
|
-
types: [AuthMethods.API_KEY];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface BothMethodsOptions {
|
|
40
|
-
jwtVerifyOptions: JWTVerifyOptions;
|
|
41
|
-
validApiKeys: string[];
|
|
42
|
-
types:
|
|
43
|
-
| [AuthMethods.JWT, AuthMethods.API_KEY]
|
|
44
|
-
| [AuthMethods.API_KEY, AuthMethods.JWT];
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export type AuthOptions = JWTOptions | ApiKeyOptions | BothMethodsOptions;
|
|
48
|
-
|
|
49
|
-
const middlewareGetterByAuthType: Record<
|
|
50
|
-
AuthMethods,
|
|
51
|
-
(
|
|
52
|
-
tokenOrJwt: string | null | undefined,
|
|
53
|
-
options: AuthOptions,
|
|
54
|
-
logger: ILogger
|
|
55
|
-
) => Promise<JWTUser | null | undefined>
|
|
56
|
-
> = {
|
|
57
|
-
[AuthMethods.JWT]: async (
|
|
58
|
-
jwt: string | null | undefined,
|
|
59
|
-
options: Exclude<AuthOptions, ApiKeyOptions>,
|
|
60
|
-
logger: ILogger
|
|
61
|
-
) => {
|
|
62
|
-
try {
|
|
63
|
-
if (!jwt) return undefined;
|
|
64
|
-
const jwtUser = await verifyJWT(
|
|
65
|
-
options.jwtVerifyOptions.publicKey,
|
|
66
|
-
jwt,
|
|
67
|
-
omit(options.jwtVerifyOptions, "publicKey")
|
|
68
|
-
);
|
|
69
|
-
logger.debug("auth.authWithJwt.authed", {
|
|
70
|
-
user: jwtUser.id,
|
|
71
|
-
org: jwtUser.organizationReference,
|
|
72
|
-
});
|
|
73
|
-
return jwtUser;
|
|
74
|
-
} catch (error: unknown) {
|
|
75
|
-
logger.info("auth.authWithJwt.invalidJwt", { jwt, error });
|
|
76
|
-
return null;
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
[AuthMethods.API_KEY]: async (
|
|
80
|
-
token: string | null | undefined,
|
|
81
|
-
options: Exclude<AuthOptions, JWTOptions>,
|
|
82
|
-
logger: ILogger
|
|
83
|
-
): Promise<JWTUser | null | undefined> => {
|
|
84
|
-
try {
|
|
85
|
-
if (!token) return undefined;
|
|
86
|
-
if (options.validApiKeys.includes(token)) {
|
|
87
|
-
logger.debug("auth.authWithApiKey.authed", {
|
|
88
|
-
user: "0",
|
|
89
|
-
org: "lara",
|
|
90
|
-
});
|
|
91
|
-
return Promise.resolve(
|
|
92
|
-
new JWTUser({
|
|
93
|
-
id: "0",
|
|
94
|
-
employeeReference: "0",
|
|
95
|
-
organizationReference: "lara",
|
|
96
|
-
roles: [],
|
|
97
|
-
segmentReference: null,
|
|
98
|
-
// This will be changed in the near future to grab all permissions.
|
|
99
|
-
permissions: "MA==", // 0 in base64
|
|
100
|
-
})
|
|
101
|
-
);
|
|
102
|
-
} else {
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
} catch (error: unknown) {
|
|
106
|
-
logger.info("auth.authWithApiKey.invalidApiKey", { token, error });
|
|
107
|
-
return null;
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
export function createAuthContext<Options extends AuthOptions>(
|
|
113
|
-
options: Options
|
|
114
|
-
) {
|
|
115
|
-
return function getMiddlewareForMethods(
|
|
116
|
-
authMethods: Options["types"][number][]
|
|
117
|
-
) {
|
|
118
|
-
return async function authWithGivenMethods(
|
|
119
|
-
req: GenericRequest,
|
|
120
|
-
res: Response,
|
|
121
|
-
next: NextFunction
|
|
122
|
-
): Promise<void> {
|
|
123
|
-
const logger = getRequestLogger(req);
|
|
124
|
-
const cookies = (req.cookies as Record<string, string | undefined>) || {};
|
|
125
|
-
const jwt =
|
|
126
|
-
cookies.jwt || parseAuthorizationHeader(req.headers.authorization);
|
|
127
|
-
|
|
128
|
-
try {
|
|
129
|
-
const authAttempts = await Promise.all(
|
|
130
|
-
authMethods.map((method) =>
|
|
131
|
-
middlewareGetterByAuthType[method](
|
|
132
|
-
method === AuthMethods.JWT ? jwt : req.headers.authorization,
|
|
133
|
-
options,
|
|
134
|
-
logger
|
|
135
|
-
)
|
|
136
|
-
)
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
const successfulAuthAttempts = compact(authAttempts);
|
|
140
|
-
|
|
141
|
-
if (isEmpty(successfulAuthAttempts)) {
|
|
142
|
-
res
|
|
143
|
-
.status(401)
|
|
144
|
-
.json(
|
|
145
|
-
render401Error([
|
|
146
|
-
authAttempts.includes(null)
|
|
147
|
-
? `Token invalid for methods ${authMethods}`
|
|
148
|
-
: `Token not set for methods ${authMethods}`,
|
|
149
|
-
])
|
|
150
|
-
);
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
const jwtUser: JWTUser = successfulAuthAttempts[0];
|
|
155
|
-
req.context.jwtUser = jwtUser;
|
|
156
|
-
req.context.authenticated.push(
|
|
157
|
-
jwtUser.employeeReference !== "0" ? "jwt" : "api_key"
|
|
158
|
-
);
|
|
159
|
-
next();
|
|
160
|
-
} catch (error: unknown) {
|
|
161
|
-
logger.info("auth.authenticateUser.error", {
|
|
162
|
-
jwt,
|
|
163
|
-
token: req.headers.authorization,
|
|
164
|
-
methods: AuthMethods,
|
|
165
|
-
error,
|
|
166
|
-
});
|
|
167
|
-
res.status(401).json(render401Error(authMethods));
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
};
|
|
171
|
-
}
|