Skip to content

Commit f1a5662

Browse files
authored
feat(secret): add secret version CRC32 (#578)
1 parent 0ae3c4d commit f1a5662

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

packages/clients/src/api/secret/v1alpha1/marshalling.gen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export const unmarshalAccessSecretVersionResponse = (data: unknown) => {
6767

6868
return {
6969
data: data.data,
70+
dataCrc32: data.data_crc32,
7071
revision: data.revision,
7172
secretId: data.secret_id,
7273
} as AccessSecretVersionResponse
@@ -124,6 +125,7 @@ export const marshalCreateSecretVersionRequest = (
124125
defaults: DefaultValues,
125126
): Record<string, unknown> => ({
126127
data: request.data,
128+
data_crc32: request.dataCrc32,
127129
description: request.description,
128130
disable_previous: request.disablePrevious,
129131
...resolveOneOf([

packages/clients/src/api/secret/v1alpha1/types.gen.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ export interface AccessSecretVersionResponse {
2929
revision: number
3030
/** The base64-encoded secret payload of the version. */
3131
data: string
32+
/**
33+
* The CRC32 checksum of the data as a base-10 integer. This field is present
34+
* only if a CRC32 was supplied during the creation of the version.
35+
*/
36+
dataCrc32: number
3237
}
3338

3439
/** List secret versions response. */
@@ -220,6 +225,14 @@ export type CreateSecretVersionRequest = {
220225
* set.
221226
*/
222227
passwordGeneration?: PasswordGenerationParams
228+
/**
229+
* The CRC32 checksum of the data as a base-10 integer. This field is optional
230+
* and can be set to 0. If greater than 0, the Secret Manager will verify the
231+
* integrity of the data received against the given CRC32. An error is
232+
* returned if the CRC32 does not match. Otherwise, the CRC32 will be stored
233+
* and returned along with the SecretVersion on futur accesses.
234+
*/
235+
dataCrc32: number
223236
}
224237

225238
export type GetSecretVersionRequest = {

0 commit comments

Comments
 (0)