From 3708391aa1bec6759cbba89789ae3805c6646326 Mon Sep 17 00:00:00 2001 From: Flavio Stutz Date: Fri, 19 Jan 2024 02:12:30 +0100 Subject: [PATCH] prepare to release --- src/wso2/wso2-api/handler/index.test.ts | 50 ++++++++++++------------- src/wso2/wso2-api/handler/utils.ts | 11 +++--- 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/src/wso2/wso2-api/handler/index.test.ts b/src/wso2/wso2-api/handler/index.test.ts index eaaa2d4..13c28a4 100644 --- a/src/wso2/wso2-api/handler/index.test.ts +++ b/src/wso2/wso2-api/handler/index.test.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { CdkCustomResourceEvent, CdkCustomResourceResponse, Context } from 'aws-lambda'; +import { CdkCustomResourceEvent } from 'aws-lambda'; import { petstoreOpenapi } from '../__tests__/petstore'; import { Wso2ApiDefinition } from '../types'; @@ -43,30 +43,30 @@ const testCFNEventCreate = (resourceProperties: { [key: string]: any }): CdkCust ResourceProperties: { ...resourceProperties, ServiceToken: 'arn:somelambdatest' }, }; }; -const testCFNEventDelete = ( - resourceProperties: { [key: string]: any }, - physicalResourceId: string, -): CdkCustomResourceEvent => { - return { - ...commonEvt, - RequestType: 'Delete', - ResourceProperties: { ...resourceProperties, ServiceToken: 'arn:somelambdatest' }, - PhysicalResourceId: physicalResourceId, - }; -}; -const testCFNEventUpdate = ( - resourceProperties: { [key: string]: any }, - oldResourceProperties: { [key: string]: any }, - physicalResourceId: string, -): CdkCustomResourceEvent => { - return { - ...commonEvt, - RequestType: 'Update', - ResourceProperties: { ...resourceProperties, ServiceToken: 'arn:somelambdatest' }, - PhysicalResourceId: physicalResourceId, - OldResourceProperties: oldResourceProperties, - }; -}; +// const testCFNEventDelete = ( +// resourceProperties: { [key: string]: any }, +// physicalResourceId: string, +// ): CdkCustomResourceEvent => { +// return { +// ...commonEvt, +// RequestType: 'Delete', +// ResourceProperties: { ...resourceProperties, ServiceToken: 'arn:somelambdatest' }, +// PhysicalResourceId: physicalResourceId, +// }; +// }; +// const testCFNEventUpdate = ( +// resourceProperties: { [key: string]: any }, +// oldResourceProperties: { [key: string]: any }, +// physicalResourceId: string, +// ): CdkCustomResourceEvent => { +// return { +// ...commonEvt, +// RequestType: 'Update', +// ResourceProperties: { ...resourceProperties, ServiceToken: 'arn:somelambdatest' }, +// PhysicalResourceId: physicalResourceId, +// OldResourceProperties: oldResourceProperties, +// }; +// }; const testEvent = { wso2BaseUrl: 'http://testwso2.com', diff --git a/src/wso2/wso2-api/handler/utils.ts b/src/wso2/wso2-api/handler/utils.ts index 125a6cd..3e63054 100644 --- a/src/wso2/wso2-api/handler/utils.ts +++ b/src/wso2/wso2-api/handler/utils.ts @@ -1,13 +1,13 @@ import { GetSecretValueCommand, SecretsManagerClient } from '@aws-sdk/client-secrets-manager'; -export const getSecretValue = async (secretName = 'SECRET_NAME') => { +export const getSecretValue = async (secretName = 'SECRET_NAME'): Promise => { const client = new SecretsManagerClient(); const response = await client.send( new GetSecretValueCommand({ SecretId: secretName, }), ); - console.log(response); + // console.log(response); // { // '$metadata': { // httpStatusCode: 200, @@ -33,7 +33,8 @@ export const getSecretValue = async (secretName = 'SECRET_NAME') => { return response.SecretString; } - if (response.SecretBinary) { - return response.SecretBinary; - } + // if (response.SecretBinary) { + // return response.SecretBinary; + // } + return ''; };