Getting Started
Follow these steps to integrate Vault functions into your app.
Enable the service and create a token
When you enable the Vault service, you will also create a token.
- Click Vault on the left-hand navigation. A dialog with details about Vault will appear. Click Next.
- You’ll be prompted to create a token to access the Vault service. Click Next.
- An additional dialog with token details will appear. Enter a Token name and select an Expiration Date, or just keep the default values. Click Done.
The Vault Overview page should appear.
Configure your app for communication with the Pangea service
For your app to communicate with the Pangea service, you must put the values of the following Configuration Details into the PANGEA_VAULT_TOKEN and PANGEA_DOMAIN environment variables:
token
domain
These Configuration Details are created when you enable Vault and can be found in the Overview section under Vault.
Set environment variables
Send the following commands in bash to set each variable:
export PANGEA_DOMAIN="yourServiceDomain"
export PANGEA_VAULT_TOKEN="yourAccessToken"
Make a POST call to create a key pair
Use the create endpoint to generate a key pair to be used for signing.
curl -sSLX POST 'https://vault.'"$PANGEA_DOMAIN"'/v1/key/generate' \
-H 'Authorization: Bearer '"$PANGEA_VAULT_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"type": "asymmetric_key", "purpose": "signing", "algorithm": "ED25519", "name": "my first key"}'
Receive a response
{
"request_id": "prq_edctqgvw5wkcujp5mugd2nd2dxnklecr",
"request_time": "2023-03-14T19:15:47.043224Z",
"response_time": "2023-03-14T19:15:47.303432Z",
"status": "Success",
"summary": "Key pair created",
"result": {
"algorithm": "ED25519",
"id": "pvi_ndbycy22zqrddl4hxdtgr36pbgmu6dk7",
"public_key": "...",
"purpose": "signing",
"type": "asymmetric_key",
"version": 1
}
}
In this instance, a key pair was created and the status
of the response indicates it was a success
.
Test the service
The interactive Vault API Reference allows you to test API endpoints from the documentation. This is an easy way to play around with different endpoints and see what they return.
Share your implementation
Reach out to the Pangea community on our
Discourse to let us know how you've integrated Vault into your application.Was this article helpful?