Dev.to Security πŸ” Cybersecurity πŸ‘ 0 πŸ“– 6 min read

Open Your Backend to Apps and Partners Without Handing Over the Database

Your backend is done. The admin console works, the business runs on it, and for a while the only consumer of your API is your own frontend. Then the requests start arriving: the mobile app team wants product and order da

Your backend is done. The admin console works, the business runs on it, and for a while the only consumer of your API is your own frontend. Then the requests start arriving: the mobile app team wants product and order data, a WeChat mini-program needs to read a few endpoints, a partner's system wants to sync records, a hardware gateway wants to report status. The data is all in your system. The question is how to let them touch it β€” without handing over the keys to the house.

The instinctive answers are the ones that haunt you later:

  • Hand the partner a database account. No audit, no throttling, no control over which tables it can touch. If the credential leaks, the data is exposed.
  • Hand them a backend login. Now an external system is logged in as a person. What it can do is whatever that account can do, and you can't separate "what this partner may do" from "what your admins may do."
  • Write a bespoke API set per partner. Auth, throttling, and docs get rewritten for every integrator. Maintenance cost grows linearly with the number of partners, and there is no single standard.
  • Buy a standalone API gateway. For a small team, that's another component to deploy, configure, and keep in sync with a business system that changes every sprint.

Each of these hands out something you can't take back.

Why it happens

The root problem is that credentials are a one-way door. A database account is a data identity. A backend login is a human identity. A bespoke API set is a one-off identity. None of them can answer the four questions any external integration has to answer:

  1. Who is calling? (identity)
  2. What may it call? (authorization)
  3. How much may it call? (throttling)
  4. What did it call? (audit)

The fix is to give each integrator its own app identity: an external system never touches your backend account system. It receives an app identity, and it can only call the endpoints you authorize. Identity, authorization, throttling, and audit all hang off that one identity β€” and, crucially, every one of them is reversible. You can scope it down, throttle it, watch it, and revoke it.

The foundation: a gateway built into the backend

GewuMind Boot builds this into the backend as a built-in open API gateway. The full flow is:

register app β†’ exchange for token β†’ authorize endpoints β†’ rate limit β†’ log calls

This is not a roadmap item. The capability has shipped with the product's release packages, the README and user manual have full chapters on it, and the official site lists it in the free base and standard editions β€” it is not one of the paid capabilities.

How the pieces fit:

  • App management. One app per integrator, each holding its own appKey / appSecret. The secret is shown in full only once, at creation time (the UI warns you to store it safely); you can reset it at any time, and a one-switch disable takes effect immediately.
  • Token exchange. The third party exchanges appKey + appSecret for a token:
  POST /open/app/token

Every request after that carries Authorization: Bearer <token>, validated by a unified interceptor. Unauthorized, over-limit, and expired-token requests each return their own status codes, so the integrator can tell what went wrong.

  • Endpoint authorization. Authorization is precise to path + method, and each authorized endpoint can carry its own rate limit β€” a configurable call count and time window. The typical pattern: a mini-program gets read endpoints only, and backend admin endpoints are never exposed.
  • Call logs. Every call records the app, endpoint path, method, request IP, status code, latency in milliseconds, and request time. You can query them per app in the admin console, which is how you troubleshoot, reconcile, and analyze rate-limit behavior.
  • Onboarding doc export. The app management UI has an "export doc" button that generates a per-app Markdown onboarding document (named like Open-API-Onboarding-<AppName>.md) you can hand directly to the integrator.

The official site lists six typical integration scenarios: mobile apps, WeChat mini-programs, third-party systems, hardware gateways, partner backends, and open platforms.

Example: three integrations

A mini-program that can only read

A WeChat mini-program needs product and order data. You create one app for it, authorize only the read endpoints (path + method), and set a rate limit on each. The mini-program exchanges for a token, then calls with Bearer <token>. If its code has a bug and the call rate spikes, the rate limit absorbs it first; the call log shows which endpoint was hit and how long each call took. The admin endpoints are simply not in its authorization list β€” the mini-program can't touch them.

Reconciliation without opening the database

A partner wants to reconcile numbers. Instead of giving it database access, you use the platform's reporting: reports are defined via report definition files, with multiple preset report forms (list, cross-tabulation, Chinese-style, conditional formatting, nested detail, multi-sheet, cross-row merge, detail with summary, column header extension), and Excel export in three modes β€” current page, full backend export, and custom data. You export the reconciliation data to Excel and send it over. The partner gets the numbers; the database stays closed.

A partner that comes and goes

A partner's backend system needs to call your API. You don't give it a backend account. You create an app, authorize only the endpoints it needs, and hand over the exported onboarding doc. When the partnership ends, you flip the app's status switch β€” access stops immediately. If you suspect a leaked secret, you reset it. Throughout, the external system only ever held an app identity; it never touched your account system, so the boundary of what it could do was always exactly what you authorized.

What to look for

If you're evaluating how to open your backend to external consumers β€” with this product or any other β€” here is a short checklist, and the boundaries to keep in mind.

Ask:

  • Can you revoke an integrator's access in one action, and does it take effect immediately?
  • Is authorization scoped to endpoints (path + method), not to a shared account?
  • Does every call leave a log you can query per app β€” app, endpoint, IP, status, latency, time?
  • Can you hand the partner a self-contained onboarding document?
  • Is the gateway a separate deployment, or part of the backend that already knows your endpoints?

And the honest boundaries of a built-in gateway like this one:

  • It is built into the backend, not a standalone API platform. The gateway lives inside the GewuMind Boot backend; configuration and business logic sit in the same system. It is not a standalone-deployed, multi-tenant, large-scale API platform.
  • Rate limiting is simple per-endpoint limiting. Two parameters: call count and time window. The documentation does not describe circuit breaking, canary release, or full traffic governance.
  • It targets HTTP REST endpoints.
  • The positioning is "exposing your own system's data to trusted third parties" β€” not a public open platform for a large population of unknown developers.

If your situation is "the system is built, and apps, mini-programs, and partners all need to pull data," and your team doesn't want to operate another standalone platform, a built-in open API gateway is the lighter path: identity, authorization, throttling, and audit live in the same backend, and the onboarding doc can be exported and handed straight to the integrator.

Try it

The source code is Apache License 2.0. Some enterprise capabilities require a commercial license; without one, you get a 30-day trial. The open API is a free capability, not a commercial-edition exclusive.

Your backend was built for your own users. The day it starts serving external ones, it becomes a platform β€” and platforms live or die on identity, authorization, throttling, and audit. Keep the keys to the house.

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.