evervault 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -0
- data/lib/evervault/client.rb +5 -0
- data/lib/evervault/version.rb +1 -1
- data/lib/evervault.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d24159a979aa8a8a684447e804ce5280bb03946ff7b81847d3ca34cdc794c488
|
4
|
+
data.tar.gz: 5b5c762a8abab38f848c506acf3674a8b39357d06f4d57c2fd4d71e8949c2886
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e4b9c709918dd7623c7c5209d7b0848a9eef6f1c80c016234f266eb9ecca3994229f298e5001b2a14341fe687b52b37672705971366f7d027a2e91f2639528f
|
7
|
+
data.tar.gz: f11ad2a4010f1aaf6f1c11efe6e5fb1fe9db8f4efae07e581de4eaef7af41b8f78adf3e348182c8b65cbad694fe85009786da9da6d5ea7fc4d05fe7142942cae
|
data/README.md
CHANGED
@@ -101,6 +101,21 @@ Evervault.decrypt(data = String | Array | Hash)
|
|
101
101
|
| --------- | ------------------------- | -------------------- |
|
102
102
|
| data | `String`, `Array`, `Hash` | Data to be decrypted |
|
103
103
|
|
104
|
+
### Evervault.create_client_side_decrypt_token
|
105
|
+
`Evervault.create_client_side_token` is used to generate a time-bound token that can be used by front-end applications to decrypt Evervault encrypted data.
|
106
|
+
|
107
|
+
```ruby
|
108
|
+
time_now = Time.now
|
109
|
+
time_in_five_minutes = time_now + 300
|
110
|
+
Evervault.create_client_side_decrypt_token(encrypted_data, time_in_five_minutes)
|
111
|
+
```
|
112
|
+
|
113
|
+
| Parameter | Type | Description |
|
114
|
+
| --------- | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
115
|
+
| data | `String`, `Array`, `Hash` | The payload the token can be used to decrypt. |
|
116
|
+
| expiry | `Time` | Optional -- The time the token should expire. The max expiry is 10 minutes in the future. If not supplied it defaults to 5 minutes |
|
117
|
+
|
118
|
+
|
104
119
|
### Evervault.enable_outbound_relay
|
105
120
|
|
106
121
|
`Evervault.enable_outbound_relay` configures your application to proxy HTTP requests using Outbound Relay based on the configuration created in the Evervault UI. See [Outbound Relay](https://docs.evervault.com/concepts/outbound-relay/overview) to learn more.
|
data/lib/evervault/client.rb
CHANGED
@@ -45,6 +45,11 @@ module Evervault
|
|
45
45
|
response["data"]
|
46
46
|
end
|
47
47
|
|
48
|
+
def create_token(action, data, expiry = nil)
|
49
|
+
payload = { payload: data, expiry: expiry, action: action }
|
50
|
+
@request_handler.post("client-side-tokens", payload, nil, nil, true)
|
51
|
+
end
|
52
|
+
|
48
53
|
def run(function_name, payload, options = {})
|
49
54
|
optional_headers = {}
|
50
55
|
if options.key?(:async)
|
data/lib/evervault/version.rb
CHANGED
data/lib/evervault.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require "time"
|
1
2
|
require_relative "evervault/version"
|
2
3
|
require_relative "evervault/client"
|
3
4
|
require_relative "evervault/errors/errors"
|
@@ -28,6 +29,13 @@ module Evervault
|
|
28
29
|
client.create_run_token(function_name, data)
|
29
30
|
end
|
30
31
|
|
32
|
+
def create_client_side_decrypt_token(data, expiry = nil)
|
33
|
+
if expiry != nil
|
34
|
+
expiry = (expiry.to_f * 1000).to_i
|
35
|
+
end
|
36
|
+
client.create_token("api:decrypt", data, expiry)
|
37
|
+
end
|
38
|
+
|
31
39
|
private def client
|
32
40
|
Evervault::Utils::ValidationUtils.validate_app_uuid_and_api_key(app_id, api_key)
|
33
41
|
@client ||= Evervault::Client.new(app_uuid: app_id, api_key: api_key)
|
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: 2.
|
4
|
+
version: 2.1.0
|
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-
|
11
|
+
date: 2023-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|