@Test public void filter_ValidCogIdentityGivenAndDisallowed_ShouldSetScWithNoPrincipal() { GatewayRequest request = new GatewayRequestBuilder() .prepareCognitoIdentityRequest(true) .build(); List<String> allowedAuthSchemes = new ArrayList<>(AwsAuthenticationSchemes.ALL_AWS_AUTHENTICATION_SCHEMES); allowedAuthSchemes.remove(AwsAuthenticationSchemes.AWS_COGNITO_IDENTITY); SecurityContext sc = filter(request, allowedAuthSchemes); assertNull(sc.getUserPrincipal()); }
@Override public void filter(ContainerRequestContext requestContext) throws IOException { requestContext.setSecurityContext(createSecurityContext()); }
AwsSecurityContextFilter implements ContainerRequestFilter { @Override public void filter(ContainerRequestContext requestContext) throws IOException { requestContext.setSecurityContext(createSecurityContext()); } }
AwsSecurityContextFilter implements ContainerRequestFilter { @Override public void filter(ContainerRequestContext requestContext) throws IOException { requestContext.setSecurityContext(createSecurityContext()); } AwsSecurityContextFilter();  AwsSecurityContextFilter(Collection<String> allowedAuthenticationSchemes); }
AwsSecurityContextFilter implements ContainerRequestFilter { @Override public void filter(ContainerRequestContext requestContext) throws IOException { requestContext.setSecurityContext(createSecurityContext()); } AwsSecurityContextFilter();  AwsSecurityContextFilter(Collection<String> allowedAuthenticationSchemes); @Override void filter(ContainerRequestContext requestContext); }
AwsSecurityContextFilter implements ContainerRequestFilter { @Override public void filter(ContainerRequestContext requestContext) throws IOException { requestContext.setSecurityContext(createSecurityContext()); } AwsSecurityContextFilter();  AwsSecurityContextFilter(Collection<String> allowedAuthenticationSchemes); @Override void filter(ContainerRequestContext requestContext);  }