intrigue-ident 0.2 → 0.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/ident.rb +29 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d05d96fbb44b3e9ea2ed428a0c63873fcfe5679a74882faa3534051ffe51338
4
- data.tar.gz: 56e52215528ae59c96cdeb9a832ea2e9a7655a607da986499dc714b9a90fa74d
3
+ metadata.gz: 66afd013738adb7a0175316a0bdef2ac0d11fc3488d164ad7d8631e19cf2b5e6
4
+ data.tar.gz: c9900036e79f6117bd9f5cfab4b03fe3d13bcdae1e83b4c66e1f6dc8e0339abd
5
5
  SHA512:
6
- metadata.gz: 17b3fe532217c204bd8ac15f42e395268ea010f409f9b37d623d115f4fa24b5a245b77a0b79e9fd5d1a76fd9558443ad13280245d15e012e3f0180f23e6f4b47
7
- data.tar.gz: 664d65996160c1ce2ab55569e76b9342f4574a34a6e2aec92f20810590f31056ec568191b14828a35f6745892f6820e24ab863fff50a62b44aae3ad1e8e794ae
6
+ metadata.gz: 163cbcb90bdc8389695a33c912c8eefeb02779db28a238a630c8a2bd3b04042eeb06a7ef926d84ee845578d23d239a825322be88614b4539333c19d88adf80c8
7
+ data.tar.gz: b9ecad141c070afee07cee67a8597832ab3aaed97f0116a1253357af497aa3624b6f8997200be11e19e305f8519254fb3aaf0db14ee52a31d0539df143aa00e8
data/ident.rb CHANGED
@@ -11,7 +11,7 @@ Dir["#{check_folder}/*.rb"].each { |file| require_relative file }
11
11
  module Intrigue
12
12
  module Ident
13
13
 
14
- VERSION=0.2
14
+ VERSION=0.3
15
15
 
16
16
  def generate_requests_and_check(url)
17
17
 
@@ -51,6 +51,33 @@ module Intrigue
51
51
  results.compact
52
52
  end
53
53
 
54
+ def check_intrigue_uri(intrigue_uri_data)
55
+
56
+ results = []
57
+
58
+ # gather all fingeprints for each product
59
+ # this will look like an array of checks, each with a uri and a SET of checks
60
+ generated_checks = Intrigue::Ident::CheckFactory.all.map{|x| x.new.generate_checks(url) }.flatten
61
+
62
+ # group by the uris, with the associated checks
63
+ # TODO - this only currently supports the first path of the group!!!!
64
+ grouped_generated_checks = generated_checks.group_by{|x| x[:paths].first }
65
+
66
+ # call the check on each uri
67
+ grouped_generated_checks.each do |ggc|
68
+
69
+ target_url = ggc.first
70
+
71
+ # call each check, collecting the product if it's a match
72
+ ggc.last.each do |check|
73
+ results << _match_uri(check, intrigue_uri_data)
74
+ end
75
+ end
76
+
77
+ # Return all matches, minus the nils (non-matches)
78
+ results.compact
79
+ end
80
+
54
81
  private
55
82
 
56
83
  def _construct_match_response(check, data)
@@ -63,7 +90,7 @@ module Intrigue
63
90
  }
64
91
  end
65
92
 
66
- def _match_uri(check,data)
93
+ def match_uri(check,data)
67
94
 
68
95
  # data[:body] => page body
69
96
  # data[:headers] => block of text with headers, one per line
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: intrigue-ident
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - jcran