You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by sh...@apache.org on 2026/09/24 10:50:03 UTC
(unomi) 02/03: Grant the JAAS success-path unit test the role and system access it now needs.
This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch graphql-authenticated-role-tenant-checks
in repository https://gitbox.apache.org/repos/asf/unomi.git
commit 091bad592a72f11e32a8f517eaacc0c5bc2a6b69
Author: Serge Huber <sh...@apache.org>
AuthorDate: Mon Sep 21 21:39:20 2026 +0200
Grant the JAAS success-path unit test the role and system access it now needs.
---
.../graphql/servlet/auth/GraphQLServletSecurityValidatorTest.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/graphql/cxs-impl/src/test/java/org/apache/unomi/graphql/servlet/auth/GraphQLServletSecurityValidatorTest.java b/graphql/cxs-impl/src/test/java/org/apache/unomi/graphql/servlet/auth/GraphQLServletSecurityValidatorTest.java
index fbf5feac2..8a664a98f 100644
--- a/graphql/cxs-impl/src/test/java/org/apache/unomi/graphql/servlet/auth/GraphQLServletSecurityValidatorTest.java
+++ b/graphql/cxs-impl/src/test/java/org/apache/unomi/graphql/servlet/auth/GraphQLServletSecurityValidatorTest.java
@@ -377,6 +377,9 @@ class GraphQLServletSecurityValidatorTest {
/** Control: a non-blank credential still reaches the realm and is accepted by it. */
@Test
void validate_withNonBlankPassword_reachesJaas() throws IOException {
+ // Role + system access are required after JAAS succeeds when no tenant header is present.
+ givenAdministratorRole();
+ when(securityService.hasSystemAccess()).thenReturn(true);
when(request.getHeader("Authorization")).thenReturn(BASIC_AUTH);
when(tenantService.getTenantByApiKey(any(), eq(ApiKey.ApiKeyType.PRIVATE))).thenReturn(null);