From 7615425ca3da5fdbded93df1d9ecae54aee76d56 Mon Sep 17 00:00:00 2001 From: LARGEMAIN Clement Date: Wed, 8 Jul 2026 08:49:23 +0200 Subject: [PATCH 1/2] Add outbound authentication to API exports wide and ultra --- .../api/export/impl/APIResultHandler.java | 48 +++++++++++++++++++ .../apim/api/export/impl/CSVAPIExporter.java | 6 ++- .../api/export/impl/ConsoleAPIExporter.java | 6 ++- 3 files changed, 57 insertions(+), 3 deletions(-) diff --git a/modules/apis/src/main/java/com/axway/apim/api/export/impl/APIResultHandler.java b/modules/apis/src/main/java/com/axway/apim/api/export/impl/APIResultHandler.java index 54768cf79..b3d81b81a 100644 --- a/modules/apis/src/main/java/com/axway/apim/api/export/impl/APIResultHandler.java +++ b/modules/apis/src/main/java/com/axway/apim/api/export/impl/APIResultHandler.java @@ -156,6 +156,54 @@ protected static String getUsedSecurity(API api) { return usedSecurity.toString().replace("[", "").replace("]", ""); } + protected static String getUsedOutboundAuthentication(API api) { + + List 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 getUsedPolicies(API api, PolicyType type) { return getUsedPolicies(api).get(type); } diff --git a/modules/apis/src/main/java/com/axway/apim/api/export/impl/CSVAPIExporter.java b/modules/apis/src/main/java/com/axway/apim/api/export/impl/CSVAPIExporter.java index a1ca0b02c..ff9d7570c 100644 --- a/modules/apis/src/main/java/com/axway/apim/api/export/impl/CSVAPIExporter.java +++ b/modules/apis/src/main/java/com/axway/apim/api/export/impl/CSVAPIExporter.java @@ -52,6 +52,8 @@ private enum HeaderFields { "API V-Host", "API State", "Backend", + "Inbound Security", + "Outbound Security", "Request Policy", "Routing Policy", "Response Policy", @@ -67,7 +69,8 @@ private enum HeaderFields { "API V-Host", "API State", "Backend", - "Security", + "Inbound Security", + "Outbound Security", "Request Policy", "Routing Policy", "Response Policy", @@ -226,6 +229,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("]", ""), diff --git a/modules/apis/src/main/java/com/axway/apim/api/export/impl/ConsoleAPIExporter.java b/modules/apis/src/main/java/com/axway/apim/api/export/impl/ConsoleAPIExporter.java index 527d9a509..5493c5edb 100644 --- a/modules/apis/src/main/java/com/axway/apim/api/export/impl/ConsoleAPIExporter.java +++ b/modules/apis/src/main/java/com/axway/apim/api/export/impl/ConsoleAPIExporter.java @@ -72,7 +72,8 @@ private void printWide(List 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) @@ -89,7 +90,8 @@ private void printUltra(List 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), From 8b1bf3d92927cee971be0abfcc413769d98efb19 Mon Sep 17 00:00:00 2001 From: LARGEMAIN Clement Date: Wed, 8 Jul 2026 10:49:24 +0200 Subject: [PATCH 2/2] Fix wide csv export --- .../java/com/axway/apim/api/export/impl/CSVAPIExporter.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/apis/src/main/java/com/axway/apim/api/export/impl/CSVAPIExporter.java b/modules/apis/src/main/java/com/axway/apim/api/export/impl/CSVAPIExporter.java index ff9d7570c..2d525218d 100644 --- a/modules/apis/src/main/java/com/axway/apim/api/export/impl/CSVAPIExporter.java +++ b/modules/apis/src/main/java/com/axway/apim/api/export/impl/CSVAPIExporter.java @@ -210,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("]", ""),