Add New secret: create KV v2 secrets from the Secrets page

Write-only values, create-only (cas: 0). Admin policy gains
secret/data/* create; docs updated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
mattandClaude Sonnet 5.5 committed 2026-11-18 10:41:27 +00:00
1 parent d5f5faf2df
commit c29b0cfd63
12 files changed
+192 -10

No files matched your search

+6 -1
View File
@@ -1,5 +1,5 @@
import { expect, test } from 'vitest'
import { policiesReferencing, validateMountPath } from './mounts'
import { policiesReferencing, validateMountPath, validateSecretPath } from './mounts'
const existing = ['secret/', 'database/', 'team/kv/']
@@ -38,3 +38,8 @@ test('finds policies with rules under a mount, however the mount is written', ()
expect(policiesReferencing(policies, 'secret')).toEqual(['a-uses', 'b-uses'])
expect(policiesReferencing(policies, 'nothing/')).toEqual([])
})
test('validateSecretPath accepts plain and nested names and rejects bad ones', () => {
for (const p of ['expo', 'shell/expo', 'a b']) expect(validateSecretPath(p), p).toBeNull()
for (const p of ['', ' x', '/x', 'x/', 'a//b', 'a/../b', '.']) expect(validateSecretPath(p), p).not.toBeNull()
})