xposedornot 1.0.0 → 1.0.2
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6f9cdb8cf4574407c468bb74827549048bf41754f4278c8987546b374b3a708c
|
|
4
|
+
data.tar.gz: fe1dd67cd895457cb38191ecde0c7a4c6eb350598137ef3c69c1aaca44304472
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ed2b79e6fb0b032718c143c988ecb788c3718f1ce0f6b60f5fb9a38635ec3f019cb0d78e898f5020b9d8b18db3c64a4cf0ef874e82c3aae475ab1aa36d42ed02
|
|
7
|
+
data.tar.gz: 589c001faa755f628a0c02c4b47120ec33eb7fa1082a7d69c63f42f23c57c51fbb25f012fb994e49a96cded660a955da678d789d17ca72cefb3834c306ee915d
|
data/README.md
CHANGED
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
|
|
14
14
|
<p align="center">
|
|
15
15
|
<a href="https://rubygems.org/gems/xposedornot"><img src="https://img.shields.io/gem/v/xposedornot.svg" alt="Gem Version"></a>
|
|
16
|
-
<a href="https://github.com/XposedOrNot/XposedOrNot-Ruby/actions"><img src="https://img.shields.io/github/actions/workflow/status/XposedOrNot/XposedOrNot-Ruby/build.yml?branch=main" alt="Build Status"></a>
|
|
17
16
|
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
|
|
18
17
|
<a href="https://www.ruby-lang.org"><img src="https://img.shields.io/badge/Ruby-%3E%3D%203.0-red.svg" alt="Ruby Version"></a>
|
|
19
18
|
</p>
|
|
@@ -44,6 +44,9 @@ module XposedOrNot
|
|
|
44
44
|
def check_email_free(email)
|
|
45
45
|
response = request(:get, "/v1/check-email/#{URI.encode_www_form_component(email)}", base: :free)
|
|
46
46
|
Models::EmailBreachResponse.new(response)
|
|
47
|
+
rescue NotFoundError
|
|
48
|
+
# 404 means email not found in any breaches — valid result
|
|
49
|
+
Models::EmailBreachResponse.new({})
|
|
47
50
|
end
|
|
48
51
|
|
|
49
52
|
# @param email [String]
|
|
@@ -17,8 +17,13 @@ module XposedOrNot
|
|
|
17
17
|
Utils.validate_password(password)
|
|
18
18
|
|
|
19
19
|
hash_prefix = Utils.keccak_hash_prefix(password)
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
begin
|
|
21
|
+
response = request(:get, "v1/pass/anon/#{hash_prefix}", base: :passwords)
|
|
22
|
+
Models::PasswordCheckResponse.new(response)
|
|
23
|
+
rescue NotFoundError
|
|
24
|
+
# 404 means password hash prefix not found — password is not exposed
|
|
25
|
+
Models::PasswordCheckResponse.not_found(hash_prefix)
|
|
26
|
+
end
|
|
22
27
|
end
|
|
23
28
|
end
|
|
24
29
|
end
|
|
@@ -21,6 +21,13 @@ module XposedOrNot
|
|
|
21
21
|
@count = (search["count"] || "0").to_i
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
+
# Build a not-found response (password is clean).
|
|
25
|
+
# @param hash_prefix [String]
|
|
26
|
+
# @return [PasswordCheckResponse]
|
|
27
|
+
def self.not_found(hash_prefix)
|
|
28
|
+
new({"SearchPassAnon" => {"anon" => hash_prefix, "char" => "", "count" => "0"}})
|
|
29
|
+
end
|
|
30
|
+
|
|
24
31
|
# @return [Boolean] true if the password has been exposed
|
|
25
32
|
def exposed?
|
|
26
33
|
@count.positive?
|
data/lib/xposedornot/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: xposedornot
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- XposedOrNot
|
|
@@ -39,7 +39,7 @@ dependencies:
|
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '2.0'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
42
|
+
name: keccak
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
45
|
- - "~>"
|