Skip to content

Commit e9a85b7

Browse files
authored
Merge branch 'develop' into develop
2 parents cb93bf6 + 3051d5c commit e9a85b7

23 files changed

+178
-47
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [6.1.1] - 2023-02-09
9+
10+
### Added
11+
12+
- package-lock.json for all modules [#426](https://github.com/aws-solutions/serverless-image-handler/pull/426)
13+
- github workflows for running unit test, eslint and prettier formatting, cdk nag, security scans [#402](https://github.com/aws-solutions/serverless-image-handler/pull/402)
14+
- demo-ui unicode support [#416](https://github.com/aws-solutions/serverless-image-handler/issues/416)
15+
- support for multiple cloudformation stack deployments in the same region [#438](https://github.com/aws-solutions/serverless-image-handler/pull/438)
16+
17+
### Changed
18+
19+
- axios version update to 1.2.3 [#425](https://github.com/aws-solutions/serverless-image-handler/pull/425)
20+
- json5 version update to 1.0.2 [#428](https://github.com/aws-solutions/serverless-image-handler/pull/428)
21+
- CodeQL advisory resolutions
22+
- contributing guidelines
23+
824
## [6.1.0] - 2022-11-10
925

1026
### Added

source/constructs/lib/common-resources/common-resources-construct.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export class CommonResources extends Construct {
9191
const applicationType = "AWS-Solutions";
9292

9393
const application = new appreg.Application(stack, "AppRegistry", {
94-
applicationName: Fn.join("-", [props.applicationName, Aws.REGION, Aws.ACCOUNT_ID]),
94+
applicationName: Fn.join("-", ["AppRegistry", Aws.STACK_NAME, Aws.REGION, Aws.ACCOUNT_ID]),
9595
description: `Service Catalog application to track and manage all your resources for the solution ${props.applicationName}`,
9696
});
9797
application.associateStack(stack);
@@ -102,7 +102,7 @@ export class CommonResources extends Construct {
102102
Tags.of(application).add("Solutions:ApplicationType", applicationType);
103103

104104
const attributeGroup = new appreg.AttributeGroup(stack, "DefaultApplicationAttributes", {
105-
attributeGroupName: Aws.STACK_NAME,
105+
attributeGroupName: `AppRegistry-${Aws.STACK_NAME}`,
106106
description: "Attribute group for solution information",
107107
attributes: {
108108
applicationType,

source/constructs/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/constructs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "constructs",
3-
"version": "6.1.0",
3+
"version": "6.1.1",
44
"description": "Serverless Image Handler Constructs",
55
"license": "Apache-2.0",
66
"bin": {

source/constructs/test/__snapshots__/constructs.test.ts.snap

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,10 @@ exports[`Serverless Image Handler Stack Snapshot 1`] = `
332332
"Fn::Join": [
333333
"-",
334334
[
335-
"sih",
335+
"AppRegistry",
336+
{
337+
"Ref": "AWS::StackName",
338+
},
336339
{
337340
"Ref": "AWS::Region",
338341
},
@@ -1936,7 +1939,15 @@ exports[`Serverless Image Handler Stack Snapshot 1`] = `
19361939
},
19371940
"Description": "Attribute group for solution information",
19381941
"Name": {
1939-
"Ref": "AWS::StackName",
1942+
"Fn::Join": [
1943+
"",
1944+
[
1945+
"AppRegistry-",
1946+
{
1947+
"Ref": "AWS::StackName",
1948+
},
1949+
],
1950+
],
19401951
},
19411952
"Tags": {
19421953
"SolutionId": "S0ABC",

source/custom-resource/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ async function checkSecretsManager(
548548
async function checkFallbackImage(
549549
requestProperties: CheckFallbackImageRequestProperties
550550
): Promise<{ Message: string; Data: unknown }> {
551-
const { FallbackImageS3Bucket, FallbackImageS3Key } = requestProperties as CheckFallbackImageRequestProperties;
551+
const { FallbackImageS3Bucket, FallbackImageS3Key } = requestProperties;
552552

553553
if (isNullOrWhiteSpace(FallbackImageS3Bucket)) {
554554
throw new CustomResourceError("S3BucketNotProvided", "You need to provide the default fallback image bucket.");

source/custom-resource/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/custom-resource/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "custom-resource",
3-
"version": "6.1.0",
3+
"version": "6.1.1",
44
"private": true,
55
"description": "Serverless Image Handler custom resource",
66
"license": "Apache-2.0",
@@ -26,4 +26,4 @@
2626
"ts-node": "^10.9.1",
2727
"typescript": "^4.8.4"
2828
}
29-
}
29+
}

source/demo-ui/scripts.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ function importOriginalImage() {
1818
// Assemble the image request
1919
const request = {
2020
bucket: bucketName,
21-
key: encodeURIComponent(keyName)
21+
key: keyName
2222
}
2323
const strRequest = JSON.stringify(request);
24-
const encRequest = btoa(strRequest);
24+
const encRequest = btoa(encodeURIComponent(strRequest).replace(/%([0-9A-F]{2})/g, function(match, p1) {
25+
return String.fromCharCode(parseInt(p1, 16))
26+
}));
27+
2528
// Import the image data into the element
2629
$(`#img-original`)
2730
.attr(`src`, `${appVariables.apiEndpoint}/${encRequest}`)
@@ -77,14 +80,18 @@ function getPreviewImage() {
7780
// Set up the request body
7881
const request = {
7982
bucket: bucketName,
80-
key: encodeURIComponent(keyName),
83+
key: keyName,
8184
edits: _edits
8285
}
8386
if (Object.keys(request.edits).length === 0) { delete request.edits }
8487
console.log(request);
8588
// Setup encoded request
8689
const str = JSON.stringify(request);
87-
const enc = btoa(str);
90+
91+
const enc = btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, p1) {
92+
return String.fromCharCode(parseInt(p1, 16))
93+
}));
94+
8895
// Fill the preview image
8996
$(`#img-preview`).attr(`src`, `${appVariables.apiEndpoint}/${enc}`);
9097
// Fill the request body field

source/image-handler/image-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ export class ImageHandler {
443443
alpha: string,
444444
sourceImageMetadata: sharp.Metadata
445445
): Promise<Buffer> {
446-
const params = { Bucket: bucket, Key: decodeURIComponent(key) };
446+
const params = { Bucket: bucket, Key: key };
447447
try {
448448
const { width, height } = sourceImageMetadata;
449449
const overlayImage: S3.GetObjectOutput = await this.s3Client.getObject(params).promise();

0 commit comments

Comments
 (0)