@Test public void certificatesObtained() { IdentityTokenResolver tokenResolver = mock(IdentityTokenResolver.class); when(httpCommand.getIdentityTokenResolver()).thenReturn(tokenResolver); when(tokenResolver.resolve(request, null)).thenReturn(new ArrayList<>()); X509Certificate cert = mock(X509Certificate.class); X509Certificate[] certs = new X509Certificate[] { cert }; when(request.getAttribute(X509IdentityTokenResolver.CERTIFICATE_ATTRIBUTE_NAME)).thenReturn(certs); identityTokenResolver.resolve(httpCommand, null, builder); verify(tokenResolver, times(1)).resolve(request, certs); }
@Override public void resolve(HttpCommand httpCommand, Ignore ignore, DehydratedExecutionContextBuilder builder) { List<IdentityToken> tokens = new ArrayList<>(); if (httpCommand.getIdentityTokenResolver() != null) { X509Certificate[] certificateChain = resolveCertificates(httpCommand.getRequest()); tokens = httpCommand.getIdentityTokenResolver().resolve(httpCommand.getRequest(), certificateChain); } builder.setIdentityTokens(tokens); }
HttpIdentityTokenResolver extends X509IdentityTokenResolver<HttpCommand, Ignore> { @Override public void resolve(HttpCommand httpCommand, Ignore ignore, DehydratedExecutionContextBuilder builder) { List<IdentityToken> tokens = new ArrayList<>(); if (httpCommand.getIdentityTokenResolver() != null) { X509Certificate[] certificateChain = resolveCertificates(httpCommand.getRequest()); tokens = httpCommand.getIdentityTokenResolver().resolve(httpCommand.getRequest(), certificateChain); } builder.setIdentityTokens(tokens); } }
HttpIdentityTokenResolver extends X509IdentityTokenResolver<HttpCommand, Ignore> { @Override public void resolve(HttpCommand httpCommand, Ignore ignore, DehydratedExecutionContextBuilder builder) { List<IdentityToken> tokens = new ArrayList<>(); if (httpCommand.getIdentityTokenResolver() != null) { X509Certificate[] certificateChain = resolveCertificates(httpCommand.getRequest()); tokens = httpCommand.getIdentityTokenResolver().resolve(httpCommand.getRequest(), certificateChain); } builder.setIdentityTokens(tokens); } HttpIdentityTokenResolver(); }
HttpIdentityTokenResolver extends X509IdentityTokenResolver<HttpCommand, Ignore> { @Override public void resolve(HttpCommand httpCommand, Ignore ignore, DehydratedExecutionContextBuilder builder) { List<IdentityToken> tokens = new ArrayList<>(); if (httpCommand.getIdentityTokenResolver() != null) { X509Certificate[] certificateChain = resolveCertificates(httpCommand.getRequest()); tokens = httpCommand.getIdentityTokenResolver().resolve(httpCommand.getRequest(), certificateChain); } builder.setIdentityTokens(tokens); } HttpIdentityTokenResolver(); @Override void resolve(HttpCommand httpCommand, Ignore ignore, DehydratedExecutionContextBuilder builder); }
HttpIdentityTokenResolver extends X509IdentityTokenResolver<HttpCommand, Ignore> { @Override public void resolve(HttpCommand httpCommand, Ignore ignore, DehydratedExecutionContextBuilder builder) { List<IdentityToken> tokens = new ArrayList<>(); if (httpCommand.getIdentityTokenResolver() != null) { X509Certificate[] certificateChain = resolveCertificates(httpCommand.getRequest()); tokens = httpCommand.getIdentityTokenResolver().resolve(httpCommand.getRequest(), certificateChain); } builder.setIdentityTokens(tokens); } HttpIdentityTokenResolver(); @Override void resolve(HttpCommand httpCommand, Ignore ignore, DehydratedExecutionContextBuilder builder);  }