vgs_api_client 0.0.1.alpha202205031253 → 0.0.1.alpha202205041132

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 59992eda95c2b4979524c25c9b283c4807eceb48424726b5a42457baa391ec8d
4
- data.tar.gz: 5d0a5c7f3e60a38ebb1f30dd432d162ccf74e49b00585acf40da52768f28066c
3
+ metadata.gz: fa2430588c0393172f00a7f6b817021543ef7ea3d4516e5274a0403c37b51bdb
4
+ data.tar.gz: 84a665c077b9722801c8a16d339034da80cfb57d1b8b90d7d00a01234564c285
5
5
  SHA512:
6
- metadata.gz: a23afd5d0b592589cb4607f296e857cd1cb77a9f3d69cb87cf6862b01fd2c7b8f85f91b29dc6b7547b752770ad334d81c7f067f16a0bfd89dbccc567240fdc72
7
- data.tar.gz: 7f33c73fccbcde9202d6bafb363d3ac454558c93e3bf2b82e5727eb64ab88baebad0ba5e5cd752d5327b699bbe7d615341bdcffcb41ae0ad3bf3eb7f7d83d4bb
6
+ metadata.gz: 3d6cbe204fa2fd252f805628f1138ceaf28cf8ea1dd7e7c4a42816b8ef8d65c30c909f7f26ad95f4603be6a9c0219ac48a3a885a2a2655fc212c1423491e4783
7
+ data.tar.gz: 69fed9d6f587633e6ab500e3125516fa227cfbdf8a8e598a3fee62eac7718e1a749f86730e08e66107dbc320a3f7f96200b6557c43d951243968d8fe5b877875
data/README.md CHANGED
@@ -16,11 +16,11 @@ gem install vgs-api-client
16
16
 
17
17
  ### Development
18
18
 
19
- Follow [DEVELOPMENT](DEVELOPMENT.md) instruction.
19
+ Follow [DEVELOPMENT](https://github.com/verygoodsecurity/vgs-api-client-ruby/blob/master/DEVELOPMENT.md) instruction.
20
20
 
21
21
  ### Release
22
22
 
23
- Follow [RELEASE](RELEASE.md) instruction.
23
+ Follow [RELEASE](https://github.com/verygoodsecurity/vgs-api-client-ruby/blob/master/RELEASE.md) instruction.
24
24
 
25
25
  ### Documentation
26
26
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1.alpha202205031253
1
+ 0.0.1.alpha202205041132
@@ -31,7 +31,7 @@ module VgsApiClient
31
31
  # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
32
32
  def initialize(config = Configuration.default)
33
33
  @config = config
34
- @user_agent = "vgs-api-client/0.0.1.alpha202205031253/ruby"
34
+ @user_agent = "vgs-api-client/0.0.1.alpha202205041132/ruby"
35
35
  @default_headers = {
36
36
  'Content-Type' => 'application/json',
37
37
  'User-Agent' => @user_agent
@@ -11,5 +11,5 @@ OpenAPI Generator version: 5.4.0
11
11
  =end
12
12
 
13
13
  module VgsApiClient
14
- VERSION = '0.0.1.alpha202205031253'
14
+ VERSION = '0.0.1.alpha202205041132'
15
15
  end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module VGS
2
- VERSION = '0.0.1.alpha202205031253'
2
+ VERSION = '0.0.1.alpha202205041132'
3
3
  end
@@ -6,7 +6,6 @@ module VGS
6
6
 
7
7
  class Aliases
8
8
  def initialize(config)
9
- raise ArgumentError, 'config is nil' if config.nil?
10
9
  @aliases_api = VgsApiClient::AliasesApi.new(VgsApiClient::ApiClient.new(config))
11
10
  end
12
11
 
@@ -14,7 +13,7 @@ module VGS
14
13
  begin
15
14
  requests = data.map do |item|
16
15
  VgsApiClient::CreateAliasesRequestNew.new(attributes = {
17
- :format => VgsApiClient::AliasFormat.build_from_hash(item[:format]),
16
+ :format => VgsApiClient::AliasFormat.build_from_hash(item[:format] || "UUID"),
18
17
  :classifiers => item[:classifiers],
19
18
  :value => item[:value],
20
19
  :storage => item[:storage]
@@ -78,7 +77,6 @@ module VGS
78
77
  config.username = username
79
78
  config.password = password
80
79
  config.host = host
81
- config.server_index = nil
82
80
  config
83
81
  end
84
82
  end
@@ -3,7 +3,7 @@
3
3
  LIB_VERSION=${LIB_VERSION:-0.0.1.alpha$(date "+%Y%m%d%H%M")}
4
4
 
5
5
  # fix version
6
- grep -rl 0.0.1.alpha202205031253 . | xargs sed -i "s/0.0.1.alpha202205031253/${LIB_VERSION}/g"
6
+ grep -rl 0.0.1.alpha202205041132 . | xargs sed -i "s/0.0.1.alpha202205041132/${LIB_VERSION}/g"
7
7
 
8
8
  # build
9
9
  gem build vgs_api_client.gemspec
data/scripts/test/run.sh CHANGED
@@ -5,7 +5,7 @@ set -e
5
5
  echo "Installing lib from local sources"
6
6
  # fix version
7
7
  VERSION=0.0.1.alpha$(date "+%Y%m%d%H%M")
8
- grep -rl 0.0.1.alpha202205031253 . | xargs sed -i "s/0.0.1.alpha202205031253/$VERSION/g"
8
+ grep -rl 0.0.1.alpha202205041132 . | xargs sed -i "s/0.0.1.alpha202205041132/$VERSION/g"
9
9
 
10
10
  bundle install
11
11
 
@@ -3,43 +3,9 @@ require 'securerandom'
3
3
  require 'vgs_api_client'
4
4
 
5
5
  describe 'AliasesApiSpec' do
6
- before(:each) do
6
+ before(:all) do
7
7
  config = VGS.config(username = ENV['VAULT_API_USERNAME'], password = ENV['VAULT_API_PASSWORD'])
8
- @api = VGS::Aliases.new config
9
- end
10
-
11
- describe 'invalid auth' do
12
- it 'should fail if invalid auth provided' do
13
- invalid_config = VGS.config(username = 'Invalid', password = 'Invalid')
14
- api = VGS::Aliases.new invalid_config
15
- data = [{
16
- format: 'UUID',
17
- value: 'Joe Doe'
18
- }]
19
-
20
- expect { api.redact data }.to raise_error(VGS::VgsApiException)
21
- end
22
- end
23
-
24
- describe 'invalid config' do
25
- it 'should fail if invalid config provided' do
26
- expect { VGS::Aliases.new nil }.to raise_error(ArgumentError)
27
- end
28
- end
29
-
30
- describe 'invalid host' do
31
- it 'should fail if invalid host provided' do
32
- config = VGS.config(
33
- username = ENV['VAULT_API_USERNAME'],
34
- password = ENV['VAULT_API_PASSWORD'],
35
- host = 'https://echo.apps.verygood.systems')
36
- api = VGS::Aliases.new config
37
- data = [{
38
- format: 'UUID',
39
- value: 'Joe Doe'
40
- }]
41
- expect { api.redact data }.to raise_error(VGS::VgsApiException)
42
- end
8
+ @aliases_api = VGS::Aliases.new config
43
9
  end
44
10
 
45
11
  describe 'redact' do
@@ -55,7 +21,7 @@ describe 'AliasesApiSpec' do
55
21
  value: 'Joe Doe',
56
22
  storage: 'VOLATILE'
57
23
  }]
58
- aliases = @api.redact data
24
+ aliases = @aliases_api.redact data
59
25
  expect(aliases.length).to eq 2
60
26
  data.each_with_index do |item, index|
61
27
  expect(aliases[index].value).to eq item[:value]
@@ -80,14 +46,14 @@ describe 'AliasesApiSpec' do
80
46
  value: 'Joe Doe',
81
47
  storage: 'VOLATILE'
82
48
  }]
83
- aliases = @api.redact(data).map { |item| item.aliases[0]._alias }
49
+ aliases = @aliases_api.redact(data).map { |item| item.aliases[0]._alias }
84
50
 
85
- response = @api.reveal aliases
51
+ response = @aliases_api.reveal aliases
86
52
 
87
53
  expect(response.length).to eq 2
88
54
  original_values = data.map { |i| i[:value] }
89
55
  revealed_values = response.values.map { |i| i.value }
90
- expect(Set.new original_values).to eq Set.new revealed_values
56
+ expect(Set.new(original_values)).to eq Set.new(revealed_values)
91
57
  end
92
58
  end
93
59
 
@@ -97,11 +63,11 @@ describe 'AliasesApiSpec' do
97
63
  format: 'UUID',
98
64
  value: SecureRandom.alphanumeric(10)
99
65
  }]
100
- _alias = @api.redact(data).map { |item| item.aliases[0]._alias }[0]
66
+ _alias = @aliases_api.redact(data).map { |item| item.aliases[0]._alias }[0]
101
67
 
102
- @api.update _alias, classifiers: %w[secure]
68
+ @aliases_api.update _alias, classifiers: %w[secure]
103
69
 
104
- response = @api.reveal _alias
70
+ response = @aliases_api.reveal(_alias)
105
71
  expect(response[_alias].classifiers).to eq %w[secure]
106
72
  end
107
73
  end
@@ -112,11 +78,11 @@ describe 'AliasesApiSpec' do
112
78
  format: 'UUID',
113
79
  value: '5201784564572092'
114
80
  }]
115
- _alias = @api.redact(data).map { |item| item.aliases[0]._alias }[0]
81
+ _alias = @aliases_api.redact(data).map { |item| item.aliases[0]._alias }[0]
116
82
 
117
- @api.delete _alias
83
+ @aliases_api.delete _alias
118
84
 
119
- expect { @api.reveal _alias }.to raise_error(VGS::VgsApiException)
85
+ expect { @aliases_api.reveal(_alias) }.to raise_error(VGS::VgsApiException)
120
86
  end
121
87
  end
122
88
 
@@ -9,8 +9,8 @@ Gem::Specification.new do |s|
9
9
  s.authors = ["Very Good Security"]
10
10
  s.email = ["support@verygoodsecurity.com"]
11
11
  s.homepage = "https://github.com/verygoodsecurity/vgs-api-client-ruby"
12
- s.summary = "VGS API Client"
13
- s.description = "This gem maps to VGS Vault API"
12
+ s.summary = "Very Good Security API Client"
13
+ s.description = "Very Good Security API Client library. More details on https://www.verygoodsecurity.com/"
14
14
  s.license = "BSD-3-Clause"
15
15
  s.required_ruby_version = ">= 2.6"
16
16
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vgs_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha202205031253
4
+ version: 0.0.1.alpha202205041132
5
5
  platform: ruby
6
6
  authors:
7
7
  - Very Good Security
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-03 00:00:00.000000000 Z
11
+ date: 2022-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -50,7 +50,7 @@ dependencies:
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
52
  version: 3.6.0
53
- description: This gem maps to VGS Vault API
53
+ description: Very Good Security API Client library. More details on https://www.verygoodsecurity.com/
54
54
  email:
55
55
  - support@verygoodsecurity.com
56
56
  executables: []
@@ -132,7 +132,7 @@ requirements: []
132
132
  rubygems_version: 3.3.7
133
133
  signing_key:
134
134
  specification_version: 4
135
- summary: VGS API Client
135
+ summary: Very Good Security API Client
136
136
  test_files:
137
137
  - spec/api_client_spec.rb
138
138
  - spec/configuration_spec.rb