sparoid 1.0.16 → 1.0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/sparoid/cli.rb +7 -0
- data/lib/sparoid/version.rb +1 -1
- data/lib/sparoid.rb +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8747bc66fcbc1b4f3e31d7246d2608298a882df7d5661aef6d51c7f7b99f406c
|
4
|
+
data.tar.gz: 99e0f9044333f8d17e022f406e519abcd9977c420a86003fb4d69d891ba92475
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16095424a1dce5589c2922191ce96a380dd0e973dcc77c1715ec0fe9af376b4caf3127645808c2d87a161797d7d929135fa80d32be8fd06e7ef14a86cefad72f
|
7
|
+
data.tar.gz: 2a56181b6d57bc511ea35e10128f9536ad4bc480fb8fae007facd5e2ee7feb8cee3a7b4aeae910b1c03c5670b20de35f7f470e495d1b5a57dd3b5a422f0cc288
|
data/CHANGELOG.md
CHANGED
data/lib/sparoid/cli.rb
CHANGED
@@ -6,6 +6,8 @@ require_relative "../sparoid"
|
|
6
6
|
module Sparoid
|
7
7
|
# CLI
|
8
8
|
class CLI < Thor
|
9
|
+
map "-v" => :version
|
10
|
+
|
9
11
|
desc "auth HOST [PORT]", "Send a authorization packet"
|
10
12
|
method_option :config, desc: "Path to a config file, INI format, with key and hmac-key", default: "~/.sparoid.ini"
|
11
13
|
def auth(host, port = 8484)
|
@@ -34,6 +36,11 @@ module Sparoid
|
|
34
36
|
Sparoid.keygen
|
35
37
|
end
|
36
38
|
|
39
|
+
desc "version", "Show version and exit"
|
40
|
+
def version
|
41
|
+
puts "#{Sparoid::VERSION} (ruby)"
|
42
|
+
end
|
43
|
+
|
37
44
|
def self.exit_on_failure?
|
38
45
|
true
|
39
46
|
end
|
data/lib/sparoid/version.rb
CHANGED
data/lib/sparoid.rb
CHANGED
@@ -14,7 +14,7 @@ module Sparoid
|
|
14
14
|
# Send an authorization packet
|
15
15
|
def auth(key, hmac_key, host, port)
|
16
16
|
ips = Resolv.getaddresses(host)
|
17
|
-
raise(
|
17
|
+
raise(ResolvError, "Sparoid failed to resolv #{host}") if ips.empty?
|
18
18
|
|
19
19
|
msg = message(cached_public_ip)
|
20
20
|
data = prefix_hmac(hmac_key, encrypt(key, msg))
|
@@ -131,6 +131,8 @@ module Sparoid
|
|
131
131
|
|
132
132
|
class Error < StandardError; end
|
133
133
|
|
134
|
+
class ResolvError < Error; end
|
135
|
+
|
134
136
|
# Instance of SPAroid that only resolved public_ip once
|
135
137
|
class Instance
|
136
138
|
include Sparoid
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sparoid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carl Hörberg
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
71
|
requirements: []
|
72
|
-
rubygems_version: 3.
|
72
|
+
rubygems_version: 3.1.4
|
73
73
|
signing_key:
|
74
74
|
specification_version: 4
|
75
75
|
summary: Single Packet Authorisation client
|