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
1 change: 1 addition & 0 deletions packages/clients/src/api/secret/v1alpha1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export type {
ListSecretsRequest,
ListSecretsRequestOrderBy,
ListSecretsResponse,
PasswordGenerationParams,
Secret,
SecretStatus,
SecretVersion,
Expand Down
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 @@ -12,6 +13,7 @@ import type {
CreateSecretVersionRequest,
ListSecretVersionsResponse,
ListSecretsResponse,
PasswordGenerationParams,
Secret,
SecretVersion,
UpdateSecretRequest,
Expand Down Expand Up @@ -96,6 +98,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 marshalCreateSecretRequest = (
request: CreateSecretRequest,
defaults: DefaultValues,
Expand All @@ -113,6 +126,14 @@ export const marshalCreateSecretVersionRequest = (
data: request.data,
description: request.description,
disable_previous: request.disablePrevious,
...resolveOneOf([
{
param: 'password_generation',
value: request.passwordGeneration
? marshalPasswordGenerationParams(request.passwordGeneration, defaults)
: undefined,
},
]),
})

export const marshalUpdateSecretRequest = (
Expand Down
24 changes: 24 additions & 0 deletions packages/clients/src/api/secret/v1alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@ export interface ListSecretsResponse {
secrets: Secret[]
}

/** Password generation params. */
export interface PasswordGenerationParams {
/** Length of the password to generate (between 1 and 1024). */
length: number
/** Do not include lower case letters by default in the alphabet. */
noLowercaseLetters: boolean
/** Do not include upper case letters by default in the alphabet. */
noUppercaseLetters: boolean
/** Do not include digits by default in the alphabet. */
noDigits: boolean
/** Additional ascii characters to be included in the alphabet. */
additionalChars: string
}

/** Secret. */
export interface Secret {
/** ID of the secret. */
Expand Down Expand Up @@ -196,6 +210,16 @@ export type CreateSecretVersionRequest = {
* the previous version was already disabled, does nothing.
*/
disablePrevious: boolean
/**
* Options to generate a password. If specified, a random password will be
* generated. The data field must be empty. By default, the generator will use
* upper and lower case letters, and digits. This behavior can be tuned using
* the generation params.
*
* One-of ('PasswordGeneration'): at most one of 'passwordGeneration' could be
* set.
*/
passwordGeneration?: PasswordGenerationParams
}

export type GetSecretVersionRequest = {
Expand Down