From 281edd9a5215d8fe52464effc9d57511d325048b Mon Sep 17 00:00:00 2001 From: gahusb Date: Thu, 11 Jun 2026 01:29:23 +0900 Subject: [PATCH] =?UTF-8?q?fix(visibility):=20=EA=B8=B0=EC=A1=B4=20?= =?UTF-8?q?=EC=8B=9C=EB=93=9C=20=ED=96=89=EB=8F=84=20=EC=88=A8=EA=B9=80=20?= =?UTF-8?q?=EA=B0=B1=EC=8B=A0=EB=90=98=EB=8F=84=EB=A1=9D=20DO=20UPDATE=20+?= =?UTF-8?q?=20=EC=9E=AC=EC=82=AC=EC=9A=A9=20=EA=B2=BD=EA=B3=A0=20JSDoc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- lib/service-visibility.ts | 2 ++ supabase/migrations/2026-06-11-hide-legacy-services.sql | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/service-visibility.ts b/lib/service-visibility.ts index 3b2d8f2..fc0e687 100644 --- a/lib/service-visibility.ts +++ b/lib/service-visibility.ts @@ -8,6 +8,8 @@ export type HideableService = 'saju' | 'music' | 'gyeol' | 'packages' | 'lotto'; /** * 서비스 노출 여부. admin_token 세션이면 항상 true. * service_settings 조회 실패(테이블 미생성 등) 시 안전하게 숨김(false). + * @warning 레거시 숨김 전용 — 일반 공개 서비스(products 등) 가드에 재사용 금지. + * fail-closed 정책이라 DB 일시 장애 시 404가 됨. 캐싱 없음(매 렌더 DB 조회). */ export async function isServiceVisible(id: HideableService): Promise { const cookieStore = await cookies(); diff --git a/supabase/migrations/2026-06-11-hide-legacy-services.sql b/supabase/migrations/2026-06-11-hide-legacy-services.sql index a759a7b..758029e 100644 --- a/supabase/migrations/2026-06-11-hide-legacy-services.sql +++ b/supabase/migrations/2026-06-11-hide-legacy-services.sql @@ -1,5 +1,5 @@ -- 2026-06-11 리뉴얼: 레거시 서비스 숨김 토글 시드 --- service_settings: 신규 id 추가 (이미 있으면 무시) — 멱등 +-- service_settings: 이미 있으면 숨김 상태로 갱신 (2026-06 리뉴얼 의도 강제) — 멱등 INSERT INTO service_settings (id, name, description, is_active, order_index) VALUES ('saju', 'AI 사주 분석', '사주 입력 및 AI 해석 (레거시)', false, 101), @@ -7,4 +7,9 @@ VALUES ('gyeol', 'CONTOUR 설문', '/gyeol PMF 설문', false, 103), ('packages', 'SaaS 제품 허브(구)', '구 /packages 페이지', false, 104), ('lotto', '로또 추천', '로또 번호 추천 노출', false, 105) -ON CONFLICT (id) DO NOTHING; +ON CONFLICT (id) DO UPDATE SET + is_active = EXCLUDED.is_active, + name = EXCLUDED.name, + description = EXCLUDED.description, + order_index = EXCLUDED.order_index, + updated_at = now();