diff --git a/backend/unittests/access_control/api/test_authentication.py b/backend/unittests/access_control/api/test_authentication.py index 5d1f5d443..478d64e91 100644 --- a/backend/unittests/access_control/api/test_authentication.py +++ b/backend/unittests/access_control/api/test_authentication.py @@ -351,6 +351,7 @@ def test_authentication(self, mock_user): ) self._check_authentication(["post"], "/api/license_policies/1/copy/") self._check_authentication(["post"], "/api/license_policies/1/apply/") + self._check_authentication(["post"], "/api/license_policies/apply_product/") self._check_authentication(["get", "post"], "/api/license_policy_items/") self._check_authentication( diff --git a/backend/unittests/access_control/api/test_authorization_license_policies.py b/backend/unittests/access_control/api/test_authorization_license_policies.py index d27aced07..e2161d243 100644 --- a/backend/unittests/access_control/api/test_authorization_license_policies.py +++ b/backend/unittests/access_control/api/test_authorization_license_policies.py @@ -1,3 +1,4 @@ +from application.core.models import Product from application.licenses.models import License_Policy from unittests.access_control.api.test_authorization import ( APITest, @@ -258,6 +259,59 @@ def test_authorization_license_policies(self): ) ) + product_1 = Product.objects.get(pk=1) + license_policy_1000 = License_Policy.objects.get(pk=1000) + product_1.license_policy = license_policy_1000 + product_1.save() + + self._test_api( + APITest( + "db_admin", + "post", + "/api/license_policies/apply_product/?product=1", + None, + 204, + None, + no_second_user=False, + ) + ) + + self._test_api( + APITest( + "db_internal_write", + "post", + "/api/license_policies/apply_product/?product=1", + None, + 204, + None, + no_second_user=False, + ) + ) + + self._test_api( + APITest( + "db_internal_read", + "post", + "/api/license_policies/apply_product/?product=1", + None, + 403, + None, + no_second_user=False, + ) + ) + + self._test_api( + APITest( + "db_external", + "post", + "/api/license_policies/apply_product/?product=1", + None, + 403, + None, + no_second_user=False, + ) + ) + self._test_api( APITest( "db_internal_write", diff --git a/end_to_end_tests/package-lock.json b/end_to_end_tests/package-lock.json index 62cb3bf3a..428380c74 100644 --- a/end_to_end_tests/package-lock.json +++ b/end_to_end_tests/package-lock.json @@ -9,7 +9,7 @@ "version": "1.22.4", "devDependencies": { "@playwright/test": "1.49.0", - "@types/node": "22.9.3" + "@types/node": "22.10.0" } }, "node_modules/@playwright/test": { @@ -29,13 +29,13 @@ } }, "node_modules/@types/node": { - "version": "22.9.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.3.tgz", - "integrity": "sha512-F3u1fs/fce3FFk+DAxbxc78DF8x0cY09RRL8GnXLmkJ1jvx3TtPdWoTT5/NiYfI5ASqXBmfqJi9dZ3gxMx4lzw==", + "version": "22.10.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.0.tgz", + "integrity": "sha512-XC70cRZVElFHfIUB40FgZOBbgJYFKKMa5nb9lxcwYstFG/Mi+/Y0bGS+rs6Dmhmkpq4pnNiLiuZAbc02YCOnmA==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~6.19.8" + "undici-types": "~6.20.0" } }, "node_modules/fsevents": { @@ -86,9 +86,9 @@ } }, "node_modules/undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", "dev": true, "license": "MIT" } diff --git a/end_to_end_tests/package.json b/end_to_end_tests/package.json index f01a84474..d0382d8a1 100644 --- a/end_to_end_tests/package.json +++ b/end_to_end_tests/package.json @@ -9,6 +9,6 @@ "author": "", "devDependencies": { "@playwright/test": "1.49.0", - "@types/node": "22.9.3" + "@types/node": "22.10.0" } } diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 56758cc44..abad1ead6 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -16,7 +16,7 @@ "@fortawesome/free-solid-svg-icons": "6.7.1", "@fortawesome/react-fontawesome": "0.2.2", "@textea/json-viewer": "3.5.0", - "axios": "1.7.7", + "axios": "1.7.8", "chart.js": "4.4.6", "markdown-to-jsx": "7.7.0", "mermaid": "11.4.0", @@ -40,7 +40,7 @@ "@microsoft/eslint-formatter-sarif": "3.1.0", "@trivago/prettier-plugin-sort-imports": "4.3.0", "@types/inflection": "1.13.2", - "@types/node": "22.9.3", + "@types/node": "22.10.0", "@types/prop-types": "15.7.13", "@types/react": "18.3.12", "@types/react-dom": "18.3.1", @@ -53,7 +53,7 @@ "eslint-plugin-react-hooks": "rc", "eslint-plugin-security": "3.0.1", "globals": "15.12.0", - "prettier": "3.3.3", + "prettier": "3.4.0", "rewire": "7.0.0", "typescript": "5.7.2", "vite": "5.4.11" @@ -2957,12 +2957,12 @@ "integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==" }, "node_modules/@types/node": { - "version": "22.9.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.3.tgz", - "integrity": "sha512-F3u1fs/fce3FFk+DAxbxc78DF8x0cY09RRL8GnXLmkJ1jvx3TtPdWoTT5/NiYfI5ASqXBmfqJi9dZ3gxMx4lzw==", + "version": "22.10.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.0.tgz", + "integrity": "sha512-XC70cRZVElFHfIUB40FgZOBbgJYFKKMa5nb9lxcwYstFG/Mi+/Y0bGS+rs6Dmhmkpq4pnNiLiuZAbc02YCOnmA==", "dev": true, "dependencies": { - "undici-types": "~6.19.8" + "undici-types": "~6.20.0" } }, "node_modules/@types/parse-json": { @@ -3497,9 +3497,9 @@ } }, "node_modules/axios": { - "version": "1.7.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", - "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "version": "1.7.8", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.8.tgz", + "integrity": "sha512-Uu0wb7KNqK2t5K+YQyVCLM76prD5sRFjKHbJYCP1J7JFGEQ6nN7HWn9+04LAeiJ3ji54lgS/gZCH1oxyrf1SPw==", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -6296,9 +6296,9 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "dev": true, "funding": [ { @@ -6675,9 +6675,9 @@ } }, "node_modules/prettier": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", - "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.0.tgz", + "integrity": "sha512-/OXNZcLyWkfo13ofOW5M7SLh+k5pnIs07owXK2teFpnfaOEcycnSy7HQxldaVX1ZP/7Q8oO1eDuQJNwbomQq5Q==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -8052,9 +8052,9 @@ "integrity": "sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ==" }, "node_modules/ts-api-utils": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.1.tgz", - "integrity": "sha512-5RU2/lxTA3YUZxju61HO2U6EoZLvBLtmV2mbTvqyu4a/7s7RmJPT+1YekhMVsQhznRWk/czIwDUg+V8Q9ZuG4w==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.2.tgz", + "integrity": "sha512-ZF5gQIQa/UmzfvxbHZI3JXN0/Jt+vnAfAviNRAMc491laiK6YCLpCW9ft8oaCRFOTxCZtUTE6XB0ZQAe3olntw==", "dev": true, "engines": { "node": ">=16" @@ -8237,9 +8237,9 @@ } }, "node_modules/undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", "dev": true }, "node_modules/update-browserslist-db": { diff --git a/frontend/package.json b/frontend/package.json index fcba161f4..104356b68 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -12,7 +12,7 @@ "@fortawesome/free-solid-svg-icons": "6.7.1", "@fortawesome/react-fontawesome": "0.2.2", "@textea/json-viewer": "3.5.0", - "axios": "1.7.7", + "axios": "1.7.8", "chart.js": "4.4.6", "markdown-to-jsx": "7.7.0", "mermaid": "11.4.0", @@ -49,7 +49,7 @@ "@microsoft/eslint-formatter-sarif": "3.1.0", "@trivago/prettier-plugin-sort-imports": "4.3.0", "@types/inflection": "1.13.2", - "@types/node": "22.9.3", + "@types/node": "22.10.0", "@types/prop-types": "15.7.13", "@types/react": "18.3.12", "@types/react-dom": "18.3.1", @@ -62,7 +62,7 @@ "eslint-plugin-react-hooks": "rc", "eslint-plugin-security": "3.0.1", "globals": "15.12.0", - "prettier": "3.3.3", + "prettier": "3.4.0", "rewire": "7.0.0", "typescript": "5.7.2", "vite": "5.4.11"