Skip to content

feat: add WSO2 API Manager self hosted gateway#5

Merged
rithakith merged 1 commit into
feature/discoverabilityfrom
feature/discoverability-2
Apr 28, 2026
Merged

feat: add WSO2 API Manager self hosted gateway#5
rithakith merged 1 commit into
feature/discoverabilityfrom
feature/discoverability-2

Conversation

@rithakith
Copy link
Copy Markdown
Owner

@rithakith rithakith commented Apr 28, 2026

Summary by CodeRabbit

Release Notes

  • New Features
    • Added support for configuring and discovering APIs from self-hosted WSO2 API gateways
    • API catalog now displays discovered APIs from self-hosted gateways alongside published APIs
    • Introduced automatic gateway discovery with live refresh (15-second intervals)
    • Enhanced API detail cards with gateway endpoint information and Choreo document retrieval
    • Improved Try it out functionality with gateway-aware behavior

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR adds comprehensive support for discovering and managing APIs from self-hosted WSO2 gateways. It introduces config-driven gateway discovery, runtime API enumeration from gateway discovery endpoints, enhanced API mapping and endpoint enrichment, new Backstage API entities for gateway-discovered APIs, and updates multiple UI components to display and manage gateway information alongside catalog APIs.

Changes

Cohort / File(s) Summary
Configuration & Version Control
.gitignore
Added *.zip file pattern to ignore list alongside existing *.ps1 pattern.
Backend Gateway Configuration & Client
plugins/wso2-api-manager-backend/src/service/wso2Client.ts
Added selfHostedGateways configuration section with discovery parameters; introduced new public methods getSettings(), getConfig(), and getGatewayApis() for retrieving Publisher settings, configuration object, and external gateway discovery data.
Backend Router & API Endpoint
plugins/wso2-api-manager-backend/src/service/router.ts
New authenticated GET /gateways endpoint that aggregates APIM environments and self-hosted gateways, optionally enriching gateways with discovered APIs via client method calls.
API Discovery & Entity Mapping
plugins/catalog-backend-module-wso2-apim/src/providers/Wso2ApiEntityProvider.ts
Introduces config-driven self-hosted gateway discovery with runtime API enumeration; fetches API metadata and Swagger from gateway discovery URLs; enhances API mapping with gateway vendor and deployment field matching; creates Backstage API entities for discovered gateway APIs in dedicated namespace.
Public API Client & Types
plugins/wso2-api-manager/src/api/Wso2ApiManagerClient.ts, plugins/wso2-api-manager/src/api/types.ts
Added getGateways() method to client and interface; extended Wso2ApiSummary and Wso2ApiProductSummary with optional displayName and entityName fields.
UI Components — About & Definition Cards
plugins/wso2-api-manager/src/components/EntityWso2AboutCard/EntityWso2AboutCard.tsx, plugins/wso2-api-manager/src/components/EntityWso2ApiDefinitionCard/EntityWso2ApiDefinitionCard.tsx
About card: centralized annotation lookup with fallback to wso2-gateway.com namespace; added "Gateway" field displaying endpoint environment and URL. Definition card: added self-hosted gateway awareness via discovery-type annotation; conditional API key generation and Try-it-out disabling; merged environments from both standard and gateway annotations.
UI Components — Documents & Overview Cards
plugins/wso2-api-manager/src/components/EntityWso2ApiDocumentsCard/EntityWso2ApiDocumentsCard.tsx, plugins/wso2-api-manager/src/components/EntityWso2ApiOverviewCard/EntityWso2ApiOverviewCard.tsx
Documents card: added Choreo integration for self-hosted gateways to fetch and augment document lists using organizationId annotation. Overview card: conditional rendering of Gateway Endpoints table based on self-hosted status.
UI Page — Manager & API Catalog
plugins/wso2-api-manager/src/components/Wso2ApiManagerPage/Wso2ApiManagerPage.tsx
Introduced gateway data fetching with OAuth token; transformed API catalog results to include gateway annotations and discovery flags; merged catalog APIs with live-discovered gateway APIs; extended UI tables with gateway and provider columns; replaced empty states with synchronizing spinners and refresh button; added auto-retry every 15 seconds for empty API lists.

Sequence Diagram

sequenceDiagram
    participant Config as Config
    participant Provider as Wso2ApiEntityProvider
    participant Discovery as Gateway Discovery URL
    participant Choreo as Choreo Endpoint
    participant Backstage as Backstage Catalog
    
    Config->>Provider: Load selfHostedGateways config
    Provider->>Provider: Initialize for each gateway
    
    loop For each configured gateway
        Provider->>Discovery: GET {discoveryUrl}
        Discovery-->>Provider: API ID list [api1, api2, ...]
        
        loop For each API ID
            Provider->>Discovery: GET {discoveryUrl}/{apiId}
            Discovery-->>Provider: API metadata (name, version, etc.)
            
            alt Has Swagger URL
                Provider->>Choreo: GET Swagger definition
                Choreo-->>Provider: OpenAPI specification
            end
            
            alt Has Document List
                Provider->>Choreo: GET document list
                Choreo-->>Provider: Documents array
            end
            
            Provider->>Provider: Enrich with gateway endpoints<br/>Add annotations for discovery-type,<br/>gateway-vendor, api-endpoints
        end
    end
    
    Provider->>Backstage: Create/update API entities<br/>in wso2-gateways namespace
    Backstage-->>Provider: Confirmation
    Provider-->>Config: Discovery complete with<br/>enriched API catalog
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 Gateways discovered, bright and wide,
Self-hosted secrets now reside,
Swagger fetched and endpoints shown,
Backstage catalog has grown!
Discovery flows through every gate,
WSO2 APIs now integrate!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add WSO2 API Manager self hosted gateway' directly and clearly summarizes the main change: introducing self-hosted gateway support to the WSO2 API Manager plugin.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/discoverability-2

Comment @coderabbitai help to get the list of available commands and usage tips.

@rithakith rithakith merged commit b02d6c3 into feature/discoverability Apr 28, 2026
1 check was pending
@coderabbitai coderabbitai Bot mentioned this pull request May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant