vgs_api_client 0.0.1.alpha202401251923 → 0.0.1.dev202204182306

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +70 -0
  3. data/docker-compose.yaml +5 -19
  4. data/lib/vgs.rb +82 -0
  5. data/lib/{openapi_client → vgs_api_client}/api/aliases_api.rb +1 -1
  6. data/lib/{openapi_client → vgs_api_client}/api_client.rb +2 -2
  7. data/lib/{openapi_client → vgs_api_client}/api_error.rb +1 -1
  8. data/lib/{openapi_client → vgs_api_client}/configuration.rb +1 -1
  9. data/lib/{openapi_client → vgs_api_client}/models/alias_format.rb +1 -4
  10. data/lib/vgs_api_client/models/api_error.rb +249 -0
  11. data/lib/{openapi_client → vgs_api_client}/models/create_aliases_request.rb +1 -1
  12. data/lib/{openapi_client → vgs_api_client}/models/create_aliases_request_new.rb +1 -1
  13. data/lib/{openapi_client → vgs_api_client}/models/create_aliases_request_reference.rb +1 -1
  14. data/lib/{openapi_client → vgs_api_client}/models/inline_response200.rb +1 -1
  15. data/lib/{openapi_client → vgs_api_client}/models/inline_response2001.rb +1 -1
  16. data/lib/{openapi_client → vgs_api_client}/models/inline_response201.rb +1 -1
  17. data/lib/{openapi_client → vgs_api_client}/models/inline_response_default.rb +1 -1
  18. data/lib/{openapi_client → vgs_api_client}/models/model_alias.rb +1 -1
  19. data/lib/{openapi_client → vgs_api_client}/models/revealed_data.rb +1 -1
  20. data/lib/{openapi_client → vgs_api_client}/models/update_alias_request.rb +1 -1
  21. data/lib/{openapi_client → vgs_api_client}/models/update_alias_request_data.rb +1 -1
  22. data/lib/{openapi_client → vgs_api_client}/version.rb +2 -2
  23. data/lib/vgs_api_client.rb +48 -106
  24. data/scripts/assemble/Dockerfile +1 -4
  25. data/scripts/assemble/run.sh +3 -3
  26. data/scripts/publish/Dockerfile +1 -4
  27. data/scripts/publish/run.sh +2 -3
  28. data/scripts/publish.sh +2 -3
  29. data/scripts/run-test-e2e.sh +13 -0
  30. data/scripts/run-test-local.sh +4 -0
  31. data/scripts/test/Dockerfile +5 -9
  32. data/scripts/test/run.sh +26 -9
  33. data/spec/api_client_spec.rb +1 -1
  34. data/spec/configuration_spec.rb +1 -1
  35. data/spec/spec_helper.rb +2 -2
  36. data/spec/test_api_spec.rb +97 -0
  37. data/vgs_api_client-0.0.1.dev202204181658.gem +0 -0
  38. data/vgs_api_client.gemspec +21 -15
  39. metadata +34 -45
  40. data/README.md +0 -39
  41. data/VERSION +0 -1
  42. data/api.yaml +0 -537
  43. data/lib/openapi_client/models/api_error.rb +0 -0
  44. data/lib/openapi_client.rb +0 -53
  45. data/lib/version.rb +0 -3
  46. data/scripts/lint/Dockerfile +0 -9
  47. data/scripts/lint/run.sh +0 -5
  48. data/scripts/lint.sh +0 -6
  49. data/scripts/run-tests-e2e.sh +0 -8
  50. data/scripts/run-tests.sh +0 -6
  51. data/scripts/test-e2e/Dockerfile +0 -14
  52. data/scripts/test-e2e/run.sh +0 -28
  53. data/spec/test_aliases_api_spec.rb +0 -123
data/scripts/test/run.sh CHANGED
@@ -1,13 +1,30 @@
1
- #!/usr/bin/env bash
1
+ #!/usr/bin/env sh
2
2
 
3
3
  set -e
4
4
 
5
- echo "Installing lib from local sources"
6
- # fix version
7
- VERSION=0.0.1.alpha$(date "+%Y%m%d%H%M")
8
- grep -rl 0.0.1.alpha202401251923 . | xargs sed -i "s/0.0.1.alpha202401251923/$VERSION/g"
5
+ #if [[ -n "$TEST_AGAINST_PUBLISHED_LIB_VERSION" ]]; then
6
+ # echo "Installing lib from PyPI ${TEST_AGAINST_PUBLISHED_LIB_VERSION} ..."
7
+ #
8
+ # set +e
9
+ # ATTEMPT=1
10
+ # while [ $ATTEMPT -lt 60 ]; do
11
+ # echo "Attempt ${ATTEMPT} ..."
12
+ #
13
+ # pip install vgs-api-client==${TEST_AGAINST_PUBLISHED_LIB_VERSION}
14
+ #
15
+ # if [[ $? == 0 ]]; then
16
+ # echo "Installed ${TEST_AGAINST_PUBLISHED_LIB_VERSION}"
17
+ # break
18
+ # fi
19
+ #
20
+ # ATTEMPT=$((ATTEMPT+1))
21
+ #
22
+ # sleep 5
23
+ # done
24
+ # set -e
25
+ #else
26
+ echo "Installing lib from local sources"
27
+ bundle install
28
+ #fi
9
29
 
10
- bundle install
11
-
12
- echo "Running tests"
13
- bundle exec rspec -f documentation ./spec/*.rb
30
+ bundle exec rspec ./spec/test_api_spec.rb
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #Vault HTTP API
3
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 and is implemented using industry best practices to ensure the security of the connection. Read more about [Identity and Access Management at VGS](https://www.verygoodsecurity.com/docs/vault/the-platform/iam) 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\" } ] } ```
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
5
 
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: support@verygoodsecurity.com
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #Vault HTTP API
3
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 and is implemented using industry best practices to ensure the security of the connection. Read more about [Identity and Access Management at VGS](https://www.verygoodsecurity.com/docs/vault/the-platform/iam) 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\" } ] } ```
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
5
 
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: support@verygoodsecurity.com
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #Vault HTTP API
3
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 and is implemented using industry best practices to ensure the security of the connection. Read more about [Identity and Access Management at VGS](https://www.verygoodsecurity.com/docs/vault/the-platform/iam) 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\" } ] } ```
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
5
 
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: support@verygoodsecurity.com
@@ -11,7 +11,7 @@ OpenAPI Generator version: 5.4.0
11
11
  =end
12
12
 
13
13
  # load the gem
14
- require 'openapi_client'
14
+ require 'vgs_api_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`.
@@ -0,0 +1,97 @@
1
+ require 'spec_helper'
2
+ require 'securerandom'
3
+ require 'vgs'
4
+
5
+ describe 'AliasesApiSpec' do
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)
9
+ end
10
+
11
+ describe 'redact' do
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)
27
+ expect(aliases.length).to eq 2
28
+ data.each_with_index do |item, index|
29
+ expect(aliases[index].value).to eq item[:value]
30
+ expect(aliases[index].storage).to eq item[:storage]
31
+ expect(aliases[index].aliases[0]._alias).to start_with "tok_"
32
+ end
33
+ expect(Set.new(aliases[0].classifiers)).to eq Set.new(%w[credit-card number])
34
+ expect(Set.new(aliases[1].classifiers)).to eq Set.new
35
+ end
36
+ end
37
+
38
+ describe 'reveal' do
39
+ 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
+ ]
53
+ aliases = @aliases_api.redact(data).map { |item| item.aliases[0]._alias }
54
+
55
+ response = @aliases_api.reveal(aliases)
56
+
57
+ expect(response.length).to eq 2
58
+ original_values = data.map { |i| i[:value] }
59
+ revealed_values = response.values.map { |i| i.value }
60
+ expect(Set.new(original_values)).to eq Set.new(revealed_values)
61
+ end
62
+ end
63
+
64
+ describe 'update' do
65
+ it 'should update alias' do
66
+ data = [
67
+ {
68
+ :format => 'UUID',
69
+ :value => SecureRandom.alphanumeric(10),
70
+ }
71
+ ]
72
+ _alias = @aliases_api.redact(data).map { |item| item.aliases[0]._alias }[0]
73
+
74
+ @aliases_api.update(_alias = _alias, data = { :classifiers => ["secure"] })
75
+
76
+ response = @aliases_api.reveal(_alias)
77
+ expect(response[_alias].classifiers).to eq %w[secure]
78
+ end
79
+ end
80
+
81
+ describe 'delete' do
82
+ it 'should delete alias' do
83
+ data = [
84
+ {
85
+ :format => 'UUID',
86
+ :value => '5201784564572092',
87
+ }
88
+ ]
89
+ _alias = @aliases_api.redact(data).map { |item| item.aliases[0]._alias }[0]
90
+
91
+ @aliases_api.delete(_alias = _alias)
92
+
93
+ expect { @aliases_api.reveal(_alias) }.to raise_error(VGS::VgsApiException)
94
+ end
95
+ end
96
+
97
+ end
@@ -1,25 +1,31 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
- require_relative "lib/version"
3
+ =begin
4
+ #Vault HTTP API
5
+
6
+ #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\" } ] } ```
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: support@verygoodsecurity.com
10
+ Generated by: https://openapi-generator.tech
11
+ OpenAPI Generator version: 5.4.0
12
+
13
+ =end
14
+
15
+ $:.push File.expand_path("../lib", __FILE__)
16
+ require "vgs_api_client/version"
4
17
 
5
18
  Gem::Specification.new do |s|
6
19
  s.name = "vgs_api_client"
7
- s.version = VGS::VERSION
20
+ s.version = VgsApiClient::VERSION
8
21
  s.platform = Gem::Platform::RUBY
9
22
  s.authors = ["Very Good Security"]
10
- s.email = ["support@verygoodsecurity.com"]
11
- s.homepage = "https://github.com/verygoodsecurity/vgs-api-client-ruby"
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
- s.license = "BSD-3-Clause"
15
- s.required_ruby_version = ">= 2.6"
16
-
17
- s.metadata = {
18
- "homepage_uri" => "https://www.verygoodsecurity.com",
19
- "bug_tracker_uri" => "https://github.com/verygoodsecurity/vgs-api-client-ruby/issues",
20
- "documentation_uri" => "https://www.verygoodsecurity.com/docs",
21
- "source_code_uri" => "https://github.com/verygoodsecurity/vgs-api-client-ruby"
22
- }
23
+ s.email = ["dev@verygoodsecurity.com"]
24
+ s.homepage = "https://openapi-generator.tech"
25
+ s.summary = "A ruby wrapper for the VGS Vault API"
26
+ s.description = "This gem maps to VGS Vault API"
27
+ s.license = "Unlicense"
28
+ s.required_ruby_version = ">= 2.4"
23
29
 
24
30
  s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
25
31
 
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.alpha202401251923
4
+ version: 0.0.1.dev202204182306
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: 2024-01-25 00:00:00.000000000 Z
11
+ date: 2022-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -50,70 +50,59 @@ dependencies:
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
52
  version: 3.6.0
53
- description: Very Good Security API Client library. More details on https://www.verygoodsecurity.com/
53
+ description: This gem maps to VGS Vault API
54
54
  email:
55
- - support@verygoodsecurity.com
55
+ - dev@verygoodsecurity.com
56
56
  executables: []
57
57
  extensions: []
58
58
  extra_rdoc_files: []
59
59
  files:
60
60
  - DEVELOPMENT.md
61
61
  - Gemfile
62
+ - Gemfile.lock
62
63
  - LICENSE
63
- - README.md
64
64
  - RELEASE.md
65
65
  - Rakefile
66
- - VERSION
67
- - api.yaml
68
66
  - docker-compose.yaml
69
- - lib/openapi_client.rb
70
- - lib/openapi_client/api/aliases_api.rb
71
- - lib/openapi_client/api_client.rb
72
- - lib/openapi_client/api_error.rb
73
- - lib/openapi_client/configuration.rb
74
- - lib/openapi_client/models/alias_format.rb
75
- - lib/openapi_client/models/api_error.rb
76
- - lib/openapi_client/models/create_aliases_request.rb
77
- - lib/openapi_client/models/create_aliases_request_new.rb
78
- - lib/openapi_client/models/create_aliases_request_reference.rb
79
- - lib/openapi_client/models/inline_response200.rb
80
- - lib/openapi_client/models/inline_response2001.rb
81
- - lib/openapi_client/models/inline_response201.rb
82
- - lib/openapi_client/models/inline_response_default.rb
83
- - lib/openapi_client/models/model_alias.rb
84
- - lib/openapi_client/models/revealed_data.rb
85
- - lib/openapi_client/models/update_alias_request.rb
86
- - lib/openapi_client/models/update_alias_request_data.rb
87
- - lib/openapi_client/version.rb
88
- - lib/version.rb
67
+ - lib/vgs.rb
89
68
  - lib/vgs_api_client.rb
69
+ - lib/vgs_api_client/api/aliases_api.rb
70
+ - lib/vgs_api_client/api_client.rb
71
+ - lib/vgs_api_client/api_error.rb
72
+ - lib/vgs_api_client/configuration.rb
73
+ - lib/vgs_api_client/models/alias_format.rb
74
+ - lib/vgs_api_client/models/api_error.rb
75
+ - lib/vgs_api_client/models/create_aliases_request.rb
76
+ - lib/vgs_api_client/models/create_aliases_request_new.rb
77
+ - lib/vgs_api_client/models/create_aliases_request_reference.rb
78
+ - lib/vgs_api_client/models/inline_response200.rb
79
+ - lib/vgs_api_client/models/inline_response2001.rb
80
+ - lib/vgs_api_client/models/inline_response201.rb
81
+ - lib/vgs_api_client/models/inline_response_default.rb
82
+ - lib/vgs_api_client/models/model_alias.rb
83
+ - lib/vgs_api_client/models/revealed_data.rb
84
+ - lib/vgs_api_client/models/update_alias_request.rb
85
+ - lib/vgs_api_client/models/update_alias_request_data.rb
86
+ - lib/vgs_api_client/version.rb
90
87
  - scripts/assemble/Dockerfile
91
88
  - scripts/assemble/run.sh
92
- - scripts/lint.sh
93
- - scripts/lint/Dockerfile
94
- - scripts/lint/run.sh
95
89
  - scripts/publish.sh
96
90
  - scripts/publish/Dockerfile
97
91
  - scripts/publish/run.sh
98
- - scripts/run-tests-e2e.sh
99
- - scripts/run-tests.sh
100
- - scripts/test-e2e/Dockerfile
101
- - scripts/test-e2e/run.sh
92
+ - scripts/run-test-e2e.sh
93
+ - scripts/run-test-local.sh
102
94
  - scripts/test/Dockerfile
103
95
  - scripts/test/run.sh
104
96
  - spec/api_client_spec.rb
105
97
  - spec/configuration_spec.rb
106
98
  - spec/spec_helper.rb
107
- - spec/test_aliases_api_spec.rb
99
+ - spec/test_api_spec.rb
100
+ - vgs_api_client-0.0.1.dev202204181658.gem
108
101
  - vgs_api_client.gemspec
109
- homepage: https://github.com/verygoodsecurity/vgs-api-client-ruby
102
+ homepage: https://openapi-generator.tech
110
103
  licenses:
111
- - BSD-3-Clause
112
- metadata:
113
- homepage_uri: https://www.verygoodsecurity.com
114
- bug_tracker_uri: https://github.com/verygoodsecurity/vgs-api-client-ruby/issues
115
- documentation_uri: https://www.verygoodsecurity.com/docs
116
- source_code_uri: https://github.com/verygoodsecurity/vgs-api-client-ruby
104
+ - Unlicense
105
+ metadata: {}
117
106
  post_install_message:
118
107
  rdoc_options: []
119
108
  require_paths:
@@ -122,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
122
111
  requirements:
123
112
  - - ">="
124
113
  - !ruby/object:Gem::Version
125
- version: '2.6'
114
+ version: '2.4'
126
115
  required_rubygems_version: !ruby/object:Gem::Requirement
127
116
  requirements:
128
117
  - - ">"
@@ -132,9 +121,9 @@ requirements: []
132
121
  rubygems_version: 3.3.7
133
122
  signing_key:
134
123
  specification_version: 4
135
- summary: Very Good Security API Client
124
+ summary: A ruby wrapper for the VGS Vault API
136
125
  test_files:
137
126
  - spec/api_client_spec.rb
138
127
  - spec/configuration_spec.rb
139
128
  - spec/spec_helper.rb
140
- - spec/test_aliases_api_spec.rb
129
+ - spec/test_api_spec.rb
data/README.md DELETED
@@ -1,39 +0,0 @@
1
- # vgs-api-client-ruby
2
-
3
- [![CircleCI](https://circleci.com/gh/verygoodsecurity/vgs-api-client-ruby.svg?style=svg)](https://github.com/verygoodsecurity/vgs-api-client-ruby)
4
-
5
- This repository contains a Ruby API client library for the Very Good Security API.
6
-
7
- ### Requirements
8
-
9
- Building and using the API client library requires Ruby 2.6+.
10
-
11
- ### Installation
12
-
13
- ```
14
- gem install vgs-api-client
15
- ```
16
-
17
- ### Development
18
-
19
- Follow [DEVELOPMENT](https://github.com/verygoodsecurity/vgs-api-client-ruby/blob/master/DEVELOPMENT.md) instruction.
20
-
21
- ### Release
22
-
23
- Follow [RELEASE](https://github.com/verygoodsecurity/vgs-api-client-ruby/blob/master/RELEASE.md) instruction.
24
-
25
- ### Documentation
26
-
27
- https://www.verygoodsecurity.com/docs/vault/api/
28
-
29
- ### Tutorial
30
-
31
- https://www.verygoodsecurity.com/docs/tokenization/ruby-tutorial
32
-
33
- ### Artifact
34
-
35
- https://rubygems.org/gems/vgs_api_client/
36
-
37
- ### Support
38
-
39
- support@verygoodsecurity.com
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.0.1.alpha202401251923