Skip to main content
Version: 2.0.0

API call examples

Check out the FoAz Proxy Config API

A Proxy Config is a Permit.io resource that defines a protected API call. It is used to define the API call, and the secrets that should be injected into it.

Create a Proxy Config

When creating a Proxy Config you need to provide the following information:

FoAz Create a Proxy Config

A mapping rule is an object that defines how Permit will map the request to a resource / action.

FoAz Mapping Rule

There are a few things you need to take care about, when creating a proxy config:

  1. The url path should be a valid openapi url with the host, for example,

    Proxying a request to https://api.stripe.com/v1/customers/:id would be https://api.stripe.com/v1/customers/{id}

  2. If you want to enforce any headers, you need to provide them in the headers key of the mapping rule.

  3. If you want to enforce specific query parameters, provide them in the url using ? and &. For example, if you want to enforce the limit query parameter, you would provide the url as https://api.stripe.com/v1/customers?limit={limit}

  4. If you have a url that is matched by multiple mapping rules, for example https://api.stripe.com/v1/customers?limit={limit} and https://api.stripe.com/v1/customers the order is randomly unless you provide the priority to the mapping rule ( the default priority used is 0 ).

  5. The auth mechanism can be either Bearer, Basic, or Headers. If you choose Headers, you need to provide an object with the keys being the names, and the value being the values of the headers. If you choose Basic, you need to provide a secret in the format of username:password. If you choose Bearer, you need to provide any secret string.

  6. If you don't provide the action to the mapping rule, the http_method will be used as default.

FoAz Create Proxy Config example

Edit a Proxy Config

When updating a Proxy Config you need to provide the following information:

FoAz Update a Proxy Config

There are a few things you need to take care about, when updating a proxy config:

  1. If you update the secret without updating the auth_mechanism notice that it should match the proxy config auth_mechanism.
  2. If you update the auth_mechanism without updating the secret notice that it should match the proxy config secret format.
  3. If you update the mapping rules, you need to provide the entire mapping rules array, and not just the updated mapping rule.

FoAz Create Proxy Config example

Delete a Proxy Config

When deleting a Proxy Config you need to provide the following information:

FoAz Delete a Proxy Config