Harthelm Docs

Generate a secret

Stores a new revision with a random value that satisfies the password policy (crypto/rand); the value is not returned. Needs `landscape.manage` on the workspace that uses the vault.

Generated from openapi/harthelm.yaml at v1.5.0
POST
/vaults/{vault}/secrets/{key}/generate

Authorization

cookie__Host-harthelm_session<token>

Browser session of the UI (12 h idle, 7 days absolute). State-changing requests also need the header Harthelm-CSRF: 1 and a matching Origin.

Path Parameters

vault*integer

A vault id, e.g. Workspace.vault_id.

Formatint64
Range1 <= value
key*string
Match^[A-Za-z_][A-Za-z0-9_]{0,127}$

Request Body

application/json
  1. body

Default 32 characters from lower, upper and digits, at least one of each.

length?integer
Range8 <= value <= 256
Default32
rules?array<>
Itemsitems <= 4

Response Body

The key's new revision (without the value).

application/json
  1. response
key*SecretKeyValue
Match^[A-Za-z_][A-Za-z0-9_]{0,127}$
revision*integer
Range1 <= value
generated*boolean

The value came from generate.

created_at*string
Formatdate-time
created_by?ID

Numeric resource id.

Formatint64
Range1 <= value
curl -X POST 'https://console.example.com/api/v1/vaults/1/secrets/string/generate' \  -H 'Content-Type: application/json' \  -d '{}'
{  "key": "string",  "revision": 1,  "generated": true,  "created_at": "2019-08-24T14:15:22Z",  "created_by": 1}