mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add secret value and file path validation (#24269)
Add secret value validation to reject null bytes and values exceeding 32KB. The 32KB limit applies uniformly to both env var and file secrets because the value field is shared and the destination can change after creation. Add file path validation to also reject null bytes and paths exceeding 4096 bytes. Wire up secret value validation into both POST and PATCH handlers.
This commit is contained in:
Generated
+14
@@ -4416,6 +4416,20 @@ export interface MatchedProvisioners {
|
||||
*/
|
||||
export const MaxChatFileIDs = 20;
|
||||
|
||||
// From codersdk/usersecretvalidation.go
|
||||
/**
|
||||
* MaxSecretValueSize is the maximum size of a user secret value
|
||||
* in bytes. This limit applies uniformly to both env var and
|
||||
* file-destined secrets because the value field is shared and
|
||||
* the destination can change after creation. 32KB is generous
|
||||
* for env vars (most are under 1KB) but necessary for file
|
||||
* content like SSH keys, TLS certificate chains, and JSON
|
||||
* configs. We are not trying to be overly restrictive here;
|
||||
* users can use the full 32KB for env var values even though
|
||||
* it would be unusual.
|
||||
*/
|
||||
export const MaxSecretValueSize = 32768; // 32KB
|
||||
|
||||
// From codersdk/organizations.go
|
||||
export interface MinimalOrganization {
|
||||
readonly id: string;
|
||||
|
||||
Reference in New Issue
Block a user