Skip to content

Commit

Permalink
Also filter mechanism name queries properly
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlloyd committed Jul 27, 2015
1 parent 0776a2f commit 09b0706
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Expand Up @@ -59,4 +59,15 @@ public SaslClient createSaslClient(final String[] mechanisms, final String autho
}
return super.createSaslClient(mechanisms, authorizationId, protocol, serverName, newProps, cbh);
}

public String[] getMechanismNames(final Map<String, ?> props) {
BiPredicate<String, Provider> existing = SaslFactories.getProviderFilterPredicate(props);
final HashMap<String, Object> newProps = new HashMap<String, Object>(props);
if (existing != null) {
newProps.put(SaslFactories.PROVIDER_FILTER_KEY, predicate.and(existing));
} else {
newProps.put(SaslFactories.PROVIDER_FILTER_KEY, predicate);
}
return super.getMechanismNames(newProps);
}
}
Expand Up @@ -58,4 +58,15 @@ public SaslServer createSaslServer(final String mechanism, final String protocol
}
return super.createSaslServer(mechanism, protocol, serverName, newProps, cbh);
}

public String[] getMechanismNames(final Map<String, ?> props) {
BiPredicate<String, Provider> existing = SaslFactories.getProviderFilterPredicate(props);
final HashMap<String, Object> newProps = new HashMap<String, Object>(props);
if (existing != null) {
newProps.put(SaslFactories.PROVIDER_FILTER_KEY, predicate.and(existing));
} else {
newProps.put(SaslFactories.PROVIDER_FILTER_KEY, predicate);
}
return super.getMechanismNames(newProps);
}
}

0 comments on commit 09b0706

Please sign in to comment.