@@ -110,7 +110,6 @@ fn check_stalled_update_downloads(conn: &PgConnection) -> Result<()> {
110
110
fn check_spam_attack ( conn : & PgConnection ) -> Result < ( ) > {
111
111
use cargo_registry:: models:: krate:: canon_crate_name;
112
112
use diesel:: dsl:: * ;
113
- use diesel:: sql_types:: Bool ;
114
113
115
114
const EVENT_KEY : & str = "spam_attack" ;
116
115
@@ -121,11 +120,6 @@ fn check_spam_attack(conn: &PgConnection) -> Result<()> {
121
120
. as_ref ( )
122
121
. map ( |s| s. split ( ',' ) . collect ( ) )
123
122
. unwrap_or_default ( ) ;
124
- let bad_author_patterns = dotenv:: var ( "SPAM_AUTHOR_PATTERNS" ) ;
125
- let bad_author_patterns: Vec < _ > = bad_author_patterns
126
- . as_ref ( )
127
- . map ( |s| s. split ( ',' ) . collect ( ) )
128
- . unwrap_or_default ( ) ;
129
123
130
124
let mut event_description = None ;
131
125
@@ -139,19 +133,6 @@ fn check_spam_attack(conn: &PgConnection) -> Result<()> {
139
133
event_description = Some ( format ! ( "Crate named {} published" , bad_crate) ) ;
140
134
}
141
135
142
- let mut query = version_authors:: table
143
- . select ( version_authors:: name)
144
- . filter ( false . into_sql :: < Bool > ( ) ) // Never return anything if we have no patterns
145
- . into_boxed ( ) ;
146
- for author_pattern in bad_author_patterns {
147
- query = query. or_filter ( version_authors:: name. like ( author_pattern) ) ;
148
- }
149
- let bad_author: Option < String > = query. first ( conn) . optional ( ) ?;
150
-
151
- if let Some ( bad_author) = bad_author {
152
- event_description = Some ( format ! ( "Crate with author {} published" , bad_author) ) ;
153
- }
154
-
155
136
let event = if let Some ( event_description) = event_description {
156
137
on_call:: Event :: Trigger {
157
138
incident_key : Some ( EVENT_KEY . into ( ) ) ,
0 commit comments