Skip to content
Closed
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
### Added
- ๋‹ค์ค‘ ํŒŒ์ผ ์—…๋กœ๋“œ ์„ ํƒ ์‹œ ์ฆ‰๊ฐ์ ์ธ ํŒŒ์ผ ๊ฐœ์ˆ˜ ํ”ผ๋“œ๋ฐฑ ๋ฐ ์ œํ•œ ์ดˆ๊ณผ ๊ฒฝ๊ณ  ๋ฉ”์‹œ์ง€ ์ถ”๊ฐ€
- ์ผ๊ด„ ์—…๋กœ๋“œ ํผ์— ๋Œ€์ƒ ๋ฐ”์ดํŠธ ํ”„๋ฆฌ์…‹ ๋ฒ„ํŠผ๊ณผ ์ด ํŒŒ์ผ ํฌ๊ธฐ ๋ฏธ๋ฆฌ๋ณด๊ธฐ๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ ์‚ฌ์šฉ์„ฑ์„ ๊ฐœ์„ ํ–ˆ์Šต๋‹ˆ๋‹ค.

## [Unreleased]
- ๐ŸŽจ Palette: `saas_web.py`์˜ `target_bytes` ์ž…๋ ฅ ํ•„๋“œ์— 5GiB ์ตœ๋Œ€ ํฌ๊ธฐ ์ œํ•œ(`max` ์†์„ฑ)๊ณผ ์ฆ‰๊ฐ์ ์ธ ํด๋ผ์ด์–ธํŠธ ์ธก ์ธ๋ผ์ธ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ๋ฐ `aria-invalid` ์ƒํƒœ ์—…๋ฐ์ดํŠธ๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ ์‚ฌ์šฉ์ž ๊ฒฝํ—˜์„ ๊ฐœ์„ ํ–ˆ์Šต๋‹ˆ๋‹ค.
15 changes: 13 additions & 2 deletions saas_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ async def add_security_headers(request: Request, call_next):
</p>
<p>
<label for="target_bytes">Target Bytes: <span class="required-star" aria-hidden="true">*</span></label><br>
<input type="number" id="target_bytes" name="target_bytes" value="2000000000" min="1" aria-describedby="target_bytes_help target_bytes_preview" required>
<input type="number" id="target_bytes" name="target_bytes" value="2000000000" min="1" max="5368709120" aria-describedby="target_bytes_help target_bytes_preview" required>
<br><span id="target_bytes_help" class="help-text">Maximum allowed file size in bytes (e.g., 2000000000 for ~1.86 GiB)</span>
<br><span id="target_bytes_preview" class="help-text" aria-live="polite" style="font-weight: bold; color: #1e7e34;">1.86 GiB</span>
<div id="preset_buttons_container" class="preset-container" role="group" aria-label="Preset target sizes">
Expand All @@ -192,6 +192,7 @@ async def add_security_headers(request: Request, call_next):
</form>
<script>
const MAX_UPLOAD_BYTES = 5 * 1024 * 1024 * 1024;
const MAX_TARGET_BYTES = 5 * 1024 * 1024 * 1024;
function formatBinaryBytes(value) {
const units = ['B', 'KiB', 'MiB', 'GiB'];
let size = value;
Expand Down Expand Up @@ -260,6 +261,11 @@ async def add_security_headers(request: Request, call_next):
preview.style.color = '#dc3545';
this.setCustomValidity('Must be greater than 0.');
this.setAttribute('aria-invalid', 'true');
} else if (val > MAX_TARGET_BYTES) {
preview.innerText = 'Exceeds the maximum allowed size (5 GiB).';
preview.style.color = '#dc3545';
this.setCustomValidity('Exceeds the maximum allowed size (5 GiB).');
this.setAttribute('aria-invalid', 'true');
} else {
preview.innerText = formatBinaryBytes(val);
}
Expand Down Expand Up @@ -287,6 +293,11 @@ async def add_security_headers(request: Request, call_next):
preview.style.color = '#dc3545';
this.setCustomValidity('Must be greater than 0.');
this.setAttribute('aria-invalid', 'true');
} else if (val > MAX_TARGET_BYTES) {
preview.innerText = 'Exceeds the maximum allowed size (5 GiB).';
preview.style.color = '#dc3545';
this.setCustomValidity('Exceeds the maximum allowed size (5 GiB).');
this.setAttribute('aria-invalid', 'true');
} else {
preview.innerText = formatBinaryBytes(val);
}
Expand Down Expand Up @@ -392,7 +403,7 @@ async def add_security_headers(request: Request, call_next):
</p>
<p>
<label for="batch_target_bytes">Target Bytes (per file): <span class="required-star" aria-hidden="true">*</span></label><br>
<input type="number" id="batch_target_bytes" name="target_bytes" value="2000000000" min="1" aria-describedby="batch_target_bytes_help batch_target_bytes_preview" required>
<input type="number" id="batch_target_bytes" name="target_bytes" value="2000000000" min="1" max="5368709120" aria-describedby="batch_target_bytes_help batch_target_bytes_preview" required>
<br><span id="batch_target_bytes_help" class="help-text">Maximum allowed size in bytes for each output file</span>
<br><span id="batch_target_bytes_preview" class="help-text" aria-live="polite" style="font-weight: bold; color: #1e7e34;">1.86 GiB</span>
<div id="batch_preset_buttons_container" class="preset-container" role="group" aria-label="Preset target sizes for batch">
Expand Down
Loading