urlscan 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8640ef2ba0a9b73834a5e8999d78223b363fe04643cfcea98a63a8172b486783
4
- data.tar.gz: 2957bc3cd06d005275d8179aaaa8faf5a060993aa2c5c41cf261bc28769ed1af
3
+ metadata.gz: 0d83b308d78e0bd41123a1a6d37a4cec0d947dcb97dc9a79176a44b142c1c00d
4
+ data.tar.gz: 6912d1c6cbdc4099d1cd391b364c6e19ee98b9976ce0a6928c22ec333f43d33a
5
5
  SHA512:
6
- metadata.gz: e882180e835209a6873b0c5032b8587ff2f225760cab8223364e72f7cb914d36f9f99dc9fc9537321ee644371fc0f125824cba4bd720730a5d043b9a0bf58f66
7
- data.tar.gz: be54b70647a26856bdccc0c3e8a0c9abf955186c52e49c284e6e4ed98e499ed87f1629536129227bd0aeac9f9af28fa0fcde897c6fffdfeb50c53ffe89d5b954
6
+ metadata.gz: 447e4250c9f685716e981caccde9020c1c3f1f7cf6c00d89db553e541b174046cc3458800962e6fa8c1bcd407d6b5106cd20031864a5fcc63bde4aee30e29a8e
7
+ data.tar.gz: 910c24d8f9457e0736b6b11604150af4fb644c396d7da9f285e63e6006ec492ae0fb24155c705169bb1e97afd5f6e1df143404cd8eee2783cbf0c7b5a445e1c0
@@ -0,0 +1,25 @@
1
+ name: Ruby CI
2
+
3
+ on: [pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+
9
+ strategy:
10
+ fail-fast: false
11
+ matrix:
12
+ ruby: [2.7, "3.0"]
13
+
14
+ steps:
15
+ - uses: actions/checkout@v2
16
+ - name: Set up Ruby
17
+ uses: ruby/setup-ruby@v1
18
+ with:
19
+ ruby-version: ${{ matrix.ruby }}
20
+ bundler-cache: true
21
+ - name: Build and test with Rake
22
+ run: |
23
+ gem install bundler
24
+ bundle install
25
+ bundle exec rake
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # urlscan
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/urlscan.svg)](https://badge.fury.io/rb/urlscan)
4
- [![Build Status](https://travis-ci.com/ninoseki/urlscan.svg?branch=master)](https://travis-ci.com/ninoseki/urlscan)
4
+ [![Ruby CI](https://github.com/ninoseki/urlscan/actions/workflows/test.yml/badge.svg)](https://github.com/ninoseki/urlscan/actions/workflows/test.yml)
5
5
  [![Maintainability](https://api.codeclimate.com/v1/badges/c6625486f2d57039adef/maintainability)](https://codeclimate.com/github/ninoseki/urlscan/maintainability)
6
6
  [![Coverage Status](https://coveralls.io/repos/github/ninoseki/urlscan/badge.svg?branch=master)](https://coveralls.io/github/ninoseki/urlscan?branch=master)
7
7
 
@@ -50,13 +50,12 @@ res = api.search("wikipedia.org")
50
50
 
51
51
  ### Pro
52
52
 
53
- | HTTP Method | URI | API method |
54
- |-------------|-------------------------|-------------------------------------------------------------------|
55
- | GET | /search | `UrlScan::Clients::Pro#search(query: nil, filter: nil, size: 50)` |
56
- | GET | /brands | `UrlScan::Clients::Pro#brands` |
57
- | GET | /kits | `UrlScan::Clients::Pro#kits` |
58
- | GET | /phishfeed | `UrlScan::Clients::Pro#phishfeed` |
59
- | GET | /result/`uuid`/similar/ | `UrlScan::Clients::Pro#similar(uuid)` |
53
+ | HTTP Method | URI | API method |
54
+ |-------------|-------------------------|---------------------------------------|
55
+ | GET | /brands | `UrlScan::Clients::Pro#brands` |
56
+ | GET | /kits | `UrlScan::Clients::Pro#kits` |
57
+ | GET | /phishfeed | `UrlScan::Clients::Pro#phishfeed` |
58
+ | GET | /result/`uuid`/similar/ | `UrlScan::Clients::Pro#similar(uuid)` |
60
59
 
61
60
  ## CLI usage
62
61
 
@@ -74,15 +73,3 @@ Options:
74
73
  [--API-KEY=API_KEY]
75
74
 
76
75
  ```
77
-
78
- ### Pro
79
-
80
- ```bash
81
- $ urlscan pro
82
- Commands:
83
- urlscan pro help [COMMAND] # Describe subcommands or one specific subcommand
84
- urlscan pro search # search for scans
85
-
86
- Options:
87
- [--API-KEY=API_KEY]
88
- ```
data/lib/urlscan.rb CHANGED
@@ -9,7 +9,6 @@ require "urlscan/clients/pro"
9
9
 
10
10
  require "urlscan/commands/base"
11
11
  require "urlscan/commands/community"
12
- require "urlscan/commands/pro"
13
12
 
14
13
  require "urlscan/api"
15
14
  require "urlscan/cli"
data/lib/urlscan/cli.rb CHANGED
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UrlScan
4
- class CLI < Commands::Community
5
- desc "pro", "PRO api commands"
6
- subcommand "pro", Commands::Pro
7
- end
4
+ class CLI < Commands::Community; end
8
5
  end
@@ -4,14 +4,7 @@ module UrlScan
4
4
  module Clients
5
5
  class Pro < Base
6
6
  VERSION = 1
7
- HOST = "pro.urlscan.com"
8
-
9
- # @return [Hash]
10
- def search(query: nil, filter: nil, size: 50)
11
- filter = build_filter(filter)
12
- params = { q: query, size: size, filter: filter }.compact
13
- get("/search", params) { |json| json }
14
- end
7
+ HOST = "urlscan.io"
15
8
 
16
9
  # @return [Hash]
17
10
  def brands
@@ -31,7 +24,7 @@ module UrlScan
31
24
 
32
25
  # @return [Hash]
33
26
  def similar(uuid)
34
- get("/result/#{uuid}/similar") { |json| json }
27
+ get("/result/#{uuid}/similar/") { |json| json }
35
28
  end
36
29
 
37
30
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UrlScan
4
- VERSION = "0.6.0"
4
+ VERSION = "0.7.0"
5
5
  end
data/urlscan.gemspec CHANGED
@@ -21,12 +21,12 @@ Gem::Specification.new do |spec|
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ["lib"]
23
23
 
24
- spec.add_development_dependency "bundler", "~> 2.1"
24
+ spec.add_development_dependency "bundler", "~> 2.2"
25
25
  spec.add_development_dependency "coveralls", "~> 0.8"
26
26
  spec.add_development_dependency "rake", "~> 13.0"
27
- spec.add_development_dependency "rspec", "~> 3.9"
27
+ spec.add_development_dependency "rspec", "~> 3.10"
28
28
  spec.add_development_dependency "vcr", "~> 6.0"
29
- spec.add_development_dependency "webmock", "~> 3.8"
29
+ spec.add_development_dependency "webmock", "~> 3.12"
30
30
 
31
- spec.add_runtime_dependency "thor", "~> 1.0"
31
+ spec.add_runtime_dependency "thor", "~> 1.1"
32
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: urlscan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manabu Niseki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-16 00:00:00.000000000 Z
11
+ date: 2021-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.1'
19
+ version: '2.2'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.1'
26
+ version: '2.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: coveralls
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.9'
61
+ version: '3.10'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.9'
68
+ version: '3.10'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: vcr
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -86,28 +86,28 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '3.8'
89
+ version: '3.12'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '3.8'
96
+ version: '3.12'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: thor
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '1.0'
103
+ version: '1.1'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '1.0'
110
+ version: '1.1'
111
111
  description:
112
112
  email:
113
113
  - manabu.niseki@gmail.com
@@ -117,10 +117,10 @@ extensions: []
117
117
  extra_rdoc_files: []
118
118
  files:
119
119
  - ".codeclimate.yml"
120
+ - ".github/workflows/test.yml"
120
121
  - ".gitignore"
121
122
  - ".rspec"
122
123
  - ".rubocop.yml"
123
- - ".travis.yml"
124
124
  - Gemfile
125
125
  - LICENSE
126
126
  - README.md
@@ -134,7 +134,6 @@ files:
134
134
  - lib/urlscan/clients/pro.rb
135
135
  - lib/urlscan/commands/base.rb
136
136
  - lib/urlscan/commands/community.rb
137
- - lib/urlscan/commands/pro.rb
138
137
  - lib/urlscan/exceptions.rb
139
138
  - lib/urlscan/version.rb
140
139
  - renovate.json
@@ -158,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
157
  - !ruby/object:Gem::Version
159
158
  version: '0'
160
159
  requirements: []
161
- rubygems_version: 3.1.2
160
+ rubygems_version: 3.2.15
162
161
  signing_key:
163
162
  specification_version: 4
164
163
  summary: Ruby API client for urlscan.io
data/.travis.yml DELETED
@@ -1,6 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.7
6
- before_install: gem install bundler -v 2.1
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module UrlScan
4
- module Commands
5
- class Pro < Base
6
- desc "search", "search for scans"
7
- method_option :size, type: :numeric, default: 50
8
- method_option :query, type: :string
9
- method_option :filter, type: :string
10
- def search
11
- with_error_handling do
12
- res = api.pro.search(query: options["query"], filter: options["filter"], size: options["size"])
13
- puts JSON.pretty_generate(res)
14
- end
15
- end
16
- end
17
- end
18
- end