Skip to content

Commit ac346aa

Browse files
authored
8.0.1 (#629)
1 parent 8719f90 commit ac346aa

File tree

68 files changed

+1351
-396
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1351
-396
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
**/tmp
99
**/out-tsc
1010
.scannerwork
11+
deployment/ecr
12+
deployment/launch-wizard-assets
13+
deployment/ecr_image_tags.json
1114

1215
# dependencies
1316
**/node_modules

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,27 @@ 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+
## [8.0.1] - 2025-12-18
9+
10+
### Security
11+
12+
- Bump `systeminformation` to mitigate [CVE-2025-68154](https://github.com/advisories/GHSA-wphj-fx3q-84ch)
13+
14+
### Added
15+
16+
- Support watermark with policy create/edit on web ui
17+
18+
### Changed
19+
20+
- upgrade lambda runtime to nodejs22 [#628](https://github.com/aws-solutions/dynamic-image-transformation-for-amazon-cloudfront/issues/628)
21+
- refactor log retention to default 10 years with all cw log groups [#620](https://github.com/aws-solutions/dynamic-image-transformation-for-amazon-cloudfront/pull/620)
22+
- fix output quality optimization to use integer values [#622](https://github.com/aws-solutions/dynamic-image-transformation-for-amazon-cloudfront/issues/622)
23+
- pass next token correctly for list policy operation on ui
24+
- move auto format selection to CF function and refactor `dit-accept` header normalization to improve cache hit
25+
- corrected auto-optimization logic for static optimization configuration
26+
- use dynamodb local image from public ecr for integration tests
27+
- fix backtracking prone regex in data-models
28+
829
## [8.0.0] - 2025-11-17
930

1031
### Added

NOTICE

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,8 @@ dit-container under the Apache-2.0 license.
10541054
dom-accessibility-api under the MIT license.
10551055
dom-helpers under the MIT license.
10561056
amazon/dynamodb-local under the DynamoDB Local License Agreement license.
1057-
dynamodb-local under the DynamoDB Local License Agreement license.
1057+
aws-dynamodb-local/aws-dynamodb-local under the DynamoDB Local License Agreement license.
1058+
dynamodb-local-patched under the DynamoDB Local License Agreement license.
10581059
eastasianwidth under the MIT license.
10591060
ee-first under the MIT license.
10601061
encode-utf8 under the MIT license.
@@ -1373,6 +1374,44 @@ tweetnacl under the Unlicense license.
13731374
untildify under the MIT license.
13741375
verror under the MIT license.
13751376
yauzl under the MIT license.
1377+
node-addon-api under the MIT license.
1378+
prebuild-install under the MIT license.
1379+
tar-fs under the MIT license.
1380+
chownr under the ISC license.
1381+
mkdirp-classic under the MIT license.
1382+
tar-stream under the MIT license.
1383+
bl under the MIT license.
1384+
fs-constants under the MIT license.
1385+
expand-template under the MIT license.
1386+
github-from-package under the MIT license.
1387+
napi-build-utils under the MIT license.
1388+
node-abi under the MIT license.
1389+
rc under the Apache-2.0 license.
1390+
deep-extend under the MIT license.
1391+
simple-get under the MIT license.
1392+
decompress-response under the MIT license.
1393+
mimic-response under the MIT license.
1394+
simple-concat under the MIT license.
1395+
b4a under the ISC license.
1396+
fast-fifo under the MIT license.
1397+
streamx under the MIT license.
1398+
text-decoder under the Apache-2.0 license.
1399+
bare-events under the Apache-2.0 license.
1400+
bare-fs under the Apache-2.0 license.
1401+
bare-path under the Apache-2.0 license.
1402+
bare-os under the Apache-2.0 license.
1403+
bare-stream under the Apache-2.0 license.
1404+
sqlite4java/sqlite4java under the Apache-2.0 license.
1405+
reactive-streams/reactive-streams under the MIT license.
1406+
partiql-lang-kotlin/partiql-lang-kotlin under the Apache-2.0 license.
1407+
partiql-ir-generator-runtime/partiql-ir-generator-runtime under the Apache-2.0 license.
1408+
kotlin-stdlib-jdk8/kotlin-stdlib-jdk8 under the Apache-2.0 license.
1409+
kotlin-stdlib-jdk7/kotlin-stdlib-jdk7 under the Apache-2.0 license.
1410+
kotlin-stdlib-common/kotlin-stdlib-common under the Apache-2.0 license.
1411+
kotlin-stdlib/kotlin-stdlib under the Apache-2.0 license.
1412+
ion-element/ion-element under the Apache-2.0 license.
1413+
checker-qual/checker-qual under the MIT license.
1414+
com.amazon.ion.java/IonJava under the Apache-2.0 license.
13761415

13771416
********************
13781417
OPEN SOURCE LICENSES

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.0.0
1+
8.0.1

deployment/build-s3-dist.sh

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ mkdir -p "$template_dist_dir"
3232
rm -rf "$build_dist_dir"
3333
mkdir -p "$build_dist_dir"
3434

35-
headline "[Init] Ensure package versions are updated"
36-
npm --prefix "$source_dir" run bump-version
37-
3835
headline "[Build] Synthesize cdk template and assets"
3936
cd "$cdk_source_dir"
4037
npm run clean:install
@@ -81,3 +78,49 @@ cat > "$deployment_dir/ecr_image_tags.json" << EOF
8178
"dynamic-image-transformation-for-amazon-cloudfront": "v8.0-stable"
8279
}
8380
EOF
81+
82+
echo "------------------------------------------------------------------------------"
83+
echo "[Packing] Launch Wizard Assets"
84+
echo "------------------------------------------------------------------------------"
85+
86+
launch_wizard_base_dir="$deployment_dir/launch-wizard-assets"
87+
88+
# Package ECS deployment versions
89+
if [ -d "${launch_wizard_base_dir}/ecs-deployment" ]; then
90+
for version_dir in "${launch_wizard_base_dir}/ecs-deployment"/*; do
91+
if [ -d "$version_dir" ]; then
92+
version_name=$(basename "$version_dir")
93+
echo "Processing ECS deployment version: ${version_name}"
94+
95+
if [ -d "${version_dir}/helpPanels" ]; then
96+
cd "${version_dir}/helpPanels"
97+
zip -q -r9 "${version_dir}/helpPanels.zip" .
98+
echo "Created helpPanels.zip for ECS version ${version_name}"
99+
else
100+
echo "helpPanels directory not found for ECS version ${version_name}, skipping..."
101+
fi
102+
fi
103+
done
104+
else
105+
echo "Launch wizard ECS deployment directory not found, skipping..."
106+
fi
107+
108+
# Package Lambda deployment versions
109+
if [ -d "${launch_wizard_base_dir}/lambda-deployment" ]; then
110+
for version_dir in "${launch_wizard_base_dir}/lambda-deployment"/*; do
111+
if [ -d "$version_dir" ]; then
112+
version_name=$(basename "$version_dir")
113+
echo "Processing Lambda deployment version: ${version_name}"
114+
115+
if [ -d "${version_dir}/helpPanels" ]; then
116+
cd "${version_dir}/helpPanels"
117+
zip -q -r9 "${version_dir}/helpPanels.zip" .
118+
echo "Created helpPanels.zip for Lambda version ${version_name}"
119+
else
120+
echo "helpPanels directory not found for Lambda version ${version_name}, skipping..."
121+
fi
122+
fi
123+
done
124+
else
125+
echo "Launch wizard Lambda deployment directory not found, skipping..."
126+
fi

source/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ RUN dnf update -y && \
1010
rm -rf /var/cache/dnf
1111

1212
# Copy workspace configuration
13-
COPY package.json package-lock.json* ./
13+
COPY package.json package-lock.json ./
1414
COPY container/package.json ./container/
1515
COPY data-models/package.json ./data-models/
1616

@@ -39,7 +39,7 @@ RUN dnf update -y && \
3939
rm -rf /var/cache/dnf
4040

4141
# Install production dependencies with workspace structure
42-
COPY package.json package-lock.json* ./
42+
COPY package.json package-lock.json ./
4343
COPY container/package.json ./container/
4444
COPY data-models/ ./data-models/
4545
RUN npm ci --workspaces --omit=dev --no-audit --no-fund && \

source/admin-ui/package-lock.json

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

source/admin-ui/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "admin-ui-dynamic-image-transformation-for-amazon-cloudfront",
3-
"version": "8.0.0",
43
"description": "Admin UI - Dynamic Image Transformation for Amazon CloudFront",
54
"author": {
65
"name": "Amazon Web Services",
Lines changed: 86 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,110 @@
11
import { describe, it, expect, vi } from 'vitest';
2-
import { screen } from '@testing-library/react';
2+
import { screen, fireEvent, waitFor } from '@testing-library/react';
33
import { render } from '../test-utils';
44
import { OutputConfigModal } from '../../components/outputTransformations/OutputConfigModal';
55

6-
const mockOutputOption = {
7-
type: 'quality',
8-
name: 'Quality Optimization',
9-
description: 'Optimize image quality'
6+
const mockQualityOutputOption = {
7+
id: 'quality',
8+
title: 'Quality Optimization',
9+
description: 'Optimize image quality based on device pixel ratio'
10+
};
11+
12+
const mockFormatOutputOption = {
13+
id: 'format',
14+
title: 'Format Optimization',
15+
description: 'Optimize image format'
1016
};
1117

1218
describe('OutputConfigModal', () => {
19+
const defaultProps = {
20+
visible: true,
21+
onDismiss: vi.fn(),
22+
onBack: vi.fn(),
23+
onAdd: vi.fn(),
24+
output: null,
25+
editingOutput: undefined
26+
};
27+
28+
beforeEach(() => {
29+
vi.clearAllMocks();
30+
});
31+
1332
it('should not render when not visible', () => {
1433
render(
1534
<OutputConfigModal
35+
{...defaultProps}
1636
visible={false}
17-
outputOption={mockOutputOption}
18-
onDismiss={vi.fn()}
19-
onSave={vi.fn()}
37+
output={mockQualityOutputOption}
2038
/>
2139
);
2240

23-
expect(screen.queryByText(/Configure/)).not.toBeInTheDocument();
41+
// Check that modal dialog has hidden class when visible=false
42+
const dialog = screen.queryByRole('dialog');
43+
expect(dialog?.className).toMatch(/awsui_hidden/);
2444
});
2545

2646
it('should render basic modal structure when visible', () => {
2747
render(
2848
<OutputConfigModal
29-
visible={true}
30-
outputOption={mockOutputOption}
31-
onDismiss={vi.fn()}
32-
onSave={vi.fn()}
49+
{...defaultProps}
50+
output={mockQualityOutputOption}
3351
/>
3452
);
3553

36-
// Just check that something renders when visible
37-
expect(document.body).toBeInTheDocument();
54+
expect(screen.getByText(/Add Output - Step 2 of 2/)).toBeInTheDocument();
55+
expect(screen.getByText('Quality Optimization')).toBeInTheDocument();
56+
});
57+
58+
describe('Quality Integer Fix Tests', () => {
59+
it('should generate quality config with integer values for DPR rules', async () => {
60+
const mockOnAdd = vi.fn();
61+
render(<OutputConfigModal {...defaultProps} output={mockQualityOutputOption} onAdd={mockOnAdd} />);
62+
63+
fireEvent.change(screen.getByLabelText(/Default Quality/), { target: { value: '80' } });
64+
65+
fireEvent.click(screen.getByText('Add DPR Rule'));
66+
fireEvent.change(screen.getAllByLabelText(/DPR Range/)[0], { target: { value: '1-1.5' } });
67+
fireEvent.change(screen.getAllByLabelText(/Quality/)[1], { target: { value: '60' } });
68+
69+
fireEvent.click(screen.getByText('Add DPR Rule'));
70+
fireEvent.change(screen.getAllByLabelText(/DPR Range/)[1], { target: { value: '2+' } });
71+
fireEvent.change(screen.getAllByLabelText(/Quality/)[2], { target: { value: '90' } });
72+
73+
fireEvent.click(screen.getByText('Add to Policy'));
74+
75+
await waitFor(() => {
76+
expect(mockOnAdd).toHaveBeenCalledWith({
77+
type: 'quality',
78+
value: [80, [1, 1.5, 60], [2, 999, 90]]
79+
});
80+
});
81+
});
82+
83+
it('should validate quality values are within 1-100 range', async () => {
84+
render(<OutputConfigModal {...defaultProps} output={mockQualityOutputOption} />);
85+
86+
fireEvent.click(screen.getByText('Add DPR Rule'));
87+
const qualityInput = screen.getAllByLabelText(/Quality/)[1];
88+
fireEvent.change(qualityInput, { target: { value: '150' } });
89+
fireEvent.blur(qualityInput);
90+
91+
await waitFor(() => {
92+
expect(screen.getByText(/Quality must be between 1 and 100/)).toBeInTheDocument();
93+
});
94+
});
95+
});
96+
97+
describe('Other Output Types', () => {
98+
it('should handle format output configuration', () => {
99+
render(
100+
<OutputConfigModal
101+
{...defaultProps}
102+
output={mockFormatOutputOption}
103+
/>
104+
);
105+
106+
expect(screen.getByText('Format Optimization')).toBeInTheDocument();
107+
expect(screen.getByText(/Format Selection/)).toBeInTheDocument();
108+
});
38109
});
39110
});

source/admin-ui/src/__tests__/services/transformationPolicyService.test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,27 @@ describe('TransformationPolicyService', () => {
5151
expect(result.success).toBe(true);
5252
expect(result.data).toHaveProperty('items');
5353
});
54+
55+
it('should pass nextToken correctly as query parameter in API request', async () => {
56+
// Create spy and subscribe to msw event loop
57+
const requestSpy = vi.fn();
58+
server.events.on('request:start', requestSpy);
59+
60+
await TransformationPolicyService.list({ nextToken: 'token123' });
61+
62+
// Validating network call for list api intercepted by msw server
63+
expect(requestSpy).toHaveBeenCalledTimes(1);
64+
65+
// vitest stores arguments in mock.calls
66+
// The first call's first argument ({ request })
67+
const { request } = requestSpy.mock.calls[0][0];
68+
const urlObject = new URL(request.url);
69+
70+
expect(urlObject.searchParams.get('nextToken')).toBe('token123');
71+
72+
// Cleanup
73+
server.events.removeListener('request:start', requestSpy);
74+
});
5475
});
5576

5677
describe('get', () => {

0 commit comments

Comments
 (0)