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 ApiError
|
18
18
|
# Explanation of what exactly went wrong.
|
19
19
|
attr_accessor :detail
|
@@ -62,13 +62,13 @@ module VgsApiClient
|
|
62
62
|
# @param [Hash] attributes Model attributes in the form of hash
|
63
63
|
def initialize(attributes = {})
|
64
64
|
if (!attributes.is_a?(Hash))
|
65
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `VgsapiClient::ApiError` initialize method"
|
66
66
|
end
|
67
67
|
|
68
68
|
# check to see if the attribute exists and convert string to symbol for hash key
|
69
69
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
70
70
|
if (!self.class.attribute_map.key?(k.to_sym))
|
71
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
71
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VgsapiClient::ApiError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
72
72
|
end
|
73
73
|
h[k.to_sym] = v
|
74
74
|
}
|
@@ -193,7 +193,7 @@ module VgsApiClient
|
|
193
193
|
end
|
194
194
|
else # model
|
195
195
|
# models (e.g. Pet) or oneOf
|
196
|
-
klass =
|
196
|
+
klass = VgsapiClient.const_get(type)
|
197
197
|
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
198
198
|
end
|
199
199
|
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 CreateAliasesRequest
|
18
18
|
attr_accessor :data
|
19
19
|
|
@@ -32,7 +32,7 @@ module VgsApiClient
|
|
32
32
|
# Attribute type mapping.
|
33
33
|
def self.openapi_types
|
34
34
|
{
|
35
|
-
:'data' => :'Array<
|
35
|
+
:'data' => :'Array<OneOfCreateAliasesRequestNewCreateAliasesRequestExisting>'
|
36
36
|
}
|
37
37
|
end
|
38
38
|
|
@@ -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::CreateAliasesRequest` 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::CreateAliasesRequest`. 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
|
}
|
@@ -72,14 +72,6 @@ module VgsApiClient
|
|
72
72
|
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
73
73
|
end
|
74
74
|
|
75
|
-
if @data.length > 20
|
76
|
-
invalid_properties.push('invalid value for "data", number of items must be less than or equal to 20.')
|
77
|
-
end
|
78
|
-
|
79
|
-
if @data.length < 1
|
80
|
-
invalid_properties.push('invalid value for "data", number of items must be greater than or equal to 1.')
|
81
|
-
end
|
82
|
-
|
83
75
|
invalid_properties
|
84
76
|
end
|
85
77
|
|
@@ -87,29 +79,9 @@ module VgsApiClient
|
|
87
79
|
# @return true if the model is valid
|
88
80
|
def valid?
|
89
81
|
return false if @data.nil?
|
90
|
-
return false if @data.length > 20
|
91
|
-
return false if @data.length < 1
|
92
82
|
true
|
93
83
|
end
|
94
84
|
|
95
|
-
# Custom attribute writer method with validation
|
96
|
-
# @param [Object] data Value to be assigned
|
97
|
-
def data=(data)
|
98
|
-
if data.nil?
|
99
|
-
fail ArgumentError, 'data cannot be nil'
|
100
|
-
end
|
101
|
-
|
102
|
-
if data.length > 20
|
103
|
-
fail ArgumentError, 'invalid value for "data", number of items must be less than or equal to 20.'
|
104
|
-
end
|
105
|
-
|
106
|
-
if data.length < 1
|
107
|
-
fail ArgumentError, 'invalid value for "data", number of items must be greater than or equal to 1.'
|
108
|
-
end
|
109
|
-
|
110
|
-
@data = data
|
111
|
-
end
|
112
|
-
|
113
85
|
# Checks equality by comparing each attribute.
|
114
86
|
# @param [Object] Object to be compared
|
115
87
|
def ==(o)
|
@@ -197,7 +169,7 @@ module VgsApiClient
|
|
197
169
|
end
|
198
170
|
else # model
|
199
171
|
# models (e.g. Pet) or oneOf
|
200
|
-
klass =
|
172
|
+
klass = VgsapiClient.const_get(type)
|
201
173
|
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
202
174
|
end
|
203
175
|
end
|
@@ -1,20 +1,20 @@
|
|
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
|
17
|
-
class
|
16
|
+
module VgsapiClient
|
17
|
+
class CreateAliasesRequestExisting
|
18
18
|
# Existing alias to use as a reference.
|
19
19
|
attr_accessor :_alias
|
20
20
|
|
@@ -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::CreateAliasesRequestExisting` 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::CreateAliasesRequestExisting`. 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
|
}
|
@@ -182,7 +182,7 @@ module VgsApiClient
|
|
182
182
|
end
|
183
183
|
else # model
|
184
184
|
# models (e.g. Pet) or oneOf
|
185
|
-
klass =
|
185
|
+
klass = VgsapiClient.const_get(type)
|
186
186
|
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
187
187
|
end
|
188
188
|
end
|
@@ -1,59 +1,33 @@
|
|
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 CreateAliasesRequestNew
|
18
18
|
# List of tags to classify the value with.
|
19
19
|
attr_accessor :classifiers
|
20
20
|
|
21
21
|
attr_accessor :format
|
22
22
|
|
23
|
-
# 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.
|
24
|
-
attr_accessor :storage
|
25
|
-
|
26
23
|
# Raw value to encrypt & store in the vault.
|
27
24
|
attr_accessor :value
|
28
25
|
|
29
|
-
class EnumAttributeValidator
|
30
|
-
attr_reader :datatype
|
31
|
-
attr_reader :allowable_values
|
32
|
-
|
33
|
-
def initialize(datatype, allowable_values)
|
34
|
-
@allowable_values = allowable_values.map do |value|
|
35
|
-
case datatype.to_s
|
36
|
-
when /Integer/i
|
37
|
-
value.to_i
|
38
|
-
when /Float/i
|
39
|
-
value.to_f
|
40
|
-
else
|
41
|
-
value
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def valid?(value)
|
47
|
-
!value || allowable_values.include?(value)
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
26
|
# Attribute mapping from ruby-style variable name to JSON key.
|
52
27
|
def self.attribute_map
|
53
28
|
{
|
54
29
|
:'classifiers' => :'classifiers',
|
55
30
|
:'format' => :'format',
|
56
|
-
:'storage' => :'storage',
|
57
31
|
:'value' => :'value'
|
58
32
|
}
|
59
33
|
end
|
@@ -68,7 +42,6 @@ module VgsApiClient
|
|
68
42
|
{
|
69
43
|
:'classifiers' => :'Array<String>',
|
70
44
|
:'format' => :'AliasFormat',
|
71
|
-
:'storage' => :'String',
|
72
45
|
:'value' => :'String'
|
73
46
|
}
|
74
47
|
end
|
@@ -83,13 +56,13 @@ module VgsApiClient
|
|
83
56
|
# @param [Hash] attributes Model attributes in the form of hash
|
84
57
|
def initialize(attributes = {})
|
85
58
|
if (!attributes.is_a?(Hash))
|
86
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
59
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `VgsapiClient::CreateAliasesRequestNew` initialize method"
|
87
60
|
end
|
88
61
|
|
89
62
|
# check to see if the attribute exists and convert string to symbol for hash key
|
90
63
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
91
64
|
if (!self.class.attribute_map.key?(k.to_sym))
|
92
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VgsapiClient::CreateAliasesRequestNew`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
93
66
|
end
|
94
67
|
h[k.to_sym] = v
|
95
68
|
}
|
@@ -104,12 +77,6 @@ module VgsApiClient
|
|
104
77
|
self.format = attributes[:'format']
|
105
78
|
end
|
106
79
|
|
107
|
-
if attributes.key?(:'storage')
|
108
|
-
self.storage = attributes[:'storage']
|
109
|
-
else
|
110
|
-
self.storage = 'PERSISTENT'
|
111
|
-
end
|
112
|
-
|
113
80
|
if attributes.key?(:'value')
|
114
81
|
self.value = attributes[:'value']
|
115
82
|
end
|
@@ -134,22 +101,10 @@ module VgsApiClient
|
|
134
101
|
# @return true if the model is valid
|
135
102
|
def valid?
|
136
103
|
return false if @format.nil?
|
137
|
-
storage_validator = EnumAttributeValidator.new('String', ["PERSISTENT", "VOLATILE"])
|
138
|
-
return false unless storage_validator.valid?(@storage)
|
139
104
|
return false if @value.nil?
|
140
105
|
true
|
141
106
|
end
|
142
107
|
|
143
|
-
# Custom attribute writer method checking allowed values (enum).
|
144
|
-
# @param [Object] storage Object to be assigned
|
145
|
-
def storage=(storage)
|
146
|
-
validator = EnumAttributeValidator.new('String', ["PERSISTENT", "VOLATILE"])
|
147
|
-
unless validator.valid?(storage)
|
148
|
-
fail ArgumentError, "invalid value for \"storage\", must be one of #{validator.allowable_values}."
|
149
|
-
end
|
150
|
-
@storage = storage
|
151
|
-
end
|
152
|
-
|
153
108
|
# Checks equality by comparing each attribute.
|
154
109
|
# @param [Object] Object to be compared
|
155
110
|
def ==(o)
|
@@ -157,7 +112,6 @@ module VgsApiClient
|
|
157
112
|
self.class == o.class &&
|
158
113
|
classifiers == o.classifiers &&
|
159
114
|
format == o.format &&
|
160
|
-
storage == o.storage &&
|
161
115
|
value == o.value
|
162
116
|
end
|
163
117
|
|
@@ -170,7 +124,7 @@ module VgsApiClient
|
|
170
124
|
# Calculates hash code according to all attributes.
|
171
125
|
# @return [Integer] Hash code
|
172
126
|
def hash
|
173
|
-
[classifiers, format,
|
127
|
+
[classifiers, format, value].hash
|
174
128
|
end
|
175
129
|
|
176
130
|
# Builds the object from hash
|
@@ -240,7 +194,7 @@ module VgsApiClient
|
|
240
194
|
end
|
241
195
|
else # model
|
242
196
|
# models (e.g. Pet) or oneOf
|
243
|
-
klass =
|
197
|
+
klass = VgsapiClient.const_get(type)
|
244
198
|
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
245
199
|
end
|
246
200
|
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 InlineResponse200
|
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::InlineResponse200` 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::InlineResponse200`. 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
|
}
|
@@ -164,7 +164,7 @@ module VgsApiClient
|
|
164
164
|
end
|
165
165
|
else # model
|
166
166
|
# models (e.g. Pet) or oneOf
|
167
|
-
klass =
|
167
|
+
klass = VgsapiClient.const_get(type)
|
168
168
|
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
169
169
|
end
|
170
170
|
end
|