vgs_api_client 0.0.1.alpha202311162359 → 0.0.1.dev202204182306

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) 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 +10 -100
  6. data/lib/{openapi_client → vgs_api_client}/api_client.rb +2 -2
  7. data/lib/vgs_api_client/api_error.rb +57 -0
  8. data/lib/{openapi_client → vgs_api_client}/configuration.rb +1 -1
  9. data/lib/vgs_api_client/models/alias_format.rb +44 -0
  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 +2 -2
  12. data/lib/{openapi_client → vgs_api_client}/models/create_aliases_request_new.rb +6 -2
  13. data/lib/{openapi_client → vgs_api_client}/models/create_aliases_request_reference.rb +6 -2
  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/models/alias_dto.rb → vgs_api_client/models/model_alias.rb} +4 -5
  19. data/lib/{openapi_client → vgs_api_client}/models/revealed_data.rb +2 -3
  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/vgs_api_client/version.rb +15 -0
  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 -46
  40. data/README.md +0 -39
  41. data/VERSION +0 -1
  42. data/api.yaml +0 -625
  43. data/lib/openapi_client/api_error.rb +0 -57
  44. data/lib/openapi_client/models/alias_format.rb +0 -50
  45. data/lib/openapi_client/models/api_error.rb +0 -0
  46. data/lib/openapi_client/models/batch_aliases_request.rb +0 -264
  47. data/lib/openapi_client/version.rb +0 -15
  48. data/lib/openapi_client.rb +0 -54
  49. data/lib/version.rb +0 -3
  50. data/scripts/lint/Dockerfile +0 -9
  51. data/scripts/lint/run.sh +0 -5
  52. data/scripts/lint.sh +0 -6
  53. data/scripts/run-tests-e2e.sh +0 -8
  54. data/scripts/run-tests.sh +0 -6
  55. data/scripts/test-e2e/Dockerfile +0 -14
  56. data/scripts/test-e2e/run.sh +0 -28
  57. data/spec/test_aliases_api_spec.rb +0 -123
@@ -1,50 +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) ## Introduction ### Alias-Formats | Format | Description | |---------------------------------|-------------------------------------------------------------------------------------------| | UUID | Generic - VGS Alias (Default) - tok_sandbox_xxxxxxxxxxxxxxxxxxxxxxxxx | | NUM_LENGTH_PRESERVING | Generic - Numeric Length Preserving - xxxxxxxxxxxxxxxx | | FPE_SIX_T_FOUR | Payment Card - Format Preserving, Luhn Valid (6T4) - <first_six>xxxxxx<last_four> | | FPE_T_FOUR | Payment Card - Format Preserving, Luhn Valid (T4) - xxxxxxxxxxxx<last_four> | | PFPT | Payment Card - Prefixed, Luhn Valid, 19 Digits Fixed Length - xxxxxxxxxxxxxxxxxxx | | NON_LUHN_FPE_ALPHANUMERIC | Payment Card - Format Preserving - Non Luhn Valid - xxxxxxxxxxxxxxxx | | FPE_SSN_T_FOUR | SSN - Format Preserving (A4) - xxx-xx-<last_four> | | FPE_ACC_NUM_T_FOUR | Account Number - Numeric Length Preserving (A4) - xxxxxxxxxxxx<last_four> | | FPE_ALPHANUMERIC_ACC_NUM_T_FOUR | Account Number - Alphanumeric Length Preserving (A4) - xxxxxxxxxxxx<last_four> | | GENERIC_T_FOUR | Generic - VGS Alias Last Four (T4) - tok_sandbox_xxxxxxxxxxxxxxxxxxxxxxxxx_<last_four> | | RAW_UUID | Generic - UUID - xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | | ALPHANUMERIC_SIX_T_FOUR | Numeric - Include Alphanumeric, 19 symbols length (6T4) - <first_six>xxxxxxxxx<last_four> | | VGS_FIXED_LEN_GENERIC | Generic - VGS Alphanumeric Fixed Length, 29 characters - vgsxxxxxxxxxxxxxxxxxxxxxxxxxx | ## 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\" } ] } ```
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 AliasFormat
18
- ALPHANUMERIC_SIX_T_FOUR = "ALPHANUMERIC_SIX_T_FOUR".freeze
19
- CUSTOM = "CUSTOM".freeze
20
- FPE_ACC_NUM_T_FOUR = "FPE_ACC_NUM_T_FOUR".freeze
21
- FPE_ALPHANUMERIC_ACC_NUM_T_FOUR = "FPE_ALPHANUMERIC_ACC_NUM_T_FOUR".freeze
22
- FPE_SIX_T_FOUR = "FPE_SIX_T_FOUR".freeze
23
- FPE_SSN_T_FOUR = "FPE_SSN_T_FOUR".freeze
24
- FPE_T_FOUR = "FPE_T_FOUR".freeze
25
- GENERIC_T_FOUR = "GENERIC_T_FOUR".freeze
26
- JS = "JS".freeze
27
- NON_LUHN_FPE_ALPHANUMERIC = "NON_LUHN_FPE_ALPHANUMERIC".freeze
28
- NUM_LENGTH_PRESERVING = "NUM_LENGTH_PRESERVING".freeze
29
- PFPT = "PFPT".freeze
30
- RAW_UUID = "RAW_UUID".freeze
31
- UUID = "UUID".freeze
32
- VGS_FIXED_LEN_GENERIC = "VGS_FIXED_LEN_GENERIC".freeze
33
-
34
- # Builds the enum from string
35
- # @param [String] The enum value in the form of the string
36
- # @return [String] The enum value
37
- def self.build_from_hash(value)
38
- new.build_from_hash(value)
39
- end
40
-
41
- # Builds the enum from string
42
- # @param [String] The enum value in the form of the string
43
- # @return [String] The enum value
44
- def build_from_hash(value)
45
- constantValues = AliasFormat.constants.select { |c| AliasFormat::const_get(c) == value }
46
- raise "Invalid ENUM value #{value} for class #AliasFormat" if constantValues.empty?
47
- value
48
- end
49
- end
50
- end
File without changes
@@ -1,264 +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) ## Introduction ### Alias-Formats | Format | Description | |---------------------------------|-------------------------------------------------------------------------------------------| | UUID | Generic - VGS Alias (Default) - tok_sandbox_xxxxxxxxxxxxxxxxxxxxxxxxx | | NUM_LENGTH_PRESERVING | Generic - Numeric Length Preserving - xxxxxxxxxxxxxxxx | | FPE_SIX_T_FOUR | Payment Card - Format Preserving, Luhn Valid (6T4) - <first_six>xxxxxx<last_four> | | FPE_T_FOUR | Payment Card - Format Preserving, Luhn Valid (T4) - xxxxxxxxxxxx<last_four> | | PFPT | Payment Card - Prefixed, Luhn Valid, 19 Digits Fixed Length - xxxxxxxxxxxxxxxxxxx | | NON_LUHN_FPE_ALPHANUMERIC | Payment Card - Format Preserving - Non Luhn Valid - xxxxxxxxxxxxxxxx | | FPE_SSN_T_FOUR | SSN - Format Preserving (A4) - xxx-xx-<last_four> | | FPE_ACC_NUM_T_FOUR | Account Number - Numeric Length Preserving (A4) - xxxxxxxxxxxx<last_four> | | FPE_ALPHANUMERIC_ACC_NUM_T_FOUR | Account Number - Alphanumeric Length Preserving (A4) - xxxxxxxxxxxx<last_four> | | GENERIC_T_FOUR | Generic - VGS Alias Last Four (T4) - tok_sandbox_xxxxxxxxxxxxxxxxxxxxxxxxx_<last_four> | | RAW_UUID | Generic - UUID - xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | | ALPHANUMERIC_SIX_T_FOUR | Numeric - Include Alphanumeric, 19 symbols length (6T4) - <first_six>xxxxxxxxx<last_four> | | VGS_FIXED_LEN_GENERIC | Generic - VGS Alphanumeric Fixed Length, 29 characters - vgsxxxxxxxxxxxxxxxxxxxxxxxxxx | ## 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\" } ] } ```
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
- # Format for batch requests (limit 20)
18
- class BatchAliasesRequest
19
- attr_accessor :data
20
-
21
- attr_accessor :storage
22
-
23
- class EnumAttributeValidator
24
- attr_reader :datatype
25
- attr_reader :allowable_values
26
-
27
- def initialize(datatype, allowable_values)
28
- @allowable_values = allowable_values.map do |value|
29
- case datatype.to_s
30
- when /Integer/i
31
- value.to_i
32
- when /Float/i
33
- value.to_f
34
- else
35
- value
36
- end
37
- end
38
- end
39
-
40
- def valid?(value)
41
- !value || allowable_values.include?(value)
42
- end
43
- end
44
-
45
- # Attribute mapping from ruby-style variable name to JSON key.
46
- def self.attribute_map
47
- {
48
- :'data' => :'data',
49
- :'storage' => :'storage'
50
- }
51
- end
52
-
53
- # Returns all the JSON keys this model knows about
54
- def self.acceptable_attributes
55
- attribute_map.values
56
- end
57
-
58
- # Attribute type mapping.
59
- def self.openapi_types
60
- {
61
- :'data' => :'Array<String>',
62
- :'storage' => :'String'
63
- }
64
- end
65
-
66
- # List of attributes with nullable: true
67
- def self.openapi_nullable
68
- Set.new([
69
- ])
70
- end
71
-
72
- # Initializes the object
73
- # @param [Hash] attributes Model attributes in the form of hash
74
- def initialize(attributes = {})
75
- if (!attributes.is_a?(Hash))
76
- fail ArgumentError, "The input argument (attributes) must be a hash in `VgsApiClient::BatchAliasesRequest` initialize method"
77
- end
78
-
79
- # check to see if the attribute exists and convert string to symbol for hash key
80
- attributes = attributes.each_with_object({}) { |(k, v), h|
81
- if (!self.class.attribute_map.key?(k.to_sym))
82
- fail ArgumentError, "`#{k}` is not a valid attribute in `VgsApiClient::BatchAliasesRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
83
- end
84
- h[k.to_sym] = v
85
- }
86
-
87
- if attributes.key?(:'data')
88
- if (value = attributes[:'data']).is_a?(Array)
89
- self.data = value
90
- end
91
- end
92
-
93
- if attributes.key?(:'storage')
94
- self.storage = attributes[:'storage']
95
- end
96
- end
97
-
98
- # Show invalid properties with the reasons. Usually used together with valid?
99
- # @return Array for valid properties with the reasons
100
- def list_invalid_properties
101
- invalid_properties = Array.new
102
- invalid_properties
103
- end
104
-
105
- # Check to see if the all the properties in the model are valid
106
- # @return true if the model is valid
107
- def valid?
108
- storage_validator = EnumAttributeValidator.new('String', ["PERSISTENT", "VOLATILE"])
109
- return false unless storage_validator.valid?(@storage)
110
- true
111
- end
112
-
113
- # Custom attribute writer method checking allowed values (enum).
114
- # @param [Object] storage Object to be assigned
115
- def storage=(storage)
116
- validator = EnumAttributeValidator.new('String', ["PERSISTENT", "VOLATILE"])
117
- unless validator.valid?(storage)
118
- fail ArgumentError, "invalid value for \"storage\", must be one of #{validator.allowable_values}."
119
- end
120
- @storage = storage
121
- end
122
-
123
- # Checks equality by comparing each attribute.
124
- # @param [Object] Object to be compared
125
- def ==(o)
126
- return true if self.equal?(o)
127
- self.class == o.class &&
128
- data == o.data &&
129
- storage == o.storage
130
- end
131
-
132
- # @see the `==` method
133
- # @param [Object] Object to be compared
134
- def eql?(o)
135
- self == o
136
- end
137
-
138
- # Calculates hash code according to all attributes.
139
- # @return [Integer] Hash code
140
- def hash
141
- [data, storage].hash
142
- end
143
-
144
- # Builds the object from hash
145
- # @param [Hash] attributes Model attributes in the form of hash
146
- # @return [Object] Returns the model itself
147
- def self.build_from_hash(attributes)
148
- new.build_from_hash(attributes)
149
- end
150
-
151
- # Builds the object from hash
152
- # @param [Hash] attributes Model attributes in the form of hash
153
- # @return [Object] Returns the model itself
154
- def build_from_hash(attributes)
155
- return nil unless attributes.is_a?(Hash)
156
- self.class.openapi_types.each_pair do |key, type|
157
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
158
- self.send("#{key}=", nil)
159
- elsif type =~ /\AArray<(.*)>/i
160
- # check to ensure the input is an array given that the attribute
161
- # is documented as an array but the input is not
162
- if attributes[self.class.attribute_map[key]].is_a?(Array)
163
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
164
- end
165
- elsif !attributes[self.class.attribute_map[key]].nil?
166
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
167
- end
168
- end
169
-
170
- self
171
- end
172
-
173
- # Deserializes the data based on type
174
- # @param string type Data type
175
- # @param string value Value to be deserialized
176
- # @return [Object] Deserialized data
177
- def _deserialize(type, value)
178
- case type.to_sym
179
- when :Time
180
- Time.parse(value)
181
- when :Date
182
- Date.parse(value)
183
- when :String
184
- value.to_s
185
- when :Integer
186
- value.to_i
187
- when :Float
188
- value.to_f
189
- when :Boolean
190
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
191
- true
192
- else
193
- false
194
- end
195
- when :Object
196
- # generic object (usually a Hash), return directly
197
- value
198
- when /\AArray<(?<inner_type>.+)>\z/
199
- inner_type = Regexp.last_match[:inner_type]
200
- value.map { |v| _deserialize(inner_type, v) }
201
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
202
- k_type = Regexp.last_match[:k_type]
203
- v_type = Regexp.last_match[:v_type]
204
- {}.tap do |hash|
205
- value.each do |k, v|
206
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
207
- end
208
- end
209
- else # model
210
- # models (e.g. Pet) or oneOf
211
- klass = VgsApiClient.const_get(type)
212
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
213
- end
214
- end
215
-
216
- # Returns the string representation of the object
217
- # @return [String] String presentation of the object
218
- def to_s
219
- to_hash.to_s
220
- end
221
-
222
- # to_body is an alias to to_hash (backward compatibility)
223
- # @return [Hash] Returns the object in the form of hash
224
- def to_body
225
- to_hash
226
- end
227
-
228
- # Returns the object in the form of hash
229
- # @return [Hash] Returns the object in the form of hash
230
- def to_hash
231
- hash = {}
232
- self.class.attribute_map.each_pair do |attr, param|
233
- value = self.send(attr)
234
- if value.nil?
235
- is_nullable = self.class.openapi_nullable.include?(attr)
236
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
237
- end
238
-
239
- hash[param] = _to_hash(value)
240
- end
241
- hash
242
- end
243
-
244
- # Outputs non-array value in the form of hash
245
- # For object, use to_hash. Otherwise, just return the value
246
- # @param [Object] value Any valid value
247
- # @return [Hash] Returns the value in the form of hash
248
- def _to_hash(value)
249
- if value.is_a?(Array)
250
- value.compact.map { |v| _to_hash(v) }
251
- elsif value.is_a?(Hash)
252
- {}.tap do |hash|
253
- value.each { |k, v| hash[k] = _to_hash(v) }
254
- end
255
- elsif value.respond_to? :to_hash
256
- value.to_hash
257
- else
258
- value
259
- end
260
- end
261
-
262
- end
263
-
264
- end
@@ -1,15 +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) ## Introduction ### Alias-Formats | Format | Description | |---------------------------------|-------------------------------------------------------------------------------------------| | UUID | Generic - VGS Alias (Default) - tok_sandbox_xxxxxxxxxxxxxxxxxxxxxxxxx | | NUM_LENGTH_PRESERVING | Generic - Numeric Length Preserving - xxxxxxxxxxxxxxxx | | FPE_SIX_T_FOUR | Payment Card - Format Preserving, Luhn Valid (6T4) - <first_six>xxxxxx<last_four> | | FPE_T_FOUR | Payment Card - Format Preserving, Luhn Valid (T4) - xxxxxxxxxxxx<last_four> | | PFPT | Payment Card - Prefixed, Luhn Valid, 19 Digits Fixed Length - xxxxxxxxxxxxxxxxxxx | | NON_LUHN_FPE_ALPHANUMERIC | Payment Card - Format Preserving - Non Luhn Valid - xxxxxxxxxxxxxxxx | | FPE_SSN_T_FOUR | SSN - Format Preserving (A4) - xxx-xx-<last_four> | | FPE_ACC_NUM_T_FOUR | Account Number - Numeric Length Preserving (A4) - xxxxxxxxxxxx<last_four> | | FPE_ALPHANUMERIC_ACC_NUM_T_FOUR | Account Number - Alphanumeric Length Preserving (A4) - xxxxxxxxxxxx<last_four> | | GENERIC_T_FOUR | Generic - VGS Alias Last Four (T4) - tok_sandbox_xxxxxxxxxxxxxxxxxxxxxxxxx_<last_four> | | RAW_UUID | Generic - UUID - xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | | ALPHANUMERIC_SIX_T_FOUR | Numeric - Include Alphanumeric, 19 symbols length (6T4) - <first_six>xxxxxxxxx<last_four> | | VGS_FIXED_LEN_GENERIC | Generic - VGS Alphanumeric Fixed Length, 29 characters - vgsxxxxxxxxxxxxxxxxxxxxxxxxxx | ## 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\" } ] } ```
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
- module VgsApiClient
14
- VERSION = '0.0.1.alpha202311162359'
15
- end
@@ -1,54 +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) ## Introduction ### Alias-Formats | Format | Description | |---------------------------------|-------------------------------------------------------------------------------------------| | UUID | Generic - VGS Alias (Default) - tok_sandbox_xxxxxxxxxxxxxxxxxxxxxxxxx | | NUM_LENGTH_PRESERVING | Generic - Numeric Length Preserving - xxxxxxxxxxxxxxxx | | FPE_SIX_T_FOUR | Payment Card - Format Preserving, Luhn Valid (6T4) - <first_six>xxxxxx<last_four> | | FPE_T_FOUR | Payment Card - Format Preserving, Luhn Valid (T4) - xxxxxxxxxxxx<last_four> | | PFPT | Payment Card - Prefixed, Luhn Valid, 19 Digits Fixed Length - xxxxxxxxxxxxxxxxxxx | | NON_LUHN_FPE_ALPHANUMERIC | Payment Card - Format Preserving - Non Luhn Valid - xxxxxxxxxxxxxxxx | | FPE_SSN_T_FOUR | SSN - Format Preserving (A4) - xxx-xx-<last_four> | | FPE_ACC_NUM_T_FOUR | Account Number - Numeric Length Preserving (A4) - xxxxxxxxxxxx<last_four> | | FPE_ALPHANUMERIC_ACC_NUM_T_FOUR | Account Number - Alphanumeric Length Preserving (A4) - xxxxxxxxxxxx<last_four> | | GENERIC_T_FOUR | Generic - VGS Alias Last Four (T4) - tok_sandbox_xxxxxxxxxxxxxxxxxxxxxxxxx_<last_four> | | RAW_UUID | Generic - UUID - xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | | ALPHANUMERIC_SIX_T_FOUR | Numeric - Include Alphanumeric, 19 symbols length (6T4) - <first_six>xxxxxxxxx<last_four> | | VGS_FIXED_LEN_GENERIC | Generic - VGS Alphanumeric Fixed Length, 29 characters - vgsxxxxxxxxxxxxxxxxxxxxxxxxxx | ## 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\" } ] } ```
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_dto'
21
- require 'openapi_client/models/alias_format'
22
- require 'openapi_client/models/api_error'
23
- require 'openapi_client/models/batch_aliases_request'
24
- require 'openapi_client/models/create_aliases_request'
25
- require 'openapi_client/models/create_aliases_request_new'
26
- require 'openapi_client/models/create_aliases_request_reference'
27
- require 'openapi_client/models/inline_response200'
28
- require 'openapi_client/models/inline_response2001'
29
- require 'openapi_client/models/inline_response201'
30
- require 'openapi_client/models/inline_response_default'
31
- require 'openapi_client/models/revealed_data'
32
- require 'openapi_client/models/update_alias_request'
33
- require 'openapi_client/models/update_alias_request_data'
34
-
35
- # APIs
36
- require 'openapi_client/api/aliases_api'
37
-
38
- module VgsApiClient
39
- class << self
40
- # Customize default settings for the SDK using block.
41
- # VgsApiClient.configure do |config|
42
- # config.username = "xxx"
43
- # config.password = "xxx"
44
- # end
45
- # If no block given, return the default Configuration object.
46
- def configure
47
- if block_given?
48
- yield(Configuration.default)
49
- else
50
- Configuration.default
51
- end
52
- end
53
- end
54
- end
data/lib/version.rb DELETED
@@ -1,3 +0,0 @@
1
- module VGS
2
- VERSION = '0.0.1.alpha202311162359'
3
- end
@@ -1,9 +0,0 @@
1
- FROM ruby:3.1.2-alpine3.15
2
-
3
- RUN apk update && \
4
- apk add bash && \
5
- gem install rubocop
6
-
7
- WORKDIR /vgs-api-client/
8
-
9
- ENTRYPOINT ["bash", "./scripts/lint/run.sh"]
data/scripts/lint/run.sh DELETED
@@ -1,5 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -e
4
-
5
- rubocop .
data/scripts/lint.sh DELETED
@@ -1,6 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -e
4
-
5
- docker-compose build lint && \
6
- docker-compose run lint
@@ -1,8 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -e
4
-
5
- export LIB_VERSION=${LIB_VERSION:-0.0.1.alpha$(date "+%Y%m%d%H%M")}
6
-
7
- docker-compose build test-e2e && \
8
- docker-compose run test-e2e
data/scripts/run-tests.sh DELETED
@@ -1,6 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -e
4
-
5
- docker-compose build test && \
6
- docker-compose run test
@@ -1,14 +0,0 @@
1
- FROM ruby:3.1.2-alpine3.15
2
-
3
- RUN apk update && \
4
- apk add bash && \
5
- apk add build-base && \
6
- apk add libcurl && \
7
- gem install rspec
8
-
9
- ADD ./scripts/test-e2e /vgs-api-client/scripts
10
- ADD ./spec /vgs-api-client/spec
11
-
12
- WORKDIR /vgs-api-client/
13
-
14
- ENTRYPOINT ["bash", "./scripts/run.sh"]
@@ -1,28 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- set -e
4
-
5
- echo "Installing lib from rubygems.org ${LIB_VERSION} ..."
6
-
7
- set +e
8
- ATTEMPT=1
9
- while [ $ATTEMPT -lt 10 ]; do
10
- echo "Attempt ${ATTEMPT} ..."
11
-
12
- gem install vgs_api_client -v ${LIB_VERSION}
13
-
14
- if [[ $? == 0 ]]; then
15
- echo "Installed ${LIB_VERSION}"
16
- break
17
- fi
18
-
19
- ATTEMPT=$((ATTEMPT+1))
20
-
21
- sleep 5
22
- done
23
- set -e
24
-
25
- echo "Running tests"
26
- gem install rspec
27
- rspec -f documentation ./spec/*.rb
28
-
@@ -1,123 +0,0 @@
1
- require 'spec_helper'
2
- require 'securerandom'
3
- require 'vgs_api_client'
4
-
5
- describe 'AliasesApiSpec' do
6
- before(:each) do
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::UnauthorizedError)
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::NotFoundError)
42
- end
43
- end
44
-
45
- describe 'redact' do
46
- it 'should redact values' do
47
- data = [{
48
- format: 'UUID',
49
- value: '5201784564572092',
50
- classifiers: %w[credit-card number],
51
- storage: 'PERSISTENT'
52
- },
53
- {
54
- format: 'UUID',
55
- value: 'Joe Doe',
56
- storage: 'VOLATILE'
57
- }]
58
- aliases = @api.redact data
59
- expect(aliases.length).to eq 2
60
- data.each_with_index do |item, index|
61
- expect(aliases[index].value).to eq item[:value]
62
- expect(aliases[index].storage).to eq item[:storage]
63
- expect(aliases[index].aliases[0]._alias).to start_with "tok_"
64
- end
65
- expect(Set.new(aliases[0].classifiers)).to eq Set.new(%w[credit-card number])
66
- expect(Set.new(aliases[1].classifiers)).to eq Set.new
67
- end
68
- end
69
-
70
- describe 'reveal' do
71
- it 'should reveal aliases' do
72
- data = [{
73
- format: 'UUID',
74
- value: '5201784564572092',
75
- classifiers: %w[credit-card number],
76
- storage: 'PERSISTENT'
77
- },
78
- {
79
- format: 'UUID',
80
- value: 'Joe Doe',
81
- storage: 'VOLATILE'
82
- }]
83
- aliases = @api.redact(data).map { |item| item.aliases[0]._alias }
84
-
85
- response = @api.reveal aliases
86
-
87
- expect(response.length).to eq 2
88
- original_values = data.map { |i| i[:value] }
89
- revealed_values = response.values.map { |i| i.value }
90
- expect(Set.new original_values).to eq Set.new revealed_values
91
- end
92
- end
93
-
94
- describe 'update' do
95
- it 'should update alias' do
96
- data = [{
97
- format: 'UUID',
98
- value: SecureRandom.alphanumeric(10)
99
- }]
100
- _alias = @api.redact(data).map { |item| item.aliases[0]._alias }[0]
101
-
102
- @api.update _alias, classifiers: %w[secure]
103
-
104
- response = @api.reveal _alias
105
- expect(response[_alias].classifiers).to eq %w[secure]
106
- end
107
- end
108
-
109
- describe 'delete' do
110
- it 'should delete alias' do
111
- data = [{
112
- format: 'UUID',
113
- value: '5201784564572092'
114
- }]
115
- _alias = @api.redact(data).map { |item| item.aliases[0]._alias }[0]
116
-
117
- @api.delete _alias
118
-
119
- expect { @api.reveal _alias }.to raise_error(VGS::VgsApiError)
120
- end
121
- end
122
-
123
- end