sparoid 1.0.22 → 1.1.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: 71a3d6d8370df36acaad83f5f03c0b29c6e5037856c33fcfa3e17a16c6f678ac
4
- data.tar.gz: d1d2cd45e4c503af8e0390c5466ec113abfbbeab62a045d3edee274ac888557d
3
+ metadata.gz: 71f77a00597cb908e5b898603a34ed4e9111fd7fdcd255def5ea1633089c6041
4
+ data.tar.gz: d4ba950c8fa66e6083e7bf43431618023aa8b163c1d12f6170835532c719ee03
5
5
  SHA512:
6
- metadata.gz: e45e3482c4c500914b12764ea4f1a16e0bde44a4de1119b3b6884a2ba29264de0ad8be169d1c24e3be5c43c8da891d55177491e13229184000fb68b284857487
7
- data.tar.gz: c52b06c69dc47867a73a3178172bf2279840ac3228fb74ace9a3fde7159b2e0af26af39d0c86dcba423c4f6ceb2f50fd5fe511072f9a2be3a00665883899e8f3
6
+ metadata.gz: 3f50ca4d5ebf7c68badec3afe5f49ea3c7d23eaa932448f2f3534fd6dc594b8bcecc8ad7c9e5f4e0b4453538fdbf45884ba6c3a5ab3c645eb6feb4ed5eabbff2
7
+ data.tar.gz: 77c377f37dfa0dc257af730d25fb7600cb4cc6fe45e1e809e455c55c3fce5bce429abbbc82080cafa1a1f7fbb6dfcfe4fb5dede8d0eea2e904ee023403197d1b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [1.1.0] - 2023-03-03
2
+
3
+ - Allow override of public ip, open for someone else by passing `:open_for_ip` to `Sparoid.auth(..., open_for_ip:)` (#11)
4
+
1
5
  ## [1.0.22] - 2023-02-01
2
6
 
3
7
  - Fix `Addrinfo SocketError` should raise `Sparoid::ResolvError` (#10)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sparoid
4
- VERSION = "1.0.22"
4
+ VERSION = "1.1.0"
5
5
  end
data/lib/sparoid.rb CHANGED
@@ -12,10 +12,10 @@ module Sparoid # rubocop:disable Metrics/ModuleLength
12
12
  SPAROID_CACHE_PATH = ENV.fetch("SPAROID_CACHE_PATH", "/tmp/.sparoid_public_ip")
13
13
 
14
14
  # Send an authorization packet
15
- def auth(key, hmac_key, host, port)
15
+ def auth(key, hmac_key, host, port, open_for_ip: cached_public_ip)
16
16
  addrs = resolve_ip_addresses(host, port)
17
-
18
- msg = message(cached_public_ip)
17
+ ip = Resolv::IPv4.create(open_for_ip)
18
+ msg = message(ip)
19
19
  data = prefix_hmac(hmac_key, encrypt(key, msg))
20
20
  sendmsg(addrs, data)
21
21
 
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.22
4
+ version: 1.1.0
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: 2023-02-01 00:00:00.000000000 Z
11
+ date: 2023-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor