Secrets
4 endpoints at https://api.kosa8.com, sent with Authorization: Bearer $KOSA8_API_KEY. Generated from the API's own OpenAPI description, which a test holds to the router.
The organization's secrets: names and where each goes, never values#
GET
Responses/v1/secretsscope sandboxes:read200401403
curl -s -X GET https://api.kosa8.com/v1/secrets \ -H "Authorization: Bearer $KOSA8_API_KEY"
Store (or replace) a secret, encrypted; sandboxes created with it hold only a placeholder#
PUT
/v1/secrets/{name}scope adminAnswers 200 when it replaces one. Sandboxes already running keep the value they were created with.
Parametersnamerequiredpath · stringSecret name: 1-32 of a-z, 0-9 and -
valuerequiredstringThe real key or token. Stored encrypted; never returned Max length 8192.
upstreamrequiredstringhttps://host[:port], no path
headerstringHeader that carries it upstream (default Authorization)
schemestringWritten before the value (default "Bearer " for Authorization, else none)
methodsarray of stringHTTP methods it may be used with; empty: any but TRACE
pathsarray of stringUpstream path prefixes it may be used on; empty: any
envobjectDefault {NAME_API_KEY: "{{placeholder}}", NAME_BASE_URL: "{{url}}"}
pipelinesbooleanDefault false. true: a pipeline run that names it gets the value itself, as an environment variable of its jobs (npm-token is NPM_TOKEN), as CI secrets are; never in a sandbox otherwise
201400401403409
curl -s -X PUT https://api.kosa8.com/v1/secrets/$NAME \ -H "Authorization: Bearer $KOSA8_API_KEY" \ -H 'Content-Type: application/json' -d @body.json
Delete a secret; sandboxes holding it keep it until they are deleted#
DELETE
Parameters/v1/secrets/{name}scope adminnamerequiredpath · stringSecret name: 1-32 of a-z, 0-9 and -
200401403404
curl -s -X DELETE https://api.kosa8.com/v1/secrets/$NAME \ -H "Authorization: Bearer $KOSA8_API_KEY"
Which secrets the sandbox was created with#
GET
Parameters/v1/sandboxes/{id}/secretsscope sandboxes:readidrequiredpath · stringSandbox id (sbx_…)
200401403404
curl -s -X GET https://api.kosa8.com/v1/sandboxes/$SBX/secrets \ -H "Authorization: Bearer $KOSA8_API_KEY"