This is an automated email from the ASF dual-hosted git repository. github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-7309-f951415bec4c9f1c6c42876c5f055bd4ff7acf5d in repository https://gitbox.apache.org/repos/asf/texera.git
commit 002081ddb6e3e5a7ae45768e4386349ceda57168 Author: Martin Vu <[email protected]> AuthorDate: Thu Aug 6 12:38:25 2026 -0700 chore(auth): use INACTIVE instead of RESTRICTED for local signup (#7309) ## What changes were proposed in this PR? This PR changes the default role assigned during local registration from RESTRICTED to INACTIVE. This aligns local registration with the other account creation paths and ensures newly registered users enter the pending approval state consistently. ## Any related issues, documentation, discussions? Closes #7185 ## How was this PR tested? * Updated the existing unit test to expect the INACTIVE role for newly registered users. * Verified locally that a newly registered user is stored with the INACTIVE role in the database. <img width="425" height="23" alt="Screenshot 2026-08-04 at 12 09 41 AM" src="https://github.com/user-attachments/assets/20e6f013-7ca6-4089-b48c-d398bb4e5253" /> * Verified that the issued JWT contains the INACTIVE role after login. ## Was this PR authored or co-authored using generative AI tooling? No --- .../main/scala/org/apache/texera/web/resource/auth/AuthResource.scala | 2 +- .../scala/org/apache/texera/web/resource/auth/AuthResourceSpec.scala | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/amber/src/main/scala/org/apache/texera/web/resource/auth/AuthResource.scala b/amber/src/main/scala/org/apache/texera/web/resource/auth/AuthResource.scala index 4171ebbe23..db443aae8e 100644 --- a/amber/src/main/scala/org/apache/texera/web/resource/auth/AuthResource.scala +++ b/amber/src/main/scala/org/apache/texera/web/resource/auth/AuthResource.scala @@ -168,7 +168,7 @@ class AuthResource { val user = new User user.setName(username) user.setEmail(useremail) - user.setRole(UserRoleEnum.RESTRICTED) + user.setRole(UserRoleEnum.INACTIVE) // hash the plain text password user.setPassword(new StrongPasswordEncryptor().encryptPassword(userpassword)) userDao.insert(user) diff --git a/amber/src/test/scala/org/apache/texera/web/resource/auth/AuthResourceSpec.scala b/amber/src/test/scala/org/apache/texera/web/resource/auth/AuthResourceSpec.scala index 51c167fe79..d91a1dc1af 100644 --- a/amber/src/test/scala/org/apache/texera/web/resource/auth/AuthResourceSpec.scala +++ b/amber/src/test/scala/org/apache/texera/web/resource/auth/AuthResourceSpec.scala @@ -131,14 +131,14 @@ class AuthResourceSpec // ─── register ───────────────────────────────────────────────────────────── - "register" should "persist a RESTRICTED user with a hashed password and issue a token" in { + "register" should "persist an INACTIVE user with a hashed password and issue a token" in { val response = resource.register(UserRegistrationRequest(uname("reg"), uemail("reg"), "pw")) subjectOf(response.accessToken) shouldBe uname("reg") val persisted = userDao.fetchByName(uname("reg")) persisted.size() shouldBe 1 val stored = persisted.get(0) - stored.getRole shouldBe UserRoleEnum.RESTRICTED + stored.getRole shouldBe UserRoleEnum.INACTIVE stored.getEmail shouldBe uemail("reg") stored.getIsPlaceholder shouldBe false // stored hashed, not in plain text, but verifies against the plain password
