blacklisted_password 0.1.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/README.md +8 -29
- data/lib/blacklisted_password/password_format.rb +8 -4
- data/lib/blacklisted_password/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZmI5NTllMDk4ZDU3ZDI3YTA5NWQ1OTI0M2JhOGUxMzlhYjYwZDFjZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDNhNWQxMWI0Y2YyMGEzYjlmY2M3OTEyM2QxYWJhMzc1NGNhYWFkNw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YWY5MjhjMDg3NjNmMWVjNWU1MzVkMTMyMTIzOGZiYWJlNTM4MzA1ZmVmZjk4
|
10
|
+
MTkxNDI0ZGFkZTNmMWFmZTkzOGVlYzc0MTNjZjgwYjg5MDRmZDg0OWZkMDYy
|
11
|
+
ODg2YWIzZDkzMmE2ZDUzZGU5ZTY5ZGYwYTZjMzhiMjdhZjhhZTY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTgzMTlmOWJhOGFiMGNhYTU2NWNlZjQzZjJiMDczZTViYjRlYzNjOTFkZjg5
|
14
|
+
MTZmNGY1MzViMjBiNDQ4YTcxMTY4M2QxYjU2ZGQ0NzJhNTg1NTE2MWU5MTk0
|
15
|
+
YTc1NTI1NzcxNGY0YzRkYTc4NDcyNTE1YWIzNzM2NjRmZjQ2NDY=
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# BlacklistedPassword
|
2
2
|
|
3
|
-
|
3
|
+
This is a Password black listing gem where you can add Blacklisted words in YAML file.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -16,42 +16,21 @@ Or install it yourself as:
|
|
16
16
|
|
17
17
|
$ gem install blacklisted_password
|
18
18
|
|
19
|
-
|
19
|
+
Then generate required files as follow:-
|
20
20
|
|
21
|
-
|
21
|
+
$ rails g blacklisted:install
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
$ touch config/blacklist_password.yml
|
26
|
-
|
27
|
-
In the blacklist_password.yml file you have to write few blacklisted words
|
28
|
-
|
29
|
-
$ ---
|
30
|
-
$ demo
|
31
|
-
$ abc
|
32
|
-
$ black
|
33
|
-
|
34
|
-
$ touch config/initializer/blacklisted_password.rb
|
35
|
-
|
36
|
-
Into initializer file
|
37
|
-
|
38
|
-
$ BLACKLISTED_PASSWORD = Rails.root.join("config/blacklist_password.yml")
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
Then in you Model where you want to validate password :-
|
23
|
+
## Usage
|
43
24
|
|
44
|
-
|
45
|
-
$ BLACKLISTED_PASSWORD = Rails.root.join("config/blacklist_password.yml")
|
46
|
-
$ validate :blacklist_password
|
25
|
+
In your Model just add :--
|
47
26
|
|
48
|
-
|
27
|
+
require 'blacklisted_password'
|
49
28
|
|
50
|
-
|
29
|
+
validates :password, blacklist: true
|
51
30
|
|
52
31
|
## Contributing
|
53
32
|
|
54
|
-
1.
|
33
|
+
1. git clone `https://github.com/tbagchi85/blacklisted_password.git`
|
55
34
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
56
35
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
57
36
|
4. Push to the branch (`git push origin my-new-feature`)
|
@@ -27,10 +27,14 @@ class BlacklistValidator < ActiveModel::EachValidator
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def email_spliting(email) #This is for possible email splitting
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
if email
|
31
|
+
character_to_split = ['_','+','@','.']
|
32
|
+
character_to_split.each do |char|
|
33
|
+
email = email.split(char).join("^")
|
34
|
+
end
|
35
|
+
email.split('^')
|
36
|
+
else
|
37
|
+
[]
|
33
38
|
end
|
34
|
-
email.split('^')
|
35
39
|
end
|
36
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklisted_password
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tanmay Bagchi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby
|