Skip to content

Commit

Permalink
feat(client-ec2): Marking fields as sensitive on BundleTask and GetPa…
Browse files Browse the repository at this point in the history
…sswordData
  • Loading branch information
awstools committed Aug 23, 2023
1 parent 7d48fba commit 31c9785
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 11 deletions.
11 changes: 8 additions & 3 deletions clients/client-ec2/src/commands/BundleInstanceCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ import {
} from "@smithy/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import { BundleInstanceRequest, BundleInstanceResult } from "../models/models_0";
import {
BundleInstanceRequest,
BundleInstanceRequestFilterSensitiveLog,
BundleInstanceResult,
BundleInstanceResultFilterSensitiveLog,
} from "../models/models_0";
import { de_BundleInstanceCommand, se_BundleInstanceCommand } from "../protocols/Aws_ec2";

/**
Expand Down Expand Up @@ -146,8 +151,8 @@ export class BundleInstanceCommand extends $Command<
logger,
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
inputFilterSensitiveLog: BundleInstanceRequestFilterSensitiveLog,
outputFilterSensitiveLog: BundleInstanceResultFilterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
Expand Down
8 changes: 6 additions & 2 deletions clients/client-ec2/src/commands/CancelBundleTaskCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import {
} from "@smithy/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import { CancelBundleTaskRequest, CancelBundleTaskResult } from "../models/models_0";
import {
CancelBundleTaskRequest,
CancelBundleTaskResult,
CancelBundleTaskResultFilterSensitiveLog,
} from "../models/models_0";
import { de_CancelBundleTaskCommand, se_CancelBundleTaskCommand } from "../protocols/Aws_ec2";

/**
Expand Down Expand Up @@ -134,7 +138,7 @@ export class CancelBundleTaskCommand extends $Command<
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: CancelBundleTaskResultFilterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
Expand Down
8 changes: 6 additions & 2 deletions clients/client-ec2/src/commands/DescribeBundleTasksCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import {
} from "@smithy/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import { DescribeBundleTasksRequest, DescribeBundleTasksResult } from "../models/models_3";
import {
DescribeBundleTasksRequest,
DescribeBundleTasksResult,
DescribeBundleTasksResultFilterSensitiveLog,
} from "../models/models_3";
import { de_DescribeBundleTasksCommand, se_DescribeBundleTasksCommand } from "../protocols/Aws_ec2";

/**
Expand Down Expand Up @@ -149,7 +153,7 @@ export class DescribeBundleTasksCommand extends $Command<
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: DescribeBundleTasksResultFilterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
Expand Down
8 changes: 6 additions & 2 deletions clients/client-ec2/src/commands/GetPasswordDataCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import {
} from "@smithy/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import { GetPasswordDataRequest, GetPasswordDataResult } from "../models/models_5";
import {
GetPasswordDataRequest,
GetPasswordDataResult,
GetPasswordDataResultFilterSensitiveLog,
} from "../models/models_5";
import { de_GetPasswordDataCommand, se_GetPasswordDataCommand } from "../protocols/Aws_ec2";

/**
Expand Down Expand Up @@ -128,7 +132,7 @@ export class GetPasswordDataCommand extends $Command<
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: GetPasswordDataResultFilterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
Expand Down
48 changes: 48 additions & 0 deletions clients/client-ec2/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9542,6 +9542,54 @@ export const AttachVerifiedAccessTrustProviderResultFilterSensitiveLog = (
}),
});

/**
* @internal
*/
export const S3StorageFilterSensitiveLog = (obj: S3Storage): any => ({
...obj,
...(obj.UploadPolicySignature && { UploadPolicySignature: SENSITIVE_STRING }),
});

/**
* @internal
*/
export const StorageFilterSensitiveLog = (obj: Storage): any => ({
...obj,
...(obj.S3 && { S3: S3StorageFilterSensitiveLog(obj.S3) }),
});

/**
* @internal
*/
export const BundleInstanceRequestFilterSensitiveLog = (obj: BundleInstanceRequest): any => ({
...obj,
...(obj.Storage && { Storage: StorageFilterSensitiveLog(obj.Storage) }),
});

/**
* @internal
*/
export const BundleTaskFilterSensitiveLog = (obj: BundleTask): any => ({
...obj,
...(obj.Storage && { Storage: StorageFilterSensitiveLog(obj.Storage) }),
});

/**
* @internal
*/
export const BundleInstanceResultFilterSensitiveLog = (obj: BundleInstanceResult): any => ({
...obj,
...(obj.BundleTask && { BundleTask: BundleTaskFilterSensitiveLog(obj.BundleTask) }),
});

/**
* @internal
*/
export const CancelBundleTaskResultFilterSensitiveLog = (obj: CancelBundleTaskResult): any => ({
...obj,
...(obj.BundleTask && { BundleTask: BundleTaskFilterSensitiveLog(obj.BundleTask) }),
});

/**
* @internal
*/
Expand Down
9 changes: 9 additions & 0 deletions clients/client-ec2/src/models/models_3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
AttachmentStatus,
AutoPlacement,
BundleTask,
BundleTaskFilterSensitiveLog,
ByoipCidr,
CapacityReservation,
CapacityReservationFleetState,
Expand Down Expand Up @@ -10278,6 +10279,14 @@ export const DeleteVerifiedAccessTrustProviderResultFilterSensitiveLog = (
}),
});

/**
* @internal
*/
export const DescribeBundleTasksResultFilterSensitiveLog = (obj: DescribeBundleTasksResult): any => ({
...obj,
...(obj.BundleTasks && { BundleTasks: obj.BundleTasks.map((item) => BundleTaskFilterSensitiveLog(item)) }),
});

/**
* @internal
*/
Expand Down
8 changes: 8 additions & 0 deletions clients/client-ec2/src/models/models_5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8616,6 +8616,14 @@ export const GetLaunchTemplateDataResultFilterSensitiveLog = (obj: GetLaunchTemp
}),
});

/**
* @internal
*/
export const GetPasswordDataResultFilterSensitiveLog = (obj: GetPasswordDataResult): any => ({
...obj,
...(obj.PasswordData && { PasswordData: SENSITIVE_STRING }),
});

/**
* @internal
*/
Expand Down
16 changes: 14 additions & 2 deletions codegen/sdk-codegen/aws-models/ec2.json
Original file line number Diff line number Diff line change
Expand Up @@ -51641,7 +51641,7 @@
}
},
"PasswordData": {
"target": "com.amazonaws.ec2#String",
"target": "com.amazonaws.ec2#PasswordData",
"traits": {
"aws.protocols#ec2QueryName": "PasswordData",
"smithy.api#documentation": "<p>The password of the instance. Returns an empty string if the password is not\n available.</p>",
Expand Down Expand Up @@ -79119,6 +79119,12 @@
}
}
},
"com.amazonaws.ec2#PasswordData": {
"type": "string",
"traits": {
"smithy.api#sensitive": {}
}
},
"com.amazonaws.ec2#PathComponent": {
"type": "structure",
"members": {
Expand Down Expand Up @@ -88883,7 +88889,7 @@
}
},
"UploadPolicySignature": {
"target": "com.amazonaws.ec2#String",
"target": "com.amazonaws.ec2#S3StorageUploadPolicySignature",
"traits": {
"aws.protocols#ec2QueryName": "UploadPolicySignature",
"smithy.api#documentation": "<p>The signature of the JSON document.</p>",
Expand All @@ -88895,6 +88901,12 @@
"smithy.api#documentation": "<p>Describes the storage parameters for Amazon S3 and Amazon S3 buckets for an instance store-backed AMI.</p>"
}
},
"com.amazonaws.ec2#S3StorageUploadPolicySignature": {
"type": "string",
"traits": {
"smithy.api#sensitive": {}
}
},
"com.amazonaws.ec2#SSEType": {
"type": "enum",
"members": {
Expand Down

0 comments on commit 31c9785

Please sign in to comment.