Firestore 보안 규칙 · 테스트 브랜드 표기 FANUZU 적용

This commit is contained in:
Sn-Kinos
2026-08-13 23:07:54 +09:00
parent 78ef31696d
commit 832cb88c30
3 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
rules_version = '2'; rules_version = '2';
// Fancake — Firestore 보안 규칙 (2주차 설계본 v0.1) // FANUZU — Firestore 보안 규칙 (2주차 설계본 v0.1)
// //
// 근거 // 근거
// - wireframe/handoff/rbac-summary.md 역할 3종 · 운영자 등급 3단계(D-18) // - wireframe/handoff/rbac-summary.md 역할 3종 · 운영자 등급 3단계(D-18)
@@ -381,7 +381,7 @@ service cloud.firestore {
match /posts/{postId} { match /posts/{postId} {
allow read: if signedIn(); allow read: if signedIn();
// 교차검증 F-05 — 예전에는 authorUid·likeCount·visibility 3개만 봐서 // 교차검증 F-05 — 예전에는 authorUid·likeCount·visibility 3개만 봐서
// ① authorName 을 "Fancake 운영팀"으로 적어 사칭 ② commentCount 위조 // ① authorName 을 "FANUZU 운영팀"으로 적어 사칭 ② commentCount 위조
// ③ 소속하지 않은 팬덤 피드에 글 삽입이 가능했다. 화이트리스트 + 원본 대조로 닫는다. // ③ 소속하지 않은 팬덤 피드에 글 삽입이 가능했다. 화이트리스트 + 원본 대조로 닫는다.
allow create: if authorIsSelf() allow create: if authorIsSelf()
&& request.resource.data.keys().hasOnly([ && request.resource.data.keys().hasOnly([
@@ -326,7 +326,7 @@ describe('F-05 — 작성자 표시명 사칭 회귀', () => {
setDoc(doc(dbFor('alice'), 'posts/forged'), { setDoc(doc(dbFor('alice'), 'posts/forged'), {
fandomId: 'fandom-a', fandomId: 'fandom-a',
authorUid: 'alice', authorUid: 'alice',
authorName: 'Fancake 운영팀', authorName: 'FANUZU 운영팀',
body: 'forged', body: 'forged',
imageUrls: [], imageUrls: [],
likeCount: 0, likeCount: 0,
@@ -342,7 +342,7 @@ describe('F-05 — 작성자 표시명 사칭 회귀', () => {
await assertFails( await assertFails(
setDoc(doc(dbFor('alice'), 'posts/post-1/comments/forged'), { setDoc(doc(dbFor('alice'), 'posts/post-1/comments/forged'), {
authorUid: 'alice', authorUid: 'alice',
authorName: 'Fancake 운영팀', authorName: 'FANUZU 운영팀',
body: 'forged', body: 'forged',
visibility: 'visible', visibility: 'visible',
createdAt: '2026-08-08T00:00:00Z', createdAt: '2026-08-08T00:00:00Z',
@@ -355,7 +355,7 @@ describe('F-05 — 작성자 표시명 사칭 회귀', () => {
await assertFails( await assertFails(
setDoc(doc(dbFor('alice'), 'questions/question-1/answers/forged'), { setDoc(doc(dbFor('alice'), 'questions/question-1/answers/forged'), {
authorUid: 'alice', authorUid: 'alice',
authorName: 'Fancake 운영팀', authorName: 'FANUZU 운영팀',
body: 'forged', body: 'forged',
sourceUrls: [], sourceUrls: [],
accepted: false, accepted: false,
+1 -1
View File
@@ -19,7 +19,7 @@ void main() {
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(tester.takeException(), isNull); expect(tester.takeException(), isNull);
expect(find.text('Fancake'), findsOneWidget); expect(find.text('FANUZU'), findsOneWidget);
// 시안 S-A-LOGIN 의 소셜 버튼 4종이 라벨 그대로 있다. // 시안 S-A-LOGIN 의 소셜 버튼 4종이 라벨 그대로 있다.
for (final provider in SocialProvider.values) { for (final provider in SocialProvider.values) {
expect(find.text(provider.label), findsOneWidget, reason: provider.name); expect(find.text(provider.label), findsOneWidget, reason: provider.name);