Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions packages/clients/src/api/secret/v1alpha1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// If you have any remark or suggestion do not hesitate to open an issue.
import {
isJSONObject,
resolveOneOf,
unmarshalArrayOfObject,
unmarshalDate,
} from '../../../bridge'
Expand All @@ -14,6 +15,7 @@ import type {
GeneratePasswordRequest,
ListSecretVersionsResponse,
ListSecretsResponse,
PasswordGenerationParams,
Secret,
SecretVersion,
UpdateSecretRequest,
Expand Down Expand Up @@ -101,6 +103,17 @@ export const unmarshalListSecretsResponse = (data: unknown) => {
} as ListSecretsResponse
}

const marshalPasswordGenerationParams = (
request: PasswordGenerationParams,
defaults: DefaultValues,
): Record<string, unknown> => ({
additional_chars: request.additionalChars,
length: request.length,
no_digits: request.noDigits,
no_lowercase_letters: request.noLowercaseLetters,
no_uppercase_letters: request.noUppercaseLetters,
})

export const marshalAddSecretOwnerRequest = (
request: AddSecretOwnerRequest,
defaults: DefaultValues,
Expand All @@ -126,6 +139,14 @@ export const marshalCreateSecretVersionRequest = (
data_crc32: request.dataCrc32,
description: request.description,
disable_previous: request.disablePrevious,
...resolveOneOf([
{
param: 'password_generation',
value: request.passwordGeneration
? marshalPasswordGenerationParams(request.passwordGeneration, defaults)
: undefined,
},
]),
})

export const marshalGeneratePasswordRequest = (
Expand Down
11 changes: 11 additions & 0 deletions packages/clients/src/api/secret/v1alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,17 @@ export type CreateSecretVersionRequest = {
* version or if the previous version was already disabled, does nothing.
*/
disablePrevious?: boolean
/**
* @deprecated Options to generate a password. (Optional.) If specified, a
* random password will be generated. The `data` and `data_crc32` fields
* must be empty. By default, the generator will use upper and lower case
* letters, and digits. This behavior can be tuned using the generation
* parameters.
*
* One-of ('PasswordGeneration'): at most one of 'passwordGeneration' could be
* set.
*/
passwordGeneration?: PasswordGenerationParams
/**
* (Optional.) The CRC32 checksum of the data as a base-10 integer. If
* specified, Secret Manager will verify the integrity of the data received
Expand Down