Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WFCORE-2080] Instantiating the WildFlyElytronProvider is an expensive operation so only do it once. #2003

Merged
merged 2 commits into from
Dec 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ public void start(StartContext context) throws StartException {
HttpAuthenticationFactory.Builder httpBuilder = HttpAuthenticationFactory.builder();
httpBuilder.setSecurityDomain(securityDomain);

HttpServerAuthenticationMechanismFactory httpServerFactory = new SecurityProviderServerMechanismFactory(() -> new Provider[] {new WildFlyElytronProvider()});
final Provider elytronProvider = new WildFlyElytronProvider();
HttpServerAuthenticationMechanismFactory httpServerFactory = new SecurityProviderServerMechanismFactory(() -> new Provider[] {elytronProvider});
httpServerFactory = new SetMechanismInformationMechanismFactory(httpServerFactory);
httpServerFactory = new FilterServerMechanismFactory(httpServerFactory, (s) -> {
AuthMechanism mechanism = toAuthMechanism("HTTP", s);
Expand All @@ -201,7 +202,7 @@ public void start(StartContext context) throws StartException {
SaslAuthenticationFactory.Builder saslBuilder = SaslAuthenticationFactory.builder();
saslBuilder.setSecurityDomain(securityDomain);

SaslServerFactory saslServerFactory = new SecurityProviderSaslServerFactory(() -> new Provider[] {new WildFlyElytronProvider()});
SaslServerFactory saslServerFactory = new SecurityProviderSaslServerFactory(() -> new Provider[] {elytronProvider});
saslServerFactory = new FilterMechanismSaslServerFactory(saslServerFactory, (s) -> {
AuthMechanism mechanism = toAuthMechanism("SASL", s);
return mechanism != null && configurationMap.containsKey(mechanism);
Expand Down