google-safe-browsing-plugin 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE.txt +20 -0
- data/README.md +88 -0
- data/lib/faraday/response/safe_browsing_update_parser.rb +119 -0
- data/lib/google/safe_browsing_client.rb +211 -0
- data/lib/google/safe_browsing_parser.rb +214 -0
- data/lib/google/safe_browsing_update_helper.rb +171 -0
- data/lib/google/sha_util.rb +22 -0
- data/lib/google/url_canonicalizer.rb +36 -0
- data/lib/google/url_scramble.rb +54 -0
- data/lib/google_safe_browsing_plugin.rb +29 -0
- data/lib/rails/generators/google/config/config_generator.rb +16 -0
- data/lib/rails/generators/google/config/templates/google_safe_browsing.yml +16 -0
- data/lib/rails/generators/google/helper/helper_generator.rb +16 -0
- data/lib/rails/generators/google/helper/templates/safe_browsing_helper.rb +168 -0
- data/lib/rails/generators/google/install_generator.rb +20 -0
- data/lib/rails/generators/google/model/model_generator.rb +47 -0
- data/lib/rails/generators/google/model/templates/create_google_functions.rb +18 -0
- data/lib/rails/generators/google/model/templates/create_google_safe_browsing_full_hash_requests.rb +22 -0
- data/lib/rails/generators/google/model/templates/create_google_safe_browsing_full_hashes.rb +20 -0
- data/lib/rails/generators/google/model/templates/create_google_safe_browsing_list.rb +15 -0
- data/lib/rails/generators/google/model/templates/create_google_safe_browsing_redirect_urls.rb +26 -0
- data/lib/rails/generators/google/model/templates/create_google_safe_browsing_shavar.rb +27 -0
- data/lib/rails/generators/google/model/templates/google.rb +2 -0
- data/lib/rails/generators/google/model/templates/google/error.rb +11 -0
- data/lib/rails/generators/google/model/templates/google/function.rb +6 -0
- data/lib/rails/generators/google/model/templates/google/safe_browsing_full_hash.rb +7 -0
- data/lib/rails/generators/google/model/templates/google/safe_browsing_full_hash_request.rb +19 -0
- data/lib/rails/generators/google/model/templates/google/safe_browsing_list.rb +41 -0
- data/lib/rails/generators/google/model/templates/google/safe_browsing_redirect_url.rb +36 -0
- data/lib/rails/generators/google/model/templates/google/safe_browsing_shavar.rb +38 -0
- data/lib/rails/generators/google/model/templates/google/safe_browsing_update.rb +77 -0
- data/lib/rails/generators/google/rspec/rspec_generator.rb +28 -0
- data/lib/rails/generators/google/rspec/templates/bin_sample_1.data +0 -0
- data/lib/rails/generators/google/rspec/templates/bin_sample_2.data +0 -0
- data/lib/rails/generators/google/rspec/templates/full_hash_parse_spec.rb +58 -0
- data/lib/rails/generators/google/rspec/templates/full_hash_response_0.data +0 -0
- data/lib/rails/generators/google/rspec/templates/full_hash_response_1.data +0 -0
- data/lib/rails/generators/google/rspec/templates/full_hash_response_2.data +3 -0
- data/lib/rails/generators/google/rspec/templates/full_hash_response_3.data +3 -0
- data/lib/rails/generators/google/rspec/templates/shavar_encode_data_parse_spec.rb +56 -0
- data/lib/rails/generators/google/rspec/templates/shavar_list_info_parse_spec.rb +48 -0
- data/lib/safe_browsing_task.rb +5 -0
- data/lib/tasks/google.rake +122 -0
- metadata +222 -0
@@ -0,0 +1,28 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Google
|
4
|
+
module Generators
|
5
|
+
class RspecGenerator < Rails::Generators::Base
|
6
|
+
desc 'Creates a Google Safe Browsing plugin Rspec test files under rspect/google'
|
7
|
+
|
8
|
+
source_root File.expand_path('../templates', __FILE__)
|
9
|
+
|
10
|
+
def copy_spec_files
|
11
|
+
%w(
|
12
|
+
bin_sample_1.data
|
13
|
+
bin_sample_2.data
|
14
|
+
full_hash_response_0.data
|
15
|
+
full_hash_response_1.data
|
16
|
+
full_hash_response_2.data
|
17
|
+
full_hash_response_3.data
|
18
|
+
full_hash_parse_spec.rb
|
19
|
+
shavar_encode_data_parse_spec.rb
|
20
|
+
shavar_list_info_parse_spec.rb
|
21
|
+
).each do |f|
|
22
|
+
copy_file "#{f}", "spec/google/#{f}"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
Binary file
|
Binary file
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Parse full length hash response from GoogleSafeBrowsing" do
|
4
|
+
|
5
|
+
include Google::SafeBrowsingParser
|
6
|
+
|
7
|
+
def read_full_length_hash_file file
|
8
|
+
resp = File.read(file, :encoding => 'ASCII-8BIT')
|
9
|
+
end
|
10
|
+
|
11
|
+
def display_list full_list
|
12
|
+
full_list.keys.each do |list|
|
13
|
+
puts "List #{list}"
|
14
|
+
puts " Full length hash:"
|
15
|
+
full_list[list].keys.each do |add_chunk_num|
|
16
|
+
puts " Add chunk num: #{add_chunk_num}"
|
17
|
+
full_list[list][add_chunk_num].each do |full_hash|
|
18
|
+
puts " full hash: #{full_hash}"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
puts "========="
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should capture single full length hash" do
|
26
|
+
resp = read_full_length_hash_file File.expand_path('../full_hash_response_0.data', __FILE__)
|
27
|
+
full_list = parse_full_hash_entries resp
|
28
|
+
full_list[:'goog-malware-shavar'][113869].should eq(['34f0021bea5c18b405cf9a279f91555100efc4edfb8909d074eab584fd702826'])
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should capture 2 full length hashes" do
|
32
|
+
resp = read_full_length_hash_file File.expand_path('../full_hash_response_1.data', __FILE__)
|
33
|
+
full_list = parse_full_hash_entries resp
|
34
|
+
full_list[:'goog-malware-shavar'][113869].should eq(
|
35
|
+
['746e32e9833b573db34c8044f6020b9379632558c4267d811cd8db70016300b7',
|
36
|
+
'ad1701117dd7dcd36d8add796f0ba16c3e1fb22a0154883c9eac14f53e5a063d'])
|
37
|
+
|
38
|
+
# display_list full_list
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should capture full length hash for both malware and phishing" do
|
42
|
+
resp = read_full_length_hash_file File.expand_path('../full_hash_response_2.data', __FILE__)
|
43
|
+
full_list = parse_full_hash_entries resp
|
44
|
+
full_list[:'goog-malware-shavar'][113423].should eq(['b3e357a66e2130ecb4afcb0fcefd32ff5e536c9fd3219681c045bcd48b89be3e'])
|
45
|
+
full_list[:'googpub-phish-shavar'][238266].should eq(['5b3583c05bdaeb39718b1d865f012663fe22f9e8de01ef0ede8d4653d87e766a'])
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should capture full length hash for more complex match" do
|
50
|
+
resp = read_full_length_hash_file File.expand_path('../full_hash_response_3.data', __FILE__)
|
51
|
+
full_list = parse_full_hash_entries resp
|
52
|
+
full_list[:'goog-malware-shavar'][113423].should eq(['b3e357a66e2130ecb4afcb0fcefd32ff5e536c9fd3219681c045bcd48b89be3e'])
|
53
|
+
full_list[:'googpub-phish-shavar'][238266].should eq([
|
54
|
+
'5b3583c05bdaeb39718b1d865f012663fe22f9e8de01ef0ede8d4653d87e766a',
|
55
|
+
'7e930bdaee322d25e4f422cc6dc688f50b1920127d8a604efd5e5ffb18d78284'])
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Parse the binary data parsing" do
|
4
|
+
|
5
|
+
include Google::SafeBrowsingParser
|
6
|
+
|
7
|
+
def read_shavar_download_file file
|
8
|
+
resp = File.read(file, :encoding => 'ASCII-8BIT')
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should read add chunk binary data" do
|
12
|
+
file = File.expand_path('../bin_sample_1.data', __FILE__)
|
13
|
+
|
14
|
+
resp = read_shavar_download_file file
|
15
|
+
adds, subs = parse_shavar_list(resp)
|
16
|
+
|
17
|
+
add = adds.first
|
18
|
+
add[:chunk_num].should eq(113601)
|
19
|
+
add[:hash_len].should eq(4)
|
20
|
+
add[:chunk_len].should eq(6246)
|
21
|
+
data = add[:chunk_data]
|
22
|
+
data['3c8fbb74'].should eq(["87c99352", "3a71cbc0", "421e54f4"])
|
23
|
+
data['1487ee7d'].should eq([])
|
24
|
+
|
25
|
+
add = adds.last
|
26
|
+
add[:chunk_num].should eq(113656)
|
27
|
+
add[:hash_len].should eq(4)
|
28
|
+
add[:chunk_len].should eq(850)
|
29
|
+
data = add[:chunk_data]
|
30
|
+
data['c21ddace'].should eq([])
|
31
|
+
data['b3b36f29'].should eq(['5d472258'])
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should read add chunk binary data" do
|
36
|
+
file = File.expand_path('../bin_sample_2.data', __FILE__)
|
37
|
+
|
38
|
+
resp = read_shavar_download_file file
|
39
|
+
adds, subs = parse_shavar_list(resp)
|
40
|
+
|
41
|
+
sub = subs.first
|
42
|
+
sub[:chunk_num].should eq(112801)
|
43
|
+
sub[:hash_len].should eq(4)
|
44
|
+
sub[:chunk_len].should eq(157)
|
45
|
+
data = sub[:chunk_data]
|
46
|
+
data['f48787fc'][108559].should eq(["37f0e2d6"])
|
47
|
+
|
48
|
+
sub = subs.last
|
49
|
+
sub[:chunk_num].should eq(112960)
|
50
|
+
sub[:hash_len].should eq(4)
|
51
|
+
sub[:chunk_len].should eq(210)
|
52
|
+
data = sub[:chunk_data]
|
53
|
+
data['812324f0'][111330].should eq(["981f1261"])
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Faraday Middleware list info parsing" do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
@parser = Faraday::Response::SafeBrowsingUpdateParser.new
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should parse sample test data one" do
|
10
|
+
resp = <<-END_OF_SAMPLE
|
11
|
+
n:1200
|
12
|
+
i:googpub-phish-shavar
|
13
|
+
u:cache.google.com/first_redirect_example
|
14
|
+
u:cache.google.com/second_redirect_example
|
15
|
+
sd:1,2
|
16
|
+
i:acme-white-shavar
|
17
|
+
u:cache.google.com/second_redirect_example
|
18
|
+
ad:1-2,4-5,7
|
19
|
+
sd:2-6
|
20
|
+
END_OF_SAMPLE
|
21
|
+
|
22
|
+
r = @parser.parse resp
|
23
|
+
r.next.should eq(1200)
|
24
|
+
r.rekey.should be_nil
|
25
|
+
r.reset.should be_nil
|
26
|
+
|
27
|
+
phish_list = r.get_list('googpub-phish-shavar')
|
28
|
+
phish_list[:u].should eq(["cache.google.com/first_redirect_example", "cache.google.com/second_redirect_example"])
|
29
|
+
phish_list[:sd].should eq([1, 2])
|
30
|
+
phish_list[:ad].should be_empty
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should stop parsing if reset is in the response" do
|
35
|
+
resp = <<-END_OF_SAMPLE
|
36
|
+
n:1200
|
37
|
+
r:pleasereset
|
38
|
+
i:goog-phish-shavar
|
39
|
+
u:cache.google.com/first_redirect_example
|
40
|
+
END_OF_SAMPLE
|
41
|
+
|
42
|
+
r = @parser.parse resp
|
43
|
+
r.next.should eq(1200)
|
44
|
+
r.reset.should be_true
|
45
|
+
r.has_lists?.should be_false
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
@@ -0,0 +1,122 @@
|
|
1
|
+
require File.expand_path('../../google/safe_browsing_update_helper', __FILE__)
|
2
|
+
|
3
|
+
namespace :google do
|
4
|
+
namespace :safe_browsing do
|
5
|
+
|
6
|
+
include Google::SafeBrowsingUpdateHelper
|
7
|
+
|
8
|
+
module GoogleTask
|
9
|
+
extend self
|
10
|
+
|
11
|
+
def gsb_api
|
12
|
+
@gsb_api ||= Google::SafeBrowsingClient.new
|
13
|
+
end
|
14
|
+
|
15
|
+
def load_remote_shavar_info list
|
16
|
+
update_obj = GoogleTask.gsb_api.shavar_data_update list
|
17
|
+
update_local_shavar_info update_obj
|
18
|
+
update_obj
|
19
|
+
end
|
20
|
+
|
21
|
+
def load_remote_shavar_chunk url
|
22
|
+
chunk_data = GoogleTask.gsb_api.chunk_data(url)
|
23
|
+
adds, subs = Google::SafeBrowsingParser.parse_shavar_list(chunk_data)
|
24
|
+
end
|
25
|
+
|
26
|
+
def load_redirect_urls urls, shavar_list
|
27
|
+
Rails.logger.info "Redirect urls: #{urls.join(%Q(\n))}"
|
28
|
+
urls.each do |url|
|
29
|
+
load_redirect_url url, shavar_list
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def load_history_redirect_urls urls
|
34
|
+
Rails.logger.info "Inspecting history failed redirect downloads..."
|
35
|
+
Rails.logger.info "Found history failed redirect urls: #{urls.blank?? 'none' : urls.map(&:url).join(%Q(\n))}"
|
36
|
+
urls.each do |url|
|
37
|
+
load_redirect_url url.url, url.list
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def load_redirect_url url, shavar_list
|
42
|
+
begin
|
43
|
+
Rails.logger.info "Loading data for [#{shavar_list.name}] from redirect url #{url}..."
|
44
|
+
adds, subs = load_remote_shavar_chunk(url)
|
45
|
+
update_shavar_chunk adds, subs, shavar_list
|
46
|
+
update_redirect_urls(url, shavar_list,
|
47
|
+
{download_state: Google::SafeBrowsingRedirectUrl::COMPLETED, last_download_at: Time.now})
|
48
|
+
|
49
|
+
Rails.logger.info "Finish loading data from #{url}\n"
|
50
|
+
rescue Google::Error::NoContent => e
|
51
|
+
Rails.logger.info "NoContent Error for redirect url [#{url}], continue..."
|
52
|
+
update_redirect_urls url, shavar_list, {download_state: e.message, last_download_at: Time.now}
|
53
|
+
rescue Exception => e
|
54
|
+
Rails.logger.info "Error (#{e.inspect}) for redirect url [#{url}], abort..."
|
55
|
+
update_redirect_urls url, shavar_list, {download_state: e.message, last_download_at: Time.now}
|
56
|
+
raise
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def history_redirect_downloads
|
61
|
+
Google::SafeBrowsingRedirectUrl.where("download_state is NULL or download_state != ?", Google::SafeBrowsingRedirectUrl::COMPLETED)
|
62
|
+
.order("google_safe_browsing_redirect_urls.order").all
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
task :set_logger => :environment do
|
68
|
+
Rails.logger = Logger.new(Rails.root.join('log', "google_safe_browsing_#{Rails.env}.log"), 7, 10240000)
|
69
|
+
end
|
70
|
+
|
71
|
+
desc "Update GoogleSafeBrowsing data"
|
72
|
+
task :load_remote => :set_logger do
|
73
|
+
Rails.logger = Logger.new(Rails.root.join('log', "google_safe_browsing_#{Rails.env}.log"), 7, 10240000)
|
74
|
+
|
75
|
+
Rails.logger.info "=== start load_remote at #{Time.now} ==="
|
76
|
+
|
77
|
+
GoogleTask.load_history_redirect_urls(GoogleTask.history_redirect_downloads)
|
78
|
+
|
79
|
+
next_updated_at = safe_browsing_service.next_updated_at
|
80
|
+
if !next_updated_at.nil? && next_updated_at > Time.now
|
81
|
+
abort "Google suggests next update until #{next_updated_at}, but now is #{Time.now}"
|
82
|
+
end
|
83
|
+
|
84
|
+
[Google::SafeBrowsingList::MalwareList, Google::SafeBrowsingList::PhishList].each do |list_name|
|
85
|
+
shavar_list = Google::SafeBrowsingList.find_by_name(list_name.to_s)
|
86
|
+
|
87
|
+
update_obj = GoogleTask.load_remote_shavar_info list_name
|
88
|
+
|
89
|
+
if (redirect_urls = update_obj.get_redirect_urls(list_name)).empty?
|
90
|
+
Rails.logger.info "No redirect urls detected for #{list_name}"
|
91
|
+
else
|
92
|
+
(new_redirects = []).tap do
|
93
|
+
redirect_urls.each do |url|
|
94
|
+
local_obj = Google::SafeBrowsingRedirectUrl.for_url_and_list_id(url, shavar_list.id).first
|
95
|
+
unless local_obj.nil?
|
96
|
+
Rails.logger.info "Skip the url as it's been processed before #{url}"
|
97
|
+
else
|
98
|
+
new_redirects << url
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
save_redirect_urls(new_redirects, shavar_list)
|
104
|
+
GoogleTask.load_redirect_urls(redirect_urls, shavar_list)
|
105
|
+
end
|
106
|
+
|
107
|
+
Rails.logger.info "=== end of #{list_name} ==="
|
108
|
+
end
|
109
|
+
|
110
|
+
end
|
111
|
+
|
112
|
+
desc "Seed Google Safe Browsing data"
|
113
|
+
task :db_seed => :set_logger do
|
114
|
+
Google::Function.where(name: Google::Function::GoogleSafeBrowsing).first_or_create
|
115
|
+
|
116
|
+
[Google::SafeBrowsingList::MalwareList, Google::SafeBrowsingList::PhishList].each do |list|
|
117
|
+
Google::SafeBrowsingList.where(name: list).first_or_create
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
end
|
122
|
+
end
|
metadata
ADDED
@@ -0,0 +1,222 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: google-safe-browsing-plugin
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.1.1
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Lonex
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-05-02 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
version_requirements: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ! '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.3.0
|
20
|
+
none: false
|
21
|
+
prerelease: false
|
22
|
+
name: activesupport
|
23
|
+
requirement: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ! '>='
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 2.3.0
|
28
|
+
none: false
|
29
|
+
type: :development
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
version_requirements: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - ~>
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0.8'
|
36
|
+
none: false
|
37
|
+
prerelease: false
|
38
|
+
name: faraday
|
39
|
+
requirement: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0.8'
|
44
|
+
none: false
|
45
|
+
type: :development
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
version_requirements: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - '='
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: 2.8.0
|
52
|
+
none: false
|
53
|
+
prerelease: false
|
54
|
+
name: rspec
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - '='
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 2.8.0
|
60
|
+
none: false
|
61
|
+
type: :development
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ~>
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '3.12'
|
68
|
+
none: false
|
69
|
+
prerelease: false
|
70
|
+
name: rdoc
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.12'
|
76
|
+
none: false
|
77
|
+
type: :development
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ~>
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: 1.2.0
|
84
|
+
none: false
|
85
|
+
prerelease: false
|
86
|
+
name: bundler
|
87
|
+
requirement: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ~>
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: 1.2.0
|
92
|
+
none: false
|
93
|
+
type: :development
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
version_requirements: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ~>
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: 1.8.4
|
100
|
+
none: false
|
101
|
+
prerelease: false
|
102
|
+
name: jeweler
|
103
|
+
requirement: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - ~>
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: 1.8.4
|
108
|
+
none: false
|
109
|
+
type: :development
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
version_requirements: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ~>
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: 0.8.7
|
116
|
+
none: false
|
117
|
+
prerelease: false
|
118
|
+
name: faraday
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ~>
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: 0.8.7
|
124
|
+
none: false
|
125
|
+
type: :runtime
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
version_requirements: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ! '>='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 2.3.0
|
132
|
+
none: false
|
133
|
+
prerelease: false
|
134
|
+
name: activesupport
|
135
|
+
requirement: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ! '>='
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: 2.3.0
|
140
|
+
none: false
|
141
|
+
type: :runtime
|
142
|
+
description: A Ruby implementation of the Google Safe Browsing v2. Rails is the dependency
|
143
|
+
mainly because of the data layer.
|
144
|
+
email: stonelonely@gmail.com
|
145
|
+
executables: []
|
146
|
+
extensions: []
|
147
|
+
extra_rdoc_files:
|
148
|
+
- LICENSE.txt
|
149
|
+
- README.md
|
150
|
+
files:
|
151
|
+
- lib/faraday/response/safe_browsing_update_parser.rb
|
152
|
+
- lib/google/safe_browsing_client.rb
|
153
|
+
- lib/google/safe_browsing_parser.rb
|
154
|
+
- lib/google/safe_browsing_update_helper.rb
|
155
|
+
- lib/google/sha_util.rb
|
156
|
+
- lib/google/url_canonicalizer.rb
|
157
|
+
- lib/google/url_scramble.rb
|
158
|
+
- lib/google_safe_browsing_plugin.rb
|
159
|
+
- lib/rails/generators/google/config/config_generator.rb
|
160
|
+
- lib/rails/generators/google/config/templates/google_safe_browsing.yml
|
161
|
+
- lib/rails/generators/google/helper/helper_generator.rb
|
162
|
+
- lib/rails/generators/google/helper/templates/safe_browsing_helper.rb
|
163
|
+
- lib/rails/generators/google/install_generator.rb
|
164
|
+
- lib/rails/generators/google/model/model_generator.rb
|
165
|
+
- lib/rails/generators/google/model/templates/create_google_functions.rb
|
166
|
+
- lib/rails/generators/google/model/templates/create_google_safe_browsing_full_hash_requests.rb
|
167
|
+
- lib/rails/generators/google/model/templates/create_google_safe_browsing_full_hashes.rb
|
168
|
+
- lib/rails/generators/google/model/templates/create_google_safe_browsing_list.rb
|
169
|
+
- lib/rails/generators/google/model/templates/create_google_safe_browsing_redirect_urls.rb
|
170
|
+
- lib/rails/generators/google/model/templates/create_google_safe_browsing_shavar.rb
|
171
|
+
- lib/rails/generators/google/model/templates/google.rb
|
172
|
+
- lib/rails/generators/google/model/templates/google/error.rb
|
173
|
+
- lib/rails/generators/google/model/templates/google/function.rb
|
174
|
+
- lib/rails/generators/google/model/templates/google/safe_browsing_full_hash.rb
|
175
|
+
- lib/rails/generators/google/model/templates/google/safe_browsing_full_hash_request.rb
|
176
|
+
- lib/rails/generators/google/model/templates/google/safe_browsing_list.rb
|
177
|
+
- lib/rails/generators/google/model/templates/google/safe_browsing_redirect_url.rb
|
178
|
+
- lib/rails/generators/google/model/templates/google/safe_browsing_shavar.rb
|
179
|
+
- lib/rails/generators/google/model/templates/google/safe_browsing_update.rb
|
180
|
+
- lib/rails/generators/google/rspec/rspec_generator.rb
|
181
|
+
- lib/rails/generators/google/rspec/templates/bin_sample_1.data
|
182
|
+
- lib/rails/generators/google/rspec/templates/bin_sample_2.data
|
183
|
+
- lib/rails/generators/google/rspec/templates/full_hash_parse_spec.rb
|
184
|
+
- lib/rails/generators/google/rspec/templates/full_hash_response_0.data
|
185
|
+
- lib/rails/generators/google/rspec/templates/full_hash_response_1.data
|
186
|
+
- lib/rails/generators/google/rspec/templates/full_hash_response_2.data
|
187
|
+
- lib/rails/generators/google/rspec/templates/full_hash_response_3.data
|
188
|
+
- lib/rails/generators/google/rspec/templates/shavar_encode_data_parse_spec.rb
|
189
|
+
- lib/rails/generators/google/rspec/templates/shavar_list_info_parse_spec.rb
|
190
|
+
- lib/safe_browsing_task.rb
|
191
|
+
- lib/tasks/google.rake
|
192
|
+
- LICENSE.txt
|
193
|
+
- README.md
|
194
|
+
homepage: http://github.com/lonex/google-safe-browsing-plugin
|
195
|
+
licenses:
|
196
|
+
- MIT
|
197
|
+
post_install_message:
|
198
|
+
rdoc_options: []
|
199
|
+
require_paths:
|
200
|
+
- lib
|
201
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
202
|
+
requirements:
|
203
|
+
- - ! '>='
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
version: '0'
|
206
|
+
segments:
|
207
|
+
- 0
|
208
|
+
hash: -3952199818102085151
|
209
|
+
none: false
|
210
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
211
|
+
requirements:
|
212
|
+
- - ! '>='
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
version: '0'
|
215
|
+
none: false
|
216
|
+
requirements: []
|
217
|
+
rubyforge_project:
|
218
|
+
rubygems_version: 1.8.24
|
219
|
+
signing_key:
|
220
|
+
specification_version: 3
|
221
|
+
summary: Rails plugin for Google Safe Browsing
|
222
|
+
test_files: []
|