ContextIntegrationTests

22

tests

0

failures

0

ignored

0.127s

duration

100%

successful

Tests

Test Duration Result
assumeRoles() 0.008s passed
assumedRolesGetAuthorizedViaGroupFromJwtButOnlyAssumedRolesRemainAsEffectiveSubject() 0.012s passed
contextDefineWithJwtContainingGroupsWillIncludeSynchronizedGroupsInEffectiveSubjects() 0.010s passed
defineContextWithSubjectAndAssumeInaccessibleRole() 0.005s passed
defineWithSubjectAndAssumedRoles() 0.005s passed
defineWithSubjectNameWithoutAssumedRoles() 0.005s passed
defineWithSubjectUuid() 0.005s passed
defineWithUnknownCurrentSubject() 0.003s passed
defineWithUnknownSubjectName() 0.012s passed
defineWithUnknownSubjectUuid() 0.005s passed
defineWithoutCurrentSubjectButWithAssumedRoles() 0.004s passed
defineWithoutHttpServletRequestUsesCallStack() 0.003s passed
findObjectUuidByIdNameReturnsNullForUnknownIdName() 0.002s passed
hasGlobalAdminRoleFollowsRedefinedContextWithinSameTransaction() 0.010s passed
hasGlobalAdminRoleIsCachedInContext() 0.009s passed
hasGlobalAdminRoleIsFalseForGlobalAdminWithAssumedNonGlobalRole() 0.008s passed
hasGlobalAdminRoleIsFalseForNonGlobalAdminWithoutAssumedRole() 0.003s passed
hasGlobalAdminRoleIsTrueForGlobalAdminWithAssumedGlobalAdminRole() 0.003s passed
hasGlobalAdminRoleIsTrueForGlobalAdminWithOneOfMultipleAssumedRolesBeingGlobalAdminRole() 0.004s passed
hasGlobalAdminRoleIsTrueForGlobalAdminWithoutAssumedRole() 0.002s passed
requireGlobalAdminPassesForGlobalAdmin() 0.004s passed
requireGlobalAdminThrowsForbiddenForNonGlobalAdmin() 0.005s passed

Standard output

2026-08-10T16:32:52.394Z  INFO 382 --- [    Test worker] t.c.s.AnnotationConfigContextLoaderUtils : Could not detect default configuration classes for test class [net.hostsharing.hsadminng.rbac.context.ContextIntegrationTests]: ContextIntegrationTests does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
2026-08-10T16:32:52.411Z  INFO 382 --- [    Test worker] .b.t.c.SpringBootTestContextBootstrapper : Found @SpringBootConfiguration net.hostsharing.hsadminng.HsadminNgApplication for test class net.hostsharing.hsadminng.rbac.context.ContextIntegrationTests
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

Hibernate: select current_setting('hsadminng.hasGlobalAdminRole', true)
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

Hibernate: select current_setting('hsadminng.hasGlobalAdminRole', true)
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

Hibernate: select rbac.hasGlobalAdminRole()
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

2026-08-10T16:32:52.439Z  WARN 382 --- [    Test worker] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 0, SQLState: P0001
2026-08-10T16:32:52.439Z ERROR 382 --- [    Test worker] o.h.engine.jdbc.spi.SqlExceptionHelper   : ERROR: [401] subject unknown-subject given in `base.defineContext(...)` does not exist or is deactivated
  Where: PL/pgSQL function rbac.determinecurrentsubjectuuid(character varying) line 11 at RAISE
SQL statement "select rbac.determineCurrentSubjectUuid(currentSubject)"
PL/pgSQL function base.contextdefined(character varying,text,character varying,character varying,text) line 16 at SQL statement
SQL statement "call base.contextDefined(currentTask, currentRequest, currentSubject, assumedRoles, currentSubjectGroups)"
PL/pgSQL function base.definecontext(character varying,text,character varying,text,text) line 23 at CALL
Hibernate: select base.currentSubject()
2026-08-10T16:32:52.441Z  WARN 382 --- [    Test worker] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 0, SQLState: 25P02
2026-08-10T16:32:52.441Z ERROR 382 --- [    Test worker] o.h.engine.jdbc.spi.SqlExceptionHelper   : ERROR: current transaction is aborted, commands ignored until end of transaction block
Hibernate: select rbac.currentSubjectUuid()
2026-08-10T16:32:52.441Z  WARN 382 --- [    Test worker] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 0, SQLState: 25P02
2026-08-10T16:32:52.441Z ERROR 382 --- [    Test worker] o.h.engine.jdbc.spi.SqlExceptionHelper   : ERROR: current transaction is aborted, commands ignored until end of transaction block
Hibernate: select base.assumedRoles() as roles
2026-08-10T16:32:52.442Z  WARN 382 --- [    Test worker] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 0, SQLState: 25P02
2026-08-10T16:32:52.442Z ERROR 382 --- [    Test worker] o.h.engine.jdbc.spi.SqlExceptionHelper   : ERROR: current transaction is aborted, commands ignored until end of transaction block
Hibernate: select rbac.currentSubjectOrAssumedRolesUuids() as uuids
2026-08-10T16:32:52.443Z  WARN 382 --- [    Test worker] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 0, SQLState: 25P02
2026-08-10T16:32:52.443Z ERROR 382 --- [    Test worker] o.h.engine.jdbc.spi.SqlExceptionHelper   : ERROR: current transaction is aborted, commands ignored until end of transaction block
Hibernate: SELECT name FROM rbac.subject s WHERE s.uuid=?
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

Hibernate: select base.currentSubject()
Hibernate: select rbac.currentSubjectUuid()
Hibernate: select base.assumedRoles() as roles
Hibernate: select rbac.currentSubjectOrAssumedRolesUuids() as uuids
Hibernate: select rbac.currentSubjectUuid()
Hibernate: select rbac.findObjectUuidByIdName('rbactest.package', 'unknown')
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

Hibernate: select rbac.hasGlobalAdminRole()
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

Hibernate: select current_setting('hsadminng.currentTask');
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

2026-08-10T16:32:52.468Z  WARN 382 --- [    Test worker] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 0, SQLState: P0001
2026-08-10T16:32:52.469Z ERROR 382 --- [    Test worker] o.h.engine.jdbc.spi.SqlExceptionHelper   : ERROR: [403] undefined has no permission to assume role rbactest.package#yyy00:ADMIN
  Where: PL/pgSQL function rbac.determinecurrentsubjectorassumedrolesuuids(uuid[],text) line 14 at RAISE
PL/pgSQL function base.contextdefined(character varying,text,character varying,character varying,text) line 26 at assignment
SQL statement "call base.contextDefined(currentTask, currentRequest, currentSubject, assumedRoles, currentSubjectGroups)"
PL/pgSQL function base.definecontext(character varying,text,character varying,text,text) line 23 at CALL
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

Hibernate: select rbac.hasGlobalAdminRole()
Hibernate: SELECT count(*) FROM rbac.subject WHERE name = ?
Hibernate: SELECT count(*) FROM rbac.subject WHERE name = ?
Hibernate: SELECT count(*) FROM rbac.subject WHERE name = ?
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

Hibernate: select base.currentSubject()
Hibernate: select base.assumedRoles() as roles
Hibernate: select rbac.currentSubjectOrAssumedRolesUuids() as uuids
Hibernate: SELECT uuid FROM rbac.subject WHERE name = ?
Hibernate: SELECT uuid FROM rbac.subject WHERE name = ?
Hibernate: SELECT uuid FROM rbac.subject WHERE name = ?
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

2026-08-10T16:32:52.486Z  WARN 382 --- [    Test worker] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 0, SQLState: P0001
2026-08-10T16:32:52.487Z ERROR 382 --- [    Test worker] o.h.engine.jdbc.spi.SqlExceptionHelper   : ERROR: [403] subject tst-customer_admin_xxx has no permission to assume role rbactest.package#yyy00:ADMIN
  Where: PL/pgSQL function rbac.determinecurrentsubjectorassumedrolesuuids(uuid[],text) line 49 at RAISE
PL/pgSQL function base.contextdefined(character varying,text,character varying,character varying,text) line 26 at assignment
SQL statement "call base.contextDefined(currentTask, currentRequest, currentSubject, assumedRoles, currentSubjectGroups)"
PL/pgSQL function base.definecontext(character varying,text,character varying,text,text) line 23 at CALL
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

Hibernate: select rbac.hasGlobalAdminRole()
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

Hibernate: select rbac.hasGlobalAdminRole()
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

Hibernate: select rbac.isGlobalAdmin()
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

2026-08-10T16:32:52.502Z  WARN 382 --- [    Test worker] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 0, SQLState: P0001
2026-08-10T16:32:52.502Z ERROR 382 --- [    Test worker] o.h.engine.jdbc.spi.SqlExceptionHelper   : ERROR: [401] subject unknown@example.org given in `base.defineContext(...)` does not exist or is deactivated
  Where: PL/pgSQL function rbac.determinecurrentsubjectuuid(character varying) line 11 at RAISE
SQL statement "select rbac.determineCurrentSubjectUuid(currentSubject)"
PL/pgSQL function base.contextdefined(character varying,text,character varying,character varying,text) line 16 at SQL statement
SQL statement "call base.contextDefined(currentTask, currentRequest, currentSubject, assumedRoles, currentSubjectGroups)"
PL/pgSQL function base.definecontext(character varying,text,character varying,text,text) line 23 at CALL
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

Hibernate: SELECT uuid FROM rbac.subject WHERE name = ?
Hibernate: call rbac.grantRoleToSubjectUnchecked(
    rbac.findRoleId(?),
    rbac.findRoleId(?),
    ?);

Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

Hibernate: SELECT uuid FROM rbac.subject WHERE name = ?
Hibernate: call rbac.grantRoleToSubjectUnchecked(
    rbac.findRoleId(?),
    rbac.findRoleId(?),
    ?);

Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

Hibernate: select base.currentSubject()
Hibernate: select base.assumedRoles() as roles
Hibernate: select rbac.currentSubjectOrAssumedRolesUuids() as uuids
Hibernate: SELECT rbac.findRoleId(?)
Hibernate: SELECT rbac.findRoleId(?)
Hibernate: SELECT uuid FROM rbac.subject WHERE name = ?
Hibernate: SELECT uuid FROM rbac.subject WHERE name = ?
Hibernate: SELECT uuid FROM rbac.subject WHERE name = ?
Hibernate: SELECT uuid FROM rbac.subject WHERE name = ?
Hibernate: SELECT name FROM rbac.subject s WHERE s.uuid=?
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

Hibernate: select base.currentSubject()
Hibernate: select rbac.currentSubjectUuid()
Hibernate: select base.assumedRoles() as roles
Hibernate: select rbac.currentSubjectOrAssumedRolesUuids() as uuids
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

Hibernate: select base.currentSubject()
Hibernate: select base.assumedRoles() as roles
Hibernate: select rbac.currentSubjectOrAssumedRolesUuids() as uuids
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

Hibernate: select rbac.isGlobalAdmin()
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

Hibernate: select rbac.hasGlobalAdminRole()
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

Hibernate: select rbac.hasGlobalAdminRole()
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

Hibernate: select rbac.hasGlobalAdminRole()
Hibernate: call base.defineContext(
    cast(? as varchar(127)),
    cast(? as text),
    cast(? as varchar(63)),
    cast(? as text),
    cast(? as text));

Hibernate: select base.currentSubject()
Hibernate: select rbac.currentSubjectUuid()
Hibernate: select base.assumedRoles() as roles
Hibernate: select rbac.currentSubjectOrAssumedRolesUuids() as uuids
Hibernate: select rbac.currentSubjectOrAssumedRolesUuids() as uuids