passweird 0.1.1 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74a16ce122dc738bb09ed51b95a2665020e998e484b8b58cbf1f66608d79985d
4
- data.tar.gz: ca0d3becb070feb3f82988f999d66fd2b8e46934f399e9750a260f7372973e81
3
+ metadata.gz: 19a3653441105d1e3b9a361e8164673754157f373c06d140e3c309045044412d
4
+ data.tar.gz: '0594f7b975f7946301c6fddc90e056ce44110e91f126c7a6757676903ffe9c6b'
5
5
  SHA512:
6
- metadata.gz: a2ad26569385375009f3600d7349c2f0c8e7ac53a56ded39598974cef91ca3534b20f36fa0ce49fcbe4188ce887eeba8f0cbe95deb1ffb7b023c8f217864da1d
7
- data.tar.gz: 366963f6c9b6fe1483ff4a15cf5433c62eb6d825d9d68eb2d5f035ccfbbaf504843fce759b164129f04fd8c379d5f779fe804b2b44214c35b19902a7aa3b5a03
6
+ metadata.gz: ff7560b5ba0c011db5c5a92d2e700542e43c17fe0f8f2865b407057288454d4b35a152f4b7966409ce7deb95bb91bd55f2db7fb24b6d64a587ef18df42d29180
7
+ data.tar.gz: 2693ae2624679e4381a2f93e0f310cf756882658ae5aa415b205231e7c477b5d97c172023a31b6f6604d0d0cddf085256123acfc3a6e1b55a8240c025dd3151d
data/Gemfile CHANGED
@@ -11,7 +11,7 @@ gem "rspec", "~> 3.0"
11
11
 
12
12
  gem "rubocop", "~> 1.21"
13
13
 
14
- gem "activerecord", "~> 6.0"
14
+ gem "activerecord", ">= 7.0", "< 8.0"
15
15
 
16
16
  gem "sqlite3", "~> 1.4", ">= 1.4.2"
17
17
 
data/Gemfile.lock CHANGED
@@ -1,25 +1,36 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- passweird (0.1.1)
5
- activerecord (~> 6.0)
4
+ passweird (0.1.3)
5
+ activerecord (>= 7.0, < 8.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activemodel (6.1.7.10)
11
- activesupport (= 6.1.7.10)
12
- activerecord (6.1.7.10)
13
- activemodel (= 6.1.7.10)
14
- activesupport (= 6.1.7.10)
15
- activesupport (6.1.7.10)
16
- concurrent-ruby (~> 1.0, >= 1.0.2)
10
+ activemodel (7.2.2.1)
11
+ activesupport (= 7.2.2.1)
12
+ activerecord (7.2.2.1)
13
+ activemodel (= 7.2.2.1)
14
+ activesupport (= 7.2.2.1)
15
+ timeout (>= 0.4.0)
16
+ activesupport (7.2.2.1)
17
+ base64
18
+ benchmark (>= 0.3)
19
+ bigdecimal
20
+ concurrent-ruby (~> 1.0, >= 1.3.1)
21
+ connection_pool (>= 2.2.5)
22
+ drb
17
23
  i18n (>= 1.6, < 2)
24
+ logger (>= 1.4.2)
18
25
  minitest (>= 5.1)
19
- tzinfo (~> 2.0)
20
- zeitwerk (~> 2.3)
26
+ securerandom (>= 0.3)
27
+ tzinfo (~> 2.0, >= 2.0.5)
21
28
  ast (2.4.2)
29
+ base64 (0.2.0)
30
+ benchmark (0.4.0)
31
+ bigdecimal (3.1.9)
22
32
  concurrent-ruby (1.3.5)
33
+ connection_pool (2.5.0)
23
34
  database_cleaner (2.1.0)
24
35
  database_cleaner-active_record (>= 2, < 3)
25
36
  database_cleaner-active_record (2.2.0)
@@ -27,10 +38,12 @@ GEM
27
38
  database_cleaner-core (~> 2.0.0)
28
39
  database_cleaner-core (2.0.1)
29
40
  diff-lcs (1.5.1)
41
+ drb (2.2.1)
30
42
  i18n (1.14.7)
31
43
  concurrent-ruby (~> 1.0)
32
44
  json (2.9.1)
33
45
  language_server-protocol (3.17.0.3)
46
+ logger (1.6.5)
34
47
  minitest (5.25.4)
35
48
  parallel (1.26.3)
36
49
  parser (3.3.7.0)
@@ -66,21 +79,22 @@ GEM
66
79
  rubocop-ast (1.37.0)
67
80
  parser (>= 3.3.1.0)
68
81
  ruby-progressbar (1.13.0)
82
+ securerandom (0.4.1)
69
83
  sqlite3 (1.7.3-arm64-darwin)
70
84
  sqlite3 (1.7.3-x86_64-linux)
85
+ timeout (0.4.3)
71
86
  tzinfo (2.0.6)
72
87
  concurrent-ruby (~> 1.0)
73
88
  unicode-display_width (3.1.4)
74
89
  unicode-emoji (~> 4.0, >= 4.0.4)
75
90
  unicode-emoji (4.0.4)
76
- zeitwerk (2.6.18)
77
91
 
78
92
  PLATFORMS
79
93
  arm64-darwin-24
80
94
  x86_64-linux
81
95
 
82
96
  DEPENDENCIES
83
- activerecord (~> 6.0)
97
+ activerecord (>= 7.0, < 8.0)
84
98
  database_cleaner (~> 2.1)
85
99
  passweird!
86
100
  rake (~> 13.0)
@@ -24,25 +24,29 @@ module Passweird
24
24
  #
25
25
  # @return [Boolean] true if the password is blacklisted, false otherwise
26
26
  def blacklisted?
27
- @blacklisted ||= BlacklistedTerm.where("LOWER(term) IN ?", possible_terms).exists?
27
+ @blacklisted ||= BlacklistedTerm.where(term: possible_terms).exists?
28
28
  end
29
29
 
30
30
  # Retrieves the blacklisted terms that match the possible terms
31
31
  #
32
32
  # @return [ActiveRecord::Relation] a collection of blacklisted terms
33
33
  def blacklisted_terms
34
- @blacklisted_terms ||= BlacklistedTerm.where("LOWER(term) IN ?", possible_terms)
34
+ @blacklisted_terms ||= BlacklistedTerm.where(term: possible_terms)
35
35
  end
36
36
 
37
37
  # Generates all possible terms from substrings and leet speak equivalents
38
38
  #
39
39
  # @return [Array<String>] an array of unique possible terms
40
40
  def possible_terms
41
- @possible_terms ||= (substrings + unleeted_substrings).uniq
41
+ @possible_terms ||= all_substring_case_permutations.uniq
42
42
  end
43
43
 
44
44
  private
45
45
 
46
+ def all_substring_case_permutations
47
+ @all_substring_case_permutations ||= substrings + unleeted_substrings + downcased_substrings + upcased_substrings
48
+ end
49
+
46
50
  def unleeted_substrings
47
51
  @unleeted_substrings ||= LeetSpeak.unleet_all(substrings)
48
52
  end
@@ -50,5 +54,13 @@ module Passweird
50
54
  def substrings
51
55
  @substrings ||= Substringer.substrings(password)
52
56
  end
57
+
58
+ def downcased_substrings
59
+ @downcased_substrings ||= substrings.map(&:downcase)
60
+ end
61
+
62
+ def upcased_substrings
63
+ @upcased_substrings ||= substrings.map(&:upcase)
64
+ end
53
65
  end
54
66
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Passweird
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.3"
5
5
  end
data/passweird.gemspec CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ["lib"]
30
30
 
31
- spec.add_dependency "activerecord", "~> 6.0"
31
+ spec.add_dependency "activerecord", ">= 7.0", "< 8.0"
32
32
 
33
33
  # For more information and examples about making a new gem, check out our
34
34
  # guide at: https://bundler.io/guides/creating_gem.html
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: passweird
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rupert Señga
@@ -14,16 +14,22 @@ dependencies:
14
14
  name: activerecord
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '6.0'
19
+ version: '7.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '8.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '7.0'
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: '6.0'
32
+ version: '8.0'
27
33
  description:
28
34
  email:
29
35
  - pertsenga@gmail.com