vgs_api_client 0.0.1.dev202204201806 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +70 -0
- data/README.md +237 -0
- data/docs/AliasFormat.md +15 -0
- data/docs/AliasesApi.md +366 -0
- data/docs/ApiError.md +24 -0
- data/docs/CreateAliasesRequest.md +18 -0
- data/docs/CreateAliasesRequestExisting.md +20 -0
- data/docs/CreateAliasesRequestNew.md +22 -0
- data/docs/InlineResponse200.md +18 -0
- data/docs/InlineResponse2001.md +18 -0
- data/docs/InlineResponse201.md +18 -0
- data/docs/InlineResponseDefault.md +18 -0
- data/docs/ModelAlias.md +20 -0
- data/docs/RevealedData.md +24 -0
- data/docs/UpdateAliasRequest.md +18 -0
- data/docs/UpdateAliasRequestData.md +18 -0
- data/git_push.sh +57 -0
- data/lib/vgs_api_client/api/aliases_api.rb +17 -8
- data/lib/vgs_api_client/api_client.rb +5 -5
- data/lib/vgs_api_client/api_error.rb +3 -3
- data/lib/vgs_api_client/configuration.rb +3 -3
- data/lib/vgs_api_client/models/alias_format.rb +3 -3
- data/lib/vgs_api_client/models/api_error.rb +6 -6
- data/lib/vgs_api_client/models/create_aliases_request.rb +7 -35
- data/lib/vgs_api_client/models/{create_aliases_request_reference.rb → create_aliases_request_existing.rb} +7 -7
- data/lib/vgs_api_client/models/create_aliases_request_new.rb +7 -53
- data/lib/vgs_api_client/models/inline_response200.rb +6 -6
- data/lib/vgs_api_client/models/inline_response2001.rb +6 -30
- data/lib/vgs_api_client/models/inline_response201.rb +6 -6
- data/lib/vgs_api_client/models/inline_response_default.rb +6 -21
- data/lib/vgs_api_client/models/model_alias.rb +6 -6
- data/lib/vgs_api_client/models/revealed_data.rb +7 -53
- data/lib/vgs_api_client/models/update_alias_request.rb +6 -6
- data/lib/vgs_api_client/models/update_alias_request_data.rb +6 -6
- data/lib/vgs_api_client/version.rb +4 -4
- data/lib/vgs_api_client.rb +5 -5
- data/spec/api/aliases_api_spec.rb +137 -0
- data/spec/api_client_spec.rb +31 -31
- data/spec/configuration_spec.rb +5 -5
- data/spec/models/alias_format_spec.rb +28 -0
- data/spec/models/api_error_spec.rb +52 -0
- data/spec/models/create_aliases_request_existing_spec.rb +40 -0
- data/spec/models/create_aliases_request_new_spec.rb +46 -0
- data/spec/models/create_aliases_request_spec.rb +34 -0
- data/spec/models/inline_response2001_spec.rb +34 -0
- data/spec/models/inline_response200_spec.rb +34 -0
- data/spec/models/inline_response201_spec.rb +34 -0
- data/spec/models/inline_response_default_spec.rb +34 -0
- data/spec/models/model_alias_spec.rb +40 -0
- data/spec/models/revealed_data_spec.rb +52 -0
- data/spec/models/update_alias_request_data_spec.rb +34 -0
- data/spec/models/update_alias_request_spec.rb +34 -0
- data/spec/spec_helper.rb +2 -2
- data/vgs_api_client.gemspec +3 -3
- metadata +51 -22
- data/DEVELOPMENT.md +0 -11
- data/LICENSE +0 -11
- data/RELEASE.md +0 -15
- data/docker-compose.yaml +0 -32
- data/lib/vgs.rb +0 -82
- data/scripts/assemble/Dockerfile +0 -8
- data/scripts/assemble/run.sh +0 -9
- data/scripts/publish/Dockerfile +0 -8
- data/scripts/publish/run.sh +0 -14
- data/scripts/publish.sh +0 -12
- data/scripts/run-tests-e2e.sh +0 -10
- data/scripts/run-tests.sh +0 -6
- data/scripts/test/Dockerfile +0 -12
- data/scripts/test/run.sh +0 -37
- data/spec/test_aliases_api_spec.rb +0 -97
@@ -1,19 +1,19 @@
|
|
1
1
|
=begin
|
2
2
|
#Vault HTTP API
|
3
3
|
|
4
|
-
#
|
4
|
+
#Storing, retrieving, and managing sensitive data within a VGS organization. **NOTE:** _The Vault API is intended only for environments that are already PCI-compliant. If you want to use this API, but are not yet PCI-compliant, you can use [VGS Collect](https://www.verygoodsecurity.com/docs/vgs-collect/what-is-it) or VGS Proxy with [Inbound Routes](https://www.verygoodsecurity.com/docs/getting-started/quick-integration#securing-inbound-connection) to quickly and seamlessly achieve compliance._ Looking for the old version of the API? Find it [here](https://www.verygoodsecurity.com/docs/api/1/vault). # Introduction Each encrypted value stored in a VGS vault has one or multiple _aliases_ associated with it. These aliases are fully opaque and retain no information about the underlying data. The user may safely store aliases without compromising data security. **NOTE:** The API works with persistent storage only. Unlike volatile storage, this means that the data is stored permanently, without any implicit TTL. Aliases are not valuable on their own. However, they can be used to decrypt the associated value and pass it to another service via the [forward proxy](https://www.verygoodsecurity.com/docs/guides/outbound-connection). ## Alias Formats Each alias corresponds to a certain format. There are several alias formats suitable for different kinds of sensitive data. For example, `UUID` produces a random Base58-encoded UUID string with an environment-dependent prefix: ``` tok_sandbox_bhtsCwFUzoJMw9rWUfEV5e ``` This format is generic and suitable for any kind of data. The tables below contain descriptions of all alias formats recognized by the API. ### Generic Formats | Value | Description | |-------------------------|-------------------------------------------------------| | `NUM_LENGTH_PRESERVING` | Length-Preserving, Numeric | | `RAW_UUID` | UUID | | `UUID` | UUID (Prefixed, Base58-Encoded) | | `GENERIC_T_FOUR` | UUID (Prefixed, Base58-Encoded, Last four preserving) | ### Account Number Formats | Value | Description | |-----------------------------------|--------------------------------------| | `FPE_ACC_NUM_T_FOUR` | Length-Preserving, Numeric (A4) | | `FPE_ALPHANUMERIC_ACC_NUM_T_FOUR` | Length-Preserving, Alphanumeric (A4) | ### Payment Card Formats | Value | Description | |------------------|---------------------------------------------| | `FPE_SIX_T_FOUR` | Format-Preserving, Luhn Valid (6T4) | | `FPE_T_FOUR` | Format-Preserving, Luhn Valid (T4) | | `PFPT` | Prefixed, Luhn Valid, 19-Digit Fixed Length | ### SSN Formats | Value | Description | |------------------|------------------------| | `FPE_SSN_T_FOUR` | Format-Preserving (A4) | # 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) # 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
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.
|
9
|
+
OpenAPI Generator version: 5.0.1-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
require 'time'
|
15
15
|
|
16
|
-
module
|
16
|
+
module VgsapiClient
|
17
17
|
class InlineResponse2001
|
18
18
|
# The retrieved value.
|
19
19
|
attr_accessor :data
|
@@ -47,13 +47,13 @@ module VgsApiClient
|
|
47
47
|
# @param [Hash] attributes Model attributes in the form of hash
|
48
48
|
def initialize(attributes = {})
|
49
49
|
if (!attributes.is_a?(Hash))
|
50
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `VgsapiClient::InlineResponse2001` initialize method"
|
51
51
|
end
|
52
52
|
|
53
53
|
# check to see if the attribute exists and convert string to symbol for hash key
|
54
54
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
55
55
|
if (!self.class.attribute_map.key?(k.to_sym))
|
56
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VgsapiClient::InlineResponse2001`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
57
57
|
end
|
58
58
|
h[k.to_sym] = v
|
59
59
|
}
|
@@ -69,39 +69,15 @@ module VgsApiClient
|
|
69
69
|
# @return Array for valid properties with the reasons
|
70
70
|
def list_invalid_properties
|
71
71
|
invalid_properties = Array.new
|
72
|
-
if !@data.nil? && @data.length > 1
|
73
|
-
invalid_properties.push('invalid value for "data", number of items must be less than or equal to 1.')
|
74
|
-
end
|
75
|
-
|
76
|
-
if !@data.nil? && @data.length < 1
|
77
|
-
invalid_properties.push('invalid value for "data", number of items must be greater than or equal to 1.')
|
78
|
-
end
|
79
|
-
|
80
72
|
invalid_properties
|
81
73
|
end
|
82
74
|
|
83
75
|
# Check to see if the all the properties in the model are valid
|
84
76
|
# @return true if the model is valid
|
85
77
|
def valid?
|
86
|
-
return false if !@data.nil? && @data.length > 1
|
87
|
-
return false if !@data.nil? && @data.length < 1
|
88
78
|
true
|
89
79
|
end
|
90
80
|
|
91
|
-
# Custom attribute writer method with validation
|
92
|
-
# @param [Object] data Value to be assigned
|
93
|
-
def data=(data)
|
94
|
-
if !data.nil? && data.length > 1
|
95
|
-
fail ArgumentError, 'invalid value for "data", number of items must be less than or equal to 1.'
|
96
|
-
end
|
97
|
-
|
98
|
-
if !data.nil? && data.length < 1
|
99
|
-
fail ArgumentError, 'invalid value for "data", number of items must be greater than or equal to 1.'
|
100
|
-
end
|
101
|
-
|
102
|
-
@data = data
|
103
|
-
end
|
104
|
-
|
105
81
|
# Checks equality by comparing each attribute.
|
106
82
|
# @param [Object] Object to be compared
|
107
83
|
def ==(o)
|
@@ -189,7 +165,7 @@ module VgsApiClient
|
|
189
165
|
end
|
190
166
|
else # model
|
191
167
|
# models (e.g. Pet) or oneOf
|
192
|
-
klass =
|
168
|
+
klass = VgsapiClient.const_get(type)
|
193
169
|
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
194
170
|
end
|
195
171
|
end
|
@@ -1,19 +1,19 @@
|
|
1
1
|
=begin
|
2
2
|
#Vault HTTP API
|
3
3
|
|
4
|
-
#
|
4
|
+
#Storing, retrieving, and managing sensitive data within a VGS organization. **NOTE:** _The Vault API is intended only for environments that are already PCI-compliant. If you want to use this API, but are not yet PCI-compliant, you can use [VGS Collect](https://www.verygoodsecurity.com/docs/vgs-collect/what-is-it) or VGS Proxy with [Inbound Routes](https://www.verygoodsecurity.com/docs/getting-started/quick-integration#securing-inbound-connection) to quickly and seamlessly achieve compliance._ Looking for the old version of the API? Find it [here](https://www.verygoodsecurity.com/docs/api/1/vault). # Introduction Each encrypted value stored in a VGS vault has one or multiple _aliases_ associated with it. These aliases are fully opaque and retain no information about the underlying data. The user may safely store aliases without compromising data security. **NOTE:** The API works with persistent storage only. Unlike volatile storage, this means that the data is stored permanently, without any implicit TTL. Aliases are not valuable on their own. However, they can be used to decrypt the associated value and pass it to another service via the [forward proxy](https://www.verygoodsecurity.com/docs/guides/outbound-connection). ## Alias Formats Each alias corresponds to a certain format. There are several alias formats suitable for different kinds of sensitive data. For example, `UUID` produces a random Base58-encoded UUID string with an environment-dependent prefix: ``` tok_sandbox_bhtsCwFUzoJMw9rWUfEV5e ``` This format is generic and suitable for any kind of data. The tables below contain descriptions of all alias formats recognized by the API. ### Generic Formats | Value | Description | |-------------------------|-------------------------------------------------------| | `NUM_LENGTH_PRESERVING` | Length-Preserving, Numeric | | `RAW_UUID` | UUID | | `UUID` | UUID (Prefixed, Base58-Encoded) | | `GENERIC_T_FOUR` | UUID (Prefixed, Base58-Encoded, Last four preserving) | ### Account Number Formats | Value | Description | |-----------------------------------|--------------------------------------| | `FPE_ACC_NUM_T_FOUR` | Length-Preserving, Numeric (A4) | | `FPE_ALPHANUMERIC_ACC_NUM_T_FOUR` | Length-Preserving, Alphanumeric (A4) | ### Payment Card Formats | Value | Description | |------------------|---------------------------------------------| | `FPE_SIX_T_FOUR` | Format-Preserving, Luhn Valid (6T4) | | `FPE_T_FOUR` | Format-Preserving, Luhn Valid (T4) | | `PFPT` | Prefixed, Luhn Valid, 19-Digit Fixed Length | ### SSN Formats | Value | Description | |------------------|------------------------| | `FPE_SSN_T_FOUR` | Format-Preserving (A4) | # 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) # 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
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.
|
9
|
+
OpenAPI Generator version: 5.0.1-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
require 'time'
|
15
15
|
|
16
|
-
module
|
16
|
+
module VgsapiClient
|
17
17
|
class InlineResponse201
|
18
18
|
# List of stored values along with their aliases.
|
19
19
|
attr_accessor :data
|
@@ -47,13 +47,13 @@ module VgsApiClient
|
|
47
47
|
# @param [Hash] attributes Model attributes in the form of hash
|
48
48
|
def initialize(attributes = {})
|
49
49
|
if (!attributes.is_a?(Hash))
|
50
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `VgsapiClient::InlineResponse201` initialize method"
|
51
51
|
end
|
52
52
|
|
53
53
|
# check to see if the attribute exists and convert string to symbol for hash key
|
54
54
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
55
55
|
if (!self.class.attribute_map.key?(k.to_sym))
|
56
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VgsapiClient::InlineResponse201`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
57
57
|
end
|
58
58
|
h[k.to_sym] = v
|
59
59
|
}
|
@@ -165,7 +165,7 @@ module VgsApiClient
|
|
165
165
|
end
|
166
166
|
else # model
|
167
167
|
# models (e.g. Pet) or oneOf
|
168
|
-
klass =
|
168
|
+
klass = VgsapiClient.const_get(type)
|
169
169
|
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
170
170
|
end
|
171
171
|
end
|
@@ -1,19 +1,19 @@
|
|
1
1
|
=begin
|
2
2
|
#Vault HTTP API
|
3
3
|
|
4
|
-
#
|
4
|
+
#Storing, retrieving, and managing sensitive data within a VGS organization. **NOTE:** _The Vault API is intended only for environments that are already PCI-compliant. If you want to use this API, but are not yet PCI-compliant, you can use [VGS Collect](https://www.verygoodsecurity.com/docs/vgs-collect/what-is-it) or VGS Proxy with [Inbound Routes](https://www.verygoodsecurity.com/docs/getting-started/quick-integration#securing-inbound-connection) to quickly and seamlessly achieve compliance._ Looking for the old version of the API? Find it [here](https://www.verygoodsecurity.com/docs/api/1/vault). # Introduction Each encrypted value stored in a VGS vault has one or multiple _aliases_ associated with it. These aliases are fully opaque and retain no information about the underlying data. The user may safely store aliases without compromising data security. **NOTE:** The API works with persistent storage only. Unlike volatile storage, this means that the data is stored permanently, without any implicit TTL. Aliases are not valuable on their own. However, they can be used to decrypt the associated value and pass it to another service via the [forward proxy](https://www.verygoodsecurity.com/docs/guides/outbound-connection). ## Alias Formats Each alias corresponds to a certain format. There are several alias formats suitable for different kinds of sensitive data. For example, `UUID` produces a random Base58-encoded UUID string with an environment-dependent prefix: ``` tok_sandbox_bhtsCwFUzoJMw9rWUfEV5e ``` This format is generic and suitable for any kind of data. The tables below contain descriptions of all alias formats recognized by the API. ### Generic Formats | Value | Description | |-------------------------|-------------------------------------------------------| | `NUM_LENGTH_PRESERVING` | Length-Preserving, Numeric | | `RAW_UUID` | UUID | | `UUID` | UUID (Prefixed, Base58-Encoded) | | `GENERIC_T_FOUR` | UUID (Prefixed, Base58-Encoded, Last four preserving) | ### Account Number Formats | Value | Description | |-----------------------------------|--------------------------------------| | `FPE_ACC_NUM_T_FOUR` | Length-Preserving, Numeric (A4) | | `FPE_ALPHANUMERIC_ACC_NUM_T_FOUR` | Length-Preserving, Alphanumeric (A4) | ### Payment Card Formats | Value | Description | |------------------|---------------------------------------------| | `FPE_SIX_T_FOUR` | Format-Preserving, Luhn Valid (6T4) | | `FPE_T_FOUR` | Format-Preserving, Luhn Valid (T4) | | `PFPT` | Prefixed, Luhn Valid, 19-Digit Fixed Length | ### SSN Formats | Value | Description | |------------------|------------------------| | `FPE_SSN_T_FOUR` | Format-Preserving (A4) | # 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) # 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
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.
|
9
|
+
OpenAPI Generator version: 5.0.1-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
require 'time'
|
15
15
|
|
16
|
-
module
|
16
|
+
module VgsapiClient
|
17
17
|
class InlineResponseDefault
|
18
18
|
# List of errors that occurred while processing the request.
|
19
19
|
attr_accessor :errors
|
@@ -47,13 +47,13 @@ module VgsApiClient
|
|
47
47
|
# @param [Hash] attributes Model attributes in the form of hash
|
48
48
|
def initialize(attributes = {})
|
49
49
|
if (!attributes.is_a?(Hash))
|
50
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `VgsapiClient::InlineResponseDefault` initialize method"
|
51
51
|
end
|
52
52
|
|
53
53
|
# check to see if the attribute exists and convert string to symbol for hash key
|
54
54
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
55
55
|
if (!self.class.attribute_map.key?(k.to_sym))
|
56
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VgsapiClient::InlineResponseDefault`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
57
57
|
end
|
58
58
|
h[k.to_sym] = v
|
59
59
|
}
|
@@ -69,30 +69,15 @@ module VgsApiClient
|
|
69
69
|
# @return Array for valid properties with the reasons
|
70
70
|
def list_invalid_properties
|
71
71
|
invalid_properties = Array.new
|
72
|
-
if !@errors.nil? && @errors.length < 1
|
73
|
-
invalid_properties.push('invalid value for "errors", number of items must be greater than or equal to 1.')
|
74
|
-
end
|
75
|
-
|
76
72
|
invalid_properties
|
77
73
|
end
|
78
74
|
|
79
75
|
# Check to see if the all the properties in the model are valid
|
80
76
|
# @return true if the model is valid
|
81
77
|
def valid?
|
82
|
-
return false if !@errors.nil? && @errors.length < 1
|
83
78
|
true
|
84
79
|
end
|
85
80
|
|
86
|
-
# Custom attribute writer method with validation
|
87
|
-
# @param [Object] errors Value to be assigned
|
88
|
-
def errors=(errors)
|
89
|
-
if !errors.nil? && errors.length < 1
|
90
|
-
fail ArgumentError, 'invalid value for "errors", number of items must be greater than or equal to 1.'
|
91
|
-
end
|
92
|
-
|
93
|
-
@errors = errors
|
94
|
-
end
|
95
|
-
|
96
81
|
# Checks equality by comparing each attribute.
|
97
82
|
# @param [Object] Object to be compared
|
98
83
|
def ==(o)
|
@@ -180,7 +165,7 @@ module VgsApiClient
|
|
180
165
|
end
|
181
166
|
else # model
|
182
167
|
# models (e.g. Pet) or oneOf
|
183
|
-
klass =
|
168
|
+
klass = VgsapiClient.const_get(type)
|
184
169
|
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
185
170
|
end
|
186
171
|
end
|
@@ -1,19 +1,19 @@
|
|
1
1
|
=begin
|
2
2
|
#Vault HTTP API
|
3
3
|
|
4
|
-
#
|
4
|
+
#Storing, retrieving, and managing sensitive data within a VGS organization. **NOTE:** _The Vault API is intended only for environments that are already PCI-compliant. If you want to use this API, but are not yet PCI-compliant, you can use [VGS Collect](https://www.verygoodsecurity.com/docs/vgs-collect/what-is-it) or VGS Proxy with [Inbound Routes](https://www.verygoodsecurity.com/docs/getting-started/quick-integration#securing-inbound-connection) to quickly and seamlessly achieve compliance._ Looking for the old version of the API? Find it [here](https://www.verygoodsecurity.com/docs/api/1/vault). # Introduction Each encrypted value stored in a VGS vault has one or multiple _aliases_ associated with it. These aliases are fully opaque and retain no information about the underlying data. The user may safely store aliases without compromising data security. **NOTE:** The API works with persistent storage only. Unlike volatile storage, this means that the data is stored permanently, without any implicit TTL. Aliases are not valuable on their own. However, they can be used to decrypt the associated value and pass it to another service via the [forward proxy](https://www.verygoodsecurity.com/docs/guides/outbound-connection). ## Alias Formats Each alias corresponds to a certain format. There are several alias formats suitable for different kinds of sensitive data. For example, `UUID` produces a random Base58-encoded UUID string with an environment-dependent prefix: ``` tok_sandbox_bhtsCwFUzoJMw9rWUfEV5e ``` This format is generic and suitable for any kind of data. The tables below contain descriptions of all alias formats recognized by the API. ### Generic Formats | Value | Description | |-------------------------|-------------------------------------------------------| | `NUM_LENGTH_PRESERVING` | Length-Preserving, Numeric | | `RAW_UUID` | UUID | | `UUID` | UUID (Prefixed, Base58-Encoded) | | `GENERIC_T_FOUR` | UUID (Prefixed, Base58-Encoded, Last four preserving) | ### Account Number Formats | Value | Description | |-----------------------------------|--------------------------------------| | `FPE_ACC_NUM_T_FOUR` | Length-Preserving, Numeric (A4) | | `FPE_ALPHANUMERIC_ACC_NUM_T_FOUR` | Length-Preserving, Alphanumeric (A4) | ### Payment Card Formats | Value | Description | |------------------|---------------------------------------------| | `FPE_SIX_T_FOUR` | Format-Preserving, Luhn Valid (6T4) | | `FPE_T_FOUR` | Format-Preserving, Luhn Valid (T4) | | `PFPT` | Prefixed, Luhn Valid, 19-Digit Fixed Length | ### SSN Formats | Value | Description | |------------------|------------------------| | `FPE_SSN_T_FOUR` | Format-Preserving (A4) | # 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) # 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
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.
|
9
|
+
OpenAPI Generator version: 5.0.1-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
require 'time'
|
15
15
|
|
16
|
-
module
|
16
|
+
module VgsapiClient
|
17
17
|
class ModelAlias
|
18
18
|
# Opaque string used to substitute the raw value.
|
19
19
|
attr_accessor :_alias
|
@@ -51,13 +51,13 @@ module VgsApiClient
|
|
51
51
|
# @param [Hash] attributes Model attributes in the form of hash
|
52
52
|
def initialize(attributes = {})
|
53
53
|
if (!attributes.is_a?(Hash))
|
54
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `VgsapiClient::ModelAlias` initialize method"
|
55
55
|
end
|
56
56
|
|
57
57
|
# check to see if the attribute exists and convert string to symbol for hash key
|
58
58
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
59
59
|
if (!self.class.attribute_map.key?(k.to_sym))
|
60
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
60
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VgsapiClient::ModelAlias`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
61
61
|
end
|
62
62
|
h[k.to_sym] = v
|
63
63
|
}
|
@@ -172,7 +172,7 @@ module VgsApiClient
|
|
172
172
|
end
|
173
173
|
else # model
|
174
174
|
# models (e.g. Pet) or oneOf
|
175
|
-
klass =
|
175
|
+
klass = VgsapiClient.const_get(type)
|
176
176
|
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
177
177
|
end
|
178
178
|
end
|
@@ -1,19 +1,19 @@
|
|
1
1
|
=begin
|
2
2
|
#Vault HTTP API
|
3
3
|
|
4
|
-
#
|
4
|
+
#Storing, retrieving, and managing sensitive data within a VGS organization. **NOTE:** _The Vault API is intended only for environments that are already PCI-compliant. If you want to use this API, but are not yet PCI-compliant, you can use [VGS Collect](https://www.verygoodsecurity.com/docs/vgs-collect/what-is-it) or VGS Proxy with [Inbound Routes](https://www.verygoodsecurity.com/docs/getting-started/quick-integration#securing-inbound-connection) to quickly and seamlessly achieve compliance._ Looking for the old version of the API? Find it [here](https://www.verygoodsecurity.com/docs/api/1/vault). # Introduction Each encrypted value stored in a VGS vault has one or multiple _aliases_ associated with it. These aliases are fully opaque and retain no information about the underlying data. The user may safely store aliases without compromising data security. **NOTE:** The API works with persistent storage only. Unlike volatile storage, this means that the data is stored permanently, without any implicit TTL. Aliases are not valuable on their own. However, they can be used to decrypt the associated value and pass it to another service via the [forward proxy](https://www.verygoodsecurity.com/docs/guides/outbound-connection). ## Alias Formats Each alias corresponds to a certain format. There are several alias formats suitable for different kinds of sensitive data. For example, `UUID` produces a random Base58-encoded UUID string with an environment-dependent prefix: ``` tok_sandbox_bhtsCwFUzoJMw9rWUfEV5e ``` This format is generic and suitable for any kind of data. The tables below contain descriptions of all alias formats recognized by the API. ### Generic Formats | Value | Description | |-------------------------|-------------------------------------------------------| | `NUM_LENGTH_PRESERVING` | Length-Preserving, Numeric | | `RAW_UUID` | UUID | | `UUID` | UUID (Prefixed, Base58-Encoded) | | `GENERIC_T_FOUR` | UUID (Prefixed, Base58-Encoded, Last four preserving) | ### Account Number Formats | Value | Description | |-----------------------------------|--------------------------------------| | `FPE_ACC_NUM_T_FOUR` | Length-Preserving, Numeric (A4) | | `FPE_ALPHANUMERIC_ACC_NUM_T_FOUR` | Length-Preserving, Alphanumeric (A4) | ### Payment Card Formats | Value | Description | |------------------|---------------------------------------------| | `FPE_SIX_T_FOUR` | Format-Preserving, Luhn Valid (6T4) | | `FPE_T_FOUR` | Format-Preserving, Luhn Valid (T4) | | `PFPT` | Prefixed, Luhn Valid, 19-Digit Fixed Length | ### SSN Formats | Value | Description | |------------------|------------------------| | `FPE_SSN_T_FOUR` | Format-Preserving (A4) | # 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) # 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
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.
|
9
|
+
OpenAPI Generator version: 5.0.1-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
require 'time'
|
15
15
|
|
16
|
-
module
|
16
|
+
module VgsapiClient
|
17
17
|
class RevealedData
|
18
18
|
# List of aliases associated with the value.
|
19
19
|
attr_accessor :aliases
|
@@ -24,41 +24,15 @@ module VgsApiClient
|
|
24
24
|
# Creation time, in UTC.
|
25
25
|
attr_accessor :created_at
|
26
26
|
|
27
|
-
# Storage medium to use. VOLATILE results in data being persisted into an in-memory data store for one hour which is required for PCI compliant storage of card security code data.
|
28
|
-
attr_accessor :storage
|
29
|
-
|
30
27
|
# Decrypted value stored in the vault.
|
31
28
|
attr_accessor :value
|
32
29
|
|
33
|
-
class EnumAttributeValidator
|
34
|
-
attr_reader :datatype
|
35
|
-
attr_reader :allowable_values
|
36
|
-
|
37
|
-
def initialize(datatype, allowable_values)
|
38
|
-
@allowable_values = allowable_values.map do |value|
|
39
|
-
case datatype.to_s
|
40
|
-
when /Integer/i
|
41
|
-
value.to_i
|
42
|
-
when /Float/i
|
43
|
-
value.to_f
|
44
|
-
else
|
45
|
-
value
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
def valid?(value)
|
51
|
-
!value || allowable_values.include?(value)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
30
|
# Attribute mapping from ruby-style variable name to JSON key.
|
56
31
|
def self.attribute_map
|
57
32
|
{
|
58
33
|
:'aliases' => :'aliases',
|
59
34
|
:'classifiers' => :'classifiers',
|
60
35
|
:'created_at' => :'created_at',
|
61
|
-
:'storage' => :'storage',
|
62
36
|
:'value' => :'value'
|
63
37
|
}
|
64
38
|
end
|
@@ -74,7 +48,6 @@ module VgsApiClient
|
|
74
48
|
:'aliases' => :'Array<ModelAlias>',
|
75
49
|
:'classifiers' => :'Array<String>',
|
76
50
|
:'created_at' => :'Time',
|
77
|
-
:'storage' => :'String',
|
78
51
|
:'value' => :'String'
|
79
52
|
}
|
80
53
|
end
|
@@ -89,13 +62,13 @@ module VgsApiClient
|
|
89
62
|
# @param [Hash] attributes Model attributes in the form of hash
|
90
63
|
def initialize(attributes = {})
|
91
64
|
if (!attributes.is_a?(Hash))
|
92
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `VgsapiClient::RevealedData` initialize method"
|
93
66
|
end
|
94
67
|
|
95
68
|
# check to see if the attribute exists and convert string to symbol for hash key
|
96
69
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
97
70
|
if (!self.class.attribute_map.key?(k.to_sym))
|
98
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
71
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VgsapiClient::RevealedData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
99
72
|
end
|
100
73
|
h[k.to_sym] = v
|
101
74
|
}
|
@@ -116,12 +89,6 @@ module VgsApiClient
|
|
116
89
|
self.created_at = attributes[:'created_at']
|
117
90
|
end
|
118
91
|
|
119
|
-
if attributes.key?(:'storage')
|
120
|
-
self.storage = attributes[:'storage']
|
121
|
-
else
|
122
|
-
self.storage = 'PERSISTENT'
|
123
|
-
end
|
124
|
-
|
125
92
|
if attributes.key?(:'value')
|
126
93
|
self.value = attributes[:'value']
|
127
94
|
end
|
@@ -137,21 +104,9 @@ module VgsApiClient
|
|
137
104
|
# Check to see if the all the properties in the model are valid
|
138
105
|
# @return true if the model is valid
|
139
106
|
def valid?
|
140
|
-
storage_validator = EnumAttributeValidator.new('String', ["PERSISTENT", "VOLATILE"])
|
141
|
-
return false unless storage_validator.valid?(@storage)
|
142
107
|
true
|
143
108
|
end
|
144
109
|
|
145
|
-
# Custom attribute writer method checking allowed values (enum).
|
146
|
-
# @param [Object] storage Object to be assigned
|
147
|
-
def storage=(storage)
|
148
|
-
validator = EnumAttributeValidator.new('String', ["PERSISTENT", "VOLATILE"])
|
149
|
-
unless validator.valid?(storage)
|
150
|
-
fail ArgumentError, "invalid value for \"storage\", must be one of #{validator.allowable_values}."
|
151
|
-
end
|
152
|
-
@storage = storage
|
153
|
-
end
|
154
|
-
|
155
110
|
# Checks equality by comparing each attribute.
|
156
111
|
# @param [Object] Object to be compared
|
157
112
|
def ==(o)
|
@@ -160,7 +115,6 @@ module VgsApiClient
|
|
160
115
|
aliases == o.aliases &&
|
161
116
|
classifiers == o.classifiers &&
|
162
117
|
created_at == o.created_at &&
|
163
|
-
storage == o.storage &&
|
164
118
|
value == o.value
|
165
119
|
end
|
166
120
|
|
@@ -173,7 +127,7 @@ module VgsApiClient
|
|
173
127
|
# Calculates hash code according to all attributes.
|
174
128
|
# @return [Integer] Hash code
|
175
129
|
def hash
|
176
|
-
[aliases, classifiers, created_at,
|
130
|
+
[aliases, classifiers, created_at, value].hash
|
177
131
|
end
|
178
132
|
|
179
133
|
# Builds the object from hash
|
@@ -243,7 +197,7 @@ module VgsApiClient
|
|
243
197
|
end
|
244
198
|
else # model
|
245
199
|
# models (e.g. Pet) or oneOf
|
246
|
-
klass =
|
200
|
+
klass = VgsapiClient.const_get(type)
|
247
201
|
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
248
202
|
end
|
249
203
|
end
|
@@ -1,19 +1,19 @@
|
|
1
1
|
=begin
|
2
2
|
#Vault HTTP API
|
3
3
|
|
4
|
-
#
|
4
|
+
#Storing, retrieving, and managing sensitive data within a VGS organization. **NOTE:** _The Vault API is intended only for environments that are already PCI-compliant. If you want to use this API, but are not yet PCI-compliant, you can use [VGS Collect](https://www.verygoodsecurity.com/docs/vgs-collect/what-is-it) or VGS Proxy with [Inbound Routes](https://www.verygoodsecurity.com/docs/getting-started/quick-integration#securing-inbound-connection) to quickly and seamlessly achieve compliance._ Looking for the old version of the API? Find it [here](https://www.verygoodsecurity.com/docs/api/1/vault). # Introduction Each encrypted value stored in a VGS vault has one or multiple _aliases_ associated with it. These aliases are fully opaque and retain no information about the underlying data. The user may safely store aliases without compromising data security. **NOTE:** The API works with persistent storage only. Unlike volatile storage, this means that the data is stored permanently, without any implicit TTL. Aliases are not valuable on their own. However, they can be used to decrypt the associated value and pass it to another service via the [forward proxy](https://www.verygoodsecurity.com/docs/guides/outbound-connection). ## Alias Formats Each alias corresponds to a certain format. There are several alias formats suitable for different kinds of sensitive data. For example, `UUID` produces a random Base58-encoded UUID string with an environment-dependent prefix: ``` tok_sandbox_bhtsCwFUzoJMw9rWUfEV5e ``` This format is generic and suitable for any kind of data. The tables below contain descriptions of all alias formats recognized by the API. ### Generic Formats | Value | Description | |-------------------------|-------------------------------------------------------| | `NUM_LENGTH_PRESERVING` | Length-Preserving, Numeric | | `RAW_UUID` | UUID | | `UUID` | UUID (Prefixed, Base58-Encoded) | | `GENERIC_T_FOUR` | UUID (Prefixed, Base58-Encoded, Last four preserving) | ### Account Number Formats | Value | Description | |-----------------------------------|--------------------------------------| | `FPE_ACC_NUM_T_FOUR` | Length-Preserving, Numeric (A4) | | `FPE_ALPHANUMERIC_ACC_NUM_T_FOUR` | Length-Preserving, Alphanumeric (A4) | ### Payment Card Formats | Value | Description | |------------------|---------------------------------------------| | `FPE_SIX_T_FOUR` | Format-Preserving, Luhn Valid (6T4) | | `FPE_T_FOUR` | Format-Preserving, Luhn Valid (T4) | | `PFPT` | Prefixed, Luhn Valid, 19-Digit Fixed Length | ### SSN Formats | Value | Description | |------------------|------------------------| | `FPE_SSN_T_FOUR` | Format-Preserving (A4) | # 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) # 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
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.
|
9
|
+
OpenAPI Generator version: 5.0.1-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
require 'time'
|
15
15
|
|
16
|
-
module
|
16
|
+
module VgsapiClient
|
17
17
|
class UpdateAliasRequest
|
18
18
|
attr_accessor :data
|
19
19
|
|
@@ -46,13 +46,13 @@ module VgsApiClient
|
|
46
46
|
# @param [Hash] attributes Model attributes in the form of hash
|
47
47
|
def initialize(attributes = {})
|
48
48
|
if (!attributes.is_a?(Hash))
|
49
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `VgsapiClient::UpdateAliasRequest` initialize method"
|
50
50
|
end
|
51
51
|
|
52
52
|
# check to see if the attribute exists and convert string to symbol for hash key
|
53
53
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
54
|
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VgsapiClient::UpdateAliasRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
56
|
end
|
57
57
|
h[k.to_sym] = v
|
58
58
|
}
|
@@ -167,7 +167,7 @@ module VgsApiClient
|
|
167
167
|
end
|
168
168
|
else # model
|
169
169
|
# models (e.g. Pet) or oneOf
|
170
|
-
klass =
|
170
|
+
klass = VgsapiClient.const_get(type)
|
171
171
|
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
172
172
|
end
|
173
173
|
end
|