Choreo Labs API Manager

How I used Choreo API Manager to make one OpsPulse endpoint public and keep incident records behind OAuth 2.0.

By Dimesh Methsara Opanayaka

View the OpsPulse project on GitHub

One of my OpsPulse tests returned HTTP 200 OK and "overallStatus": "Down" in the same response. Both were correct. The gateway had delivered the status report successfully. The report itself said that a simulated service was down.

That response captured the design question behind OpsPulse, an incident-management API I built with ASP.NET Core. Anyone checking a status page should be able to answer “Is there a problem?” Reading the incident records behind that answer, or opening a new incident, requires a different level of access. I wanted to see how precisely I could draw that line in Choreo API Manager.

The decision hiding inside a wildcard

I started with a local API called OpsPulseAPI. My ASP.NET Core service listened on port 5080, and clients called the API Manager gateway over HTTPS on port 8243. In Publisher, the initial resource list included a wildcard path, /*.

That wildcard made me pause. Both the public status check and the incident list use GET. If I made a catch-all GET operation public, the HTTP method alone would give the gateway no way to express the distinction I cared about. I needed to name the paths explicitly.

In Publisher → API Configurations → Resources, I defined the operations, expanded GET /api/status, and switched off security for that operation. I kept OAuth 2.0 enabled on both incident operations. Then I deployed the revision to my local gateway, published the API, and used a subscribed application in the Developer Portal to obtain a test token.

Three requests through the same gateway

I ran all three tests against https://localhost:8243/opspulse/1.0.0. Calling that address mattered. A request sent straight to port 5080 would exercise the backend and skip the gateway policy I wanted to test.

Request Credentials sent What I observed
GET /api/status None 200 OK. The JSON included the overall status and a count of two open demo incidents.
POST /api/incidents None 401 Unauthorized. The gateway reported missing credentials.
GET /api/incidents OAuth 2.0 bearer token 200 OK. The response contained a JSON array of incident records.

The middle request was the one I cared about most. A successful request with a token tells me the application can return data. It takes a request without credentials to find out what an anonymous caller can do. For that test, an empty JSON object was enough.

Here are the two anonymous requests as I ran them in PowerShell. I used -k for the self-signed certificate in this local demo. With a trusted gateway certificate, omit that flag so curl verifies the server.

$base = "https://localhost:8243/opspulse/1.0.0" curl.exe -k -i "$base/api/status" curl.exe -k -i -X POST "$base/api/incidents" -H "Content-Type: application/json" -d "{}" 

What the experiment changed for me

Before this project, I might have put a single item on my checklist called “test API authentication.” Now I’d write down the method, path, and caller for each check. My successful authenticated read and rejected anonymous write covered different operations. Two cases I’d add next are an anonymous attempt to list incidents and an authenticated attempt to create one with a valid payload.

I’d also review the public response itself. OpsPulse exposed an open-incident count alongside its overall status. Even with the full incident list behind a token, that count tells an outside reader something about the service. The gateway setting prompted a second design decision about which fields belonged on the public side.

If you were building a public status page, would you publish the number of open incidents, or just tell users which services are affected? I’d be interested in what would make you choose one over the other.

Choreo API Manager documentation · WSO2 guide to configuring security per resource