Local Testing with Docker

Run the SDK locally against PostgreSQL without Kubernetes.

For a quick sanity check without a Kubernetes cluster, run the SDK on Docker against a local PostgreSQL container.

Start PostgreSQL locally

bash · terminal
1docker run -d \
2 --name securelytix-postgres \
3 -e POSTGRES_USER=vault \
4 -e POSTGRES_PASSWORD=vault \
5 -e POSTGRES_DB=vault \
6 -p 5432:5432 \
7 postgres:15

Authenticate with DockerHub

bash · terminal
1docker login -u securelytix2026
2# Enter your PAT token when prompted

Run the SDK container

bash · terminal
1docker pull securelytix2026/vault-key:1.0.5
2docker run -d --name securelytix-vault-key -p 8080:8080 \
3 -v /etc/machine-id:/host-machine-id:ro \
4 -e VAULT_PORT=8080 \
5 -e DATABASE_URL="postgresql://vault:vault@host.docker.internal:5432/vault?sslmode=disable" \
6 -e API_KEY="<your-api-key>" \
7 securelytix2026/vault-key:1.0.5

Verify

bash · terminal
1curl http://localhost:8080/health
2# Expected response:
3{
4 "status": "ok",
5 "timestamp": "2026-05-15T10:30:00Z",
6 "postgres": "ok"
7}

Test tokenization end-to-end

Tokenize a sample email and name. Send tokenized values in the detokenize request to recover the original values.

bash · terminal
1curl -sS -X POST "http://localhost:8080/api/v1/tokenize" \
2 -H "Content-Type: application/json" \
3 -d '{
4 "data": {
5 "email": "user@example.com",
6 "name": "user example"
7 }
8}'
9# Expected response:
10{
11 "data": {
12 "email": "bujd@xhpsmhg.wiw_stx",
13 "name": "kngw uanitan_stx"
14 },
15 "request_id": "d3229946-6d0f-4ff6-96e8-775d751c076b",
16 "client_id": "stx_b96890c117de267449572500"
17}
bash · terminal
1curl -sS -X POST "http://localhost:8080/api/v1/detokenize" \
2 -H "Content-Type: application/json" \
3 -d '{
4 "data": {
5 "email": "bujd@xhpsmhg.wiw_stx",
6 "name": "kngw uanitan_stx"
7 }
8}'
9# Expected response:
10{
11 "data": {
12 "email": "user@example.com",
13 "name": "user example"
14 },
15 "status": "success",
16 "request_id": "c9bf57af-e144-4197-bcc1-3b0c22b051e1",
17 "client_id": "stx_b96890c117de267449572500"
18}

Cleanup

bash · terminal
1docker stop securelytix-vault-key securelytix-postgres
2docker rm securelytix-vault-key securelytix-postgres

Was this page helpful?