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

KNOX-2825 - Webshell - Only add Default provider iff it is found in the provider contributor map #649

Merged
merged 1 commit into from Oct 17, 2022
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
Expand Up @@ -260,7 +260,13 @@ private static void addMissingDefaultProviders(Topology topology) {
// for some tests the number of providers are limited to the classpath of the module
// and exceptions will be thrown as topologies are deployed even though they will
// work fine at actual server runtime.
if (PROVIDER_CONTRIBUTOR_MAP.get("identity-assertion") != null) {

// SRM: Only add "Default" provider iff it is found in the provider contributor map
// There could be cases where service loader might find other
// identity-assertion providers e.g. JWTAuthCodeAsserter
if (PROVIDER_CONTRIBUTOR_MAP.get("identity-assertion") != null &&
PROVIDER_CONTRIBUTOR_MAP.get("identity-assertion").keySet() != null &&
PROVIDER_CONTRIBUTOR_MAP.get("identity-assertion").keySet().contains("Default")) {
// check for required providers and add the defaults if missing
if (!providerMap.containsKey("identity-assertion")) {
Provider idassertion = new Provider();
Expand Down