feat: add user secrets SDK types and db2sdk converters (#24102)

Adds the SDK types and database-to-SDK conversion helpers for the user secrets feature.
This commit is contained in:
Zach
2026-04-08 16:48:41 -06:00
committed by GitHub
parent 506fba9ebf
commit 9b91af8ab7
3 changed files with 122 additions and 0 deletions
+43
View File
@@ -2811,6 +2811,20 @@ export interface CreateUserRequestWithOrgs {
readonly service_account?: boolean;
}
// From codersdk/usersecrets.go
/**
* CreateUserSecretRequest is the payload for creating a new user
* secret. Name and Value are required. All other fields are optional
* and default to empty string.
*/
export interface CreateUserSecretRequest {
readonly name: string;
readonly value: string;
readonly description?: string;
readonly env_name?: string;
readonly file_path?: string;
}
// From codersdk/workspaces.go
export type CreateWorkspaceBuildReason =
| "cli"
@@ -7686,6 +7700,20 @@ export interface UpdateUserQuietHoursScheduleRequest {
readonly schedule: string;
}
// From codersdk/usersecrets.go
/**
* UpdateUserSecretRequest is the payload for partially updating a
* user secret. At least one field must be non-nil. Pointer fields
* distinguish "not sent" (nil) from "set to empty string" (pointer
* to empty string).
*/
export interface UpdateUserSecretRequest {
readonly value?: string;
readonly description?: string;
readonly env_name?: string;
readonly file_path?: string;
}
// From codersdk/workspaces.go
export interface UpdateWorkspaceACL {
/**
@@ -8038,6 +8066,21 @@ export interface UserRoles {
readonly organization_roles: Record<string, string[]>;
}
// From codersdk/usersecrets.go
/**
* UserSecret represents a user secret's metadata. The secret value
* is never included in API responses.
*/
export interface UserSecret {
readonly id: string;
readonly name: string;
readonly description: string;
readonly env_name: string;
readonly file_path: string;
readonly created_at: string;
readonly updated_at: string;
}
// From codersdk/users.go
export type UserStatus = "active" | "dormant" | "suspended";