@Test void testJwtAuthFilter() { final ContainerRequestContext mockContext = mock(ContainerRequestContext.class); assertNotNull(filter); assertNotNull(producer); final String iss = "https: final String sub = "acoburn"; final JwtClaims claims = new JwtClaims(); claims.setSubject(sub); claims.setIssuer(iss); producer.setJsonWebToken(new DefaultJWTCallerPrincipal(claims)); assertDoesNotThrow(() -> filter.filter(mockContext)); verify(mockContext).setSecurityContext(securityArgument.capture()); assertEquals(iss + sub, securityArgument.getValue().getUserPrincipal().getName()); }
public JwtAuthFilter() { this.admins = getConfiguredAdmins(getConfig().getOptionalValue(CONFIG_AUTH_ADMIN_USERS, String.class) .orElse("")); }
JwtAuthFilter implements ContainerRequestFilter { public JwtAuthFilter() { this.admins = getConfiguredAdmins(getConfig().getOptionalValue(CONFIG_AUTH_ADMIN_USERS, String.class) .orElse("")); } }
JwtAuthFilter implements ContainerRequestFilter { public JwtAuthFilter() { this.admins = getConfiguredAdmins(getConfig().getOptionalValue(CONFIG_AUTH_ADMIN_USERS, String.class) .orElse("")); } JwtAuthFilter(); }
JwtAuthFilter implements ContainerRequestFilter { public JwtAuthFilter() { this.admins = getConfiguredAdmins(getConfig().getOptionalValue(CONFIG_AUTH_ADMIN_USERS, String.class) .orElse("")); } JwtAuthFilter(); @Override void filter(final ContainerRequestContext ctx); }
JwtAuthFilter implements ContainerRequestFilter { public JwtAuthFilter() { this.admins = getConfiguredAdmins(getConfig().getOptionalValue(CONFIG_AUTH_ADMIN_USERS, String.class) .orElse("")); } JwtAuthFilter(); @Override void filter(final ContainerRequestContext ctx); static final String CONFIG_AUTH_ADMIN_USERS; }