diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a138b03..0cdc764 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: persist-credentials: false - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1 + uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6.3.0 with: distribution: temurin java-version: ${{ matrix.java }} @@ -153,7 +153,7 @@ jobs: - name: Set up Node uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: - node-version: '24.22.1' + node-version: '24.22.3' - name: Build the web client working-directory: oie-web-client @@ -209,7 +209,7 @@ jobs: persist-credentials: false - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1 + uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6.3.0 with: distribution: temurin java-version: ${{ matrix.java }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 671b42a..1375e88 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -58,7 +58,7 @@ jobs: persist-credentials: false - name: Set up JDK 17 - uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1 + uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6.3.0 with: distribution: temurin java-version: '17' diff --git a/CLAUDE.md b/CLAUDE.md index da6529a..3fdc1fc 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -22,8 +22,8 @@ Then: ```bash mvn clean install # 'mvn package' at the root also works (verified on a fresh repo; the release workflow uses it) — install additionally puts the jars in ~/.m2 ``` -The packaging step downloads Node.js v24.21.0 (frontend-maven-plugin), installs the web UI's dependencies with `npm ci`, builds `webadmin/web/plugin.js` (gitignored), and runs the web UI's unit tests in the test phase, so the first build needs network access beyond Maven Central. -Output: `package/target/rbac-1.3.0.zip` +The packaging step downloads Node.js v24.22.3 (frontend-maven-plugin), installs the web UI's dependencies with `npm ci`, builds `webadmin/web/plugin.js` (gitignored), and runs the web UI's unit tests in the test phase, so the first build needs network access beyond Maven Central. +Output: `package/target/rbac-1.4.0.zip` ## Architecture diff --git a/README.md b/README.md index 15b0cbc..99c0a87 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Running OIE 4.6.0? Use [rbac 1.1.4](https://github.com/diridium-com/role-based-a Web admin ready: the same zip ships both UIs. Role management and role-based task gating work in the desktop (Swing) Administrator and in the [OIE Web Administrator](https://github.com/diridium-com/role-based-access-control/wiki/Web-Administrator), with matching behavior in each. The web UI's permission gating is also more complete than Swing's, which cannot hide buttons inside panel bodies (an engine limitation that applies to all plugins); either way, denied operations always fail server-side. On servers where the Web Administrator isn't used, the web module is inert. -Data Pruner uses its own View Settings, Save Settings, and Start / Stop grants; channel Start/Stop permission does not grant pruning access. The web manifest marks RBAC as an authorization plugin so compatible web clients can stop startup if it cannot load. Failed permission loads stay closed until both permission APIs recover. Recovery restores the Roles tab when View Roles is granted. A page that showed Access denied while permissions were failing has to be opened again. [Web client 1.1.0](https://github.com/gibson9583/oie-web-client/releases/tag/v1.1.0) or later is also required to hide Data Pruner actions and restricted navigation correctly; rbac 1.3.0 was tested against web client 1.1.0 and 1.3.0. +Data Pruner uses its own View Settings, Save Settings, and Start / Stop grants; channel Start/Stop permission does not grant pruning access. The web manifest marks RBAC as an authorization plugin so compatible web clients can stop startup if it cannot load. Failed permission loads stay closed until both permission APIs recover. Recovery restores the Roles tab when View Roles is granted. A page that showed Access denied while permissions were failing has to be opened again. [Web client 1.1.0](https://github.com/gibson9583/oie-web-client/releases/tag/v1.1.0) or later is also required to hide Data Pruner actions and restricted navigation correctly; rbac 1.4.0 was tested against web client 1.1.0 and 1.3.0. An unavailable permission snapshot gets at most three automatic retries, 15 seconds apart. Subsequent task checks retain the throttled lazy retry, and signing out cancels pending retries. @@ -26,7 +26,7 @@ Full documentation is in the [wiki](https://github.com/diridium-com/role-based-a - JDK 17 - Maven 3.x -- Network access on the first build: the engine jar script below downloads the OIE distribution, and the packaging step downloads Node.js v24.21.0 (via frontend-maven-plugin) to build the web administrator UI in `webadmin/` +- Network access on the first build: the engine jar script below downloads the OIE distribution, and the packaging step downloads Node.js v24.22.3 (via frontend-maven-plugin) to build the web administrator UI in `webadmin/` ## Build @@ -49,7 +49,7 @@ This runs the Java tests and the web UI's unit tests; `-DskipTests` skips both. The distributable zip lands at: ``` -package/target/rbac-1.3.0.zip +package/target/rbac-1.4.0.zip ``` ## Testing @@ -62,7 +62,7 @@ package/target/rbac-1.3.0.zip To run `e2e` locally you need Java 17 or later, Docker for every database but Derby, and the OIE distribution for the POM's `mc.version` (`oie_unix_4_7_0.tar.gz` from the engine's release): ```bash -python3 e2e/run.py --db postgres --zip package/target/rbac-1.3.0.zip \ +python3 e2e/run.py --db postgres --zip package/target/rbac-1.4.0.zip \ --tarball oie_unix_4_7_0.tar.gz --work /tmp/rbac-e2e-1 ``` diff --git a/e2e/scenarios.py b/e2e/scenarios.py index e9a29e7..7520d9c 100644 --- a/e2e/scenarios.py +++ b/e2e/scenarios.py @@ -19,6 +19,10 @@ from oie import Api PASSWORD = "Rbac-e2e-" + b.new_id()[:12] + "!" +# The schema version each release in upgrade-sources.txt leaves behind, and the latest one. A release added there +# without an entry here fails the upgrade's schema-step check. +SCHEMA_LEFT_BY = {"1.1.2": 2, "1.1.3": 2, "1.1.4": 2, "1.2.0": 2, "1.3.0": 4} +LATEST_SCHEMA = 4 # rbac writes these at WARN on purpose: every refusal, the blocked deletion of the last admin user, the made-up grant # the unregistered-grant check gives a role, and, on an engine that doesn't label them, the operations the label checks # call as a role without the label's permission. @@ -333,16 +337,18 @@ def upgrade(r, engine, db, dbname, new_zip, old_zip, upgrade_engine=None, **_): got = b.user_role(api, uid) r.check(f"{name} holds the admin role again", admin_role and got and got["id"] == admin_role["id"], str(got)) else: - # Releases before schema step v3 left SQL Server's text columns VARCHAR; every release before v4 lacks the - # restricted column, which v4 adds and sets for the roles that have channel rows. + # The upgrade runs every schema step after the one the old release left: v3 converts SQL Server's text columns + # to NVARCHAR (on SQL Server only), and v4 adds the restricted column and sets it for the roles that have + # channel rows. Releases up to 1.2.0 left version 2; 1.3.0 left 4, so upgrading from it runs none. steps = re.findall(r"Applying RBAC schema (v\d)", after) - want = ["v3", "v4"] if db.server == "sqlserver" else ["v4"] + left = SCHEMA_LEFT_BY.get(old_version, 0) + want = [f"v{n}" for n in range(left + 1, LATEST_SCHEMA + 1) if n != 3 or db.server == "sqlserver"] r.check(f"the upgrade ran schema steps {want}", steps == want, f"ran {steps}") now = b.roles(api) others = {rid: role for rid, role in snapshot.items() if not role["isAdmin"]} r.check("every non-admin role is kept as it was", {rid: now.get(rid) for rid in others} == others, f"{others} -> {now}") - r.check("v4 set the restricted flag for the role with channel rows and not for the others", + r.check("the role with channel rows is restricted and the others aren't", now.get(rid, {}).get("restricted") is True and all(role["restricted"] is False for rid2, role in now.items() if rid2 != rid), str(now)) old_admin = next(role for role in snapshot.values() if role["isAdmin"]) diff --git a/e2e/upgrade-sources.txt b/e2e/upgrade-sources.txt index 304f145..3499187 100644 --- a/e2e/upgrade-sources.txt +++ b/e2e/upgrade-sources.txt @@ -6,7 +6,9 @@ # 1.1.3: built for OIE 4.6.0, the Oracle fix. # 1.1.4: the last release for OIE 4.6.0. # 1.2.0: the first release for OIE 4.7.0. +# 1.3.0: role export and import, and a restricted role that can have no channel (schema version 4). 1.1.2 59bd1e9729c7badb193bbb9ecc4765870b37561ae7ea106c7e72cd3072e2f7ba https://github.com/diridium-com/role-based-access-control/releases/download/v1.1.2/rbac-1.1.2.zip 1.1.3 d77e894fa93117609bb72baf73cf62fb3ea5fc31943e417d7280e440580aad57 https://github.com/diridium-com/role-based-access-control/releases/download/v1.1.3/rbac-1.1.3.zip 1.1.4 7e3ce2a9c55c399b4f7db04e73a4b5d4d8dab8f9f9522d3d44c2ae0ed1d7749d https://github.com/diridium-com/role-based-access-control/releases/download/v1.1.4/rbac-1.1.4.zip 1.2.0 b622861432b16739bd2c9b94e30ba529ecf6c343addbe91ed57cfe53646f3488 https://github.com/diridium-com/role-based-access-control/releases/download/v1.2.0/rbac-1.2.0.zip +1.3.0 f540cc77ebfadda88147f07fce412caff41abf30ad302ddca61f0b3f422d0cfd https://github.com/diridium-com/role-based-access-control/releases/download/v1.3.0/rbac-1.3.0.zip diff --git a/oie.json b/oie.json index f80024e..7242c3c 100644 --- a/oie.json +++ b/oie.json @@ -5,7 +5,7 @@ "description": "Enforces role-based access control with dynamic roles, per-permission grants, and channel-level restrictions.", "type": "plugin", "ui": ["web", "swing"], - "version": "1.3.0", + "version": "1.4.0", "minEngineVersion": "4.7.0", "maxEngineVersion": "4.7.0", "filename": "rbac-{version}.zip", diff --git a/package/pom.xml b/package/pom.xml index ab2712e..738701f 100644 --- a/package/pom.xml +++ b/package/pom.xml @@ -56,7 +56,7 @@ install-node-and-npm generate-resources install-node-and-npm - v24.22.1 + v24.22.3 diff --git a/pom.xml b/pom.xml index 4dbcedb..34450cc 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ pom - 1.3.0 + 1.4.0 ${mc.version} diff --git a/webadmin/package-lock.json b/webadmin/package-lock.json index 64c3218..10d68c1 100644 --- a/webadmin/package-lock.json +++ b/webadmin/package-lock.json @@ -1,14 +1,14 @@ { "name": "rbac-webadmin", - "version": "1.3.0", + "version": "1.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rbac-webadmin", - "version": "1.3.0", + "version": "1.4.0", "devDependencies": { - "@playwright/test": "^1.61.0", + "@playwright/test": "^1.65.1", "esbuild": "^0.28.2" } }, @@ -455,19 +455,19 @@ } }, "node_modules/@playwright/test": { - "version": "1.61.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.61.1.tgz", - "integrity": "sha512-8nKv6+0RJSL9FE4jYOEGXnPeM/Hg12qZpmqzZjRh3qM0Y7c3z1mrOTfFLids72RDQYVh9WpLEfR5WdpNX4fkig==", + "version": "1.65.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.65.1.tgz", + "integrity": "sha512-y+NCIRm2LvY4slUVWvGh1nujJ8RF/hEisIsq2mtUPgdQC4L701bq5hZGMhrpeXjACvwvO9tj5dJqhvM6TP9lbw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright": "1.61.1" + "playwright": "1.65.1" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/esbuild": { @@ -512,51 +512,33 @@ "@esbuild/win32-x64": "0.28.2" } }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/playwright": { - "version": "1.61.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.61.1.tgz", - "integrity": "sha512-DWnY5o3YbLWK4GovuAVwpqL+1VwGNdUGrRr++8j8PtQQzvAVZUIMjKQ90fY689sEJZJBbZVw1rXaOKSTitkzPQ==", + "version": "1.65.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.65.1.tgz", + "integrity": "sha512-vJ1FuoOrNwOKHUIVEvSt3jT1L+wjjDpwhwIstKtfvTh8XIG4FG4bIFuvNdMxi81LGfAhUgUZleVFaOLY4RIUUw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.61.1" + "playwright-core": "1.65.1" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "fsevents": "2.3.2" + "node": ">=20" } }, "node_modules/playwright-core": { - "version": "1.61.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.61.1.tgz", - "integrity": "sha512-h7Qlt6m4REp25qvIdvbDtVmD4LqVXfpRxhORv9L0jzETM05p4fuPJ3dKyuSXQxDSbXnmS79HAgi9589lGSpLkg==", + "version": "1.65.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.65.1.tgz", + "integrity": "sha512-hqPpz7blSMPxWVdoeE1yiBSzXsKiVOd2k+kjCvmUywD2GPO2Dd9HfcWnq9NN0GHbNZDFgZ9JfBFr+X5/BLo0qw==", "dev": true, "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" }, "engines": { - "node": ">=18" + "node": ">=20" } } } diff --git a/webadmin/package.json b/webadmin/package.json index 0ee9304..4a97aa9 100644 --- a/webadmin/package.json +++ b/webadmin/package.json @@ -1,6 +1,6 @@ { "name": "rbac-webadmin", - "version": "1.3.0", + "version": "1.4.0", "private": true, "type": "module", "scripts": { @@ -9,7 +9,7 @@ "e2e": "playwright test" }, "devDependencies": { - "@playwright/test": "^1.61.0", + "@playwright/test": "^1.65.1", "esbuild": "^0.28.2" } } diff --git a/webadmin/plugin.json b/webadmin/plugin.json index c79e74b..16fb4ab 100644 --- a/webadmin/plugin.json +++ b/webadmin/plugin.json @@ -1,7 +1,7 @@ { "id": "rbac", "name": "Role-Based Access Control", - "version": "1.3.0", + "version": "1.4.0", "author": "Diridium Technologies Inc.", "description": "Role management and role-based UI hiding for the web administrator: a Role-Based Access Control settings tab (roles, permission grants, channel restrictions, user assignments) plus task-permission enforcement that hides navigation and task buttons the user's role does not grant. Web administrator UI for the role-based-access-control engine plugin.", "oie": { "apiMin": "4.6" },