diff --git a/.eslintrc.cjs b/.eslintrc.cjs index b73fa4e..98583e2 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -4,9 +4,5 @@ module.exports = { project: [ 'tsconfig.json', ], - }, - rules: { - '@typescript-eslint/consistent-type-imports': 0, - '@typescript-eslint/consistent-type-exports': 0 } }; diff --git a/docs/modules/ROOT/pages/abac.adoc b/docs/modules/ROOT/pages/abac.adoc index 3bf291a..6fd60a2 100644 --- a/docs/modules/ROOT/pages/abac.adoc +++ b/docs/modules/ROOT/pages/abac.adoc @@ -95,7 +95,7 @@ as demanding such evaluation would require a replication of this functionality a # To identify role scoping entity - id ex: urn:restorecommerce:acs:names:roleScopingEntity - - value ex: urn:restorecommerce:model:organization.Organization + - value ex: urn:restorecommerce:acs:model:organization.Organization # To identify role scoping instance - id ex: urn:restorecommerce:acs:names:roleScopeInstance @@ -103,7 +103,7 @@ as demanding such evaluation would require a replication of this functionality a - resources # To identify a domain model type - id ex: maskedProperty - - value ex: urn:restorecommerce:model:user.User + - value ex: urn:restorecommerce:acs:model:user.User # To identify a single resource by its ID - id ex: urn:oasis:names:tc:xacml:1.0:resource:resource-id @@ -191,7 +191,7 @@ request: - id: ex: urn:oasis:names:tc:xacml:1.0:subject:subject-id value: Alice - id: urn:restorecommerce:acs:names:roleScopingEntity - value: urn:restorecommerce:model:organization.Organization + value: urn:restorecommerce:acs:model:organization.Organization - id: urn:restorecommerce:acs:names:roleScopeInstance value: OrgB resources: @@ -210,7 +210,7 @@ request: - role: admin attributes: # a list of attributes associated with the role - id: urn:restorecommerce:acs:names:roleScopingEntity - value: urn:restorecommerce:model:organization.Organization + value: urn:restorecommerce:acs:model:organization.Organization attributes: - id: urn:restorecommerce:acs:names:roleScopeInstance value: OrgA @@ -228,12 +228,12 @@ request: modified_by: RandomUser owners: - id: urn:restorecommerce:acs:names:ownerIndicatoryEntity - value: urn:restorecommerce:model:organization.Organization + value: urn:restorecommerce:acs:model:organization.Organization attributes: - id: urn:restorecommerce:acs:names:ownerInstance value: OrgB - id: urn:restorecommerce:acs:names:ownerIndicatoryEntity - value: urn:restorecommerce:model:user.User + value: urn:restorecommerce:acs:model:user.User attributes: - id: urn:restorecommerce:acs:names:ownerInstance value: RandomUser @@ -265,7 +265,7 @@ policy_sets: - id: urn:restorecommerce:acs:names:role value: admin - id: urn:restorecommerce:acs:names:roleScopingEntity - value: urn:restorecommerce:model:organization.Organization + value: urn:restorecommerce:acs:model:organization.Organization - id: urn:restorecommerce:acs:names:hierarchicalRoleScoping value: 'true' effect: PERMIT @@ -293,7 +293,7 @@ request: - id: ex: urn:oasis:names:tc:xacml:1.0:subject:subject-id value: Alice - id: urn:restorecommerce:acs:names:roleScopingEntity - value: urn:restorecommerce:model:organization.Organization + value: urn:restorecommerce:acs:model:organization.Organization - id: urn:restorecommerce:acs:names:roleScopeInstance value: OrgA resources: @@ -318,7 +318,7 @@ request: - role: admin attributes: # a list of attributes associated with the role - id: urn:restorecommerce:acs:names:roleScopingEntity - value: urn:restorecommerce:model:organization.Organization + value: urn:restorecommerce:acs:model:organization.Organization attributes: - id: urn:restorecommerce:acs:names:roleScopeInstance value: OrgA @@ -358,7 +358,7 @@ policy_sets: - id: urn:restorecommerce:acs:names:role value: admin - id: urn:restorecommerce:acs:names:roleScopingEntity - value: urn:restorecommerce:model:organization.Organization + value: urn:restorecommerce:acs:model:organization.Organization effect: PERMIT - name: Country Policy description: A policy which contains country-related rules @@ -379,7 +379,7 @@ policy_sets: - id: urn:restorecommerce:acs:names:role value: admin - id: urn:restorecommerce:acs:names:roleScopingEntity - value: urn:restorecommerce:model:organization.Organization + value: urn:restorecommerce:acs:model:organization.Organization effect: PERMIT ---- @@ -395,7 +395,7 @@ request: - id: ex: urn:oasis:names:tc:xacml:1.0:subject:subject-id value: Alice - id: urn:restorecommerce:acs:names:roleScopingEntity - value: urn:restorecommerce:model:organization.Organization + value: urn:restorecommerce:acs:model:organization.Organization - id: urn:restorecommerce:acs:names:roleScopeInstance value: OrgA resources: @@ -412,7 +412,7 @@ request: - role: admin attributes: # a list of attributes associated with the role - id: urn:restorecommerce:acs:names:roleScopingEntity - value: urn:restorecommerce:model:organization.Organization + value: urn:restorecommerce:acs:model:organization.Organization attributes: - id: urn:restorecommerce:acs:names:roleScopeInstance value: OrgA @@ -428,12 +428,12 @@ request: modified_by: RandomUser owners: - id: urn:restorecommerce:acs:names:ownerIndicatoryEntity - value: urn:restorecommerce:model:organization.Organization + value: urn:restorecommerce:acs:model:organization.Organization attributes: - id: urn:restorecommerce:acs:names:ownerInstance value: OrgA - id: urn:restorecommerce:acs:names:ownerIndicatoryEntity - value: urn:restorecommerce:model:user.User + value: urn:restorecommerce:acs:model:user.User attributes: - id: urn:restorecommerce:acs:names:ownerInstance value: RandomUser @@ -456,7 +456,7 @@ rules: - id: urn:restorecommerce:acs:names:role value: admin - id: urn:restorecommerce:acs:names:roleScopingEntity - value: urn:restorecommerce:model:organization.Organization + value: urn:restorecommerce:acs:model:organization.Organization effect: PERMIT ---- diff --git a/package-lock.json b/package-lock.json index db45bd4..7a5fbed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,12 +9,12 @@ "version": "1.2.8", "license": "MIT", "dependencies": { - "@restorecommerce/acs-client": "^1.4.9", + "@restorecommerce/acs-client": "^1.4.11", "@restorecommerce/chassis-srv": "^1.4.6", "@restorecommerce/grpc-client": "^2.1.1", - "@restorecommerce/kafka-client": "^1.1.18", + "@restorecommerce/kafka-client": "^1.1.19", "@restorecommerce/logger": "^1.2.9", - "@restorecommerce/rc-grpc-clients": "^5.1.18", + "@restorecommerce/rc-grpc-clients": "^5.1.19", "@restorecommerce/resource-base-interface": "^1.4.4", "@restorecommerce/service-config": "^1.0.11", "apollo-boost": "^0.4.9", @@ -31,15 +31,15 @@ "devDependencies": { "@alenon/grpc-mock-server": "^3.1.9", "@grpc/proto-loader": "^0.7.10", - "@restorecommerce/dev": "^0.0.6", + "@restorecommerce/dev": "^0.0.7", "@restorecommerce/protos": "^6.7.0", "@types/lodash-es": "^4.17.12", "@types/mocha": "^10.0.6", "@types/nock": "^11.1.0", - "@types/node": "^20.11.17", - "@typescript-eslint/eslint-plugin": "^6.21.0", - "@typescript-eslint/eslint-plugin-tslint": "^6.21.0", - "@typescript-eslint/parser": "^6.21.0", + "@types/node": "^20.11.19", + "@typescript-eslint/eslint-plugin": "^7.0.1", + "@typescript-eslint/eslint-plugin-tslint": "^7.0.1", + "@typescript-eslint/parser": "^7.0.1", "c8": "^9.1.0", "coveralls": "^3.1.1", "cross-env": "^7.0.3", @@ -47,7 +47,7 @@ "eslint": "^8.56.0", "eslint-plugin-prefer-arrow-functions": "^3.2.4", "mocha": "^10.3.0", - "nock": "^13.5.1", + "nock": "^13.5.3", "nodemon": "^3.0.3", "npm-run-all": "^4.1.5", "rimraf": "^5.0.5", @@ -1259,19 +1259,19 @@ } }, "node_modules/@restorecommerce/acs-client": { - "version": "1.4.9", - "resolved": "https://registry.npmjs.org/@restorecommerce/acs-client/-/acs-client-1.4.9.tgz", - "integrity": "sha512-jeUBmiJO4DbrU9GGVCd+8opyHe/u3WI/aKBemuL3eZDNO0qT2rKQfKqthMULp6iqqCFLrrocLen3rtIMNB3ONw==", + "version": "1.4.11", + "resolved": "https://registry.npmjs.org/@restorecommerce/acs-client/-/acs-client-1.4.11.tgz", + "integrity": "sha512-hGf0WcUeHu3LkW7jsWt93td80Oqyudz/OWuv/ZGfBnxsjX0PWVgmUiKZCGJyi3yP1/dZyYYuXkCJKeBNrzwYNA==", "dependencies": { "@restorecommerce/grpc-client": "^2.1.1", - "@restorecommerce/kafka-client": "^1.1.18", + "@restorecommerce/kafka-client": "^1.1.19", "@restorecommerce/logger": "^1.2.9", - "@restorecommerce/rc-grpc-clients": "^5.1.18", + "@restorecommerce/rc-grpc-clients": "^5.1.19", "@restorecommerce/service-config": "^1.0.11", "lodash": "^4.17.21", "nconf": "^0.12.1", "node-eval": "^2.0.0", - "redis": "^4.6.10", + "redis": "^4.6.13", "winston": "^3.11.0" } }, @@ -1308,9 +1308,9 @@ } }, "node_modules/@restorecommerce/dev": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@restorecommerce/dev/-/dev-0.0.6.tgz", - "integrity": "sha512-D8+2ADnFKxYXQTtplpEpO09vk0rK335ETbL87YO2VkTIn6Ss0JxcRQP0JKajQ9AfHGuXgiEECGKrsIHJ/ifrZQ==", + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/@restorecommerce/dev/-/dev-0.0.7.tgz", + "integrity": "sha512-/vFjeWuAQfUqtNgGA5MxdY/eSQi2ttkfDVU08HIUyGgfMdshwzJm2ChZ/K6BRHRpGtK42hiV6lTwyI90fbDjBg==", "dev": true, "dependencies": { "@typescript-eslint/eslint-plugin": "^5.59.9", @@ -1576,12 +1576,12 @@ } }, "node_modules/@restorecommerce/kafka-client": { - "version": "1.1.18", - "resolved": "https://registry.npmjs.org/@restorecommerce/kafka-client/-/kafka-client-1.1.18.tgz", - "integrity": "sha512-54xWZpl1kDY32mA+KHbEkBU40kyXojlTMLsXx2s9njg9RvMIfZntPsWbVNA0GbILVeRrBQCY+oi/MnD8RYFQnQ==", + "version": "1.1.19", + "resolved": "https://registry.npmjs.org/@restorecommerce/kafka-client/-/kafka-client-1.1.19.tgz", + "integrity": "sha512-tit/pOeZYXqnIP4qspj1+I04dFYQ4bIVbmSEEL1zYIp/7GJ9FOO6yz9KF1Tfn76xjCosbaDKr7FLHRs+5+VEzA==", "dependencies": { "@restorecommerce/logger": "^1.2.9", - "@restorecommerce/rc-grpc-clients": "^5.1.18", + "@restorecommerce/rc-grpc-clients": "^5.1.19", "async": "^3.2.5", "cls-rtracer": "^2.6.3", "events": "^3.3.0", @@ -1617,9 +1617,9 @@ "integrity": "sha512-Syx5b/8j0PA/bmrv7w6nQIY3+dEhwj3IALddM0UX3agKw29RyzDLJXh1duIVcbXemSbaTZoP1GhsVg61QQ759w==" }, "node_modules/@restorecommerce/rc-grpc-clients": { - "version": "5.1.18", - "resolved": "https://registry.npmjs.org/@restorecommerce/rc-grpc-clients/-/rc-grpc-clients-5.1.18.tgz", - "integrity": "sha512-uDdR0v0OxEwsDXOsVmf66t7cRkMVwV9gWAVnES/znWgxjqKmZBBSWRKBplZDwT6wUjkDsWK+AgEed6yOq3P7dw==", + "version": "5.1.19", + "resolved": "https://registry.npmjs.org/@restorecommerce/rc-grpc-clients/-/rc-grpc-clients-5.1.19.tgz", + "integrity": "sha512-C2wOVh2WMZZfe5RTsjsvcES8A5N484vjt3G2FAi+Z2tBtKW9yFguVBfC7euFjEbZbjX0ERZmkCHAmrDxJSy5Yg==", "dependencies": { "@grpc/grpc-js": "^1.9.11", "@restorecommerce/grpc-client": "^2.1.1", @@ -1757,9 +1757,9 @@ } }, "node_modules/@types/node": { - "version": "20.11.17", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.17.tgz", - "integrity": "sha512-QmgQZGWu1Yw9TDyAP9ZzpFJKynYNeOvwMJmaxABfieQoVoiVOS6MN1WSpqpRcbeA5+RW82kraAVxCCJg+780Qw==", + "version": "20.11.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.19.tgz", + "integrity": "sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ==", "dependencies": { "undici-types": "~5.26.4" } @@ -1787,16 +1787,16 @@ "integrity": "sha512-LKzNTjj+2j09wAo/vvVjzgw5qckJJzhdGgWHW7j69QIGdq/KnZrMAMIHQiWGl3Ccflh5/CudBAntTPYdprPltA==" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz", - "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.0.1.tgz", + "integrity": "sha512-OLvgeBv3vXlnnJGIAgCLYKjgMEU+wBGj07MQ/nxAaON+3mLzX7mJbhRYrVGiVvFiXtwFlkcBa/TtmglHy0UbzQ==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/type-utils": "6.21.0", - "@typescript-eslint/utils": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", + "@typescript-eslint/scope-manager": "7.0.1", + "@typescript-eslint/type-utils": "7.0.1", + "@typescript-eslint/utils": "7.0.1", + "@typescript-eslint/visitor-keys": "7.0.1", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -1812,8 +1812,8 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", - "eslint": "^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -1822,12 +1822,12 @@ } }, "node_modules/@typescript-eslint/eslint-plugin-tslint": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin-tslint/-/eslint-plugin-tslint-6.21.0.tgz", - "integrity": "sha512-DktcL2dSnR90VCVHXYKUz40QQ5DY2lSvnbkQJ+b1BtWhj/sNXdtlmQR6vB6b4RyEm/GMhvLFj6Pq1MvVVXLMAg==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin-tslint/-/eslint-plugin-tslint-7.0.1.tgz", + "integrity": "sha512-IZCRgd1wNtc6tRQMvMy1DeEbmISDickzQ4K/k7DmizBzzjaBtoX8J2XwDgeC4iSHqRpUGChqxYqUASzWPu+stw==", "dev": true, "dependencies": { - "@typescript-eslint/utils": "6.21.0" + "@typescript-eslint/utils": "7.0.1" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -1837,21 +1837,21 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0", + "eslint": "^8.56.0", "tslint": "^5.0.0 || ^6.0.0", "typescript": "*" } }, "node_modules/@typescript-eslint/parser": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", - "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.0.1.tgz", + "integrity": "sha512-8GcRRZNzaHxKzBPU3tKtFNing571/GwPBeCvmAUw0yBtfE2XVd0zFKJIMSWkHJcPQi0ekxjIts6L/rrZq5cxGQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", + "@typescript-eslint/scope-manager": "7.0.1", + "@typescript-eslint/types": "7.0.1", + "@typescript-eslint/typescript-estree": "7.0.1", + "@typescript-eslint/visitor-keys": "7.0.1", "debug": "^4.3.4" }, "engines": { @@ -1862,7 +1862,7 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -1871,13 +1871,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", - "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.0.1.tgz", + "integrity": "sha512-v7/T7As10g3bcWOOPAcbnMDuvctHzCFYCG/8R4bK4iYzdFqsZTbXGln0cZNVcwQcwewsYU2BJLay8j0/4zOk4w==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0" + "@typescript-eslint/types": "7.0.1", + "@typescript-eslint/visitor-keys": "7.0.1" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -1888,13 +1888,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz", - "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.0.1.tgz", + "integrity": "sha512-YtT9UcstTG5Yqy4xtLiClm1ZpM/pWVGFnkAa90UfdkkZsR1eP2mR/1jbHeYp8Ay1l1JHPyGvoUYR6o3On5Nhmw==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.21.0", - "@typescript-eslint/utils": "6.21.0", + "@typescript-eslint/typescript-estree": "7.0.1", + "@typescript-eslint/utils": "7.0.1", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -1906,7 +1906,7 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -1915,9 +1915,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", - "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.0.1.tgz", + "integrity": "sha512-uJDfmirz4FHib6ENju/7cz9SdMSkeVvJDK3VcMFvf/hAShg8C74FW+06MaQPODHfDJp/z/zHfgawIJRjlu0RLg==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -1928,13 +1928,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", - "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.0.1.tgz", + "integrity": "sha512-SO9wHb6ph0/FN5OJxH4MiPscGah5wjOd0RRpaLvuBv9g8565Fgu0uMySFEPqwPHiQU90yzJ2FjRYKGrAhS1xig==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", + "@typescript-eslint/types": "7.0.1", + "@typescript-eslint/visitor-keys": "7.0.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1956,17 +1956,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", - "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.0.1.tgz", + "integrity": "sha512-oe4his30JgPbnv+9Vef1h48jm0S6ft4mNwi9wj7bX10joGn07QRfqIqFHoMiajrtoU88cIhXf8ahwgrcbNLgPA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/scope-manager": "7.0.1", + "@typescript-eslint/types": "7.0.1", + "@typescript-eslint/typescript-estree": "7.0.1", "semver": "^7.5.4" }, "engines": { @@ -1977,16 +1977,16 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", - "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.0.1.tgz", + "integrity": "sha512-hwAgrOyk++RTXrP4KzCg7zB2U0xt7RUU0ZdMSCsqF3eKUwkdXUMyTb0qdCuji7VIbcpG62kKTU9M1J1c9UpFBw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/types": "7.0.1", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -5724,9 +5724,9 @@ "dev": true }, "node_modules/nock": { - "version": "13.5.1", - "resolved": "https://registry.npmjs.org/nock/-/nock-13.5.1.tgz", - "integrity": "sha512-+s7b73fzj5KnxbKH4Oaqz07tQ8degcMilU4rrmnKvI//b0JMBU4wEXFQ8zqr+3+L4eWSfU3H/UoIVGUV0tue1Q==", + "version": "13.5.3", + "resolved": "https://registry.npmjs.org/nock/-/nock-13.5.3.tgz", + "integrity": "sha512-2NlGmHIK2rTeyy7UaY1ZNg0YZfEJMxghXgZi0b4DBsUyoDNTTxZeCSG1nmirAWF44RkkoV8NnegLVQijgVapNQ==", "dev": true, "dependencies": { "debug": "^4.1.0", diff --git a/package.json b/package.json index d12b288..0c6d2d3 100644 --- a/package.json +++ b/package.json @@ -17,12 +17,12 @@ "service" ], "dependencies": { - "@restorecommerce/acs-client": "^1.4.9", + "@restorecommerce/acs-client": "^1.4.11", "@restorecommerce/chassis-srv": "^1.4.6", "@restorecommerce/grpc-client": "^2.1.1", - "@restorecommerce/kafka-client": "^1.1.18", + "@restorecommerce/kafka-client": "^1.1.19", "@restorecommerce/logger": "^1.2.9", - "@restorecommerce/rc-grpc-clients": "^5.1.18", + "@restorecommerce/rc-grpc-clients": "^5.1.19", "@restorecommerce/resource-base-interface": "^1.4.4", "@restorecommerce/service-config": "^1.0.11", "apollo-boost": "^0.4.9", @@ -39,15 +39,15 @@ "devDependencies": { "@alenon/grpc-mock-server": "^3.1.9", "@grpc/proto-loader": "^0.7.10", - "@restorecommerce/dev": "^0.0.6", + "@restorecommerce/dev": "^0.0.7", "@restorecommerce/protos": "^6.7.0", "@types/lodash-es": "^4.17.12", "@types/mocha": "^10.0.6", "@types/nock": "^11.1.0", - "@types/node": "^20.11.17", - "@typescript-eslint/eslint-plugin": "^6.21.0", - "@typescript-eslint/eslint-plugin-tslint": "^6.21.0", - "@typescript-eslint/parser": "^6.21.0", + "@types/node": "^20.11.19", + "@typescript-eslint/eslint-plugin": "^7.0.1", + "@typescript-eslint/eslint-plugin-tslint": "^7.0.1", + "@typescript-eslint/parser": "^7.0.1", "c8": "^9.1.0", "coveralls": "^3.1.1", "cross-env": "^7.0.3", @@ -55,7 +55,7 @@ "eslint": "^8.56.0", "eslint-plugin-prefer-arrow-functions": "^3.2.4", "mocha": "^10.3.0", - "nock": "^13.5.1", + "nock": "^13.5.3", "nodemon": "^3.0.3", "npm-run-all": "^4.1.5", "rimraf": "^5.0.5", diff --git a/src/core/utils.ts b/src/core/utils.ts index 2b5aa08..a69d032 100644 --- a/src/core/utils.ts +++ b/src/core/utils.ts @@ -214,7 +214,7 @@ export async function checkAccessRequest(ctx: ACSClientContext, resource: Resour /* eslint-disable prefer-arrow-functions/prefer-arrow-functions */ export async function checkAccessRequest(ctx: ACSClientContext, resource: Resource[], action: AuthZAction, operation: Operation): Promise { - let subject = ctx.subject; + let subject = ctx.subject as Subject; // resolve subject id using findByToken api and update subject with id let dbSubject; if (subject?.token) { @@ -229,7 +229,7 @@ export async function checkAccessRequest(ctx: ACSClientContext, resource: Resour let result: DecisionResponse | PolicySetRQResponse; try { - result = await accessRequest(subject, resource, action, ctx, operation); + result = await accessRequest(subject, resource, action, ctx, { operation }); } catch (err) { return { decision: Response_Decision.DENY,