Skip to content

Commit

Permalink
feat(client-mediapackage): Fix SDK logging of certain fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
awstools committed Aug 14, 2023
1 parent 31de2c4 commit 0dc18f1
Show file tree
Hide file tree
Showing 10 changed files with 338 additions and 260 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import {
} from "@smithy/types";

import { MediaPackageClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../MediaPackageClient";
import { ConfigureLogsRequest, ConfigureLogsResponse } from "../models/models_0";
import {
ConfigureLogsRequest,
ConfigureLogsResponse,
ConfigureLogsResponseFilterSensitiveLog,
} from "../models/models_0";
import { de_ConfigureLogsCommand, se_ConfigureLogsCommand } from "../protocols/Aws_restJson1";

/**
Expand Down Expand Up @@ -157,7 +161,7 @@ export class ConfigureLogsCommand extends $Command<
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: ConfigureLogsResponseFilterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import {
} from "@smithy/types";

import { MediaPackageClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../MediaPackageClient";
import { CreateChannelRequest, CreateChannelResponse } from "../models/models_0";
import {
CreateChannelRequest,
CreateChannelResponse,
CreateChannelResponseFilterSensitiveLog,
} from "../models/models_0";
import { de_CreateChannelCommand, se_CreateChannelCommand } from "../protocols/Aws_restJson1";

/**
Expand Down Expand Up @@ -155,7 +159,7 @@ export class CreateChannelCommand extends $Command<
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: CreateChannelResponseFilterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import {
} from "@smithy/types";

import { MediaPackageClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../MediaPackageClient";
import { DescribeChannelRequest, DescribeChannelResponse } from "../models/models_0";
import {
DescribeChannelRequest,
DescribeChannelResponse,
DescribeChannelResponseFilterSensitiveLog,
} from "../models/models_0";
import { de_DescribeChannelCommand, se_DescribeChannelCommand } from "../protocols/Aws_restJson1";

/**
Expand Down Expand Up @@ -153,7 +157,7 @@ export class DescribeChannelCommand extends $Command<
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: DescribeChannelResponseFilterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from "@smithy/types";

import { MediaPackageClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../MediaPackageClient";
import { ListChannelsRequest, ListChannelsResponse } from "../models/models_0";
import { ListChannelsRequest, ListChannelsResponse, ListChannelsResponseFilterSensitiveLog } from "../models/models_0";
import { de_ListChannelsCommand, se_ListChannelsCommand } from "../protocols/Aws_restJson1";

/**
Expand Down Expand Up @@ -157,7 +157,7 @@ export class ListChannelsCommand extends $Command<
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: ListChannelsResponseFilterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import {
} from "@smithy/types";

import { MediaPackageClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../MediaPackageClient";
import { RotateChannelCredentialsRequest, RotateChannelCredentialsResponse } from "../models/models_0";
import {
RotateChannelCredentialsRequest,
RotateChannelCredentialsResponse,
RotateChannelCredentialsResponseFilterSensitiveLog,
} from "../models/models_0";
import { de_RotateChannelCredentialsCommand, se_RotateChannelCredentialsCommand } from "../protocols/Aws_restJson1";

/**
Expand Down Expand Up @@ -155,7 +159,7 @@ export class RotateChannelCredentialsCommand extends $Command<
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: RotateChannelCredentialsResponseFilterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import {
} from "@smithy/types";

import { MediaPackageClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../MediaPackageClient";
import { RotateIngestEndpointCredentialsRequest, RotateIngestEndpointCredentialsResponse } from "../models/models_0";
import {
RotateIngestEndpointCredentialsRequest,
RotateIngestEndpointCredentialsResponse,
RotateIngestEndpointCredentialsResponseFilterSensitiveLog,
} from "../models/models_0";
import {
de_RotateIngestEndpointCredentialsCommand,
se_RotateIngestEndpointCredentialsCommand,
Expand Down Expand Up @@ -159,7 +163,7 @@ export class RotateIngestEndpointCredentialsCommand extends $Command<
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: RotateIngestEndpointCredentialsResponseFilterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import {
} from "@smithy/types";

import { MediaPackageClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../MediaPackageClient";
import { UpdateChannelRequest, UpdateChannelResponse } from "../models/models_0";
import {
UpdateChannelRequest,
UpdateChannelResponse,
UpdateChannelResponseFilterSensitiveLog,
} from "../models/models_0";
import { de_UpdateChannelCommand, se_UpdateChannelCommand } from "../protocols/Aws_restJson1";

/**
Expand Down Expand Up @@ -152,7 +156,7 @@ export class UpdateChannelCommand extends $Command<
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: UpdateChannelResponseFilterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
Expand Down
2 changes: 1 addition & 1 deletion clients/client-mediapackage/src/endpoint/ruleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ m={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:e},"supportsDualStack"
n=[i],
o=[j],
p=[{[t]:"Region"}];
const _data={version:"1.0",parameters:{Region:f,UseDualStack:g,UseFIPS:g,Endpoint:f},rules:[{conditions:[{[r]:a,[s]:[h]}],type:b,rules:[{conditions:n,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:o,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:h,properties:k,headers:k},type:d}]}]},{type:b,rules:[{conditions:[{[r]:a,[s]:p}],type:b,rules:[{conditions:[{[r]:"aws.partition",[s]:p,assign:e}],type:b,rules:[{conditions:[i,j],type:b,rules:[{conditions:[l,m],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://mediapackage-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:n,type:b,rules:[{conditions:[l],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://mediapackage-fips.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:o,type:b,rules:[{conditions:[m],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://mediapackage.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{type:b,rules:[{endpoint:{url:"https://mediapackage.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},type:d}]}]}]},{error:"Invalid Configuration: Missing Region",type:c}]}]};
const _data={version:"1.0",parameters:{Region:f,UseDualStack:g,UseFIPS:g,Endpoint:f},rules:[{conditions:[{[r]:a,[s]:[h]}],type:b,rules:[{conditions:n,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{conditions:o,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:h,properties:k,headers:k},type:d}]},{conditions:[{[r]:a,[s]:p}],type:b,rules:[{conditions:[{[r]:"aws.partition",[s]:p,assign:e}],type:b,rules:[{conditions:[i,j],type:b,rules:[{conditions:[l,m],type:b,rules:[{endpoint:{url:"https://mediapackage-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},type:d}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:n,type:b,rules:[{conditions:[l],type:b,rules:[{endpoint:{url:"https://mediapackage-fips.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},type:d}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:o,type:b,rules:[{conditions:[m],type:b,rules:[{endpoint:{url:"https://mediapackage.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},type:d}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{endpoint:{url:"https://mediapackage.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"Invalid Configuration: Missing Region",type:c}]};
export const ruleSet: RuleSetObject = _data;
86 changes: 85 additions & 1 deletion clients/client-mediapackage/src/models/models_0.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// smithy-typescript generated code
import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client";
import { ExceptionOptionType as __ExceptionOptionType, SENSITIVE_STRING } from "@smithy/smithy-client";

import { MediaPackageServiceException as __BaseException } from "./MediaPackageServiceException";

Expand Down Expand Up @@ -2730,3 +2730,87 @@ export interface UpdateOriginEndpointResponse {
*/
Whitelist?: string[];
}

/**
* @internal
*/
export const IngestEndpointFilterSensitiveLog = (obj: IngestEndpoint): any => ({
...obj,
...(obj.Password && { Password: SENSITIVE_STRING }),
...(obj.Username && { Username: SENSITIVE_STRING }),
});

/**
* @internal
*/
export const HlsIngestFilterSensitiveLog = (obj: HlsIngest): any => ({
...obj,
...(obj.IngestEndpoints && {
IngestEndpoints: obj.IngestEndpoints.map((item) => IngestEndpointFilterSensitiveLog(item)),
}),
});

/**
* @internal
*/
export const ChannelFilterSensitiveLog = (obj: Channel): any => ({
...obj,
...(obj.HlsIngest && { HlsIngest: HlsIngestFilterSensitiveLog(obj.HlsIngest) }),
});

/**
* @internal
*/
export const ConfigureLogsResponseFilterSensitiveLog = (obj: ConfigureLogsResponse): any => ({
...obj,
...(obj.HlsIngest && { HlsIngest: HlsIngestFilterSensitiveLog(obj.HlsIngest) }),
});

/**
* @internal
*/
export const CreateChannelResponseFilterSensitiveLog = (obj: CreateChannelResponse): any => ({
...obj,
...(obj.HlsIngest && { HlsIngest: HlsIngestFilterSensitiveLog(obj.HlsIngest) }),
});

/**
* @internal
*/
export const DescribeChannelResponseFilterSensitiveLog = (obj: DescribeChannelResponse): any => ({
...obj,
...(obj.HlsIngest && { HlsIngest: HlsIngestFilterSensitiveLog(obj.HlsIngest) }),
});

/**
* @internal
*/
export const ListChannelsResponseFilterSensitiveLog = (obj: ListChannelsResponse): any => ({
...obj,
});

/**
* @internal
*/
export const RotateChannelCredentialsResponseFilterSensitiveLog = (obj: RotateChannelCredentialsResponse): any => ({
...obj,
...(obj.HlsIngest && { HlsIngest: HlsIngestFilterSensitiveLog(obj.HlsIngest) }),
});

/**
* @internal
*/
export const RotateIngestEndpointCredentialsResponseFilterSensitiveLog = (
obj: RotateIngestEndpointCredentialsResponse
): any => ({
...obj,
...(obj.HlsIngest && { HlsIngest: HlsIngestFilterSensitiveLog(obj.HlsIngest) }),
});

/**
* @internal
*/
export const UpdateChannelResponseFilterSensitiveLog = (obj: UpdateChannelResponse): any => ({
...obj,
...(obj.HlsIngest && { HlsIngest: HlsIngestFilterSensitiveLog(obj.HlsIngest) }),
});
Loading

0 comments on commit 0dc18f1

Please sign in to comment.