Skip to content
User guide

Keyguard: outside APIs

Call outside APIs through a REM CloudHub proxy address so their keys stay out of your code, with proxy keys, budgets, allowed callers, usage and field mapping.

Keyguard puts an outside API (a maps API, a payments API, a data vendor) behind a proxy address. Your code calls the proxy address with a proxy key; Keyguard adds the real credential from the Vault and forwards the call. The real key never reaches your code, your logs or the browser.

Open Resources > Keyguard. It has three views: APIs, Proxy keys and Usage.

Add an API

  1. Keyguard > APIs > Add API.

  2. Fill in:

Field

Meaning

Name

For example Maps API

Short name

The /gw/<name>/ part of the proxy address

Address

Where calls go, with the rest of the path, such as https://api.example.com/v1. Only this host is reachable

Description, Owner, Who can use it

Who may put it on a proxy key

How the credential is sent

As a header, or as a query key; the credential is typed in or picked from the Vault

Price a call, Price a KB

Optional, in dollars, for spend tracking

Time limit

Seconds

  1. Save. Preview and Send once try a Method and Path (/v1/status?x=1) through the gateway before anyone uses it.

Make a proxy key

Proxy keys > New, give it a name (such as Pricing app (production)), pick the APIs it may call, and set:

  • Monthly budget in dollars: calls are refused once spent; it resets on the 1st (UTC).

  • Ends on: an end date.

  • Allowed IPs (one a line, such as 203.0.113.7 or 10.0.0.0/8), Allowed sites (the Referer or Origin host, such as *.example.com) and Allowed clients (the user agent contains, such as MyApp/). Empty means any.

The key and its proxy address are shown once: click I have copied it. Rotate issues a new value; an overlap gives callers time to switch before the old value stops.

Call it

curl https://remcloudhub.com/gw/maps/geocode?q=Pune \
  -H "Authorization: Bearer $PROXY_KEY"

Send the proxy key (it starts with qchg_) as Authorization: Bearer ... or in the X-Proxy-Key header. The path after /gw/<short name>/ is appended to the API's address. Your own Authorization and cookies are never forwarded to the API.

Field mapping

A mapping turns a simple call into the request the API expects. Use this mapping, then set the Method sent to the API, the Path sent to the API (/v1/weather/{city}, where {city} is filled from an input), inputs (name, type, required, default, and where it goes: a query parameter, a body field, a header or a path placeholder) and outputs (a field of the answer, such as body.main.temp, returned as temp). Callers then send plain JSON fields or query parameters and get back only the outputs. Remove mapping passes calls through as they are.

Usage

Usage shows calls by key and API for a period, with errors and spend.

Download: PDF · Word · Markdown

Keyguard: outside APIs | REM CloudHub docs · REM CloudHub