tanishqgandhi1908 opened a new pull request, #9234: URL: https://github.com/apache/texera/pull/9234
### What changes were proposed in this PR? With `COMPUTING_UNIT_SHARING_ENABLED=false`, shared units disappeared from the sharee's list and the share/revoke endpoints returned 403, but existing grants still worked. A user granted access before sharing was turned off could still connect to the owner's unit through the gateway, mount onto it, or rename it. The owner could neither see nor revoke that access. Now, while sharing is disabled, only the owner has access. Grant rows are kept, so re-enabling sharing restores them. - **`ComputingUnitAccess.getComputingUnitAccess`** (common/auth), the check behind the access-control gateway, the mount endpoint and the unit info page, ignores grants while sharing is disabled. It takes a `sharingEnabled` parameter that defaults to `ComputingUnitConfig.sharingComputingUnitEnabled`, so tests can set it directly. - **`ComputingUnitAccessResource.hasReadAccess` / `hasWriteAccess`** (computing-unit-managing-service) go through the same check, so rename and share/revoke follow the flag too. - **build.sbt**: the sharing flag is a load-time val, so the managing service already runs its tests with sharing enabled and gives each `*SharingDisabledSpec` its own JVM with it disabled. That setup is moved into a shared `computingUnitSharingTestSettings` and also applied to access-control-service, whose grant-based tests otherwise ran with sharing disabled. ### Any related issues, documentation, discussions? Closes #9227. ### How was this PR tested? New tests: - `ComputingUnitAccessSpec` (auth): with sharing disabled, READ and WRITE grantees get NONE and the owner keeps WRITE. - `ComputingUnitAccessSharingDisabledSpec` (managing service, sharing disabled): a WRITE grantee has no read or write access and gets 403 on rename; the owner keeps full access. - `AccessControlSharingDisabledSpec` (new, access-control, sharing disabled): the gateway refuses a grantee with 403 and lets the owner through with WRITE. With the fix disabled, the 4 new behaviour tests fail (1 auth, 2 managing, 1 gateway). Auth (114), computing-unit-managing-service (323) and access-control-service (97) tests pass, and `scalafmtCheckAll` and `scalafixAll --check` are clean. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
