1. Presigned URL์ ๋ง๋ฃ ๋ฉ์ปค๋์ฆ
์ต๊ทผ ์ด๋ฏธ์ง ํ๋ฆฌ๋ก๋ฉ ๊ธฐ๋ฅ์ ๊ตฌํํ๋ฉด์ 403 Forbidden ์๋ฌ๋ฅผ ๋ง๋ฌ๋ค. S3์์ ๋ฐ๊ธ๋ฐ์ Presigned URL๋ก ์ด๋ฏธ์ง๋ฅผ ๋ฏธ๋ฆฌ ํ๋ฆฌ๋ก๋ํด ๋์๋๋ฐ, ํ๋ฉด์์ ์ค์ ๋ก ํ์ํ๋ ค๋ ์์ ์ URL์ด ๋ง๋ฃ๋์ด ์์๋ ๊ฒ์ด๋ค. Presigned URL์ ๋ณดํต ๋ค์ ๋ ๊ฐ์ง ๋ฐฉ์ ์ค ํ๋๋ก ๋ง๋ฃ ์๊ฐ ์ ๋ณด๋ฅผ ๋ด๊ณ ์์๊ณ , ์ด ์ ๋ณด๋ฅผ ์ด์ฉํด URL์ ๋ง๋ฃ ์๊ฐ์ ๊ณ์ฐํ๋ ๊ฐ๋จํ ํจ์๋ฅผ ๋ง๋ค์๋ค.
- Azure: se ํ๋ผ๋ฏธํฐ์ ๋ง๋ฃ ์๊ฐ์ด ์ง์ ๋ช ์
- AWS / GCP: ๋ฐ๊ธ ์๊ฐ๊ณผ ์ ํจ๊ธฐ๊ฐ์ ํฉ์ผ๋ก ๊ณ์ฐ
function getExpiryFromPresignedUrl(urlStr: string): number | undefined {
const url = new URL(urlStr);
// Azure: ๋ง๋ฃ ์๊ฐ์ด ์ง์ ๋ช
์๋จ
const se = url.searchParams.get('se');
if (se) {
return new Date(se).getTime();
}
// AWS/GCP: ๋ฐ๊ธ ์๊ฐ + ์ ํจ๊ธฐ๊ฐ์ผ๋ก ๊ณ์ฐ
const date = url.searchParams.get('X-Amz-Date') || url.searchParams.get('X-Goog-Date');
const expires = url.searchParams.get('X-Amz-Expires') || url.searchParams.get('X-Goog-Expires');
if (date && expires) {
const issuedAt = parseAmzDate(date);
return issuedAt + Number(expires) * 1000;
}
return undefined;
}
function parseAmzDate(dateStr: string): number {
// Format: 20251025T143000Z
const year = dateStr.slice(0, 4);
const month = dateStr.slice(4, 6);
const day = dateStr.slice(6, 8);
const hour = dateStr.slice(9, 11);
const minute = dateStr.slice(11, 13);
const second = dateStr.slice(13, 15);
return Date.UTC(
parseInt(year),
parseInt(month) - 1,
parseInt(day),
parseInt(hour),
parseInt(minute),
parseInt(second)
);
}
์ด๋ ๊ฒ ๊ณ์ฐ๋ ๋ง๋ฃ ์๊ฐ์ ๊ธฐ๋ฐ์ผ๋ก, ๋ง๋ฃ๊ฐ ์๋ฐํ URL์ ๋ฏธ๋ฆฌ ์ฌ์์ฒญํ๋๋ก ํด์ 403 ์๋ฌ๋ฅผ ํด๊ฒฐํ ์ ์์๋ค.
2. @starting-style
@starting-style์ ์ ๋๋ฉ์ด์ ์ด ์์๋ ๋ ์ด๊ธฐ ์ํ๋ฅผ ๋ช ์์ ์ผ๋ก ์ง์ ํ๋ ๊ท์น์ด๋ค. ๊ธฐ์กด์๋ ํธ๋์ง์ ์ด ์์๋๊ธฐ ์ ์ํ๋ฅผ ๋ธ๋ผ์ฐ์ ๊ฐ ์ถ๋ก ํ๊ธฐ ๋๋ฌธ์ ์ด๊ธฐ ๋ ๋ ์ ๊น๋นก์์ด ์๊ธฐ๋ ๊ฒฝ์ฐ๊ฐ ์์๋๋ฐ, ํด๋น ๋ถ๋ถ์ ์ ์ดํ ์ ์๋ค.
.dialog {
transition: opacity 0.3s;
opacity: 1;
}
@starting-style {
.dialog {
opacity: 0;
}
}'๐ WIL' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| Framer Motion์ผ๋ก ๋ณธ Rotating Text ๋ ์ด์์ ์ฒ๋ฆฌ ๋ฐฉ์ (0) | 2025.11.16 |
|---|---|
| ๋์์ธ ํ ํฐ ์ค๋ณต ์์ ๊ธฐ (0) | 2025.11.08 |
| ์ด๋ฏธ์ง ํ๋ฆฌ๋ก๋ฉ์ ๊ตฌํํ๋ฉฐ ์๊ฒ ๋ ๊ฒ๋ค (4) | 2025.10.25 |
| @property (1) | 2025.10.18 |
| i18next-parser ์ฌ์ฉํด์ ๋ฒ์ญ ํ๋ก์ธ์ค ๊ฐ์ ํ๊ธฐ (2) | 2025.09.20 |