-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
1,671 additions
and
1,506 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
--- | ||
title: Ephemeral Proxy | ||
--- | ||
|
||
import { | ||
HttpMethod, | ||
HttpMethods, | ||
} from "@site/src/components/shared/HttpMethod"; | ||
import { Permission } from "@site/src/components/shared/Permission"; | ||
import { Alert, Alerts } from "@site/src/components/shared/Alert"; | ||
|
||
# Ephemeral Proxy | ||
|
||
The Basis Theory Proxy can be used to share tokenized data with trusted third parties via outbound HTTP requests. | ||
Some outbound proxy requests simply need to [detokenize](/docs/expressions/detokenization) some tokens in the request and forward | ||
the plaintext data to a destination API over HTTP. Ephemeral proxy requests are a good fit for this use case, | ||
as they don't require any up-front setup, and all configuration is self-contained within the proxy request. | ||
|
||
## Invoke the Proxy | ||
|
||
Detokenize and forward an HTTP request through the proxy. | ||
|
||
<HttpMethod | ||
method={HttpMethods.POST} | ||
endpoint="https://api.basistheory.com/proxy" | ||
/> | ||
|
||
<HttpMethod | ||
method={HttpMethods.GET} | ||
endpoint="https://api.basistheory.com/proxy" | ||
/> | ||
|
||
<HttpMethod | ||
method={HttpMethods.PUT} | ||
endpoint="https://api.basistheory.com/proxy" | ||
/> | ||
|
||
<HttpMethod | ||
method={HttpMethods.PATCH} | ||
endpoint="https://api.basistheory.com/proxy" | ||
/> | ||
|
||
<HttpMethod | ||
method={HttpMethods.DELETE} | ||
endpoint="https://api.basistheory.com/proxy" | ||
/> | ||
|
||
### Authentication | ||
|
||
Ephemeral proxy requests require a `BT-API-KEY` header (see [Authentication](/docs/api/authentication)) containing an API key for an authorized `private` application. | ||
|
||
Any authentication required by the destination service can be set on the request and it will be forwarded through the proxy | ||
(for example, by setting an `Authorization` header). | ||
|
||
### Permissions | ||
|
||
<Permission content="token:use" /> | ||
<br/><br/> | ||
|
||
The `token:use` permission is required for each [Container](/docs/concepts/what-are-containers) of Tokens you wish to detokenize through the Proxy. | ||
This permission is required to use the Proxy, even if there are no tokens being detokenized within your request. | ||
|
||
It is recommended that you restrict which tokens the Proxy can detokenize by only granting `token:use` | ||
permission on the most-specific [container](/docs/concepts/what-are-containers) of tokens that is required. | ||
|
||
### Request | ||
|
||
A `BT-PROXY-URL` request header is required - its value defines the base URL to which the request will be proxied. | ||
See [Destination URLs](/docs/api/proxies/#destination-urls) for more information. | ||
|
||
```shell showLineNumbers | ||
curl "https://api.basistheory.com/proxy" \ | ||
-H "BT-API-KEY: key_N88mVGsp3sCXkykyN2EFED" \ | ||
-H "BT-PROXY-URL: https://example.com/api" \ | ||
-H "Content-Type: application/json" \ | ||
-X "POST" \ | ||
-d '{ | ||
"parameter1": "{{26818785-547b-4b28-b0fa-531377e99f4e}}", | ||
"parameter2": "non-sensitive" | ||
}' | ||
``` | ||
|
||
### Response | ||
|
||
The raw response from the destination will be returned from the proxy, unless an error occurs within the Basis Theory Proxy while processing the request. | ||
|
||
If an error occurs within the proxy (e.g. an invalid detokenization expression was found), then the following error response will be returned: | ||
|
||
| Attribute | Type | Description | | ||
|---------------|-------|---------------------------------------------------| | ||
| `proxy_error` | _any_ | A standard Basis Theory [error](/docs/api/errors) | |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
fc4f3f4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
developers-basistheory-com – ./
developers-basistheory-com-git-master-basis-theory.vercel.app
developers-basistheory-com-basis-theory.vercel.app
developers.basistheory.com