Skip to content

Commit

Permalink
prepare to release
Browse files Browse the repository at this point in the history
  • Loading branch information
Flavio Stutz committed Jan 19, 2024
1 parent 27ad4f7 commit 3708391
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 30 deletions.
50 changes: 25 additions & 25 deletions src/wso2/wso2-api/handler/index.test.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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',
Expand Down
11 changes: 6 additions & 5 deletions src/wso2/wso2-api/handler/utils.ts
Original file line number Diff line number Diff line change
@@ -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<string> => {
const client = new SecretsManagerClient();
const response = await client.send(
new GetSecretValueCommand({
SecretId: secretName,
}),
);
console.log(response);
// console.log(response);
// {
// '$metadata': {
// httpStatusCode: 200,
Expand All @@ -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 '';
};

0 comments on commit 3708391

Please sign in to comment.