vgs_api_client 0.0.1.alpha202204221804 → 0.0.1.alpha202204222318

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +33 -0
  3. data/lib/{vgs_api_client → openapi_client}/api/aliases_api.rb +0 -0
  4. data/lib/{vgs_api_client → openapi_client}/api_client.rb +1 -1
  5. data/lib/{vgs_api_client → openapi_client}/api_error.rb +0 -0
  6. data/lib/{vgs_api_client → openapi_client}/configuration.rb +0 -0
  7. data/lib/{vgs_api_client → openapi_client}/models/alias_format.rb +0 -0
  8. data/lib/openapi_client/models/api_error.rb +0 -0
  9. data/lib/{vgs_api_client → openapi_client}/models/create_aliases_request.rb +0 -0
  10. data/lib/{vgs_api_client → openapi_client}/models/create_aliases_request_new.rb +0 -0
  11. data/lib/{vgs_api_client → openapi_client}/models/create_aliases_request_reference.rb +0 -0
  12. data/lib/{vgs_api_client → openapi_client}/models/inline_response200.rb +0 -0
  13. data/lib/{vgs_api_client → openapi_client}/models/inline_response2001.rb +0 -0
  14. data/lib/{vgs_api_client → openapi_client}/models/inline_response201.rb +0 -0
  15. data/lib/{vgs_api_client → openapi_client}/models/inline_response_default.rb +0 -0
  16. data/lib/{vgs_api_client → openapi_client}/models/model_alias.rb +0 -0
  17. data/lib/{vgs_api_client → openapi_client}/models/revealed_data.rb +0 -0
  18. data/lib/{vgs_api_client → openapi_client}/models/update_alias_request.rb +0 -0
  19. data/lib/{vgs_api_client → openapi_client}/models/update_alias_request_data.rb +0 -0
  20. data/lib/{vgs_api_client → openapi_client}/version.rb +1 -1
  21. data/lib/openapi_client.rb +53 -0
  22. data/lib/version.rb +1 -1
  23. data/lib/vgs_api_client.rb +1 -23
  24. data/scripts/assemble/run.sh +2 -2
  25. data/scripts/publish/run.sh +1 -1
  26. data/scripts/publish.sh +1 -1
  27. data/scripts/run-tests-e2e.sh +1 -1
  28. data/scripts/test/run.sh +2 -2
  29. data/scripts/test-e2e/Dockerfile +1 -9
  30. data/scripts/test-e2e/run.sh +3 -5
  31. data/spec/spec_helper.rb +1 -1
  32. data/spec/test_aliases_api_spec.rb +36 -44
  33. data/vgs_api_client.gemspec +2 -2
  34. metadata +23 -24
  35. data/Gemfile.lock +0 -70
  36. data/datadog.rb +0 -10
  37. data/lib/vgs_api_client/models/api_error.rb +0 -249
  38. data/test.rb +0 -93
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad6f53cf37b26adf6ad0d2d8601bce2d3812dfd8f33f5956fb2bc7a1a0adedc6
4
- data.tar.gz: b1f5add24e6548547ffacda7cde9ebf25f2db4fcbe7f350b2fa8836efe93544e
3
+ metadata.gz: 5cab695598ef55ea5a07e69316ee7a106921c794b5c7e37b97559d7a1c099996
4
+ data.tar.gz: 66925e1467c3c87eff425f90937217985eb0bdd48a26c4538305373a8aa2f4db
5
5
  SHA512:
6
- metadata.gz: 0e24e515b39092e5027afa40defa1efb5c4162fbc9889118d9dcd114beb8b0fbdba030f181f4df81f7031d1e573f1743f2d7ed8e6e3057a255715c32bf91e967
7
- data.tar.gz: d738f6848d1e2e61bd074319153ecd7dd8646efa59f428f103e86a208e54762d4e7921ad95090d530bfb1fb60725cf8e5f8f7c2978d3e0de05bc8dec1f0bd9c3
6
+ metadata.gz: a1658b2a77c7cd7462b547384ef8c93b4eab424a8b1d3e585116eb9afafe9ff493a16055831edc1a54d648eecb109fac0ccacc1c4377511e36498d8fbd6ddf68
7
+ data.tar.gz: 10105ca8a5cb2543a55d671193403248dbc9109815bf3849e43370f06b29fc704f6ec2a7d2b70df50b14fa4b8ee79057249f823296ae68c3d5048c42fe3f21d0
data/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # vgs-api-client-python
2
+
3
+ This repository contains a Ruby API client library for the Very Good Security API.
4
+
5
+ ### Requirements
6
+
7
+ Building and using the API client library requires Ruby 2.6+.
8
+
9
+ ### Installation
10
+
11
+ ```
12
+ gem install vgs-api-client
13
+ ```
14
+
15
+ ### Development
16
+
17
+ Follow [DEVELOPMENT](DEVELOPMENT.md) instruction.
18
+
19
+ ### Release
20
+
21
+ Follow [RELEASE](RELEASE.md) instruction.
22
+
23
+ ### Documentation
24
+
25
+ https://www.verygoodsecurity.com/docs/vault/api/
26
+
27
+ ### Tutorial
28
+
29
+ https://www.verygoodsecurity.com/docs/tokenization/ruby-tutorial
30
+
31
+ ### Support
32
+
33
+ support@verygoodsecurity.com
@@ -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.alpha202204221804/ruby"
34
+ @user_agent = "vgs-api-client/0.0.1.alpha202204222318/ruby"
35
35
  @default_headers = {
36
36
  'Content-Type' => 'application/json',
37
37
  'User-Agent' => @user_agent
File without changes
File without changes
@@ -11,5 +11,5 @@ OpenAPI Generator version: 5.4.0
11
11
  =end
12
12
 
13
13
  module VgsApiClient
14
- VERSION = '0.0.1.alpha202204221804'
14
+ VERSION = '0.0.1.alpha202204222318'
15
15
  end
@@ -0,0 +1,53 @@
1
+ =begin
2
+ #Vault HTTP API
3
+
4
+ #The VGS Vault HTTP API is used for storing, retrieving, and managing sensitive data (aka Tokenization) within a VGS Vault. The VGS API is organized around REST. Our API is built with a predictable resource-oriented structure, uses JSON-encoded requests and responses, follows standard HTTP verbs/responses, and uses industry standard authentication. ## What is VGS Storing sensitive data on your company’s infrastructure often comes with a heavy compliance burden. For instance, storing payments data yourself greatly increases the amount of work needed to become PCI compliant. It also increases your security risk in general. To combat this, companies will minimize the amount of sensitive information they have to handle or store. VGS provides multiple methods for minimizing the sensitive information that needs to be stored which allows customers to secure any type of data for any use-case. **Tokenization** is a method that focuses on securing the storage of data. This is the quickest way to get started and is free. [Get started with Tokenization](https://www.verygoodsecurity.com/docs/tokenization/getting-started). **Zero Data** is a unique method invented by VGS in 2016 that securely stores data like Tokenization, however it also removes the customer’s environment from PCI scope completely providing maximum security, and minimum compliance scope. [Get started with Zero Data](https://www.verygoodsecurity.com/docs/getting-started/before-you-start). Additionally, for scenarios where neither technology is a complete solution, for instance with legacy systems, VGS provides a compliance product which guarantees customers are able to meet their compliance needs no matter what may happen. [Get started with Control](https://www.verygoodsecurity.com/docs/control). ## Learn about Tokenization - [Create an Account for Free Tokenization](https://dashboard.verygoodsecurity.com/tokenization) - [Try a Tokenization Demo](https://www.verygoodsecurity.com/docs/tokenization/getting-started) - [Install a Tokenization SDK](https://www.verygoodsecurity.com/docs/tokenization/client-libraries) ### Authentication This API uses `Basic` authentication. Credentials to access the API can be generated on the [dashboard](https://dashboard.verygoodsecurity.com) by going to the Settings section of the vault of your choosing. [Docs » Guides » Access credentials](https://www.verygoodsecurity.com/docs/settings/access-credentials) ## Resource Limits ### Data Limits This API allows storing data up to 32MB in size. ### Rate Limiting The API allows up to 3,000 requests per minute. Requests are associated with the vault, regardless of the access credentials used to authenticate the request. Your current rate limit is included as HTTP headers in every API response: | Header Name | Description | |-------------------------|----------------------------------------------------------| | `x-ratelimit-remaining` | The number of requests remaining in the 1-minute window. | If you exceed the rate limit, the API will reject the request with HTTP [429 Too Many Requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429). ### Errors The API uses standard HTTP status codes to indicate whether the request succeeded or not. In case of failure, the response body will be JSON in a predefined format. For example, trying to create too many aliases at once results in the following response: ```json { \"errors\": [ { \"status\": 400, \"title\": \"Bad request\", \"detail\": \"Too many values (limit: 20)\", \"href\": \"https://api.sandbox.verygoodvault.com/aliases\" } ] } ```
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@verygoodsecurity.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.4.0
10
+
11
+ =end
12
+
13
+ # Common files
14
+ require 'openapi_client/api_client'
15
+ require 'openapi_client/api_error'
16
+ require 'openapi_client/version'
17
+ require 'openapi_client/configuration'
18
+
19
+ # Models
20
+ require 'openapi_client/models/alias_format'
21
+ require 'openapi_client/models/api_error'
22
+ require 'openapi_client/models/create_aliases_request'
23
+ require 'openapi_client/models/create_aliases_request_new'
24
+ require 'openapi_client/models/create_aliases_request_reference'
25
+ require 'openapi_client/models/inline_response200'
26
+ require 'openapi_client/models/inline_response2001'
27
+ require 'openapi_client/models/inline_response201'
28
+ require 'openapi_client/models/inline_response_default'
29
+ require 'openapi_client/models/model_alias'
30
+ require 'openapi_client/models/revealed_data'
31
+ require 'openapi_client/models/update_alias_request'
32
+ require 'openapi_client/models/update_alias_request_data'
33
+
34
+ # APIs
35
+ require 'openapi_client/api/aliases_api'
36
+
37
+ module VgsApiClient
38
+ class << self
39
+ # Customize default settings for the SDK using block.
40
+ # VgsApiClient.configure do |config|
41
+ # config.username = "xxx"
42
+ # config.password = "xxx"
43
+ # end
44
+ # If no block given, return the default Configuration object.
45
+ def configure
46
+ if block_given?
47
+ yield(Configuration.default)
48
+ else
49
+ Configuration.default
50
+ end
51
+ end
52
+ end
53
+ end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module VGS
2
- VERSION = '0.0.1.alpha202204221804'
2
+ VERSION = '0.0.1.alpha202204222318'
3
3
  end
@@ -1,26 +1,4 @@
1
- # Common files
2
- require 'vgs_api_client/api_client'
3
- require 'vgs_api_client/api_error'
4
- require 'vgs_api_client/version'
5
- require 'vgs_api_client/configuration'
6
-
7
- # Models
8
- require 'vgs_api_client/models/alias_format'
9
- require 'vgs_api_client/models/api_error'
10
- require 'vgs_api_client/models/create_aliases_request'
11
- require 'vgs_api_client/models/create_aliases_request_new'
12
- require 'vgs_api_client/models/create_aliases_request_reference'
13
- require 'vgs_api_client/models/inline_response200'
14
- require 'vgs_api_client/models/inline_response2001'
15
- require 'vgs_api_client/models/inline_response201'
16
- require 'vgs_api_client/models/inline_response_default'
17
- require 'vgs_api_client/models/model_alias'
18
- require 'vgs_api_client/models/revealed_data'
19
- require 'vgs_api_client/models/update_alias_request'
20
- require 'vgs_api_client/models/update_alias_request_data'
21
-
22
- # APIs
23
- require 'vgs_api_client/api/aliases_api'
1
+ require 'openapi_client'
24
2
 
25
3
  module VGS
26
4
  class VgsApiException < StandardError
@@ -1,9 +1,9 @@
1
1
  #!/bin/bash
2
2
 
3
- LIB_VERSION=${LIB_VERSION:-0.0.1.alpha202204221804.alpha$(date "+%Y%m%d%H%M")}
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.alpha202204221804 . | xargs sed -i "s/0.0.1.alpha202204221804/${LIB_VERSION}/g"
6
+ grep -rl 0.0.1.alpha202204222318 . | xargs sed -i "s/0.0.1.alpha202204222318/${LIB_VERSION}/g"
7
7
 
8
8
  # build
9
9
  gem build vgs_api_client.gemspec
@@ -6,7 +6,7 @@ usage() { echo "Required env var '$1' is missing"; exit 1; }
6
6
 
7
7
  [ -z "${ARTIFACT_REPOSITORY_TOKEN}" ] && usage "ARTIFACT_REPOSITORY_TOKEN" ;
8
8
 
9
- LIB_VERSION=${LIB_VERSION:-0.0.1.alpha202204221804.alpha$(date "+%Y%m%d%H%M")}
9
+ LIB_VERSION=${LIB_VERSION:-0.0.1.alpha$(date "+%Y%m%d%H%M")}
10
10
 
11
11
  mkdir ~/.gem
12
12
  echo ":rubygems_api_key: ${ARTIFACT_REPOSITORY_TOKEN}" > ~/.gem/credentials
data/scripts/publish.sh CHANGED
@@ -6,7 +6,7 @@ usage() { echo "Required env var '$1' is missing"; exit 1; }
6
6
 
7
7
  [ -z "${ARTIFACT_REPOSITORY_TOKEN}" ] && usage "ARTIFACT_REPOSITORY_TOKEN" ;
8
8
 
9
- export LIB_VERSION=${LIB_VERSION:-0.0.1.alpha202204221804.alpha$(date "+%Y%m%d%H%M")}
9
+ export LIB_VERSION=${LIB_VERSION:-0.0.1.alpha$(date "+%Y%m%d%H%M")}
10
10
 
11
11
  docker-compose build && \
12
12
  docker-compose run assemble && \
@@ -2,7 +2,7 @@
2
2
 
3
3
  set -e
4
4
 
5
- export LIB_VERSION=${LIB_VERSION:-0.0.1.alpha202204221804.alpha$(date "+%Y%m%d%H%M")}
5
+ export LIB_VERSION=${LIB_VERSION:-0.0.1.alpha$(date "+%Y%m%d%H%M")}
6
6
 
7
7
  docker-compose build test-e2e && \
8
8
  docker-compose run test-e2e
data/scripts/test/run.sh CHANGED
@@ -4,8 +4,8 @@ set -e
4
4
 
5
5
  echo "Installing lib from local sources"
6
6
  # fix version
7
- VERSION=0.0.1.alpha202204221804.alpha$(date "+%Y%m%d%H%M")
8
- grep -rl 0.0.1.alpha202204221804 . | xargs sed -i "s/0.0.1.alpha202204221804/$VERSION/g"
7
+ VERSION=0.0.1.alpha$(date "+%Y%m%d%H%M")
8
+ grep -rl 0.0.1.alpha202204222318 . | xargs sed -i "s/0.0.1.alpha202204222318/$VERSION/g"
9
9
 
10
10
  bundle install
11
11
 
@@ -4,19 +4,11 @@ RUN apk update && \
4
4
  apk add bash && \
5
5
  apk add build-base && \
6
6
  apk add libcurl && \
7
- gem install bundler && \
8
- gem install rspec-support
9
-
10
- RUN mkdir -p /vgs-api-client/ && \
11
- mkdir -p /vgs-api-client/tmp
7
+ gem install rspec
12
8
 
13
9
  ADD ./scripts/test-e2e /vgs-api-client/scripts
14
10
  ADD ./spec /vgs-api-client/spec
15
11
 
16
- # Temporarily copying gem files to tmp/ dir
17
- ADD ./vgs_api_client.gemspec /vgs-api-client/tmp/vgs_api_client.gemspec
18
- ADD ./Gemfile /vgs-api-client/tmp/Gemfile
19
-
20
12
  WORKDIR /vgs-api-client/
21
13
 
22
14
  ENTRYPOINT ["bash", "./scripts/run.sh"]
@@ -9,7 +9,6 @@ ATTEMPT=1
9
9
  while [ $ATTEMPT -lt 10 ]; do
10
10
  echo "Attempt ${ATTEMPT} ..."
11
11
 
12
- bundle install --without production --binstubs
13
12
  gem install vgs_api_client -v ${LIB_VERSION}
14
13
 
15
14
  if [[ $? == 0 ]]; then
@@ -24,7 +23,6 @@ done
24
23
  set -e
25
24
 
26
25
  echo "Running tests"
27
- mv /vgs-api-client/tmp/Gemfile /vgs-api-client/
28
- mv /vgs-api-client/tmp/vgs_api_client.gemspec /vgs-api-client/
29
- bundle install --without production --binstubs
30
- bundle exec rspec -f documentation ./spec/*.rb
26
+ gem install rspec
27
+ rspec -f documentation ./spec/*.rb
28
+
data/spec/spec_helper.rb CHANGED
@@ -11,7 +11,7 @@ OpenAPI Generator version: 5.4.0
11
11
  =end
12
12
 
13
13
  # load the gem
14
- require 'vgs_api_client'
14
+ require 'openapi_client'
15
15
 
16
16
  # The following was generated by the `rspec --init` command. Conventionally, all
17
17
  # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
@@ -4,26 +4,24 @@ require 'vgs_api_client'
4
4
 
5
5
  describe 'AliasesApiSpec' do
6
6
  before(:all) do
7
- config = VGS.config(username = ENV["VAULT_API_USERNAME"], password = ENV["VAULT_API_PASSWORD"])
8
- @aliases_api = VGS::Aliases.new(config)
7
+ config = VGS.config(username = ENV['VAULT_API_USERNAME'], password = ENV['VAULT_API_PASSWORD'])
8
+ @aliases_api = VGS::Aliases.new config
9
9
  end
10
10
 
11
11
  describe 'redact' do
12
12
  it 'should redact values' do
13
- data = [
14
- {
15
- :format => 'UUID',
16
- :value => '5201784564572092',
17
- :classifiers => %w[credit-card number],
18
- :storage => 'PERSISTENT',
19
- },
20
- {
21
- :format => 'UUID',
22
- :value => 'Joe Doe',
23
- :storage => 'VOLATILE',
24
- }
25
- ]
26
- aliases = @aliases_api.redact(data)
13
+ data = [{
14
+ format: 'UUID',
15
+ value: '5201784564572092',
16
+ classifiers: %w[credit-card number],
17
+ storage: 'PERSISTENT'
18
+ },
19
+ {
20
+ format: 'UUID',
21
+ value: 'Joe Doe',
22
+ storage: 'VOLATILE'
23
+ }]
24
+ aliases = @aliases_api.redact data
27
25
  expect(aliases.length).to eq 2
28
26
  data.each_with_index do |item, index|
29
27
  expect(aliases[index].value).to eq item[:value]
@@ -37,22 +35,20 @@ describe 'AliasesApiSpec' do
37
35
 
38
36
  describe 'reveal' do
39
37
  it 'should reveal aliases' do
40
- data = [
41
- {
42
- :format => 'UUID',
43
- :value => '5201784564572092',
44
- :classifiers => %w[credit-card number],
45
- :storage => 'PERSISTENT',
46
- },
47
- {
48
- :format => 'UUID',
49
- :value => 'Joe Doe',
50
- :storage => 'VOLATILE',
51
- }
52
- ]
38
+ data = [{
39
+ format: 'UUID',
40
+ value: '5201784564572092',
41
+ classifiers: %w[credit-card number],
42
+ storage: 'PERSISTENT'
43
+ },
44
+ {
45
+ format: 'UUID',
46
+ value: 'Joe Doe',
47
+ storage: 'VOLATILE'
48
+ }]
53
49
  aliases = @aliases_api.redact(data).map { |item| item.aliases[0]._alias }
54
50
 
55
- response = @aliases_api.reveal(aliases)
51
+ response = @aliases_api.reveal aliases
56
52
 
57
53
  expect(response.length).to eq 2
58
54
  original_values = data.map { |i| i[:value] }
@@ -63,15 +59,13 @@ describe 'AliasesApiSpec' do
63
59
 
64
60
  describe 'update' do
65
61
  it 'should update alias' do
66
- data = [
67
- {
68
- :format => 'UUID',
69
- :value => SecureRandom.alphanumeric(10),
70
- }
71
- ]
62
+ data = [{
63
+ format: 'UUID',
64
+ value: SecureRandom.alphanumeric(10)
65
+ }]
72
66
  _alias = @aliases_api.redact(data).map { |item| item.aliases[0]._alias }[0]
73
67
 
74
- @aliases_api.update(_alias = _alias, data = { :classifiers => ["secure"] })
68
+ @aliases_api.update _alias, classifiers: %w[secure]
75
69
 
76
70
  response = @aliases_api.reveal(_alias)
77
71
  expect(response[_alias].classifiers).to eq %w[secure]
@@ -80,15 +74,13 @@ describe 'AliasesApiSpec' do
80
74
 
81
75
  describe 'delete' do
82
76
  it 'should delete alias' do
83
- data = [
84
- {
85
- :format => 'UUID',
86
- :value => '5201784564572092',
87
- }
88
- ]
77
+ data = [{
78
+ format: 'UUID',
79
+ value: '5201784564572092'
80
+ }]
89
81
  _alias = @aliases_api.redact(data).map { |item| item.aliases[0]._alias }[0]
90
82
 
91
- @aliases_api.delete(_alias = _alias)
83
+ @aliases_api.delete _alias
92
84
 
93
85
  expect { @aliases_api.reveal(_alias) }.to raise_error(VGS::VgsApiException)
94
86
  end
@@ -11,8 +11,8 @@ Gem::Specification.new do |s|
11
11
  s.homepage = "https://github.com/verygoodsecurity/vgs-api-client-ruby"
12
12
  s.summary = "VGS API Client"
13
13
  s.description = "This gem maps to VGS Vault API"
14
- s.license = "BSD"
15
- s.required_ruby_version = ">= 2.4"
14
+ s.license = "BSD-3-Clause"
15
+ s.required_ruby_version = ">= 2.6"
16
16
 
17
17
  s.metadata = {
18
18
  "homepage_uri" => "https://www.verygoodsecurity.com",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vgs_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha202204221804
4
+ version: 0.0.1.alpha202204222318
5
5
  platform: ruby
6
6
  authors:
7
7
  - Very Good Security
@@ -59,32 +59,32 @@ extra_rdoc_files: []
59
59
  files:
60
60
  - DEVELOPMENT.md
61
61
  - Gemfile
62
- - Gemfile.lock
63
62
  - LICENSE
63
+ - README.md
64
64
  - RELEASE.md
65
65
  - Rakefile
66
- - datadog.rb
67
66
  - docker-compose.yaml
67
+ - lib/openapi_client.rb
68
+ - lib/openapi_client/api/aliases_api.rb
69
+ - lib/openapi_client/api_client.rb
70
+ - lib/openapi_client/api_error.rb
71
+ - lib/openapi_client/configuration.rb
72
+ - lib/openapi_client/models/alias_format.rb
73
+ - lib/openapi_client/models/api_error.rb
74
+ - lib/openapi_client/models/create_aliases_request.rb
75
+ - lib/openapi_client/models/create_aliases_request_new.rb
76
+ - lib/openapi_client/models/create_aliases_request_reference.rb
77
+ - lib/openapi_client/models/inline_response200.rb
78
+ - lib/openapi_client/models/inline_response2001.rb
79
+ - lib/openapi_client/models/inline_response201.rb
80
+ - lib/openapi_client/models/inline_response_default.rb
81
+ - lib/openapi_client/models/model_alias.rb
82
+ - lib/openapi_client/models/revealed_data.rb
83
+ - lib/openapi_client/models/update_alias_request.rb
84
+ - lib/openapi_client/models/update_alias_request_data.rb
85
+ - lib/openapi_client/version.rb
68
86
  - lib/version.rb
69
87
  - lib/vgs_api_client.rb
70
- - lib/vgs_api_client/api/aliases_api.rb
71
- - lib/vgs_api_client/api_client.rb
72
- - lib/vgs_api_client/api_error.rb
73
- - lib/vgs_api_client/configuration.rb
74
- - lib/vgs_api_client/models/alias_format.rb
75
- - lib/vgs_api_client/models/api_error.rb
76
- - lib/vgs_api_client/models/create_aliases_request.rb
77
- - lib/vgs_api_client/models/create_aliases_request_new.rb
78
- - lib/vgs_api_client/models/create_aliases_request_reference.rb
79
- - lib/vgs_api_client/models/inline_response200.rb
80
- - lib/vgs_api_client/models/inline_response2001.rb
81
- - lib/vgs_api_client/models/inline_response201.rb
82
- - lib/vgs_api_client/models/inline_response_default.rb
83
- - lib/vgs_api_client/models/model_alias.rb
84
- - lib/vgs_api_client/models/revealed_data.rb
85
- - lib/vgs_api_client/models/update_alias_request.rb
86
- - lib/vgs_api_client/models/update_alias_request_data.rb
87
- - lib/vgs_api_client/version.rb
88
88
  - scripts/assemble/Dockerfile
89
89
  - scripts/assemble/run.sh
90
90
  - scripts/publish.sh
@@ -100,11 +100,10 @@ files:
100
100
  - spec/configuration_spec.rb
101
101
  - spec/spec_helper.rb
102
102
  - spec/test_aliases_api_spec.rb
103
- - test.rb
104
103
  - vgs_api_client.gemspec
105
104
  homepage: https://github.com/verygoodsecurity/vgs-api-client-ruby
106
105
  licenses:
107
- - BSD
106
+ - BSD-3-Clause
108
107
  metadata:
109
108
  homepage_uri: https://www.verygoodsecurity.com
110
109
  bug_tracker_uri: https://github.com/verygoodsecurity/vgs-api-client-ruby/issues
@@ -118,7 +117,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
118
117
  requirements:
119
118
  - - ">="
120
119
  - !ruby/object:Gem::Version
121
- version: '2.4'
120
+ version: '2.6'
122
121
  required_rubygems_version: !ruby/object:Gem::Requirement
123
122
  requirements:
124
123
  - - ">"
data/Gemfile.lock DELETED
@@ -1,70 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- vgs_api_client (0.0.1.alpha202204221804)
5
- typhoeus (~> 1.0, >= 1.0.1)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- ast (2.4.2)
11
- byebug (11.1.3)
12
- coderay (1.1.3)
13
- diff-lcs (1.5.0)
14
- ethon (0.15.0)
15
- ffi (>= 1.15.0)
16
- ffi (1.15.5)
17
- jaro_winkler (1.5.4)
18
- method_source (1.0.0)
19
- parallel (1.22.1)
20
- parser (3.1.2.0)
21
- ast (~> 2.4.1)
22
- pry (0.13.1)
23
- coderay (~> 1.1)
24
- method_source (~> 1.0)
25
- pry-byebug (3.9.0)
26
- byebug (~> 11.0)
27
- pry (~> 0.13.0)
28
- psych (4.0.3)
29
- stringio
30
- rainbow (3.1.1)
31
- rake (13.0.6)
32
- rspec (3.11.0)
33
- rspec-core (~> 3.11.0)
34
- rspec-expectations (~> 3.11.0)
35
- rspec-mocks (~> 3.11.0)
36
- rspec-core (3.11.0)
37
- rspec-support (~> 3.11.0)
38
- rspec-expectations (3.11.0)
39
- diff-lcs (>= 1.2.0, < 2.0)
40
- rspec-support (~> 3.11.0)
41
- rspec-mocks (3.11.1)
42
- diff-lcs (>= 1.2.0, < 2.0)
43
- rspec-support (~> 3.11.0)
44
- rspec-support (3.11.0)
45
- rubocop (0.66.0)
46
- jaro_winkler (~> 1.5.1)
47
- parallel (~> 1.10)
48
- parser (>= 2.5, != 2.5.1.1)
49
- psych (>= 3.1.0)
50
- rainbow (>= 2.2.2, < 4.0)
51
- ruby-progressbar (~> 1.7)
52
- unicode-display_width (>= 1.4.0, < 1.6)
53
- ruby-progressbar (1.11.0)
54
- stringio (3.0.1)
55
- typhoeus (1.4.0)
56
- ethon (>= 0.9.0)
57
- unicode-display_width (1.5.0)
58
-
59
- PLATFORMS
60
- x86_64-darwin-21
61
-
62
- DEPENDENCIES
63
- pry-byebug
64
- rake (~> 13.0.1)
65
- rspec (~> 3.6, >= 3.6.0)
66
- rubocop (~> 0.66.0)
67
- vgs_api_client!
68
-
69
- BUNDLED WITH
70
- 2.3.11
data/datadog.rb DELETED
@@ -1,10 +0,0 @@
1
- require 'datadog_api_client'
2
-
3
- api_instance = DatadogAPIClient::V1::IPRangesAPI.new
4
-
5
- begin
6
- result = api_instance.get_ip_ranges
7
- p result
8
- rescue DatadogAPIClient::V1::APIError => e
9
- puts "Error when calling IPRangesAPI->get_ip_ranges: #{e}"
10
- end
@@ -1,249 +0,0 @@
1
- =begin
2
- #Vault HTTP API
3
-
4
- #The VGS Vault HTTP API is used for storing, retrieving, and managing sensitive data (aka Tokenization) within a VGS Vault. The VGS API is organized around REST. Our API is built with a predictable resource-oriented structure, uses JSON-encoded requests and responses, follows standard HTTP verbs/responses, and uses industry standard authentication. ## What is VGS Storing sensitive data on your company’s infrastructure often comes with a heavy compliance burden. For instance, storing payments data yourself greatly increases the amount of work needed to become PCI compliant. It also increases your security risk in general. To combat this, companies will minimize the amount of sensitive information they have to handle or store. VGS provides multiple methods for minimizing the sensitive information that needs to be stored which allows customers to secure any type of data for any use-case. **Tokenization** is a method that focuses on securing the storage of data. This is the quickest way to get started and is free. [Get started with Tokenization](https://www.verygoodsecurity.com/docs/tokenization/getting-started). **Zero Data** is a unique method invented by VGS in 2016 that securely stores data like Tokenization, however it also removes the customer’s environment from PCI scope completely providing maximum security, and minimum compliance scope. [Get started with Zero Data](https://www.verygoodsecurity.com/docs/getting-started/before-you-start). Additionally, for scenarios where neither technology is a complete solution, for instance with legacy systems, VGS provides a compliance product which guarantees customers are able to meet their compliance needs no matter what may happen. [Get started with Control](https://www.verygoodsecurity.com/docs/control). ## Learn about Tokenization - [Create an Account for Free Tokenization](https://dashboard.verygoodsecurity.com/tokenization) - [Try a Tokenization Demo](https://www.verygoodsecurity.com/docs/tokenization/getting-started) - [Install a Tokenization SDK](https://www.verygoodsecurity.com/docs/tokenization/client-libraries) ### Authentication This API uses `Basic` authentication. Credentials to access the API can be generated on the [dashboard](https://dashboard.verygoodsecurity.com) by going to the Settings section of the vault of your choosing. [Docs » Guides » Access credentials](https://www.verygoodsecurity.com/docs/settings/access-credentials) ## Resource Limits ### Data Limits This API allows storing data up to 32MB in size. ### Rate Limiting The API allows up to 3,000 requests per minute. Requests are associated with the vault, regardless of the access credentials used to authenticate the request. Your current rate limit is included as HTTP headers in every API response: | Header Name | Description | |-------------------------|----------------------------------------------------------| | `x-ratelimit-remaining` | The number of requests remaining in the 1-minute window. | If you exceed the rate limit, the API will reject the request with HTTP [429 Too Many Requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429). ### Errors The API uses standard HTTP status codes to indicate whether the request succeeded or not. In case of failure, the response body will be JSON in a predefined format. For example, trying to create too many aliases at once results in the following response: ```json { \"errors\": [ { \"status\": 400, \"title\": \"Bad request\", \"detail\": \"Too many values (limit: 20)\", \"href\": \"https://api.sandbox.verygoodvault.com/aliases\" } ] } ```
5
-
6
- The version of the OpenAPI document: 1.0.0
7
- Contact: support@verygoodsecurity.com
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.4.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module VgsApiClient
17
- class ApiError
18
- # Explanation of what exactly went wrong.
19
- attr_accessor :detail
20
-
21
- # Request URL.
22
- attr_accessor :href
23
-
24
- # HTTP status code.
25
- attr_accessor :status
26
-
27
- # High-level reason of why the request failed.
28
- attr_accessor :title
29
-
30
- # Attribute mapping from ruby-style variable name to JSON key.
31
- def self.attribute_map
32
- {
33
- :'detail' => :'detail',
34
- :'href' => :'href',
35
- :'status' => :'status',
36
- :'title' => :'title'
37
- }
38
- end
39
-
40
- # Returns all the JSON keys this model knows about
41
- def self.acceptable_attributes
42
- attribute_map.values
43
- end
44
-
45
- # Attribute type mapping.
46
- def self.openapi_types
47
- {
48
- :'detail' => :'String',
49
- :'href' => :'String',
50
- :'status' => :'Integer',
51
- :'title' => :'String'
52
- }
53
- end
54
-
55
- # List of attributes with nullable: true
56
- def self.openapi_nullable
57
- Set.new([
58
- ])
59
- end
60
-
61
- # Initializes the object
62
- # @param [Hash] attributes Model attributes in the form of hash
63
- def initialize(attributes = {})
64
- if (!attributes.is_a?(Hash))
65
- fail ArgumentError, "The input argument (attributes) must be a hash in `VgsApiClient::ApiError` initialize method"
66
- end
67
-
68
- # check to see if the attribute exists and convert string to symbol for hash key
69
- attributes = attributes.each_with_object({}) { |(k, v), h|
70
- if (!self.class.attribute_map.key?(k.to_sym))
71
- fail ArgumentError, "`#{k}` is not a valid attribute in `VgsApiClient::ApiError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
- end
73
- h[k.to_sym] = v
74
- }
75
-
76
- if attributes.key?(:'detail')
77
- self.detail = attributes[:'detail']
78
- end
79
-
80
- if attributes.key?(:'href')
81
- self.href = attributes[:'href']
82
- end
83
-
84
- if attributes.key?(:'status')
85
- self.status = attributes[:'status']
86
- end
87
-
88
- if attributes.key?(:'title')
89
- self.title = attributes[:'title']
90
- end
91
- end
92
-
93
- # Show invalid properties with the reasons. Usually used together with valid?
94
- # @return Array for valid properties with the reasons
95
- def list_invalid_properties
96
- invalid_properties = Array.new
97
- invalid_properties
98
- end
99
-
100
- # Check to see if the all the properties in the model are valid
101
- # @return true if the model is valid
102
- def valid?
103
- true
104
- end
105
-
106
- # Checks equality by comparing each attribute.
107
- # @param [Object] Object to be compared
108
- def ==(o)
109
- return true if self.equal?(o)
110
- self.class == o.class &&
111
- detail == o.detail &&
112
- href == o.href &&
113
- status == o.status &&
114
- title == o.title
115
- end
116
-
117
- # @see the `==` method
118
- # @param [Object] Object to be compared
119
- def eql?(o)
120
- self == o
121
- end
122
-
123
- # Calculates hash code according to all attributes.
124
- # @return [Integer] Hash code
125
- def hash
126
- [detail, href, status, title].hash
127
- end
128
-
129
- # Builds the object from hash
130
- # @param [Hash] attributes Model attributes in the form of hash
131
- # @return [Object] Returns the model itself
132
- def self.build_from_hash(attributes)
133
- new.build_from_hash(attributes)
134
- end
135
-
136
- # Builds the object from hash
137
- # @param [Hash] attributes Model attributes in the form of hash
138
- # @return [Object] Returns the model itself
139
- def build_from_hash(attributes)
140
- return nil unless attributes.is_a?(Hash)
141
- self.class.openapi_types.each_pair do |key, type|
142
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
143
- self.send("#{key}=", nil)
144
- elsif type =~ /\AArray<(.*)>/i
145
- # check to ensure the input is an array given that the attribute
146
- # is documented as an array but the input is not
147
- if attributes[self.class.attribute_map[key]].is_a?(Array)
148
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
149
- end
150
- elsif !attributes[self.class.attribute_map[key]].nil?
151
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
152
- end
153
- end
154
-
155
- self
156
- end
157
-
158
- # Deserializes the data based on type
159
- # @param string type Data type
160
- # @param string value Value to be deserialized
161
- # @return [Object] Deserialized data
162
- def _deserialize(type, value)
163
- case type.to_sym
164
- when :Time
165
- Time.parse(value)
166
- when :Date
167
- Date.parse(value)
168
- when :String
169
- value.to_s
170
- when :Integer
171
- value.to_i
172
- when :Float
173
- value.to_f
174
- when :Boolean
175
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
176
- true
177
- else
178
- false
179
- end
180
- when :Object
181
- # generic object (usually a Hash), return directly
182
- value
183
- when /\AArray<(?<inner_type>.+)>\z/
184
- inner_type = Regexp.last_match[:inner_type]
185
- value.map { |v| _deserialize(inner_type, v) }
186
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
187
- k_type = Regexp.last_match[:k_type]
188
- v_type = Regexp.last_match[:v_type]
189
- {}.tap do |hash|
190
- value.each do |k, v|
191
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
192
- end
193
- end
194
- else # model
195
- # models (e.g. Pet) or oneOf
196
- klass = VgsApiClient.const_get(type)
197
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
198
- end
199
- end
200
-
201
- # Returns the string representation of the object
202
- # @return [String] String presentation of the object
203
- def to_s
204
- to_hash.to_s
205
- end
206
-
207
- # to_body is an alias to to_hash (backward compatibility)
208
- # @return [Hash] Returns the object in the form of hash
209
- def to_body
210
- to_hash
211
- end
212
-
213
- # Returns the object in the form of hash
214
- # @return [Hash] Returns the object in the form of hash
215
- def to_hash
216
- hash = {}
217
- self.class.attribute_map.each_pair do |attr, param|
218
- value = self.send(attr)
219
- if value.nil?
220
- is_nullable = self.class.openapi_nullable.include?(attr)
221
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
- end
223
-
224
- hash[param] = _to_hash(value)
225
- end
226
- hash
227
- end
228
-
229
- # Outputs non-array value in the form of hash
230
- # For object, use to_hash. Otherwise, just return the value
231
- # @param [Object] value Any valid value
232
- # @return [Hash] Returns the value in the form of hash
233
- def _to_hash(value)
234
- if value.is_a?(Array)
235
- value.compact.map { |v| _to_hash(v) }
236
- elsif value.is_a?(Hash)
237
- {}.tap do |hash|
238
- value.each { |k, v| hash[k] = _to_hash(v) }
239
- end
240
- elsif value.respond_to? :to_hash
241
- value.to_hash
242
- else
243
- value
244
- end
245
- end
246
-
247
- end
248
-
249
- end
data/test.rb DELETED
@@ -1,93 +0,0 @@
1
- require 'vgs'
2
-
3
- # Defining the host is optional and defaults to https://api.sandbox.verygoodvault.com.
4
- # For production use https://api.live.verygoodvault.com
5
- config = VGS.config(
6
- host = "https://api.sandbox.verygoodvault.com",
7
- username = ENV["VAULT_API_USERNAME"],
8
- password = ENV["VAULT_API_PASSWORD"]
9
- )
10
-
11
- # in this example we are storing three tokens within your VGS vault using a single API call
12
- # this will return three tokens which can be stored in your system and used individually or together
13
- # through any VGS Vault product including our Zero Data platform.
14
- #
15
- # the aliases namespace allows you to directly store, manage, and
16
- # retrieve tokens from your vgs vault.
17
- #
18
- # in the below example we demonstrate how to store payment card and personally identifiable
19
- # information in a single API call.
20
- #
21
- # see https://www.verygoodsecurity.com/docs/vault/what-is-zero-data
22
- # to learn how to remove any servers handling sentistive information
23
- # 100% from pci scope.
24
-
25
- api = VGS::Aliases.new(config)
26
-
27
- # first, let's create a request payload to tokenize our sensitive data.
28
- data = [
29
- # credit card
30
- dict(
31
- # format is used to determine how the stored token is represented
32
- # see https://www.verygoodsecurity.com/docs/terminology/nomenclature#alias-formats
33
- # to learn about different formats and representations available
34
- # to tokenize secured data.
35
- :format => "PFPT",
36
- :value => "4111111111111111",
37
- # see https://www.verygoodsecurity.com/docs/vault/concepts#classifiers
38
- # to learn how to classify and tag your data to help secure access and
39
- # route data compliantly.
40
- :classifiers => ["credit-card", "number"],
41
- :storage => "PERSISTENT"
42
- ),
43
- # card security code
44
- dict(
45
- :format => "UUID",
46
- :value => "123",
47
- :classifiers => ["credit-card", "csc"],
48
- # learn how volatile storage allows you to maintain full pci compliance
49
- # https://www.verygoodsecurity.com/docs/terminology/nomenclature#storage
50
- :storage => "VOLATILE"
51
- ),
52
- # social security number
53
- dict(
54
- :format => "UUID",
55
- :value => "078-05-1120",
56
- :classifiers => ["pii", "ssn"]
57
- )
58
- ]
59
- puts "Tokenizing multiple values..."
60
-
61
- aliases = api.redact(data)
62
-
63
- puts "Tokens created #{aliases}"
64
-
65
- # example of how to find the alias associated to each value
66
- puts aliases.map { |record| record.aliases[0]._alias }
67
-
68
-
69
- # next, let's update the classifiers and re-alias
70
- first_alias = aliases[0].aliases[0]._alias
71
-
72
- api.update(first_alias, { :classifiers => ["bank-account", "test-tag"] })
73
-
74
- puts "Token #{first_alias} updated"
75
-
76
- # now let's retrieve it back
77
- revealed = api.reveal(first_alias)
78
-
79
- puts "Token #{first_alias} retrieved\n{revealed}"
80
-
81
- # finally, let's delete an alias
82
- api.delete(first_alias)
83
-
84
- puts "Token #{first_alias} deleted"
85
-
86
- # now let's fetch it back to ensure it's not usable.
87
- puts "Trying to retrieve deleted token #{first_alias}..."
88
- begin
89
- api.reveal(first_alias)
90
- rescue => error
91
- puts "We can no longer fetch the token, it has been deleted: #{error.message}"
92
- end
93
-