Skip to content

Commit fc1c8ac

Browse files
author
awstools
committed
feat(client-appflow): Enables users to pass custom token URL parameters for Oauth2 authentication during create connector profile
1 parent 71acd15 commit fc1c8ac

File tree

3 files changed

+242
-1
lines changed

3 files changed

+242
-1
lines changed

clients/client-appflow/src/models/models_0.ts

+67
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,61 @@ export namespace CustomAuthConfig {
221221
});
222222
}
223223

224+
export enum OAuth2CustomPropType {
225+
AUTH_URL = "AUTH_URL",
226+
TOKEN_URL = "TOKEN_URL",
227+
}
228+
229+
/**
230+
* <p>Custom parameter required for OAuth 2.0 authentication.</p>
231+
*/
232+
export interface OAuth2CustomParameter {
233+
/**
234+
* <p>The key of the custom parameter required for OAuth 2.0 authentication.</p>
235+
*/
236+
key?: string;
237+
238+
/**
239+
* <p>Indicates whether the custom parameter for OAuth 2.0 authentication is required.</p>
240+
*/
241+
isRequired?: boolean;
242+
243+
/**
244+
* <p>The label of the custom parameter used for OAuth 2.0 authentication.</p>
245+
*/
246+
label?: string;
247+
248+
/**
249+
* <p>A description about the custom parameter used for OAuth 2.0 authentication.</p>
250+
*/
251+
description?: string;
252+
253+
/**
254+
* <p>Indicates whether this authentication custom parameter is a sensitive field.</p>
255+
*/
256+
isSensitiveField?: boolean;
257+
258+
/**
259+
* <p>Contains default values for this authentication parameter that are supplied by the
260+
* connector.</p>
261+
*/
262+
connectorSuppliedValues?: string[];
263+
264+
/**
265+
* <p>Indicates whether custom parameter is used with TokenUrl or AuthUrl.</p>
266+
*/
267+
type?: OAuth2CustomPropType | string;
268+
}
269+
270+
export namespace OAuth2CustomParameter {
271+
/**
272+
* @internal
273+
*/
274+
export const filterSensitiveLog = (obj: OAuth2CustomParameter): any => ({
275+
...obj,
276+
});
277+
}
278+
224279
export enum OAuth2GrantType {
225280
AUTHORIZATION_CODE = "AUTHORIZATION_CODE",
226281
CLIENT_CREDENTIALS = "CLIENT_CREDENTIALS",
@@ -249,6 +304,11 @@ export interface OAuth2Defaults {
249304
* <p>OAuth 2.0 grant types supported by the connector.</p>
250305
*/
251306
oauth2GrantTypesSupported?: (OAuth2GrantType | string)[];
307+
308+
/**
309+
* <p>List of custom parameters required for OAuth 2.0 authentication.</p>
310+
*/
311+
oauth2CustomProperties?: OAuth2CustomParameter[];
252312
}
253313

254314
export namespace OAuth2Defaults {
@@ -1903,6 +1963,13 @@ export interface OAuth2Properties {
19031963
* <p>The OAuth 2.0 grant type used by connector for OAuth 2.0 authentication.</p>
19041964
*/
19051965
oAuth2GrantType: OAuth2GrantType | string | undefined;
1966+
1967+
/**
1968+
* <p>Associates your token URL with a map of properties that you define. Use this parameter
1969+
* to provide any additional details that the connector requires to authenticate your
1970+
* request.</p>
1971+
*/
1972+
tokenUrlCustomProperties?: { [key: string]: string };
19061973
}
19071974

19081975
export namespace OAuth2Properties {

clients/client-appflow/src/protocols/Aws_restJson1.ts

+76
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ import {
146146
MarketoMetadata,
147147
MarketoSourceProperties,
148148
OAuth2Credentials,
149+
OAuth2CustomParameter,
149150
OAuth2Defaults,
150151
OAuth2GrantType,
151152
OAuth2Properties,
@@ -3060,6 +3061,13 @@ const serializeAws_restJson1OAuth2Properties = (input: OAuth2Properties, context
30603061
...(input.oAuth2GrantType !== undefined &&
30613062
input.oAuth2GrantType !== null && { oAuth2GrantType: input.oAuth2GrantType }),
30623063
...(input.tokenUrl !== undefined && input.tokenUrl !== null && { tokenUrl: input.tokenUrl }),
3064+
...(input.tokenUrlCustomProperties !== undefined &&
3065+
input.tokenUrlCustomProperties !== null && {
3066+
tokenUrlCustomProperties: serializeAws_restJson1TokenUrlCustomProperties(
3067+
input.tokenUrlCustomProperties,
3068+
context
3069+
),
3070+
}),
30633071
};
30643072
};
30653073

@@ -3628,6 +3636,21 @@ const serializeAws_restJson1Tasks = (input: Task[], context: __SerdeContext): an
36283636
});
36293637
};
36303638

3639+
const serializeAws_restJson1TokenUrlCustomProperties = (
3640+
input: { [key: string]: string },
3641+
context: __SerdeContext
3642+
): any => {
3643+
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
3644+
if (value === null) {
3645+
return acc;
3646+
}
3647+
return {
3648+
...acc,
3649+
[key]: value,
3650+
};
3651+
}, {});
3652+
};
3653+
36313654
const serializeAws_restJson1TrendmicroConnectorProfileCredentials = (
36323655
input: TrendmicroConnectorProfileCredentials,
36333656
context: __SerdeContext
@@ -4966,12 +4989,46 @@ const deserializeAws_restJson1MarketoSourceProperties = (
49664989
} as any;
49674990
};
49684991

4992+
const deserializeAws_restJson1OAuth2CustomParameter = (output: any, context: __SerdeContext): OAuth2CustomParameter => {
4993+
return {
4994+
connectorSuppliedValues:
4995+
output.connectorSuppliedValues !== undefined && output.connectorSuppliedValues !== null
4996+
? deserializeAws_restJson1ConnectorSuppliedValueList(output.connectorSuppliedValues, context)
4997+
: undefined,
4998+
description: __expectString(output.description),
4999+
isRequired: __expectBoolean(output.isRequired),
5000+
isSensitiveField: __expectBoolean(output.isSensitiveField),
5001+
key: __expectString(output.key),
5002+
label: __expectString(output.label),
5003+
type: __expectString(output.type),
5004+
} as any;
5005+
};
5006+
5007+
const deserializeAws_restJson1OAuth2CustomPropertiesList = (
5008+
output: any,
5009+
context: __SerdeContext
5010+
): OAuth2CustomParameter[] => {
5011+
const retVal = (output || [])
5012+
.filter((e: any) => e != null)
5013+
.map((entry: any) => {
5014+
if (entry === null) {
5015+
return null as any;
5016+
}
5017+
return deserializeAws_restJson1OAuth2CustomParameter(entry, context);
5018+
});
5019+
return retVal;
5020+
};
5021+
49695022
const deserializeAws_restJson1OAuth2Defaults = (output: any, context: __SerdeContext): OAuth2Defaults => {
49705023
return {
49715024
authCodeUrls:
49725025
output.authCodeUrls !== undefined && output.authCodeUrls !== null
49735026
? deserializeAws_restJson1AuthCodeUrlList(output.authCodeUrls, context)
49745027
: undefined,
5028+
oauth2CustomProperties:
5029+
output.oauth2CustomProperties !== undefined && output.oauth2CustomProperties !== null
5030+
? deserializeAws_restJson1OAuth2CustomPropertiesList(output.oauth2CustomProperties, context)
5031+
: undefined,
49755032
oauth2GrantTypesSupported:
49765033
output.oauth2GrantTypesSupported !== undefined && output.oauth2GrantTypesSupported !== null
49775034
? deserializeAws_restJson1OAuth2GrantTypeSupportedList(output.oauth2GrantTypesSupported, context)
@@ -5006,6 +5063,10 @@ const deserializeAws_restJson1OAuth2Properties = (output: any, context: __SerdeC
50065063
return {
50075064
oAuth2GrantType: __expectString(output.oAuth2GrantType),
50085065
tokenUrl: __expectString(output.tokenUrl),
5066+
tokenUrlCustomProperties:
5067+
output.tokenUrlCustomProperties !== undefined && output.tokenUrlCustomProperties !== null
5068+
? deserializeAws_restJson1TokenUrlCustomProperties(output.tokenUrlCustomProperties, context)
5069+
: undefined,
50095070
} as any;
50105071
};
50115072

@@ -5651,6 +5712,21 @@ const deserializeAws_restJson1Tasks = (output: any, context: __SerdeContext): Ta
56515712
return retVal;
56525713
};
56535714

5715+
const deserializeAws_restJson1TokenUrlCustomProperties = (
5716+
output: any,
5717+
context: __SerdeContext
5718+
): { [key: string]: string } => {
5719+
return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
5720+
if (value === null) {
5721+
return acc;
5722+
}
5723+
return {
5724+
...acc,
5725+
[key]: __expectString(value) as any,
5726+
};
5727+
}, {});
5728+
};
5729+
56545730
const deserializeAws_restJson1TokenUrlList = (output: any, context: __SerdeContext): string[] => {
56555731
const retVal = (output || [])
56565732
.filter((e: any) => e != null)

codegen/sdk-codegen/aws-models/appflow.json

+99-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@
283283
"traits": {
284284
"smithy.api#length": {
285285
"min": 0,
286-
"max": 512
286+
"max": 2048
287287
},
288288
"smithy.api#pattern": "^\\S+$"
289289
}
@@ -4871,6 +4871,77 @@
48714871
"smithy.api#documentation": "<p>The OAuth 2.0 credentials required for OAuth 2.0 authentication.</p>"
48724872
}
48734873
},
4874+
"com.amazonaws.appflow#OAuth2CustomParameter": {
4875+
"type": "structure",
4876+
"members": {
4877+
"key": {
4878+
"target": "com.amazonaws.appflow#Key",
4879+
"traits": {
4880+
"smithy.api#documentation": "<p>The key of the custom parameter required for OAuth 2.0 authentication.</p>"
4881+
}
4882+
},
4883+
"isRequired": {
4884+
"target": "com.amazonaws.appflow#Boolean",
4885+
"traits": {
4886+
"smithy.api#documentation": "<p>Indicates whether the custom parameter for OAuth 2.0 authentication is required.</p>"
4887+
}
4888+
},
4889+
"label": {
4890+
"target": "com.amazonaws.appflow#Label",
4891+
"traits": {
4892+
"smithy.api#documentation": "<p>The label of the custom parameter used for OAuth 2.0 authentication.</p>"
4893+
}
4894+
},
4895+
"description": {
4896+
"target": "com.amazonaws.appflow#Description",
4897+
"traits": {
4898+
"smithy.api#documentation": "<p>A description about the custom parameter used for OAuth 2.0 authentication.</p>"
4899+
}
4900+
},
4901+
"isSensitiveField": {
4902+
"target": "com.amazonaws.appflow#Boolean",
4903+
"traits": {
4904+
"smithy.api#documentation": "<p>Indicates whether this authentication custom parameter is a sensitive field.</p>"
4905+
}
4906+
},
4907+
"connectorSuppliedValues": {
4908+
"target": "com.amazonaws.appflow#ConnectorSuppliedValueList",
4909+
"traits": {
4910+
"smithy.api#documentation": "<p>Contains default values for this authentication parameter that are supplied by the\n connector.</p>"
4911+
}
4912+
},
4913+
"type": {
4914+
"target": "com.amazonaws.appflow#OAuth2CustomPropType",
4915+
"traits": {
4916+
"smithy.api#documentation": "<p>Indicates whether custom parameter is used with TokenUrl or AuthUrl.</p>"
4917+
}
4918+
}
4919+
},
4920+
"traits": {
4921+
"smithy.api#documentation": "<p>Custom parameter required for OAuth 2.0 authentication.</p>"
4922+
}
4923+
},
4924+
"com.amazonaws.appflow#OAuth2CustomPropType": {
4925+
"type": "string",
4926+
"traits": {
4927+
"smithy.api#enum": [
4928+
{
4929+
"value": "TOKEN_URL",
4930+
"name": "TOKEN_URL"
4931+
},
4932+
{
4933+
"value": "AUTH_URL",
4934+
"name": "AUTH_URL"
4935+
}
4936+
]
4937+
}
4938+
},
4939+
"com.amazonaws.appflow#OAuth2CustomPropertiesList": {
4940+
"type": "list",
4941+
"member": {
4942+
"target": "com.amazonaws.appflow#OAuth2CustomParameter"
4943+
}
4944+
},
48744945
"com.amazonaws.appflow#OAuth2Defaults": {
48754946
"type": "structure",
48764947
"members": {
@@ -4897,6 +4968,12 @@
48974968
"traits": {
48984969
"smithy.api#documentation": "<p>OAuth 2.0 grant types supported by the connector.</p>"
48994970
}
4971+
},
4972+
"oauth2CustomProperties": {
4973+
"target": "com.amazonaws.appflow#OAuth2CustomPropertiesList",
4974+
"traits": {
4975+
"smithy.api#documentation": "<p>List of custom parameters required for OAuth 2.0 authentication.</p>"
4976+
}
49004977
}
49014978
},
49024979
"traits": {
@@ -4940,6 +5017,12 @@
49405017
"smithy.api#documentation": "<p>The OAuth 2.0 grant type used by connector for OAuth 2.0 authentication.</p>",
49415018
"smithy.api#required": {}
49425019
}
5020+
},
5021+
"tokenUrlCustomProperties": {
5022+
"target": "com.amazonaws.appflow#TokenUrlCustomProperties",
5023+
"traits": {
5024+
"smithy.api#documentation": "<p>Associates your token URL with a map of properties that you define. Use this parameter\n to provide any additional details that the connector requires to authenticate your\n request.</p>"
5025+
}
49435026
}
49445027
},
49455028
"traits": {
@@ -7799,6 +7882,21 @@
77997882
"smithy.api#pattern": "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]$"
78007883
}
78017884
},
7885+
"com.amazonaws.appflow#TokenUrlCustomProperties": {
7886+
"type": "map",
7887+
"key": {
7888+
"target": "com.amazonaws.appflow#CustomPropertyKey"
7889+
},
7890+
"value": {
7891+
"target": "com.amazonaws.appflow#CustomPropertyValue"
7892+
},
7893+
"traits": {
7894+
"smithy.api#length": {
7895+
"min": 0,
7896+
"max": 50
7897+
}
7898+
}
7899+
},
78027900
"com.amazonaws.appflow#TokenUrlList": {
78037901
"type": "list",
78047902
"member": {

0 commit comments

Comments
 (0)