evervault 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +6 -0
- data/.github/pull_request_template.md +6 -0
- data/.github/workflows/release.yml +23 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +6 -6
- data/lib/evervault.rb +2 -18
- data/lib/evervault/http/request.rb +7 -19
- data/lib/evervault/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e666a2b2b7d130e4221e2c25f963fdd6a3e7e986f08127be6f3937ab7f94e52
|
4
|
+
data.tar.gz: dbd8034681606769295e1a2678b019c02f7600b96918c6bb737a5ad0bb9f0616
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4830d141e96f9b47a65a581bd214a0cd4d86d440e6f2fdc6f70cd9abd7371f86ef331982d65d3850a19edbc56833994aec8463bc5d55fb0c4ea73c66b6d23abe
|
7
|
+
data.tar.gz: 6d22b0c92ea74e1679513b53431ac7ebe78ba79b215eaea9ebf84062cb2ec45ba4a6e99a1075e66c93a39f9d8c7b1305f0e717c2f9408f4270a7a74d34ab5ca3
|
data/.github/CODEOWNERS
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
# This file is used to automatically request reviews on PRs.
|
2
|
+
|
3
|
+
# These owners will be the default owners for everything in
|
4
|
+
# the repo, unless a match on a later line takes precedence.
|
5
|
+
# "@evervault/product-engineering" below requests review from all members of Product Engineering.
|
6
|
+
* @evervault/product-engineering
|
@@ -1,19 +1,38 @@
|
|
1
1
|
name: Publish Gem
|
2
2
|
|
3
|
-
on:
|
4
|
-
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags:
|
6
|
+
- v*
|
5
7
|
|
6
8
|
jobs:
|
7
|
-
|
9
|
+
test:
|
10
|
+
strategy:
|
11
|
+
fail-fast: false
|
12
|
+
matrix:
|
13
|
+
os: [ubuntu, macos]
|
14
|
+
ruby: [2.5, 2.6, 2.7, jruby, jruby-head, truffleruby]
|
15
|
+
runs-on: ${{ matrix.os }}-latest
|
16
|
+
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@v2
|
19
|
+
- uses: ruby/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: ${{ matrix.ruby }}
|
22
|
+
- run: bundle install
|
23
|
+
- run: bundle exec rake
|
24
|
+
|
8
25
|
build:
|
9
26
|
runs-on: ubuntu-latest
|
10
|
-
|
27
|
+
needs: test
|
28
|
+
|
11
29
|
steps:
|
12
30
|
- uses: actions/checkout@v2
|
13
31
|
- uses: ruby/setup-ruby@v1
|
14
32
|
with:
|
15
33
|
ruby-version: 2.7
|
16
34
|
- name: Release Gem
|
35
|
+
if: contains(github.ref, 'refs/tags/v')
|
17
36
|
run: ./scripts/release.sh
|
18
37
|
env:
|
19
38
|
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -11,12 +11,13 @@ GEM
|
|
11
11
|
coderay (1.1.3)
|
12
12
|
crack (0.4.4)
|
13
13
|
diff-lcs (1.4.4)
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
faraday (1.1.0)
|
15
|
+
multipart-post (>= 1.2, < 3)
|
16
|
+
ruby2_keywords
|
17
17
|
gem-release (2.2.0)
|
18
18
|
hashdiff (1.0.1)
|
19
19
|
method_source (1.0.0)
|
20
|
+
multipart-post (2.1.1)
|
20
21
|
pry (0.13.1)
|
21
22
|
coderay (~> 1.1)
|
22
23
|
method_source (~> 1.0)
|
@@ -35,8 +36,7 @@ GEM
|
|
35
36
|
diff-lcs (>= 1.2.0, < 2.0)
|
36
37
|
rspec-support (~> 3.9.0)
|
37
38
|
rspec-support (3.9.3)
|
38
|
-
|
39
|
-
ethon (>= 0.9.0)
|
39
|
+
ruby2_keywords (0.0.2)
|
40
40
|
webmock (3.9.3)
|
41
41
|
addressable (>= 2.3.6)
|
42
42
|
crack (>= 0.3.2)
|
@@ -47,11 +47,11 @@ PLATFORMS
|
|
47
47
|
|
48
48
|
DEPENDENCIES
|
49
49
|
evervault!
|
50
|
+
faraday
|
50
51
|
gem-release
|
51
52
|
pry
|
52
53
|
rake (~> 12.0)
|
53
54
|
rspec (~> 3.0)
|
54
|
-
typhoeus
|
55
55
|
webmock
|
56
56
|
|
57
57
|
BUNDLED WITH
|
data/lib/evervault.rb
CHANGED
@@ -6,24 +6,8 @@ module Evervault
|
|
6
6
|
class << self
|
7
7
|
attr_accessor :api_key
|
8
8
|
|
9
|
-
def
|
10
|
-
client.
|
11
|
-
end
|
12
|
-
|
13
|
-
def encrypt_and_run(cage_name, data)
|
14
|
-
client.encrypt_and_run(cage_name, data)
|
15
|
-
end
|
16
|
-
|
17
|
-
def encrypt(data)
|
18
|
-
client.encrypt(data)
|
19
|
-
end
|
20
|
-
|
21
|
-
def cages
|
22
|
-
client.cages
|
23
|
-
end
|
24
|
-
|
25
|
-
def cage_list
|
26
|
-
client.cage_list
|
9
|
+
def method_missing(method, *args, &block)
|
10
|
+
client.send(method, *args, &block)
|
27
11
|
end
|
28
12
|
|
29
13
|
private def client
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require "
|
1
|
+
require "faraday"
|
2
2
|
require "json"
|
3
3
|
require_relative "../version"
|
4
4
|
require_relative "../errors/error_map"
|
@@ -35,25 +35,12 @@ module Evervault
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def execute(method, url, params)
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
url,
|
42
|
-
method: method,
|
43
|
-
params: params,
|
44
|
-
headers: build_headers
|
45
|
-
)
|
46
|
-
req.on_complete do |response|
|
47
|
-
if response.success?
|
48
|
-
return JSON.parse(response.body)
|
49
|
-
else
|
50
|
-
Evervault::Errors::ErrorMap.raise_errors_on_failure(
|
51
|
-
response.code,
|
52
|
-
response.body
|
53
|
-
)
|
54
|
-
end
|
38
|
+
resp = Faraday.send(method, url) do |req|
|
39
|
+
req.body = params.nil? || params.empty? ? nil : params.to_json
|
40
|
+
req.headers = build_headers
|
55
41
|
end
|
56
|
-
resp
|
42
|
+
return JSON.parse(resp.body) if resp.status >= 200 && resp.status <= 300
|
43
|
+
Evervault::Errors::ErrorMap.raise_errors_on_failure(resp.status, resp.body)
|
57
44
|
end
|
58
45
|
|
59
46
|
private def build_headers
|
@@ -61,6 +48,7 @@ module Evervault
|
|
61
48
|
"AcceptEncoding": "gzip, deflate",
|
62
49
|
"Accept": "application/json",
|
63
50
|
"Content-Type": "application/json",
|
51
|
+
"User-Agent": "evervault-ruby/#{VERSION}",
|
64
52
|
"Api-Key": @api_key
|
65
53
|
}
|
66
54
|
end
|
data/lib/evervault/version.rb
CHANGED
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: 0.1.
|
4
|
+
version: 0.1.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: 2020-
|
11
|
+
date: 2020-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -17,6 +17,8 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
+
- ".github/CODEOWNERS"
|
21
|
+
- ".github/pull_request_template.md"
|
20
22
|
- ".github/workflows/release.yml"
|
21
23
|
- ".github/workflows/run-tests.yml"
|
22
24
|
- ".gitignore"
|
@@ -63,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
63
65
|
- !ruby/object:Gem::Version
|
64
66
|
version: '0'
|
65
67
|
requirements: []
|
66
|
-
rubygems_version: 3.1.
|
68
|
+
rubygems_version: 3.1.2
|
67
69
|
signing_key:
|
68
70
|
specification_version: 4
|
69
71
|
summary: Ruby SDK to run Evervault Cages
|