File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 11import type { Doc } from '../_generated/dataModel'
22
33const FLAG_RULES : Array < { flag : string ; pattern : RegExp } > = [
4+ // Known-bad / known-suspicious identifiers.
5+ // NOTE: keep these narrowly scoped; use staff review to confirm removals.
6+ { flag : 'blocked.malware' , pattern : / ( k e e p c o l d 1 3 1 \/ C l a w d A u t h e n t i c a t o r T o o l | C l a w d A u t h e n t i c a t o r T o o l ) / i } ,
7+
48 { flag : 'suspicious.keyword' , pattern : / ( m a l w a r e | s t e a l e r | p h i s h | p h i s h i n g | k e y l o g g e r ) / i } ,
59 { flag : 'suspicious.secrets' , pattern : / ( a p i [ - _ ] ? k e y | t o k e n | p a s s w o r d | p r i v a t e k e y | s e c r e t ) / i } ,
610 { flag : 'suspicious.crypto' , pattern : / ( w a l l e t | s e e d p h r a s e | m n e m o n i c | c r y p t o ) / i } ,
Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ export function toPublicUser(user: Doc<'users'> | null | undefined): PublicUser
5353
5454export function toPublicSkill ( skill : Doc < 'skills' > | null | undefined ) : PublicSkill | null {
5555 if ( ! skill || skill . softDeletedAt ) return null
56+ if ( skill . moderationStatus && skill . moderationStatus !== 'active' ) return null
57+ if ( skill . moderationFlags ?. includes ( 'blocked.malware' ) ) return null
5658 return {
5759 _id : skill . _id ,
5860 _creationTime : skill . _creationTime ,
@@ -73,6 +75,8 @@ export function toPublicSkill(skill: Doc<'skills'> | null | undefined): PublicSk
7375
7476export function toPublicSoul ( soul : Doc < 'souls' > | null | undefined ) : PublicSoul | null {
7577 if ( ! soul || soul . softDeletedAt ) return null
78+ if ( soul . moderationStatus && soul . moderationStatus !== 'active' ) return null
79+ if ( soul . moderationFlags ?. includes ( 'blocked.malware' ) ) return null
7680 return {
7781 _id : soul . _id ,
7882 _creationTime : soul . _creationTime ,
You can’t perform that action at this time.
0 commit comments