blacklisted_password 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/blacklisted_password.gemspec +1 -0
- data/config/blacklist_password.rb +1 -0
- data/config/blacklist_password.yml +251 -3
- data/lib/blacklisted_password/password_format.rb +36 -0
- data/lib/blacklisted_password/version.rb +1 -1
- data/lib/blacklisted_password.rb +1 -34
- data/lib/generators/blacklisted/install_generator.rb +13 -0
- metadata +18 -2
- data/lib/generators/blacklisted_password/install_generator.rb +0 -24
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTc4MjQ4ZDgzNGIzOWQ2M2VhZGNkMjRkNTI1Yzk1ZDAxZjQ3NDQyYw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzVjZTQ4MWM1MjIwYTFiNDNlN2U4MmZiZDE4NWFiMjg0ODM5NWRmZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTY4MTUxY2Q3YmIwYTFlNjQwZTQ2OWIxOTg2MDE1MjMzMmIwMThlNzBkMGQ3
|
10
|
+
YWFjNjVmYWJjYzczZGViNjgyOGJmNWE2NGRiNDZiYmJkYzJjNTY1ODQ3ZDRl
|
11
|
+
ODA3ZjE4NDYxMmQxNjdiODZiMmQ1MDE5NWZjYmYzNDU3OWRlZjY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MWM0YTcxODA1MDQ0Yjg4YmZlNGM3YjAxZmQ3MDc2ZTJjNzc1MDk4MmI4OGRm
|
14
|
+
MjU2MWRjYmEwNWQ4OTRhYzc3YWNhZTRjZjIwM2NjN2FkNWIyY2RkMmExMjc5
|
15
|
+
MjZiY2NkMmI2MmFhYWVmNDA3NjA2ZmRkNTgwNzRkYTU5ZTU4NjU=
|
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
+
spec.add_development_dependency "ruby", "~> 1.9"
|
21
22
|
spec.add_development_dependency "bundler", "~> 1.3"
|
22
23
|
spec.add_development_dependency "rake"
|
23
24
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
BLACKLISTED_PASSWORD = Rails.root.join("config/blacklist_password.yml")
|
@@ -1,4 +1,252 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
4r5e
|
3
|
+
5h1t
|
4
|
+
5hit
|
5
|
+
a55
|
6
|
+
anal
|
7
|
+
anus
|
8
|
+
ar5e
|
9
|
+
arrse
|
10
|
+
arse
|
11
|
+
ass
|
12
|
+
ass-fucker
|
13
|
+
asshole
|
14
|
+
asswhole
|
15
|
+
a_s_s
|
16
|
+
b!tch
|
17
|
+
b00bs
|
18
|
+
b17ch
|
19
|
+
b1tch
|
20
|
+
ballbag
|
21
|
+
balls
|
22
|
+
ballsack
|
23
|
+
bastard
|
24
|
+
beastial
|
25
|
+
beastiality
|
26
|
+
bellend
|
27
|
+
bestial
|
28
|
+
bestiality
|
29
|
+
bi+ch
|
30
|
+
biatch
|
31
|
+
bitch
|
32
|
+
bloody
|
33
|
+
boiolas
|
34
|
+
bollock
|
35
|
+
bollok
|
36
|
+
boner
|
37
|
+
buceta
|
38
|
+
bugger
|
39
|
+
bum
|
40
|
+
bunny fucker
|
41
|
+
butt
|
42
|
+
c0ck
|
43
|
+
carpet muncher
|
44
|
+
cawk
|
45
|
+
chink
|
46
|
+
cipa
|
47
|
+
cl1t
|
48
|
+
clit
|
49
|
+
clitoris
|
50
|
+
clits
|
51
|
+
cnut
|
52
|
+
cock
|
53
|
+
cock-sucker
|
54
|
+
cok
|
55
|
+
coon
|
56
|
+
cox
|
57
|
+
crap
|
58
|
+
cum
|
59
|
+
cunilingus
|
60
|
+
cunillingus
|
61
|
+
cunnilingus
|
62
|
+
cunt
|
63
|
+
cyalis
|
64
|
+
cyberfuc
|
65
|
+
cyberfuck
|
66
|
+
d1ck
|
67
|
+
damn
|
68
|
+
dildo
|
69
|
+
dink
|
70
|
+
dirsa
|
71
|
+
dlck
|
72
|
+
dog-fucker
|
73
|
+
doggin
|
74
|
+
donkeyribber
|
75
|
+
doosh
|
76
|
+
duche
|
77
|
+
dyke
|
78
|
+
ejaculate
|
79
|
+
ejaculating
|
80
|
+
ejaculation
|
81
|
+
ejakulate
|
82
|
+
f4nny
|
83
|
+
fag
|
84
|
+
fanny
|
85
|
+
fanyy
|
86
|
+
fatass
|
87
|
+
fcuk
|
88
|
+
feck
|
89
|
+
felching
|
90
|
+
fellate
|
91
|
+
fellatio
|
92
|
+
fingerfuck
|
93
|
+
fistfuck
|
94
|
+
flange
|
95
|
+
fook
|
96
|
+
fuck
|
97
|
+
fudge packer
|
98
|
+
fudgepacker
|
99
|
+
fuk
|
100
|
+
fux
|
101
|
+
fux0r
|
102
|
+
f_u_c_k
|
103
|
+
gangbang
|
104
|
+
gaylord
|
105
|
+
gaysex
|
106
|
+
goatse
|
107
|
+
God
|
108
|
+
god-dam
|
109
|
+
god-damned
|
110
|
+
goddamn
|
111
|
+
goddamned
|
112
|
+
hardcoresex
|
113
|
+
hell
|
114
|
+
heshe
|
115
|
+
hoar
|
116
|
+
hoare
|
117
|
+
hoer
|
118
|
+
homo
|
119
|
+
hore
|
120
|
+
horniest
|
121
|
+
horny
|
122
|
+
hotsex
|
123
|
+
jack-off
|
124
|
+
jackoff
|
125
|
+
jap
|
126
|
+
jerk-off
|
127
|
+
jism
|
128
|
+
jiz
|
129
|
+
kawk
|
130
|
+
knob
|
131
|
+
kock
|
132
|
+
kondum
|
133
|
+
kum
|
134
|
+
kummer
|
135
|
+
kunilingus
|
136
|
+
l3i+ch
|
137
|
+
l3itch
|
138
|
+
labia
|
139
|
+
lmfao
|
140
|
+
lust
|
141
|
+
m0f0
|
142
|
+
m0fo
|
143
|
+
m45terbate
|
144
|
+
ma5terb8
|
145
|
+
ma5terbate
|
146
|
+
masochist
|
147
|
+
master-bate
|
148
|
+
masterb8
|
149
|
+
masterbat
|
150
|
+
mo-fo
|
151
|
+
mof0
|
152
|
+
mofo
|
153
|
+
mothafuck
|
154
|
+
motherfuck
|
155
|
+
motherfuckka
|
156
|
+
muff
|
157
|
+
mutha
|
158
|
+
muthafecker
|
159
|
+
muthafuckker
|
160
|
+
muther
|
161
|
+
mutherfucker
|
162
|
+
n1gga
|
163
|
+
n1gger
|
164
|
+
nazi
|
165
|
+
nigg3r
|
166
|
+
nigg4h
|
167
|
+
nigga
|
168
|
+
nigger
|
169
|
+
nob
|
170
|
+
numbnuts
|
171
|
+
nutsack
|
172
|
+
orgasim
|
173
|
+
orgasm
|
174
|
+
p0rn
|
175
|
+
pawn
|
176
|
+
pecker
|
177
|
+
penis
|
178
|
+
phonesex
|
179
|
+
phuck
|
180
|
+
phuk
|
181
|
+
phuq
|
182
|
+
pigfucker
|
183
|
+
pimpis
|
184
|
+
piss
|
185
|
+
poop
|
186
|
+
porn
|
187
|
+
prick
|
188
|
+
pron
|
189
|
+
pube
|
190
|
+
pusse
|
191
|
+
pussi
|
192
|
+
pussy
|
193
|
+
rectum
|
194
|
+
retard
|
195
|
+
rimjaw
|
196
|
+
rimming
|
197
|
+
s hit
|
198
|
+
s.o.b.
|
199
|
+
sadist
|
200
|
+
schlong
|
201
|
+
screwing
|
202
|
+
scroat
|
203
|
+
scrote
|
204
|
+
scrotum
|
205
|
+
semen
|
206
|
+
sex
|
207
|
+
sh!+
|
208
|
+
sh!t
|
209
|
+
sh1t
|
210
|
+
shag
|
211
|
+
shagger
|
212
|
+
shaggin
|
213
|
+
shagging
|
214
|
+
shemale
|
215
|
+
shi+
|
216
|
+
shit
|
217
|
+
skank
|
218
|
+
slut
|
219
|
+
smegma
|
220
|
+
smut
|
221
|
+
snatch
|
222
|
+
son-of-a-bitch
|
223
|
+
spac
|
224
|
+
spunk
|
225
|
+
s_h_i_t
|
226
|
+
t1tt1e5
|
227
|
+
t1tties
|
228
|
+
teets
|
229
|
+
teez
|
230
|
+
testical
|
231
|
+
testicle
|
232
|
+
tit
|
233
|
+
tosser
|
234
|
+
turd
|
235
|
+
tw4t
|
236
|
+
twat
|
237
|
+
twunt
|
238
|
+
v14gra
|
239
|
+
v1gra
|
240
|
+
vulva
|
241
|
+
w00se
|
242
|
+
wang
|
243
|
+
wank
|
244
|
+
wanker
|
245
|
+
wanky
|
246
|
+
whoar
|
247
|
+
whore
|
248
|
+
willies
|
249
|
+
willy
|
250
|
+
xrated
|
251
|
+
xxx
|
252
|
+
|
@@ -0,0 +1,36 @@
|
|
1
|
+
class BlacklistValidator < ActiveModel::EachValidator
|
2
|
+
def validate_each(record, attribute, value) #This is for blacklisting password
|
3
|
+
password = record.password
|
4
|
+
email = record.email
|
5
|
+
if password.present?
|
6
|
+
array = YAML.load_file(BLACKLISTED_PASSWORD).split(' ')
|
7
|
+
if record.class.column_names.include?('email')
|
8
|
+
email_element = email_spliting(email)
|
9
|
+
array << email_element
|
10
|
+
array.flatten!
|
11
|
+
end
|
12
|
+
password_in_downcase = password.downcase
|
13
|
+
@value = false
|
14
|
+
array.each do |element|
|
15
|
+
reg_string = "#{element}"
|
16
|
+
reg = Regexp.new(reg_string)
|
17
|
+
result = reg.match( password_in_downcase)
|
18
|
+
if result
|
19
|
+
@value ||= true
|
20
|
+
break
|
21
|
+
else
|
22
|
+
@value ||= false
|
23
|
+
end
|
24
|
+
end
|
25
|
+
record.errors.add attribute, "is black listed." if @value
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def email_spliting(email) #This is for possible email splitting
|
30
|
+
character_to_split = ['_','+','@','.']
|
31
|
+
character_to_split.each do |char|
|
32
|
+
email = email.split(char).join("^")
|
33
|
+
end
|
34
|
+
email.split('^')
|
35
|
+
end
|
36
|
+
end
|
data/lib/blacklisted_password.rb
CHANGED
@@ -1,35 +1,2 @@
|
|
1
1
|
require "blacklisted_password/version"
|
2
|
-
|
3
|
-
module BlacklistedPassword
|
4
|
-
|
5
|
-
def blacklist_password #This is for blacklisting password
|
6
|
-
if password.present?
|
7
|
-
array = YAML.load_file(BLACKLISTED_PASSWORD).split(' ')
|
8
|
-
email_element = email_spliting(email)
|
9
|
-
array << email_element
|
10
|
-
array.flatten!
|
11
|
-
password_in_downcase = password.downcase
|
12
|
-
@value = false
|
13
|
-
array.each do |element|
|
14
|
-
reg_string = "#{element}"
|
15
|
-
reg = Regexp.new(reg_string)
|
16
|
-
result = reg.match( password_in_downcase)
|
17
|
-
if result
|
18
|
-
@value ||= true
|
19
|
-
break
|
20
|
-
else
|
21
|
-
@value ||= false
|
22
|
-
end
|
23
|
-
end
|
24
|
-
errors.add :password, "is black listed." if @value
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def email_spliting(email) #This is for possible email splitting
|
29
|
-
character_to_split = ['_','+','@','.']
|
30
|
-
character_to_split.each do |char|
|
31
|
-
email = email.split(char).join("^")
|
32
|
-
end
|
33
|
-
email.split('^')
|
34
|
-
end
|
35
|
-
end
|
2
|
+
require 'blacklisted_password/password_format'
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module Blacklisted
|
4
|
+
class InstallGenerator < Rails::Generators::Base
|
5
|
+
source_root File.expand_path('../../../..', __FILE__)
|
6
|
+
|
7
|
+
def copy_files
|
8
|
+
copy_file "config/blacklist_password.yml", "config/blacklist_password.yml"
|
9
|
+
copy_file "config/blacklist_password.rb", "config/initializers/blacklist_password.rb"
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklisted_password
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tanmay Bagchi
|
@@ -10,6 +10,20 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2014-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: ruby
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.9'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.9'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -51,10 +65,12 @@ files:
|
|
51
65
|
- README.md
|
52
66
|
- Rakefile
|
53
67
|
- blacklisted_password.gemspec
|
68
|
+
- config/blacklist_password.rb
|
54
69
|
- config/blacklist_password.yml
|
55
70
|
- lib/blacklisted_password.rb
|
71
|
+
- lib/blacklisted_password/password_format.rb
|
56
72
|
- lib/blacklisted_password/version.rb
|
57
|
-
- lib/generators/
|
73
|
+
- lib/generators/blacklisted/install_generator.rb
|
58
74
|
homepage: ''
|
59
75
|
licenses:
|
60
76
|
- MIT
|
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'rails/generators/active_record'
|
2
|
-
require 'securerandom'
|
3
|
-
|
4
|
-
module Goldencobra
|
5
|
-
module Generators
|
6
|
-
class InstallGenerator < ActiveRecord::Generators::Base
|
7
|
-
desc "This will create a blacklisted yml file"
|
8
|
-
|
9
|
-
|
10
|
-
def self.source_root
|
11
|
-
File.expand_path("../config", __FILE__)
|
12
|
-
end
|
13
|
-
|
14
|
-
def create_migrations
|
15
|
-
Dir["#{self.class.source_root}/config/*.rb"].sort.each do |filepath|
|
16
|
-
name = File.basename(filepath)
|
17
|
-
template "config/#{name}", "config/#{name}"
|
18
|
-
sleep 1
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|