evervault 1.3.0 → 1.3.2

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: d119a5f6ffe3fc73260463bcd365a93ae7b0c43543d1e5aadb29ee6cd3efe33d
4
- data.tar.gz: 11ff4779974a332d1d5827d75c2abfad9bcbb0eaded80d0a96e3398717a8c4e5
3
+ metadata.gz: 2df77a79ce53a19ab616f270d0cef3fd7639e23bf4b25a2cd75bb5b70e95dbc4
4
+ data.tar.gz: 71a830838eaa042e50299b827826327a7b6ed48b3a747ab395746afce754d7e6
5
5
  SHA512:
6
- metadata.gz: 4bccf2dc5282f8a13bbf6a23a5b3d5c526d5d484d3ccd5304d9d58abb06803d7064902e098b6ca09c8967fceb085ea335c8b355ca6e8a5344e21f0524f1be76d
7
- data.tar.gz: a9651858faf3ab62acdc268b0dfd6e3b8220fb52373890c2def502758619e50003f3aa1a6847601508d98296299166ad80f025243140c0eaad63e4262281b9a0
6
+ metadata.gz: f1cd19d8dc2d3c09a8a10958119bb788082b809dd50aec730562116b2146f1b84d33d0e234bd86529ff982d3148749a428041c0e43ea35da733b4a32eb4f922b
7
+ data.tar.gz: 17e6c1952d3af892c05a90b2165ee71a8849ae0cea637635c0914f23335a28b450ba9c326e0b9b60f325cd9ee50c5333e19892ec11195a30e35370972b19f222
data/.gitignore CHANGED
@@ -6,6 +6,7 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ Gemfile.lock
9
10
 
10
11
  # rspec failure tracking
11
12
  .rspec_status
@@ -46,7 +46,7 @@ module NetHTTPOverride
46
46
  end
47
47
  end
48
48
 
49
- def connect
49
+ def connect_with_intercept
50
50
  if NetHTTPOverride.should_decrypt(conn_address)
51
51
  @cert_store = OpenSSL::X509::Store.new
52
52
  @cert_store.add_cert(@@cert)
@@ -54,19 +54,25 @@ module NetHTTPOverride
54
54
  @proxy_address = @@relay_url
55
55
  @proxy_port = @@relay_port
56
56
  end
57
- super
57
+ connect_without_intercept
58
58
  end
59
59
 
60
- def request(req, body = nil, &block)
60
+ def request_with_intercept(req, body = nil, &block)
61
61
  should_decrypt = NetHTTPOverride.should_decrypt(@address)
62
62
  if should_decrypt
63
63
  req["Proxy-Authorization"] = @@api_key
64
64
  end
65
- super
65
+ request_without_intercept(req, body, &block)
66
66
  end
67
67
  end
68
68
 
69
- Net::HTTP.send :prepend, NetHTTPOverride
69
+ Net::HTTP.class_eval do
70
+ include NetHTTPOverride
71
+ alias_method :request_without_intercept, :request
72
+ alias_method :request, :request_with_intercept
73
+ alias_method :connect_without_intercept, :connect
74
+ alias_method :connect, :connect_with_intercept
75
+ end
70
76
 
71
77
  module Evervault
72
78
  module Http
@@ -1,4 +1,4 @@
1
1
  module Evervault
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.2"
3
3
  EV_VERSION = {"prime256v1" => "NOC", "secp256k1" => "DUB"}
4
4
  end
data/lib/evervault.rb CHANGED
@@ -6,8 +6,20 @@ module Evervault
6
6
  class << self
7
7
  attr_accessor :api_key
8
8
 
9
- def method_missing(method, *args, &block)
10
- client.send(method, *args, &block)
9
+ def encrypt(data)
10
+ client.encrypt(data)
11
+ end
12
+
13
+ def run(function_name, encrypted_data, options = {})
14
+ client.run(function_name, encrypted_data, options)
15
+ end
16
+
17
+ def enable_outbound_relay(decryption_domains = nil)
18
+ client.enable_outbound_relay(decryption_domains)
19
+ end
20
+
21
+ def create_run_token(function_name, data = {})
22
+ client.create_run_token(function_name, data)
11
23
  end
12
24
 
13
25
  private def client
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evervault
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonny O'Mahony
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-21 00:00:00.000000000 Z
11
+ date: 2023-04-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: