Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
feat: updating application types (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
jleon15 authored Aug 10, 2022
1 parent f9e5680 commit ff308c6
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 23 deletions.
19 changes: 9 additions & 10 deletions source/includes/api-reference/_applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ Your ability to authenticate to the API is granted by creating Applications, eac

| Name | Type | Description |
|-------------------------|--------------------|--------------------------------------------------------------------------------------------------------------------------------|
| Server-to-Server | `server_to_server` | Used for tokenizing, retrieving, and decrypting data within backend services where the `API key` can be secured |
| Client-side Application | `public` | Used for tokenizing data directly within your mobile or browser application |
| Elements | `elements` | Used for tokenizing data with the Basis Theory Elements module |
| Private | `private` | Used for tokenizing, retrieving, and decrypting data within backend services where the `API key` can be secured |
| Public | `public` | Used for tokenizing data directly within your mobile or browser application |
| Management | `management` | Used for managing all aspects of your token infrastructure such as [creating an Application](#applications-create-application) |

## Create Application
Expand All @@ -37,7 +36,7 @@ curl "https://api.basistheory.com/applications" \
-X "POST" \
-d '{
"name": "My Example App",
"type": "server_to_server",
"type": "private",
"permissions": [
"token:general:create",
"token:general:read:low"
Expand All @@ -54,7 +53,7 @@ const bt = await new BasisTheory().init('key_N88mVGsp3sCXkykyN2EFED');

const application = await bt.applications.create({
name: 'My Example App',
type: 'server_to_server',
type: 'private',
permissions: [
'token:general:create',
'token:general:read:low',
Expand All @@ -71,7 +70,7 @@ var client = new ApplicationClient("key_N88mVGsp3sCXkykyN2EFED");

var application = await client.CreateAsync(new Application {
Name = "My Example App",
Type = "server_to_server",
Type = "private",
Permissions = new List<string> {
"token:general:create",
"token:general:read:low",
Expand All @@ -91,7 +90,7 @@ with basistheory.ApiClient(configuration=basistheory.Configuration(api_key="key_

application = application_client.create(create_application_request=CreateApplicationRequest(
name="My Example App",
type="server_to_server",
type="private",
permissions=[
"token:general:create",
"token:general:read:low",
Expand Down Expand Up @@ -136,7 +135,7 @@ func main() {
"tenant_id": "77cb0024-123e-41a8-8ff8-a3d5a0fa8a08",
"name": "My Example App",
"key": "key_FZ8RmaxoGc73lbmF2cpmUJ",
"type": "server_to_server",
"type": "private",
"permissions": [
"token:general:create",
"token:general:read:low",
Expand Down Expand Up @@ -238,7 +237,7 @@ func main() {
"id": "fb124bba-f90d-45f0-9a59-5edca27b3b4a",
"tenant_id": "77cb0024-123e-41a8-8ff8-a3d5a0fa8a08",
"name": "My Example App",
"type": "server_to_server",
"type": "private",
"permissions": [
"token:general:create",
"token:general:read:low",
Expand Down Expand Up @@ -671,7 +670,7 @@ func main() {
"tenant_id": "77cb0024-123e-41a8-8ff8-a3d5a0fa8a08",
"name": "My Example App",
"key": "key_FZ8RmaxoGc73lbmF2cpmUJ",
"type": "server_to_server",
"type": "private",
"permissions": [
"token:general:create",
"token:general:read:low",
Expand Down
18 changes: 9 additions & 9 deletions source/includes/api-reference/_permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ All Token permissions follow the form of `token:<classification>:<operation>:<sc

| Permission | Description | Application Types |
|----------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------|
| `token:<classification>:create` | Create Tokens in [\<classification\>](#tokens-token-classifications) (e.g. `token:general:create`) | `public`, `elements`, `server_to_server` |
| `token:<classification>:read:low` | Read plaintext token data in [\<classification\>](#tokens-token-classifications) with `low` [\<impact_level\>](#tokens-token-impact-levels). Tokens in `<classification>` with higher impact level will be restricted based on the token's [restriction policy](#tokens-token-restriction-policies) | `server_to_server` |
| `token:<classification>:read:moderate` | Read plaintext token data in [\<classification\>](#tokens-token-classifications) with `moderate` [\<impact_level\>](#tokens-token-impact-levels) and lower. Tokens in `<classification>` with higher impact level will be restricted based on the token's [restriction policy](#tokens-token-restriction-policies) | `server_to_server` |
| `token:<classification>:read:high` | Read plaintext token data in [\<classification\>](#tokens-token-classifications) with `high` [\<impact_level\>](#tokens-token-impact-levels) and lower (i.e. `low` and `moderate`). | `server_to_server` |
| `token:<classification>:update` | Update Tokens in [\<classification\>](#tokens-token-classifications) (e.g. `token:general:update`) | `server_to_server` |
| `token:<classification>:delete` | Delete Tokens in [\<classification\>](#tokens-token-classifications) (e.g. `token:general:delete`) | `server_to_server` |
| `token:<classification>:use:proxy` | Use Tokens in [\<classification\>](#tokens-token-classifications) via [Proxy](#proxy) (e.g. `token:general:use:proxy`) | `server_to_server` |
| `token:<classification>:use:reactor` | Use Tokens in [\<classification\>](#tokens-token-classifications) via [Reactor](#reactors) (e.g. `token:general:use:reactor`) | `server_to_server` |
| `token:<classification>:create` | Create Tokens in [\<classification\>](#tokens-token-classifications) (e.g. `token:general:create`) | `public`, `private` |
| `token:<classification>:read:low` | Read plaintext token data in [\<classification\>](#tokens-token-classifications) with `low` [\<impact_level\>](#tokens-token-impact-levels). Tokens in `<classification>` with higher impact level will be restricted based on the token's [restriction policy](#tokens-token-restriction-policies) | `private` |
| `token:<classification>:read:moderate` | Read plaintext token data in [\<classification\>](#tokens-token-classifications) with `moderate` [\<impact_level\>](#tokens-token-impact-levels) and lower. Tokens in `<classification>` with higher impact level will be restricted based on the token's [restriction policy](#tokens-token-restriction-policies) | `private` |
| `token:<classification>:read:high` | Read plaintext token data in [\<classification\>](#tokens-token-classifications) with `high` [\<impact_level\>](#tokens-token-impact-levels) and lower (i.e. `low` and `moderate`). | `private` |
| `token:<classification>:update` | Update Tokens in [\<classification\>](#tokens-token-classifications) (e.g. `token:general:update`) | `private` |
| `token:<classification>:delete` | Delete Tokens in [\<classification\>](#tokens-token-classifications) (e.g. `token:general:delete`) | `private` |
| `token:<classification>:use:proxy` | Use Tokens in [\<classification\>](#tokens-token-classifications) via [Proxy](#proxy) (e.g. `token:general:use:proxy`) | `private` |
| `token:<classification>:use:reactor` | Use Tokens in [\<classification\>](#tokens-token-classifications) via [Reactor](#reactors) (e.g. `token:general:use:reactor`) | `private` |

## List Permissions

Expand Down Expand Up @@ -126,7 +126,7 @@ func main() {
"type": "token:pci:read:low",
"description": "Read tokens with PCI classification of low impact level",
"application_types": [
"server_to_server"
"private"
]
},
{...},
Expand Down
2 changes: 1 addition & 1 deletion source/includes/elements/_authentication.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Authentication

**Elements** use a specific type of Application key to allow access to the API. To create one, login into our <a href="https://portal.basistheory.com" target="_blank">Portal</a> and create a new "Elements" Application with the permissions you require.
**Elements** use an application of type "Public" to allow access to the API. To create one, login into our <a href="https://portal.basistheory.com" target="_blank">Portal</a> and create a new "Public" Application with the permissions you require.
7 changes: 6 additions & 1 deletion source/includes/elements/_permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ Permissions offer fine-grained control over your Application's access to differe

Permissions are associated with every Application and can be configured when you [create an Application](/api-reference#applications-create-application) or [update an Application](/api-reference#applications-update-application).

**Elements** Applications only allow _create_ permissions, removing any risk that your API keys are stolen and used to access data.
**Public** Applications only allow _create_ and _update_ permissions, removing any risk that your API keys are stolen and used to access data.

## Permission Types

| Permission | Description |
|------------------------|----------------------------|
| `token:general:create` | Create tokens in the vault |
| `token:general:update` | Update tokens in the vault |
| `token:pci:create` | Create Card tokens |
| `token:pci:update` | Update Card tokens |
| `token:bank:create` | Create Bank tokens |
| `token:bank:update` | Update Bank tokens |
| `token:pii:create` | Create PII tokens |
| `token:pii:update` | Update PII tokens |
2 changes: 1 addition & 1 deletion source/includes/elements/react/_use_basis_theory.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Parameter | Required | Type | Description
<!-- Options link above looks weird because of how Slate generates them -->

<aside class="notice">
<span>Make sure your API key has an <code>Elements</code> or <code>Client-side Application</code> <a href="/api-reference#applications-application-types">Application Type</a>.</span>
<span>Make sure your API key has a <code>Public</code> <a href="/api-reference#applications-application-types">Application Type</a>.</span>
</aside>

## Retrieve from Context
Expand Down
2 changes: 1 addition & 1 deletion source/includes/elements/vanilla/_initialize.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ Attribute | Required | Type | Description
</aside>

<aside class="notice">
<span>Friendly reminder to replace <code>test_1234567890</code> with a valid <a href="/api-reference/#applications-application-types">Elements Application key</a>.</span>
<span>Friendly reminder to replace <code>test_1234567890</code> with a valid <a href="/api-reference/#applications-application-types">Public Application key</a>.</span>
</aside>

0 comments on commit ff308c6

Please sign in to comment.