blacklisted_password 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +29 -0
- data/lib/blacklisted_password/version.rb +1 -1
- data/lib/blacklisted_password.rb +1 -1
- data/lib/generators/blacklisted_password/install_generator.rb +24 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NzNhMjY5NjU2YmQxNzllZDRhZmQzMjMwYWMwOWZiY2UwZmMwNWY1OA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTY4MjllM2QxNjM2NGM2ZDBlY2RjMDNmMDRhOTRlZjk4ZjZkMDQ0Nw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZGIxMmY5YzZmZTUwZTk2MTZjOTMzMTZmZTIxOGJmYzNlNzQ4NmU1ZWM2NTUz
|
10
|
+
ODQxNzllOWNiYWQwYTVkYWZiM2FmZDIzY2UwMzY5YThhNzE4NDU4NTNkOTc5
|
11
|
+
NDU0Yjc3YjZlODVkMjE3MzE1YWJiYTRjOWVkZDQyNDIyMGQzNjg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTJjZWRkMzlkZGRiNTIzYmYwZWNlMDgwNTgxN2Q5ODNmNDA0NmFkMDZjYWM1
|
14
|
+
ODAyNDllM2YyNTA3MmIyZDA2MTRjZTg2Y2Q5NGIxMTkyODAxY2QyYjhmNTk2
|
15
|
+
OTVkMzg1NzE2YjY0ODdhOGI5N2ZiOWQ1MjEwNmU1Y2RkNmZkOGU=
|
data/README.md
CHANGED
@@ -16,6 +16,35 @@ Or install it yourself as:
|
|
16
16
|
|
17
17
|
$ gem install blacklisted_password
|
18
18
|
|
19
|
+
I am still working on that Gem:-
|
20
|
+
|
21
|
+
So Till the Generator file I create, please follow the following steps:-
|
22
|
+
|
23
|
+
From your Root of your application:-
|
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 :-
|
43
|
+
|
44
|
+
$ require "blacklisted_password"
|
45
|
+
$ BLACKLISTED_PASSWORD = Rails.root.join("config/blacklist_password.yml")
|
46
|
+
$ validate :blacklist_password
|
47
|
+
|
19
48
|
## Usage
|
20
49
|
|
21
50
|
TODO: Write usage instructions here
|
data/lib/blacklisted_password.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require "blacklisted_password/version"
|
2
2
|
|
3
3
|
module BlacklistedPassword
|
4
|
-
|
4
|
+
|
5
5
|
def blacklist_password #This is for blacklisting password
|
6
6
|
if password.present?
|
7
7
|
array = YAML.load_file(BLACKLISTED_PASSWORD).split(' ')
|
@@ -0,0 +1,24 @@
|
|
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
|
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.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tanmay Bagchi
|
@@ -54,6 +54,7 @@ files:
|
|
54
54
|
- config/blacklist_password.yml
|
55
55
|
- lib/blacklisted_password.rb
|
56
56
|
- lib/blacklisted_password/version.rb
|
57
|
+
- lib/generators/blacklisted_password/install_generator.rb
|
57
58
|
homepage: ''
|
58
59
|
licenses:
|
59
60
|
- MIT
|