ipscanner-io 0.2.0 → 0.3.0

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: d22b356fd16c6950e961822c81d0492f2c63bc60065714eb22573df3d9e5fa4a
4
- data.tar.gz: 703bc0f59259dc31089f4340677a1367255379da07398034f9506f3ceeab4c15
3
+ metadata.gz: b7a8b3d5d555b9e2144338cbac64916afe040753ab2bdb4c79d7cfb02f72d72c
4
+ data.tar.gz: ef4d623e45c017b03fa384e7d82a40caf3a00917405d0b49078a03ad006ccd42
5
5
  SHA512:
6
- metadata.gz: 21add4a3fdb414c8e0f9b212e0f32698beb06d004814d80c7dcd9698ba414509aca8755274921487479362d739d8062cd9a3ae6c6c259fb7c606e553b3a3b5e1
7
- data.tar.gz: b776fb21029185a662bc3e3fff0a68b4831101d2b21d3af84c902bef8156640d43cdba1cd5343baa416e791b4b1319618118d8d473f98848cfabed7c4563c3d7
6
+ metadata.gz: e9a249af17bac70daa3d8e29a907ee6df249311b9e6d8786d36305ce3003f41af29770e5ab9cd85fbb8e6a46f8e5e944aebbf0ebd935c5ce395a5757de3dee57
7
+ data.tar.gz: 8a853e728a652899252ae604027244119baba699909bef53033541364b435bc0d2d7c5facce138cfb63f582aeeddc25c87b9a83165d17512567726ad39a70204
data/README.md CHANGED
@@ -50,6 +50,17 @@ client.ip.demo("1.1.1.1") # no key needed
50
50
  client.ip.myip # no key needed
51
51
  ```
52
52
 
53
+ `vpn` and `proxy` carry `purity` (the score breakdown) on paid plans; a locked answer has `deductionCount` instead.
54
+
55
+ ### Email
56
+
57
+ ```ruby
58
+ result = client.email.check("jane@outlok.com")
59
+ # result["status"] "risky", result["reason"] "typo", result["suggestion"] "jane@outlook.com"
60
+ ```
61
+
62
+ Checks syntax, throwaway domains, whether the domain receives mail, typos of big webmail domains and role addresses. The mailbox itself is not probed. One request per address.
63
+
53
64
  ### Bulk
54
65
 
55
66
  ```ruby
@@ -96,10 +107,11 @@ client.sites.policy("your-site-id")
96
107
  ### Gate
97
108
 
98
109
  ```ruby
99
- result = client.gate.verify(secret: "gs_...", token: gate_token, remote_ip: request.remote_ip)
110
+ result = client.gate.verify(secret: "gs_...", token: gate_token, remote_ip: request.remote_ip,
111
+ email: params["email"])
100
112
  ```
101
113
 
102
- `gate.verify` sends the site secret instead of the API key and is never retried.
114
+ `gate.verify` sends the site secret instead of the API key and is never retried. `email` is optional; with it, `result["email"]` holds the check and its action, and `result["action"]` is the stricter of the network and email actions.
103
115
 
104
116
  ### Provenance
105
117
 
@@ -6,7 +6,7 @@ module IPScanner
6
6
  DEFAULT_BASE_URL = "https://ipscanner.io"
7
7
 
8
8
  attr_reader :ip, :bulk, :agentscan, :provenance, :account, :asn_directory, :crawlers,
9
- :edge, :sites, :gate
9
+ :edge, :sites, :gate, :email
10
10
 
11
11
  def initialize(api_key: nil, base_url: nil, timeout: 30, max_retries: 2)
12
12
  api_key ||= ENV.fetch("IPSCANNER_API_KEY", nil)
@@ -24,6 +24,7 @@ module IPScanner
24
24
  @edge = Resources::Edge.new(http)
25
25
  @sites = Resources::Sites.new(http)
26
26
  @gate = Resources::Gate.new(http)
27
+ @email = Resources::Email.new(http)
27
28
  end
28
29
  end
29
30
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "base"
4
+
5
+ module IPScanner
6
+ module Resources
7
+ # Email: address checks before a signup is accepted.
8
+ class Email < Base
9
+ # Checks one address: syntax, throwaway domains, mail servers, typos and role addresses. One request.
10
+ def check(email)
11
+ @http.post("/v1/email/check", { email: email })
12
+ end
13
+ end
14
+ end
15
+ end
@@ -7,8 +7,10 @@ module IPScanner
7
7
  # Gate: server-side redemption of form tokens.
8
8
  class Gate < Base
9
9
  # Redeems a gate token with the site secret. Sends no API key and is never retried.
10
- def verify(secret:, token:, remote_ip: nil)
11
- @http.post("/v1/gate/verify", compact({ secret: secret, token: token, remote_ip: remote_ip }), auth: false)
10
+ # email (optional) adds an email check, one request.
11
+ def verify(secret:, token:, remote_ip: nil, email: nil)
12
+ body = compact({ secret: secret, token: token, remote_ip: remote_ip, email: email })
13
+ @http.post("/v1/gate/verify", body, auth: false)
12
14
  end
13
15
  end
14
16
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IPScanner
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
data/lib/ipscanner.rb CHANGED
@@ -13,6 +13,7 @@ require_relative "ipscanner/resources/crawlers"
13
13
  require_relative "ipscanner/resources/edge"
14
14
  require_relative "ipscanner/resources/sites"
15
15
  require_relative "ipscanner/resources/gate"
16
+ require_relative "ipscanner/resources/email"
16
17
  require_relative "ipscanner/client"
17
18
 
18
19
  # Ruby client for the IPScanner API.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ipscanner-io
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - IPScanner
@@ -28,6 +28,7 @@ files:
28
28
  - lib/ipscanner/resources/bulk.rb
29
29
  - lib/ipscanner/resources/crawlers.rb
30
30
  - lib/ipscanner/resources/edge.rb
31
+ - lib/ipscanner/resources/email.rb
31
32
  - lib/ipscanner/resources/gate.rb
32
33
  - lib/ipscanner/resources/ip.rb
33
34
  - lib/ipscanner/resources/provenance.rb