Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,54 @@ protected static String getUsedSecurity(API api) {
return usedSecurity.toString().replace("[", "").replace("]", "");
}

protected static String getUsedOutboundAuthentication(API api) {

List<String> result = new ArrayList<>();

if (api.getOutboundProfiles() == null) {
return "";
}

for (OutboundProfile profile : api.getOutboundProfiles().values()) {

if (profile.getAuthenticationProfile() == null) {
continue;
}

for (AuthenticationProfile authProfile : api.getAuthenticationProfiles()) {

if (!authProfile.getName().equals(profile.getAuthenticationProfile())) {
continue;
}

String authType = authProfile.getType().getName();

if (!result.contains(authType)) {
result.add(authType);
}

if (authProfile.getType() == AuthType.oauth) {

String providerProfile =
(String) authProfile.getParameters().get("providerProfile");

if (providerProfile != null) {
providerProfile =
Utils.getExternalPolicyName(
providerProfile,
Utils.FedKeyType.OAuthAppProfile);

if (!result.contains(providerProfile)) {
result.add(providerProfile);
}
}
}
}
}

return String.join(", ", result);
}

protected static List<String> getUsedPolicies(API api, PolicyType type) {
return getUsedPolicies(api).get(type);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ private enum HeaderFields {
"API V-Host",
"API State",
"Backend",
"Inbound Security",
"Outbound Security",
"Request Policy",
"Routing Policy",
"Response Policy",
Expand All @@ -67,7 +69,8 @@ private enum HeaderFields {
"API V-Host",
"API State",
"Backend",
"Security",
"Inbound Security",
"Outbound Security",
"Request Policy",
"Routing Policy",
"Response Policy",
Expand Down Expand Up @@ -207,6 +210,8 @@ private void writeWideToCSV(CSVPrinter csvPrinter, API api) throws IOException {
api.getVhost(),
api.getState(),
getBackendPath(api),
getUsedSecurity(api),
getUsedOutboundAuthentication(api),
getUsedPolicies(api, PolicyType.REQUEST).toString().replace("[", "").replace("]", ""),
getUsedPolicies(api, PolicyType.ROUTING).toString().replace("[", "").replace("]", ""),
getUsedPolicies(api, PolicyType.RESPONSE).toString().replace("[", "").replace("]", ""),
Expand All @@ -226,6 +231,7 @@ private void writeAPIUltraToCSV(CSVPrinter csvPrinter, API api, ClientApplicatio
api.getState(),
getBackendPath(api),
getUsedSecurity(api),
getUsedOutboundAuthentication(api),
getUsedPolicies(api, PolicyType.REQUEST).toString().replace("[", "").replace("]", ""),
getUsedPolicies(api, PolicyType.ROUTING).toString().replace("[", "").replace("]", ""),
getUsedPolicies(api, PolicyType.RESPONSE).toString().replace("[", "").replace("]", ""),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ private void printWide(List<API> apis) {
new Column().header("V-Host").with(API::getVhost),
new Column().header("State").with(this::getState),
new Column().header("Backend").headerAlign(HorizontalAlign.LEFT).dataAlign(HorizontalAlign.LEFT).with(APIResultHandler::getBackendPath),
new Column().header("Security").with(APIResultHandler::getUsedSecurity),
new Column().header("Inbound Security").with(APIResultHandler::getUsedSecurity),
new Column().header("Outbound Security").with(APIResultHandler::getUsedOutboundAuthentication),
new Column().header("Policies").dataAlign(HorizontalAlign.LEFT).maxWidth(30).with(this::getUsedPoliciesForConsole),
new Column().header("Organization").dataAlign(HorizontalAlign.LEFT).with(api -> api.getOrganization().getName()),
new Column().header(CREATED_ON).with(this::getFormattedDate)
Expand All @@ -89,7 +90,8 @@ private void printUltra(List<API> apis) {
new Column().header("V-Host").with(API::getVhost),
new Column().header("State").with(this::getState),
new Column().header("Backend").headerAlign(HorizontalAlign.LEFT).dataAlign(HorizontalAlign.LEFT).with(APIResultHandler::getBackendPath),
new Column().header("Security").with(APIResultHandler::getUsedSecurity),
new Column().header("Inbound Security").with(APIResultHandler::getUsedSecurity),
new Column().header("Outbound Security").with(APIResultHandler::getUsedOutboundAuthentication),
new Column().header("Policies").dataAlign(HorizontalAlign.LEFT).maxWidth(30).with(this::getUsedPoliciesForConsole),
new Column().header("Organization").dataAlign(HorizontalAlign.LEFT).with(api -> api.getOrganization().getName()),
new Column().header("Orgs").with(this::getOrgCount),
Expand Down
Loading