Repository navigation
Fix nits from the 1.4.0 release review - #76
Merged
Merged
Conversation
rbac PR #75 fixed what the first 1.4.0 release review found. A second review, of PR #75, found no blocker and 31 small findings. This fixes 28 of them. The other three: - Import refusal messages show a backslash in a role name doubled. Left as is; docs/design-notes.md says why. - Splitting SecureAuthorizationController joins the splits of RbacAuthorizationController, RbacRepository, RoleEditorDialog and e2e/checks.py planned for the next release. - Not done: an optional probe of whether the e2e suite can read Derby's schema version over REST after an uninstall. Changes: - Assign Role over REST (POST /api/extensions/rbac/users/{id}/role/{roleId}) answers 404, with a message, for a user id the engine doesn't have, as UserRoles.assign refuses one. - Three web changes match what Swing already does: after a failed import apply, the web previews again only on a 400 or 409, so a 403 shows its error once; the Orphaned Permissions dialog can't be closed during a removal; and the role editor counts a field edited back to its first shown text as unedited. - Swing: Import Roles and the export download can't be started twice. The Orphaned Permissions dialog always clears its guards, so an exception can't leave it stuck open. - The release job's check that Build passed on main refuses an answer that isn't a number, and its message says to re-run the job once Build passes. RELEASING.md says the same. - Tests: LogNameEscapingTest matches each quoted placeholder to its argument, and SqlStatementIdCoverageTest reads the statement ids from the sources. New tests cover a failure reading the permission labels at startup, the REST 404, the import's skip of the admin role, the web's rule for previewing again, the web's edited-back field, the Swing permission-load guard, a 403 on apply and the dialog during a removal. The browser test for an unedited description with a line break now fails on the old code. - e2e: UserRoles.assign with an unknown user id, the REST 404, and a NOTE with the number of permission labels rbac read at startup. The UserRoles check stops before its channel script if another admin couldn't be moved off the admin role. - Docs: the README says a Java caller using reflection gets UserRoles' exceptions as the cause of an InvocationTargetException. Comments and test names list all three admin-only tasks: Export Roles, Import Roles and Orphaned Permissions. CLAUDE.md gains the full condition for the "(no longer exists)" row of the import preview's channel table, the REST 404, and that a user delete doesn't take the role-change lock. A new entry in docs/design-notes.md corrects what the previous one said about the web editor and line breaks, and says what has no automated test. - Small: a misplaced Javadoc, the --label-as help text and a docstring in e2e/run.py, a test name, an indent, a blank line. Tested on this branch: the unit tests (shared 11, server 398, client 110, web 151), the browser suite against web client 1.3.0 and 1.1.0 (92 tests each), and the e2e suite on OIE 4.7.0 with Derby, MySQL, PostgreSQL, Oracle and SQL Server (jTDS and Microsoft drivers), with no failures. The new UserRoles check first failed on every database: its script looked for the exception's cause, and Rhino unwraps the InvocationTargetException that Method.invoke throws. With the script fixed, I ran the fresh scenario again on all six. Controls: with eight fixes undone at once, only the new unit test of each fails. With three web fixes undone, the three new browser tests fail (the 403 on apply, the dialog during a removal, the line break). With the user-exists check wired to accept any id in both the REST call and UserRoles, the three new e2e checks of an unknown user fail. In the Swing Administrator on OIE 4.7.0, Export Roles, Import Roles and Orphaned Permissions each open again when pressed a second time, and a removal keeps Close off until the list reloads. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rbac PR #75 fixed what the first 1.4.0 release review found. A second review, of PR #75, found no blocker and 31 small findings. This fixes 28 of them. The other three:
docs/design-notes.mdsays why.SecureAuthorizationController(now 504 lines) joins the splits ofRbacAuthorizationController,RbacRepository,RoleEditorDialogande2e/checks.pyplanned for the next release.Behavior
POST /api/extensions/rbac/users/{id}/role/{roleId}) answers 404 for a user id the engine doesn't have, with the message "No engine user has the id N.", asUserRoles.assignrefuses one. It used to store the assignment.mainrefuses an answer that isn't a number, and its message says to re-run the job once Build passes. RELEASING.md says the same.Correction to rbac PR #75
PR #75 said that saving what a text field showed renamed a role stored with a line break, in both editors. That was true of the Swing editor only. The web editor saves the value in its state, which is the stored value until the field is edited, so a line break in the middle of a value was never lost there; its browser test passed on the old code (measured). The web change kept the leading and trailing spaces and line breaks of an unedited value. The browser test now uses a description ending in a line break, which the old code dropped, and a new entry in
docs/design-notes.mdrecords the correction.New and changed tests
LogNameEscapingTestmatches each quoted placeholder to its argument by position. The old count let a dropped escape through when another argument had one.SqlStatementIdCoverageTestreads the statement ids from the sources instead of a hand-kept list.UserRoles.assignwith a user id the engine doesn't have throwsIllegalArgumentExceptionon a real engine, and the REST call answers 404 and stores nothing. A NOTE line records how many permission labels rbac read at startup. TheUserRolescheck stops before its channel script if another admin couldn't be moved off the admin role.Docs and small fixes
UserRoles' exceptions as the cause of anInvocationTargetException.--label-ashelp text and a docstring ine2e/run.py, a test name that contradicted its assertion, an indent and a blank line.Test results
UserRolescheck first failed on every database: its script looked for the exception's cause, and Rhino, the engine's script runtime, unwraps theInvocationTargetExceptionthatMethod.invokethrows. With the script fixed, I ran the fresh scenario again on all six.UserRoles, the three new e2e checks of an unknown user fail.Co-authored with Claude Code.