Skip to content

Commit 1a3a067

Browse files
authored
feat(secret_manager): add ephemeral action to secret creation (#963)
1 parent a41cbda commit 1a3a067

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ export class API extends ParentAPI {
199199
request.region ?? this.client.settings.defaultRegion,
200200
)}/secrets`,
201201
urlParams: urlParams(
202+
['is_ephemeral', request.isEphemeral],
202203
['is_managed', request.isManaged],
203204
['name', request.name],
204205
['order_by', request.orderBy ?? 'name_asc'],

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export type {
3535
Product,
3636
ProtectSecretRequest,
3737
Secret,
38+
SecretEphemeralAction,
3839
SecretStatus,
3940
SecretType,
4041
SecretVersion,

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ export const unmarshalSecret = (data: unknown) => {
5252
return {
5353
createdAt: unmarshalDate(data.created_at),
5454
description: data.description,
55+
ephemeralAction: data.ephemeral_action,
56+
expiresAt: unmarshalDate(data.expires_at),
5557
id: data.id,
58+
isEphemeral: data.is_ephemeral,
5659
isManaged: data.is_managed,
5760
isProtected: data.is_protected,
5861
name: data.name,
@@ -182,6 +185,8 @@ export const marshalCreateSecretRequest = (
182185
defaults: DefaultValues,
183186
): Record<string, unknown> => ({
184187
description: request.description,
188+
ephemeral_action: request.ephemeralAction ?? 'unknown_ephemeral_action',
189+
expires_at: request.expiresAt,
185190
name: request.name,
186191
path: request.path,
187192
project_id: request.projectId ?? defaults.defaultProjectId,

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ export type ListSecretsRequestOrderBy =
1818

1919
export type Product = 'unknown'
2020

21+
export type SecretEphemeralAction =
22+
| 'unknown_ephemeral_action'
23+
| 'delete_secret'
24+
| 'disable_secret'
25+
2126
export type SecretStatus = 'ready' | 'locked'
2227

2328
export type SecretType =
@@ -142,6 +147,18 @@ export interface Secret {
142147
type: SecretType
143148
/** Path of the secret. Location of the secret in the directory structure. */
144149
path: string
150+
/**
151+
* Expiration date of the secret. (Optional.) Date on which the secret will be
152+
* deleted or deactivated.
153+
*/
154+
expiresAt?: Date
155+
/**
156+
* Action to be taken when the secret expires. See `Secret.EphemeralAction`
157+
* enum for description of values.
158+
*/
159+
ephemeralAction: SecretEphemeralAction
160+
/** Returns `true` for secrets that are ephemeral. */
161+
isEphemeral: boolean
145162
/** Region of the secret. */
146163
region: Region
147164
}
@@ -196,6 +213,13 @@ export type CreateSecretRequest = {
196213
* structure. If not specified, the path is `/`.
197214
*/
198215
path?: string
216+
/**
217+
* Expiration date of the secret. (Optional.) Date on which the secret will be
218+
* deleted or deactivated.
219+
*/
220+
expiresAt?: Date
221+
/** Action to be taken when the secret expires. */
222+
ephemeralAction?: SecretEphemeralAction
199223
}
200224

201225
export type CreateFolderRequest = {
@@ -282,6 +306,8 @@ export type ListSecretsRequest = {
282306
isManaged?: boolean
283307
/** Filter by path (optional). */
284308
path?: string
309+
/** Filter by ephemeral / not ephemeral (optional). */
310+
isEphemeral?: boolean
285311
}
286312

287313
export type ListFoldersRequest = {

0 commit comments

Comments
 (0)