Secret templates
The nine typed secret shapes, their fields, and where each one is stored.
How templates work
Every secret has a template. It decides what fields the value has, which of them are sensitive, and where the secret is stored.
Fields marked non-sensitive - a hostname, a port, a region - are copied into metadata alongside the ciphertext so they can be listed and searched without decrypting anything. Sensitive fields exist only inside the encrypted payload.
shortspan secret templates
curl -H "Authorization: Bearer $SHORTSPAN_TOKEN" \
https://shortspan.dev/api/v1/secret-templatesTwo storage behaviours
| Storage | Templates | Appears as |
|---|---|---|
Secret |
| A secret under Secrets. |
SSH |
| An SSH target under Infrastructure. |
Database |
| A database target under Infrastructure. |
AWS |
| An AWS profile under Infrastructure. |
Kubeconfig |
| A Kubernetes context under Infrastructure. |
Value templates
env - Environment variable
A single KEY=VALUE pair, injected into a process by shortspan run. Stored as a string.
| Field | Input | Sensitive | Required |
|---|---|---|---|
| textarea | yes | yes |
plain - Plain secret
An opaque string: an API key, a token, a password. Stored as a string.
| Field | Input | Sensitive | Required |
|---|---|---|---|
| textarea | yes | yes |
note - Secure note
Free-form encrypted text. Recovery steps, a break-glass procedure, anything that should be readable but not public. Stored as a string.
| Field | Input | Sensitive | Required |
|---|---|---|---|
| textarea | yes | yes |
json_blob - JSON document
A structured document encrypted as a whole - a service account key file, a webhook configuration. Stored as JSON.
| Field | Input | Sensitive | Required |
|---|---|---|---|
| json | yes | yes |
tls_certificate - TLS certificate
A certificate, its private key, and an optional chain. Stored as JSON. The certificate and chain are not marked sensitive - they are public by nature - so they can be inspected without a reveal.
| Field | Input | Sensitive | Required |
|---|---|---|---|
| textarea (PEM) | no | yes |
| textarea (PEM) | yes | yes |
| textarea (PEM) | no | no |
Connection templates
ssh_login - SSH login
A server, keyed by alias. Connect with shortspan ssh <alias>.
| Field | Input | Sensitive | Notes |
|---|---|---|---|
| text | no | What people type. |
| text | no | Hostname or address. |
| number | no | Defaults to 22. |
| text | no | The account to connect as. |
| select | no |
|
| textarea | yes | The password, or the private key in PEM form. |
database_url - Database connection
A database, keyed by alias. Connect with shortspan db <alias>.
| Field | Input | Sensitive | Notes |
|---|---|---|---|
| text | no | What people type. |
| select | no |
|
| text | no | As reachable from the bastion, if one is configured. |
| number | no | Driver default if omitted. |
| text | no | The database name. |
| text | no | The role to connect as. |
| password | yes | Encrypted at rest. |
aws_keys - AWS credentials
An access key pair, keyed by alias. Inject with shortspan aws <alias>.
| Field | Input | Sensitive | Notes |
|---|---|---|---|
| text | no | What people type. |
| text | no | Identifies the key; not itself a secret. |
| password | yes | Encrypted at rest. |
| text | no | Injected as |
kubeconfig - Kubernetes context
A cluster and its kubeconfig, keyed by alias. Enter with shortspan k8s <alias>.
| Field | Input | Sensitive | Notes |
|---|---|---|---|
| text | no | What people type. |
| text | no | For display. |
| textarea (YAML) | yes | The whole document is encrypted - it usually contains a client certificate or token. |
Creating through the API
curl -X POST https://shortspan.dev/api/v1/projects/{project}/secrets \
-H "Authorization: Bearer $SHORTSPAN_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"key": "edge-cert",
"template": "tls_certificate",
"fields": {
"certificate": "-----BEGIN CERTIFICATE-----\n…",
"private_key": "-----BEGIN PRIVATE KEY-----\n…"
}
}'Single-field templates accept value instead of fields. Omitting template entirely stores the value as plain.
Fields are validated against the template before anything is encrypted, so a missing required field is a 422 naming the field rather than a corrupt secret you discover later.
Something here wrong or missing? Tell us.