From fc1c93957cdb9f7387736e6d94bc40e05770eb97 Mon Sep 17 00:00:00 2001 From: Saad Jutt Date: Sat, 7 Aug 2021 07:32:48 +0500 Subject: [PATCH] fix: while checking session extract username also --- package-lock.json | 582 +++++++++++++----------------- src/auth/AuthManager.ts | 13 +- src/auth/spec/AuthManager.spec.ts | 2 +- 3 files changed, 267 insertions(+), 330 deletions(-) diff --git a/package-lock.json b/package-lock.json index 63e1e4f..25458bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7872,11 +7872,14 @@ } }, "node_modules/npm": { - "version": "7.16.0", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/npm/-/npm-7.20.5.tgz", + "integrity": "sha512-vRyu1V79n5BzKn4vkanag1xEjEMLIZ48Ry1V7IyAvHQHi8syOEiYWvUMxNpeDk+e8JKAKCNG3lIYJDm3pM8VMQ==", "bundleDependencies": [ "@npmcli/arborist", "@npmcli/ci-detect", "@npmcli/config", + "@npmcli/package-json", "@npmcli/run-script", "abbrev", "ansicolors", @@ -7940,192 +7943,14 @@ "treeverse", "validate-npm-package-name", "which", - "write-file-atomic", - "@npmcli/disparity-colors", - "@npmcli/git", - "@npmcli/installed-package-contents", - "@npmcli/map-workspaces", - "@npmcli/metavuln-calculator", - "@npmcli/move-file", - "@npmcli/name-from-folder", - "@npmcli/node-gyp", - "@npmcli/promise-spawn", - "@tootallnate/once", - "agent-base", - "agentkeepalive", - "aggregate-error", - "ajv", - "ansi-regex", - "ansi-styles", - "aproba", - "are-we-there-yet", - "asap", - "asn1", - "assert-plus", - "asynckit", - "aws-sign2", - "aws4", - "balanced-match", - "bcrypt-pbkdf", - "bin-links", - "binary-extensions", - "brace-expansion", - "builtins", - "caseless", - "cidr-regex", - "clean-stack", - "clone", - "cmd-shim", - "code-point-at", - "color-convert", - "color-name", - "colors", - "combined-stream", - "common-ancestor-path", - "concat-map", - "console-control-strings", - "core-util-is", - "dashdash", - "debug", - "debuglog", - "defaults", - "delayed-stream", - "delegates", - "depd", - "dezalgo", - "diff", - "ecc-jsbn", - "emoji-regex", - "encoding", - "env-paths", - "err-code", - "extend", - "extsprintf", - "fast-deep-equal", - "fast-json-stable-stringify", - "forever-agent", - "fs-minipass", - "fs.realpath", - "function-bind", - "gauge", - "getpass", - "har-schema", - "har-validator", - "has", - "has-flag", - "has-unicode", - "http-cache-semantics", - "http-proxy-agent", - "http-signature", - "https-proxy-agent", - "humanize-ms", - "iconv-lite", - "ignore-walk", - "imurmurhash", - "indent-string", - "infer-owner", - "inflight", - "inherits", - "ip", - "ip-regex", - "is-core-module", - "is-fullwidth-code-point", - "is-lambda", - "is-typedarray", - "isarray", - "isexe", - "isstream", - "jsbn", - "json-schema", - "json-schema-traverse", - "json-stringify-nice", - "json-stringify-safe", - "jsonparse", - "jsprim", - "just-diff", - "just-diff-apply", - "lru-cache", - "mime-db", - "mime-types", - "minimatch", - "minipass-collect", - "minipass-fetch", - "minipass-flush", - "minipass-json-stream", - "minipass-sized", - "minizlib", - "mute-stream", - "negotiator", - "normalize-package-data", - "npm-bundled", - "npm-install-checks", - "npm-normalize-package-bin", - "npm-packlist", - "number-is-nan", - "oauth-sign", - "object-assign", - "once", - "p-map", - "path-is-absolute", - "path-parse", - "performance-now", - "proc-log", - "process-nextick-args", - "promise-all-reject-late", - "promise-call-limit", - "promise-inflight", - "promise-retry", - "promzard", - "psl", - "punycode", - "qs", - "read-cmd-shim", - "readable-stream", - "request", - "resolve", - "retry", - "safe-buffer", - "safer-buffer", - "set-blocking", - "signal-exit", - "smart-buffer", - "socks", - "socks-proxy-agent", - "spdx-correct", - "spdx-exceptions", - "spdx-expression-parse", - "spdx-license-ids", - "sshpk", - "string_decoder", - "string-width", - "stringify-package", - "strip-ansi", - "supports-color", - "tunnel-agent", - "tweetnacl", - "typedarray-to-buffer", - "unique-filename", - "unique-slug", - "uri-js", - "util-deprecate", - "uuid", - "validate-npm-package-license", - "verror", - "walk-up-path", - "wcwidth", - "wide-align", - "wrappy", - "yallist" + "write-file-atomic" ], "dev": true, - "license": "Artistic-2.0", - "workspaces": [ - "docs" - ], "dependencies": { - "@npmcli/arborist": "^2.6.1", + "@npmcli/arborist": "^2.8.0", "@npmcli/ci-detect": "^1.2.0", "@npmcli/config": "^2.2.0", + "@npmcli/package-json": "^1.0.1", "@npmcli/run-script": "^1.8.5", "abbrev": "~1.1.1", "ansicolors": "~0.3.2", @@ -8133,13 +7958,13 @@ "archy": "~1.0.0", "byte-size": "^7.0.1", "cacache": "^15.2.0", - "chalk": "^4.1.0", + "chalk": "^4.1.2", "chownr": "^2.0.0", "cli-columns": "^3.1.2", "cli-table3": "^0.6.0", "columnify": "~1.5.4", "glob": "^7.1.7", - "graceful-fs": "^4.2.6", + "graceful-fs": "^4.2.8", "hosted-git-info": "^4.0.2", "ini": "^2.0.0", "init-package-json": "^2.0.3", @@ -8148,7 +7973,7 @@ "leven": "^3.1.0", "libnpmaccess": "^4.0.2", "libnpmdiff": "^2.0.4", - "libnpmexec": "^1.2.0", + "libnpmexec": "^2.0.1", "libnpmfund": "^1.1.0", "libnpmhook": "^6.0.2", "libnpmorg": "^2.0.2", @@ -8156,8 +7981,8 @@ "libnpmpublish": "^4.0.1", "libnpmsearch": "^3.1.1", "libnpmteam": "^2.0.3", - "libnpmversion": "^1.2.0", - "make-fetch-happen": "^9.0.1", + "libnpmversion": "^1.2.1", + "make-fetch-happen": "^9.0.4", "minipass": "^3.1.3", "minipass-pipeline": "^1.2.4", "mkdirp": "^1.0.4", @@ -8166,24 +7991,24 @@ "node-gyp": "^7.1.2", "nopt": "^5.0.0", "npm-audit-report": "^2.1.5", - "npm-package-arg": "^8.1.4", + "npm-package-arg": "^8.1.5", "npm-pick-manifest": "^6.1.1", "npm-profile": "^5.0.3", "npm-registry-fetch": "^11.0.0", "npm-user-validate": "^1.0.1", - "npmlog": "~4.1.2", + "npmlog": "^5.0.0", "opener": "^1.5.2", - "pacote": "^11.3.3", + "pacote": "^11.3.5", "parse-conflict-json": "^1.1.1", "qrcode-terminal": "^0.12.0", "read": "~1.0.7", "read-package-json": "^3.0.1", - "read-package-json-fast": "^2.0.2", + "read-package-json-fast": "^2.0.3", "readdir-scoped-modules": "^1.1.0", "rimraf": "^3.0.2", "semver": "^7.3.5", "ssri": "^8.0.1", - "tar": "^6.1.0", + "tar": "^6.1.6", "text-table": "~0.2.0", "tiny-relative-date": "^1.3.0", "treeverse": "^1.0.4", @@ -8211,7 +8036,7 @@ } }, "node_modules/npm/node_modules/@npmcli/arborist": { - "version": "2.6.2", + "version": "2.8.0", "dev": true, "inBundle": true, "license": "ISC", @@ -8222,24 +8047,29 @@ "@npmcli/move-file": "^1.1.0", "@npmcli/name-from-folder": "^1.0.1", "@npmcli/node-gyp": "^1.0.1", + "@npmcli/package-json": "^1.0.1", "@npmcli/run-script": "^1.8.2", "bin-links": "^2.2.1", "cacache": "^15.0.3", "common-ancestor-path": "^1.0.1", "json-parse-even-better-errors": "^2.3.1", "json-stringify-nice": "^1.1.4", + "mkdirp": "^1.0.4", "mkdirp-infer-owner": "^2.0.0", "npm-install-checks": "^4.0.0", - "npm-package-arg": "^8.1.0", + "npm-package-arg": "^8.1.5", "npm-pick-manifest": "^6.1.0", "npm-registry-fetch": "^11.0.0", - "pacote": "^11.2.6", + "pacote": "^11.3.5", "parse-conflict-json": "^1.1.1", + "proc-log": "^1.0.0", "promise-all-reject-late": "^1.0.0", "promise-call-limit": "^1.0.1", "read-package-json-fast": "^2.0.2", "readdir-scoped-modules": "^1.1.0", + "rimraf": "^3.0.2", "semver": "^7.3.5", + "ssri": "^8.0.1", "tar": "^6.1.0", "treeverse": "^1.0.4", "walk-up-path": "^1.0.0" @@ -8286,7 +8116,7 @@ } }, "node_modules/npm/node_modules/@npmcli/git": { - "version": "2.0.9", + "version": "2.1.0", "dev": true, "inBundle": true, "license": "ISC", @@ -8368,6 +8198,15 @@ "inBundle": true, "license": "ISC" }, + "node_modules/npm/node_modules/@npmcli/package-json": { + "version": "1.0.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "json-parse-even-better-errors": "^2.3.1" + } + }, "node_modules/npm/node_modules/@npmcli/promise-spawn": { "version": "1.3.2", "dev": true, @@ -8664,7 +8503,7 @@ "license": "Apache-2.0" }, "node_modules/npm/node_modules/chalk": { - "version": "4.1.1", + "version": "4.1.2", "dev": true, "inBundle": true, "license": "MIT", @@ -8830,6 +8669,15 @@ "inBundle": true, "license": "MIT" }, + "node_modules/npm/node_modules/color-support": { + "version": "1.1.3", + "dev": true, + "inBundle": true, + "license": "ISC", + "bin": { + "color-support": "bin.js" + } + }, "node_modules/npm/node_modules/colors": { "version": "1.4.0", "dev": true, @@ -8899,7 +8747,7 @@ } }, "node_modules/npm/node_modules/debug": { - "version": "4.3.1", + "version": "4.3.2", "dev": true, "inBundle": true, "license": "MIT", @@ -9084,51 +8932,23 @@ "license": "MIT" }, "node_modules/npm/node_modules/gauge": { - "version": "2.7.4", + "version": "3.0.1", "dev": true, "inBundle": true, "license": "ISC", "dependencies": { - "aproba": "^1.0.3", + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "node_modules/npm/node_modules/gauge/node_modules/aproba": { - "version": "1.2.0", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/npm/node_modules/gauge/node_modules/is-fullwidth-code-point": { - "version": "1.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "number-is-nan": "^1.0.0" + "string-width": "^1.0.1 || ^2.0.0", + "strip-ansi": "^3.0.1 || ^4.0.0", + "wide-align": "^1.1.2" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/npm/node_modules/gauge/node_modules/string-width": { - "version": "1.0.2", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" + "node": ">=10" } }, "node_modules/npm/node_modules/getpass": { @@ -9161,7 +8981,7 @@ } }, "node_modules/npm/node_modules/graceful-fs": { - "version": "4.2.6", + "version": "4.2.8", "dev": true, "inBundle": true, "license": "ISC" @@ -9402,7 +9222,7 @@ } }, "node_modules/npm/node_modules/is-core-module": { - "version": "2.4.0", + "version": "2.5.0", "dev": true, "inBundle": true, "license": "MIT", @@ -9561,8 +9381,8 @@ "binary-extensions": "^2.2.0", "diff": "^5.0.0", "minimatch": "^3.0.4", - "npm-package-arg": "^8.1.1", - "pacote": "^11.3.0", + "npm-package-arg": "^8.1.4", + "pacote": "^11.3.4", "tar": "^6.1.0" }, "engines": { @@ -9570,7 +9390,7 @@ } }, "node_modules/npm/node_modules/libnpmexec": { - "version": "1.2.0", + "version": "2.0.1", "dev": true, "inBundle": true, "license": "ISC", @@ -9682,7 +9502,7 @@ } }, "node_modules/npm/node_modules/libnpmversion": { - "version": "1.2.0", + "version": "1.2.1", "dev": true, "inBundle": true, "license": "ISC", @@ -9707,7 +9527,7 @@ } }, "node_modules/npm/node_modules/make-fetch-happen": { - "version": "9.0.2", + "version": "9.0.4", "dev": true, "inBundle": true, "license": "ISC", @@ -9734,7 +9554,7 @@ } }, "node_modules/npm/node_modules/mime-db": { - "version": "1.48.0", + "version": "1.49.0", "dev": true, "inBundle": true, "license": "MIT", @@ -9743,12 +9563,12 @@ } }, "node_modules/npm/node_modules/mime-types": { - "version": "2.1.31", + "version": "2.1.32", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "mime-db": "1.48.0" + "mime-db": "1.49.0" }, "engines": { "node": ">= 0.6" @@ -9791,7 +9611,7 @@ } }, "node_modules/npm/node_modules/minipass-fetch": { - "version": "1.3.3", + "version": "1.3.4", "dev": true, "inBundle": true, "license": "MIT", @@ -9937,6 +9757,66 @@ "node": ">= 10.12.0" } }, + "node_modules/npm/node_modules/node-gyp/node_modules/aproba": { + "version": "1.2.0", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/npm/node_modules/node-gyp/node_modules/gauge": { + "version": "2.7.4", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "node_modules/npm/node_modules/node-gyp/node_modules/is-fullwidth-code-point": { + "version": "1.0.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm/node_modules/node-gyp/node_modules/npmlog": { + "version": "4.1.2", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "node_modules/npm/node_modules/node-gyp/node_modules/string-width": { + "version": "1.0.2", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/npm/node_modules/nopt": { "version": "5.0.0", "dev": true, @@ -10007,7 +9887,7 @@ "license": "ISC" }, "node_modules/npm/node_modules/npm-package-arg": { - "version": "8.1.4", + "version": "8.1.5", "dev": true, "inBundle": true, "license": "ISC", @@ -10086,15 +9966,15 @@ "license": "BSD-2-Clause" }, "node_modules/npm/node_modules/npmlog": { - "version": "4.1.2", + "version": "5.0.0", "dev": true, "inBundle": true, "license": "ISC", "dependencies": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" + "are-we-there-yet": "^1.1.5", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" } }, "node_modules/npm/node_modules/number-is-nan": { @@ -10158,12 +10038,12 @@ } }, "node_modules/npm/node_modules/pacote": { - "version": "11.3.4", + "version": "11.3.5", "dev": true, "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/git": "^2.0.1", + "@npmcli/git": "^2.1.0", "@npmcli/installed-package-contents": "^1.0.6", "@npmcli/promise-spawn": "^1.2.0", "@npmcli/run-script": "^1.8.2", @@ -10346,7 +10226,7 @@ } }, "node_modules/npm/node_modules/read-package-json-fast": { - "version": "2.0.2", + "version": "2.0.3", "dev": true, "inBundle": true, "license": "ISC", @@ -10695,7 +10575,7 @@ } }, "node_modules/npm/node_modules/tar": { - "version": "6.1.0", + "version": "6.1.6", "dev": true, "inBundle": true, "license": "ISC", @@ -19403,12 +19283,15 @@ "dev": true }, "npm": { - "version": "7.16.0", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/npm/-/npm-7.20.5.tgz", + "integrity": "sha512-vRyu1V79n5BzKn4vkanag1xEjEMLIZ48Ry1V7IyAvHQHi8syOEiYWvUMxNpeDk+e8JKAKCNG3lIYJDm3pM8VMQ==", "dev": true, "requires": { - "@npmcli/arborist": "^2.6.1", + "@npmcli/arborist": "^2.8.0", "@npmcli/ci-detect": "^1.2.0", "@npmcli/config": "^2.2.0", + "@npmcli/package-json": "^1.0.1", "@npmcli/run-script": "^1.8.5", "abbrev": "~1.1.1", "ansicolors": "~0.3.2", @@ -19416,13 +19299,13 @@ "archy": "~1.0.0", "byte-size": "^7.0.1", "cacache": "^15.2.0", - "chalk": "^4.1.0", + "chalk": "^4.1.2", "chownr": "^2.0.0", "cli-columns": "^3.1.2", "cli-table3": "^0.6.0", "columnify": "~1.5.4", "glob": "^7.1.7", - "graceful-fs": "^4.2.6", + "graceful-fs": "^4.2.8", "hosted-git-info": "^4.0.2", "ini": "^2.0.0", "init-package-json": "^2.0.3", @@ -19431,7 +19314,7 @@ "leven": "^3.1.0", "libnpmaccess": "^4.0.2", "libnpmdiff": "^2.0.4", - "libnpmexec": "^1.2.0", + "libnpmexec": "^2.0.1", "libnpmfund": "^1.1.0", "libnpmhook": "^6.0.2", "libnpmorg": "^2.0.2", @@ -19439,8 +19322,8 @@ "libnpmpublish": "^4.0.1", "libnpmsearch": "^3.1.1", "libnpmteam": "^2.0.3", - "libnpmversion": "^1.2.0", - "make-fetch-happen": "^9.0.1", + "libnpmversion": "^1.2.1", + "make-fetch-happen": "^9.0.4", "minipass": "^3.1.3", "minipass-pipeline": "^1.2.4", "mkdirp": "^1.0.4", @@ -19449,24 +19332,24 @@ "node-gyp": "^7.1.2", "nopt": "^5.0.0", "npm-audit-report": "^2.1.5", - "npm-package-arg": "^8.1.4", + "npm-package-arg": "^8.1.5", "npm-pick-manifest": "^6.1.1", "npm-profile": "^5.0.3", "npm-registry-fetch": "^11.0.0", "npm-user-validate": "^1.0.1", - "npmlog": "~4.1.2", + "npmlog": "^5.0.0", "opener": "^1.5.2", - "pacote": "^11.3.3", + "pacote": "^11.3.5", "parse-conflict-json": "^1.1.1", "qrcode-terminal": "^0.12.0", "read": "~1.0.7", "read-package-json": "^3.0.1", - "read-package-json-fast": "^2.0.2", + "read-package-json-fast": "^2.0.3", "readdir-scoped-modules": "^1.1.0", "rimraf": "^3.0.2", "semver": "^7.3.5", "ssri": "^8.0.1", - "tar": "^6.1.0", + "tar": "^6.1.6", "text-table": "~0.2.0", "tiny-relative-date": "^1.3.0", "treeverse": "^1.0.4", @@ -19476,7 +19359,7 @@ }, "dependencies": { "@npmcli/arborist": { - "version": "2.6.2", + "version": "2.8.0", "bundled": true, "dev": true, "requires": { @@ -19486,24 +19369,29 @@ "@npmcli/move-file": "^1.1.0", "@npmcli/name-from-folder": "^1.0.1", "@npmcli/node-gyp": "^1.0.1", + "@npmcli/package-json": "^1.0.1", "@npmcli/run-script": "^1.8.2", "bin-links": "^2.2.1", "cacache": "^15.0.3", "common-ancestor-path": "^1.0.1", "json-parse-even-better-errors": "^2.3.1", "json-stringify-nice": "^1.1.4", + "mkdirp": "^1.0.4", "mkdirp-infer-owner": "^2.0.0", "npm-install-checks": "^4.0.0", - "npm-package-arg": "^8.1.0", + "npm-package-arg": "^8.1.5", "npm-pick-manifest": "^6.1.0", "npm-registry-fetch": "^11.0.0", - "pacote": "^11.2.6", + "pacote": "^11.3.5", "parse-conflict-json": "^1.1.1", + "proc-log": "^1.0.0", "promise-all-reject-late": "^1.0.0", "promise-call-limit": "^1.0.1", "read-package-json-fast": "^2.0.2", "readdir-scoped-modules": "^1.1.0", + "rimraf": "^3.0.2", "semver": "^7.3.5", + "ssri": "^8.0.1", "tar": "^6.1.0", "treeverse": "^1.0.4", "walk-up-path": "^1.0.0" @@ -19535,7 +19423,7 @@ } }, "@npmcli/git": { - "version": "2.0.9", + "version": "2.1.0", "bundled": true, "dev": true, "requires": { @@ -19598,6 +19486,14 @@ "bundled": true, "dev": true }, + "@npmcli/package-json": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "json-parse-even-better-errors": "^2.3.1" + } + }, "@npmcli/promise-spawn": { "version": "1.3.2", "bundled": true, @@ -19821,7 +19717,7 @@ "dev": true }, "chalk": { - "version": "4.1.1", + "version": "4.1.2", "bundled": true, "dev": true, "requires": { @@ -19927,6 +19823,11 @@ "bundled": true, "dev": true }, + "color-support": { + "version": "1.1.3", + "bundled": true, + "dev": true + }, "colors": { "version": "1.4.0", "bundled": true, @@ -19979,7 +19880,7 @@ } }, "debug": { - "version": "4.3.1", + "version": "4.3.2", "bundled": true, "dev": true, "requires": { @@ -20112,43 +20013,19 @@ "dev": true }, "gauge": { - "version": "2.7.4", + "version": "3.0.1", "bundled": true, "dev": true, "requires": { - "aproba": "^1.0.3", + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - }, - "dependencies": { - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - } + "string-width": "^1.0.1 || ^2.0.0", + "strip-ansi": "^3.0.1 || ^4.0.0", + "wide-align": "^1.1.2" } }, "getpass": { @@ -20173,7 +20050,7 @@ } }, "graceful-fs": { - "version": "4.2.6", + "version": "4.2.8", "bundled": true, "dev": true }, @@ -20344,7 +20221,7 @@ } }, "is-core-module": { - "version": "2.4.0", + "version": "2.5.0", "bundled": true, "dev": true, "requires": { @@ -20463,13 +20340,13 @@ "binary-extensions": "^2.2.0", "diff": "^5.0.0", "minimatch": "^3.0.4", - "npm-package-arg": "^8.1.1", - "pacote": "^11.3.0", + "npm-package-arg": "^8.1.4", + "pacote": "^11.3.4", "tar": "^6.1.0" } }, "libnpmexec": { - "version": "1.2.0", + "version": "2.0.1", "bundled": true, "dev": true, "requires": { @@ -20552,7 +20429,7 @@ } }, "libnpmversion": { - "version": "1.2.0", + "version": "1.2.1", "bundled": true, "dev": true, "requires": { @@ -20572,7 +20449,7 @@ } }, "make-fetch-happen": { - "version": "9.0.2", + "version": "9.0.4", "bundled": true, "dev": true, "requires": { @@ -20595,16 +20472,16 @@ } }, "mime-db": { - "version": "1.48.0", + "version": "1.49.0", "bundled": true, "dev": true }, "mime-types": { - "version": "2.1.31", + "version": "2.1.32", "bundled": true, "dev": true, "requires": { - "mime-db": "1.48.0" + "mime-db": "1.49.0" } }, "minimatch": { @@ -20632,7 +20509,7 @@ } }, "minipass-fetch": { - "version": "1.3.3", + "version": "1.3.4", "bundled": true, "dev": true, "requires": { @@ -20729,6 +20606,57 @@ "semver": "^7.3.2", "tar": "^6.0.2", "which": "^2.0.2" + }, + "dependencies": { + "aproba": { + "version": "1.2.0", + "bundled": true, + "dev": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "dev": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + } } }, "nopt": { @@ -20780,7 +20708,7 @@ "dev": true }, "npm-package-arg": { - "version": "8.1.4", + "version": "8.1.5", "bundled": true, "dev": true, "requires": { @@ -20838,14 +20766,14 @@ "dev": true }, "npmlog": { - "version": "4.1.2", + "version": "5.0.0", "bundled": true, "dev": true, "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" + "are-we-there-yet": "^1.1.5", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" } }, "number-is-nan": { @@ -20885,11 +20813,11 @@ } }, "pacote": { - "version": "11.3.4", + "version": "11.3.5", "bundled": true, "dev": true, "requires": { - "@npmcli/git": "^2.0.1", + "@npmcli/git": "^2.1.0", "@npmcli/installed-package-contents": "^1.0.6", "@npmcli/promise-spawn": "^1.2.0", "@npmcli/run-script": "^1.8.2", @@ -21022,7 +20950,7 @@ } }, "read-package-json-fast": { - "version": "2.0.2", + "version": "2.0.3", "bundled": true, "dev": true, "requires": { @@ -21283,7 +21211,7 @@ } }, "tar": { - "version": "6.1.0", + "version": "6.1.6", "bundled": true, "dev": true, "requires": { diff --git a/src/auth/AuthManager.ts b/src/auth/AuthManager.ts index 2418d67..33e9b46 100644 --- a/src/auth/AuthManager.ts +++ b/src/auth/AuthManager.ts @@ -110,7 +110,7 @@ export class AuthManager { //For SAS9 we will send request on SASStoredProcess const url = this.serverType === 'SASVIYA' - ? `${this.serverUrl}/identities` + ? `${this.serverUrl}/identities/users/@currentUser` : `${this.serverUrl}/SASStoredProcess` const { result: loginResponse } = await this.requestClient @@ -120,6 +120,10 @@ export class AuthManager { }) const isLoggedIn = loginResponse !== 'authErr' + const userName = isLoggedIn + ? this.extractUserName(loginResponse) + : this.userName + let loginForm = null if (!isLoggedIn) { @@ -137,11 +141,16 @@ export class AuthManager { return Promise.resolve({ isLoggedIn, - userName: this.userName, + userName: userName ?? this.userName, loginForm }) } + private extractUserName = (response: string) => + this.serverType === 'SASVIYA' + ? response?.match(/[0-1a-zA-Z]*<\/id>/)?.[0].slice(4, -5) + : response?.match(/"title":"Log Off [0-1a-zA-Z]*"/)?.[0].slice(17, -1) + private getLoginForm(response: any) { const pattern: RegExp = // const matches = pattern.exec(response) diff --git a/src/auth/spec/AuthManager.spec.ts b/src/auth/spec/AuthManager.spec.ts index 584dc04..6551420 100644 --- a/src/auth/spec/AuthManager.spec.ts +++ b/src/auth/spec/AuthManager.spec.ts @@ -175,7 +175,7 @@ describe('AuthManager', () => { expect(response.isLoggedIn).toBeTruthy() expect(mockedAxios.get).toHaveBeenNthCalledWith( 1, - `http://test-server.com/identities`, + `http://test-server.com/identities/users/@currentUser`, { withCredentials: true, responseType: 'text',