vgs_api_client 0.0.28 → 0.0.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/DEVELOPMENT.md +11 -0
- data/LICENSE +11 -0
- data/RELEASE.md +15 -0
- data/docker-compose.yaml +24 -7
- data/lib/vgs.rb +82 -0
- data/lib/vgs_api_client/api/aliases_api.rb +6 -6
- data/lib/vgs_api_client/api_client.rb +3 -9
- data/lib/vgs_api_client/api_error.rb +2 -2
- data/lib/vgs_api_client/configuration.rb +2 -2
- data/lib/vgs_api_client/models/alias_format.rb +2 -2
- data/lib/vgs_api_client/models/api_error.rb +2 -3
- data/lib/vgs_api_client/models/create_aliases_request.rb +3 -4
- data/lib/vgs_api_client/models/create_aliases_request_new.rb +49 -4
- data/lib/vgs_api_client/models/{create_aliases_request_existing.rb → create_aliases_request_reference.rb} +5 -6
- data/lib/vgs_api_client/models/inline_response200.rb +2 -3
- data/lib/vgs_api_client/models/inline_response2001.rb +2 -3
- data/lib/vgs_api_client/models/inline_response201.rb +2 -3
- data/lib/vgs_api_client/models/inline_response_default.rb +2 -3
- data/lib/vgs_api_client/models/model_alias.rb +2 -3
- data/lib/vgs_api_client/models/revealed_data.rb +49 -4
- data/lib/vgs_api_client/models/update_alias_request.rb +2 -3
- data/lib/vgs_api_client/models/update_alias_request_data.rb +2 -3
- data/lib/vgs_api_client/version.rb +3 -3
- data/lib/vgs_api_client.rb +3 -3
- data/scripts/assemble/Dockerfile +8 -0
- data/scripts/assemble/run.sh +9 -0
- data/scripts/publish/Dockerfile +8 -0
- data/scripts/publish/run.sh +14 -0
- data/scripts/publish.sh +12 -0
- data/scripts/run-tests-e2e.sh +10 -0
- data/scripts/run-tests.sh +7 -0
- data/scripts/test/Dockerfile +12 -0
- data/scripts/test/run.sh +33 -0
- data/spec/api_client_spec.rb +2 -2
- data/spec/configuration_spec.rb +2 -2
- data/spec/spec_helper.rb +2 -2
- data/spec/test_api_spec.rb +97 -0
- data/vgs_api_client.gemspec +2 -2
- metadata +18 -52
- data/README.md +0 -237
- data/docs/AliasFormat.md +0 -15
- data/docs/AliasesApi.md +0 -366
- data/docs/ApiError.md +0 -24
- data/docs/CreateAliasesRequest.md +0 -18
- data/docs/CreateAliasesRequestExisting.md +0 -20
- data/docs/CreateAliasesRequestNew.md +0 -22
- data/docs/InlineResponse200.md +0 -18
- data/docs/InlineResponse2001.md +0 -18
- data/docs/InlineResponse201.md +0 -18
- data/docs/InlineResponseDefault.md +0 -18
- data/docs/ModelAlias.md +0 -20
- data/docs/RevealedData.md +0 -24
- data/docs/UpdateAliasRequest.md +0 -18
- data/docs/UpdateAliasRequestData.md +0 -18
- data/git_push.sh +0 -57
- data/publish/Dockerfile +0 -11
- data/publish/build_and_publish.sh +0 -13
- data/spec/api/aliases_api_spec.rb +0 -96
- data/spec/api/test_api_spec.rb +0 -137
- data/spec/models/alias_format_spec.rb +0 -28
- data/spec/models/api_error_spec.rb +0 -52
- data/spec/models/create_aliases_request_existing_spec.rb +0 -40
- data/spec/models/create_aliases_request_new_spec.rb +0 -46
- data/spec/models/create_aliases_request_spec.rb +0 -34
- data/spec/models/inline_response2001_spec.rb +0 -34
- data/spec/models/inline_response200_spec.rb +0 -34
- data/spec/models/inline_response201_spec.rb +0 -34
- data/spec/models/inline_response_default_spec.rb +0 -34
- data/spec/models/model_alias_spec.rb +0 -40
- data/spec/models/revealed_data_spec.rb +0 -52
- data/spec/models/update_alias_request_data_spec.rb +0 -34
- data/spec/models/update_alias_request_spec.rb +0 -34
- data/test/Dockerfile +0 -16
data/spec/spec_helper.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Vault HTTP API
|
3
3
|
|
4
|
-
#
|
4
|
+
#The VGS Vault HTTP API is used for storing, retrieving, and managing sensitive data (aka Tokenization) within a VGS Vault. The VGS API is organized around REST. Our API is built with a predictable resource-oriented structure, uses JSON-encoded requests and responses, follows standard HTTP verbs/responses, and uses industry standard authentication. ## What is VGS Storing sensitive data on your company’s infrastructure often comes with a heavy compliance burden. For instance, storing payments data yourself greatly increases the amount of work needed to become PCI compliant. It also increases your security risk in general. To combat this, companies will minimize the amount of sensitive information they have to handle or store. VGS provides multiple methods for minimizing the sensitive information that needs to be stored which allows customers to secure any type of data for any use-case. **Tokenization** is a method that focuses on securing the storage of data. This is the quickest way to get started and is free. [Get started with Tokenization](https://www.verygoodsecurity.com/docs/tokenization/getting-started). **Zero Data** is a unique method invented by VGS in 2016 that securely stores data like Tokenization, however it also removes the customer’s environment from PCI scope completely providing maximum security, and minimum compliance scope. [Get started with Zero Data](https://www.verygoodsecurity.com/docs/getting-started/before-you-start). Additionally, for scenarios where neither technology is a complete solution, for instance with legacy systems, VGS provides a compliance product which guarantees customers are able to meet their compliance needs no matter what may happen. [Get started with Control](https://www.verygoodsecurity.com/docs/control). ## Learn about Tokenization - [Create an Account for Free Tokenization](https://dashboard.verygoodsecurity.com/tokenization) - [Try a Tokenization Demo](https://www.verygoodsecurity.com/docs/tokenization/getting-started) - [Install a Tokenization SDK](https://www.verygoodsecurity.com/docs/tokenization/client-libraries) ### Authentication This API uses `Basic` authentication. Credentials to access the API can be generated on the [dashboard](https://dashboard.verygoodsecurity.com) by going to the Settings section of the vault of your choosing. [Docs » Guides » Access credentials](https://www.verygoodsecurity.com/docs/settings/access-credentials) ## Resource Limits ### Data Limits This API allows storing data up to 32MB in size. ### Rate Limiting The API allows up to 3,000 requests per minute. Requests are associated with the vault, regardless of the access credentials used to authenticate the request. Your current rate limit is included as HTTP headers in every API response: | Header Name | Description | |-------------------------|----------------------------------------------------------| | `x-ratelimit-remaining` | The number of requests remaining in the 1-minute window. | If you exceed the rate limit, the API will reject the request with HTTP [429 Too Many Requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429). ### Errors The API uses standard HTTP status codes to indicate whether the request succeeded or not. In case of failure, the response body will be JSON in a predefined format. For example, trying to create too many aliases at once results in the following response: ```json { \"errors\": [ { \"status\": 400, \"title\": \"Bad request\", \"detail\": \"Too many values (limit: 20)\", \"href\": \"https://api.sandbox.verygoodvault.com/aliases\" } ] } ```
|
5
5
|
|
6
6
|
The version of the OpenAPI document: 1.0.0
|
7
7
|
Contact: support@verygoodsecurity.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -0,0 +1,97 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'securerandom'
|
3
|
+
require 'vgs'
|
4
|
+
|
5
|
+
describe 'AliasesApiSpec' do
|
6
|
+
before(:all) do
|
7
|
+
config = VGS.config(username = ENV["VAULT_API_USERNAME"], password = ENV["VAULT_API_PASSWORD"])
|
8
|
+
@aliases_api = VGS::Aliases.new(config)
|
9
|
+
end
|
10
|
+
|
11
|
+
describe 'redact' do
|
12
|
+
it 'should redact values' do
|
13
|
+
data = [
|
14
|
+
{
|
15
|
+
:format => 'UUID',
|
16
|
+
:value => '5201784564572092',
|
17
|
+
:classifiers => %w[credit-card number],
|
18
|
+
:storage => 'PERSISTENT',
|
19
|
+
},
|
20
|
+
{
|
21
|
+
:format => 'UUID',
|
22
|
+
:value => 'Joe Doe',
|
23
|
+
:storage => 'VOLATILE',
|
24
|
+
}
|
25
|
+
]
|
26
|
+
aliases = @aliases_api.redact(data)
|
27
|
+
expect(aliases.length).to eq 2
|
28
|
+
data.each_with_index do |item, index|
|
29
|
+
expect(aliases[index].value).to eq item[:value]
|
30
|
+
expect(aliases[index].storage).to eq item[:storage]
|
31
|
+
expect(aliases[index].aliases[0]._alias).to start_with "tok_"
|
32
|
+
end
|
33
|
+
expect(Set.new(aliases[0].classifiers)).to eq Set.new(%w[credit-card number])
|
34
|
+
expect(Set.new(aliases[1].classifiers)).to eq Set.new
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe 'reveal' do
|
39
|
+
it 'should reveal aliases' do
|
40
|
+
data = [
|
41
|
+
{
|
42
|
+
:format => 'UUID',
|
43
|
+
:value => '5201784564572092',
|
44
|
+
:classifiers => %w[credit-card number],
|
45
|
+
:storage => 'PERSISTENT',
|
46
|
+
},
|
47
|
+
{
|
48
|
+
:format => 'UUID',
|
49
|
+
:value => 'Joe Doe',
|
50
|
+
:storage => 'VOLATILE',
|
51
|
+
}
|
52
|
+
]
|
53
|
+
aliases = @aliases_api.redact(data).map { |item| item.aliases[0]._alias }
|
54
|
+
|
55
|
+
response = @aliases_api.reveal(aliases)
|
56
|
+
|
57
|
+
expect(response.length).to eq 2
|
58
|
+
original_values = data.map { |i| i[:value] }
|
59
|
+
revealed_values = response.values.map { |i| i.value }
|
60
|
+
expect(Set.new(original_values)).to eq Set.new(revealed_values)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
describe 'update' do
|
65
|
+
it 'should update alias' do
|
66
|
+
data = [
|
67
|
+
{
|
68
|
+
:format => 'UUID',
|
69
|
+
:value => SecureRandom.alphanumeric(10),
|
70
|
+
}
|
71
|
+
]
|
72
|
+
_alias = @aliases_api.redact(data).map { |item| item.aliases[0]._alias }[0]
|
73
|
+
|
74
|
+
@aliases_api.update(_alias = _alias, data = { :classifiers => ["secure"] })
|
75
|
+
|
76
|
+
response = @aliases_api.reveal(_alias)
|
77
|
+
expect(response[_alias].classifiers).to eq %w[secure]
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
describe 'delete' do
|
82
|
+
it 'should delete alias' do
|
83
|
+
data = [
|
84
|
+
{
|
85
|
+
:format => 'UUID',
|
86
|
+
:value => '5201784564572092',
|
87
|
+
}
|
88
|
+
]
|
89
|
+
_alias = @aliases_api.redact(data).map { |item| item.aliases[0]._alias }[0]
|
90
|
+
|
91
|
+
@aliases_api.delete(_alias = _alias)
|
92
|
+
|
93
|
+
expect { @aliases_api.reveal(_alias) }.to raise_error(VGS::VgsApiException)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|
data/vgs_api_client.gemspec
CHANGED
@@ -3,12 +3,12 @@
|
|
3
3
|
=begin
|
4
4
|
#Vault HTTP API
|
5
5
|
|
6
|
-
#
|
6
|
+
#The VGS Vault HTTP API is used for storing, retrieving, and managing sensitive data (aka Tokenization) within a VGS Vault. The VGS API is organized around REST. Our API is built with a predictable resource-oriented structure, uses JSON-encoded requests and responses, follows standard HTTP verbs/responses, and uses industry standard authentication. ## What is VGS Storing sensitive data on your company’s infrastructure often comes with a heavy compliance burden. For instance, storing payments data yourself greatly increases the amount of work needed to become PCI compliant. It also increases your security risk in general. To combat this, companies will minimize the amount of sensitive information they have to handle or store. VGS provides multiple methods for minimizing the sensitive information that needs to be stored which allows customers to secure any type of data for any use-case. **Tokenization** is a method that focuses on securing the storage of data. This is the quickest way to get started and is free. [Get started with Tokenization](https://www.verygoodsecurity.com/docs/tokenization/getting-started). **Zero Data** is a unique method invented by VGS in 2016 that securely stores data like Tokenization, however it also removes the customer’s environment from PCI scope completely providing maximum security, and minimum compliance scope. [Get started with Zero Data](https://www.verygoodsecurity.com/docs/getting-started/before-you-start). Additionally, for scenarios where neither technology is a complete solution, for instance with legacy systems, VGS provides a compliance product which guarantees customers are able to meet their compliance needs no matter what may happen. [Get started with Control](https://www.verygoodsecurity.com/docs/control). ## Learn about Tokenization - [Create an Account for Free Tokenization](https://dashboard.verygoodsecurity.com/tokenization) - [Try a Tokenization Demo](https://www.verygoodsecurity.com/docs/tokenization/getting-started) - [Install a Tokenization SDK](https://www.verygoodsecurity.com/docs/tokenization/client-libraries) ### Authentication This API uses `Basic` authentication. Credentials to access the API can be generated on the [dashboard](https://dashboard.verygoodsecurity.com) by going to the Settings section of the vault of your choosing. [Docs » Guides » Access credentials](https://www.verygoodsecurity.com/docs/settings/access-credentials) ## Resource Limits ### Data Limits This API allows storing data up to 32MB in size. ### Rate Limiting The API allows up to 3,000 requests per minute. Requests are associated with the vault, regardless of the access credentials used to authenticate the request. Your current rate limit is included as HTTP headers in every API response: | Header Name | Description | |-------------------------|----------------------------------------------------------| | `x-ratelimit-remaining` | The number of requests remaining in the 1-minute window. | If you exceed the rate limit, the API will reject the request with HTTP [429 Too Many Requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429). ### Errors The API uses standard HTTP status codes to indicate whether the request succeeded or not. In case of failure, the response body will be JSON in a predefined format. For example, trying to create too many aliases at once results in the following response: ```json { \"errors\": [ { \"status\": 400, \"title\": \"Bad request\", \"detail\": \"Too many values (limit: 20)\", \"href\": \"https://api.sandbox.verygoodvault.com/aliases\" } ] } ```
|
7
7
|
|
8
8
|
The version of the OpenAPI document: 1.0.0
|
9
9
|
Contact: support@verygoodsecurity.com
|
10
10
|
Generated by: https://openapi-generator.tech
|
11
|
-
OpenAPI Generator version:
|
11
|
+
OpenAPI Generator version: 5.4.0
|
12
12
|
|
13
13
|
=end
|
14
14
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vgs_api_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Very Good Security
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -57,25 +57,13 @@ executables: []
|
|
57
57
|
extensions: []
|
58
58
|
extra_rdoc_files: []
|
59
59
|
files:
|
60
|
+
- DEVELOPMENT.md
|
60
61
|
- Gemfile
|
61
|
-
-
|
62
|
+
- LICENSE
|
63
|
+
- RELEASE.md
|
62
64
|
- Rakefile
|
63
65
|
- docker-compose.yaml
|
64
|
-
-
|
65
|
-
- docs/AliasesApi.md
|
66
|
-
- docs/ApiError.md
|
67
|
-
- docs/CreateAliasesRequest.md
|
68
|
-
- docs/CreateAliasesRequestExisting.md
|
69
|
-
- docs/CreateAliasesRequestNew.md
|
70
|
-
- docs/InlineResponse200.md
|
71
|
-
- docs/InlineResponse2001.md
|
72
|
-
- docs/InlineResponse201.md
|
73
|
-
- docs/InlineResponseDefault.md
|
74
|
-
- docs/ModelAlias.md
|
75
|
-
- docs/RevealedData.md
|
76
|
-
- docs/UpdateAliasRequest.md
|
77
|
-
- docs/UpdateAliasRequestData.md
|
78
|
-
- git_push.sh
|
66
|
+
- lib/vgs.rb
|
79
67
|
- lib/vgs_api_client.rb
|
80
68
|
- lib/vgs_api_client/api/aliases_api.rb
|
81
69
|
- lib/vgs_api_client/api_client.rb
|
@@ -84,8 +72,8 @@ files:
|
|
84
72
|
- lib/vgs_api_client/models/alias_format.rb
|
85
73
|
- lib/vgs_api_client/models/api_error.rb
|
86
74
|
- lib/vgs_api_client/models/create_aliases_request.rb
|
87
|
-
- lib/vgs_api_client/models/create_aliases_request_existing.rb
|
88
75
|
- lib/vgs_api_client/models/create_aliases_request_new.rb
|
76
|
+
- lib/vgs_api_client/models/create_aliases_request_reference.rb
|
89
77
|
- lib/vgs_api_client/models/inline_response200.rb
|
90
78
|
- lib/vgs_api_client/models/inline_response2001.rb
|
91
79
|
- lib/vgs_api_client/models/inline_response201.rb
|
@@ -95,27 +83,19 @@ files:
|
|
95
83
|
- lib/vgs_api_client/models/update_alias_request.rb
|
96
84
|
- lib/vgs_api_client/models/update_alias_request_data.rb
|
97
85
|
- lib/vgs_api_client/version.rb
|
98
|
-
-
|
99
|
-
-
|
100
|
-
-
|
101
|
-
-
|
86
|
+
- scripts/assemble/Dockerfile
|
87
|
+
- scripts/assemble/run.sh
|
88
|
+
- scripts/publish.sh
|
89
|
+
- scripts/publish/Dockerfile
|
90
|
+
- scripts/publish/run.sh
|
91
|
+
- scripts/run-tests-e2e.sh
|
92
|
+
- scripts/run-tests.sh
|
93
|
+
- scripts/test/Dockerfile
|
94
|
+
- scripts/test/run.sh
|
102
95
|
- spec/api_client_spec.rb
|
103
96
|
- spec/configuration_spec.rb
|
104
|
-
- spec/models/alias_format_spec.rb
|
105
|
-
- spec/models/api_error_spec.rb
|
106
|
-
- spec/models/create_aliases_request_existing_spec.rb
|
107
|
-
- spec/models/create_aliases_request_new_spec.rb
|
108
|
-
- spec/models/create_aliases_request_spec.rb
|
109
|
-
- spec/models/inline_response2001_spec.rb
|
110
|
-
- spec/models/inline_response200_spec.rb
|
111
|
-
- spec/models/inline_response201_spec.rb
|
112
|
-
- spec/models/inline_response_default_spec.rb
|
113
|
-
- spec/models/model_alias_spec.rb
|
114
|
-
- spec/models/revealed_data_spec.rb
|
115
|
-
- spec/models/update_alias_request_data_spec.rb
|
116
|
-
- spec/models/update_alias_request_spec.rb
|
117
97
|
- spec/spec_helper.rb
|
118
|
-
-
|
98
|
+
- spec/test_api_spec.rb
|
119
99
|
- vgs_api_client.gemspec
|
120
100
|
homepage: https://openapi-generator.tech
|
121
101
|
licenses:
|
@@ -141,21 +121,7 @@ signing_key:
|
|
141
121
|
specification_version: 4
|
142
122
|
summary: A ruby wrapper for the VGS Vault API
|
143
123
|
test_files:
|
144
|
-
- spec/api/test_api_spec.rb
|
145
|
-
- spec/api/aliases_api_spec.rb
|
146
124
|
- spec/api_client_spec.rb
|
147
125
|
- spec/configuration_spec.rb
|
148
|
-
- spec/models/create_aliases_request_new_spec.rb
|
149
|
-
- spec/models/revealed_data_spec.rb
|
150
|
-
- spec/models/create_aliases_request_spec.rb
|
151
|
-
- spec/models/inline_response2001_spec.rb
|
152
|
-
- spec/models/update_alias_request_data_spec.rb
|
153
|
-
- spec/models/inline_response_default_spec.rb
|
154
|
-
- spec/models/model_alias_spec.rb
|
155
|
-
- spec/models/inline_response201_spec.rb
|
156
|
-
- spec/models/inline_response200_spec.rb
|
157
|
-
- spec/models/create_aliases_request_existing_spec.rb
|
158
|
-
- spec/models/api_error_spec.rb
|
159
|
-
- spec/models/update_alias_request_spec.rb
|
160
|
-
- spec/models/alias_format_spec.rb
|
161
126
|
- spec/spec_helper.rb
|
127
|
+
- spec/test_api_spec.rb
|
data/README.md
DELETED
@@ -1,237 +0,0 @@
|
|
1
|
-
# vgs_api_client
|
2
|
-
|
3
|
-
VgsApiClient - the Ruby gem for the Vault HTTP API
|
4
|
-
|
5
|
-
Storing, retrieving, and managing sensitive data within a VGS organization.
|
6
|
-
|
7
|
-
**NOTE:** _The Vault API is intended only for environments that are already PCI-compliant.
|
8
|
-
If you want to use this API, but are not yet PCI-compliant, you can
|
9
|
-
use [VGS Collect](https://www.verygoodsecurity.com/docs/vgs-collect/what-is-it) or
|
10
|
-
VGS Proxy with [Inbound Routes](https://www.verygoodsecurity.com/docs/getting-started/quick-integration#securing-inbound-connection)
|
11
|
-
to quickly and seamlessly achieve compliance._
|
12
|
-
|
13
|
-
Looking for the old version of the API? Find it
|
14
|
-
[here](https://www.verygoodsecurity.com/docs/api/1/vault).
|
15
|
-
|
16
|
-
# Introduction
|
17
|
-
|
18
|
-
Each encrypted value stored in a VGS vault has one or multiple _aliases_
|
19
|
-
associated with it. These aliases are fully opaque and retain no information
|
20
|
-
about the underlying data. The user may safely store aliases without
|
21
|
-
compromising data security.
|
22
|
-
|
23
|
-
**NOTE:** The API works with persistent storage only. Unlike volatile
|
24
|
-
storage, this means that the data is stored permanently, without any
|
25
|
-
implicit TTL.
|
26
|
-
|
27
|
-
Aliases are not valuable on their own. However, they can be used to decrypt
|
28
|
-
the associated value and pass it to another service via the
|
29
|
-
[forward proxy](https://www.verygoodsecurity.com/docs/guides/outbound-connection).
|
30
|
-
|
31
|
-
## Alias Formats
|
32
|
-
|
33
|
-
Each alias corresponds to a certain format. There are several alias formats
|
34
|
-
suitable for different kinds of sensitive data.
|
35
|
-
|
36
|
-
For example, `UUID` produces a random Base58-encoded UUID string with an
|
37
|
-
environment-dependent prefix:
|
38
|
-
|
39
|
-
```
|
40
|
-
tok_sandbox_bhtsCwFUzoJMw9rWUfEV5e
|
41
|
-
```
|
42
|
-
|
43
|
-
This format is generic and suitable for any kind of data.
|
44
|
-
|
45
|
-
The tables below contain descriptions of all alias formats recognized by the
|
46
|
-
API.
|
47
|
-
|
48
|
-
### Generic Formats
|
49
|
-
|
50
|
-
| Value | Description |
|
51
|
-
|-------------------------|-------------------------------------------------------|
|
52
|
-
| `NUM_LENGTH_PRESERVING` | Length-Preserving, Numeric |
|
53
|
-
| `RAW_UUID` | UUID |
|
54
|
-
| `UUID` | UUID (Prefixed, Base58-Encoded) |
|
55
|
-
| `GENERIC_T_FOUR` | UUID (Prefixed, Base58-Encoded, Last four preserving) |
|
56
|
-
|
57
|
-
### Account Number Formats
|
58
|
-
|
59
|
-
| Value | Description |
|
60
|
-
|-----------------------------------|--------------------------------------|
|
61
|
-
| `FPE_ACC_NUM_T_FOUR` | Length-Preserving, Numeric (A4) |
|
62
|
-
| `FPE_ALPHANUMERIC_ACC_NUM_T_FOUR` | Length-Preserving, Alphanumeric (A4) |
|
63
|
-
|
64
|
-
|
65
|
-
### Payment Card Formats
|
66
|
-
|
67
|
-
| Value | Description |
|
68
|
-
|------------------|---------------------------------------------|
|
69
|
-
| `FPE_SIX_T_FOUR` | Format-Preserving, Luhn Valid (6T4) |
|
70
|
-
| `FPE_T_FOUR` | Format-Preserving, Luhn Valid (T4) |
|
71
|
-
| `PFPT` | Prefixed, Luhn Valid, 19-Digit Fixed Length |
|
72
|
-
|
73
|
-
### SSN Formats
|
74
|
-
|
75
|
-
| Value | Description |
|
76
|
-
|------------------|------------------------|
|
77
|
-
| `FPE_SSN_T_FOUR` | Format-Preserving (A4) |
|
78
|
-
|
79
|
-
# Authentication
|
80
|
-
|
81
|
-
This API uses `Basic` authentication.
|
82
|
-
|
83
|
-
Credentials to access the API can be generated on the
|
84
|
-
[dashboard](https://dashboard.verygoodsecurity.com) by going to the Settings
|
85
|
-
section of the vault of your choosing.
|
86
|
-
|
87
|
-
[Docs » Guides » Access credentials](https://www.verygoodsecurity.com/docs/settings/access-credentials)
|
88
|
-
|
89
|
-
# Rate Limiting
|
90
|
-
|
91
|
-
The API allows up to 3,000 requests per minute. Requests are associated with
|
92
|
-
the vault, regardless of the access credentials used to authenticate the
|
93
|
-
request.
|
94
|
-
|
95
|
-
Your current rate limit is included as HTTP headers in every API response:
|
96
|
-
|
97
|
-
| Header Name | Description |
|
98
|
-
|-------------------------|----------------------------------------------------------|
|
99
|
-
| `x-ratelimit-remaining` | The number of requests remaining in the 1-minute window. |
|
100
|
-
|
101
|
-
If you exceed the rate limit, the API will reject the request with HTTP
|
102
|
-
[429 Too Many Requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429).
|
103
|
-
|
104
|
-
# Errors
|
105
|
-
|
106
|
-
The API uses standard HTTP status codes to indicate whether the request
|
107
|
-
succeeded or not.
|
108
|
-
|
109
|
-
In case of failure, the response body will be JSON in a predefined format.
|
110
|
-
For example, trying to create too many aliases at once results in the
|
111
|
-
following response:
|
112
|
-
|
113
|
-
```json
|
114
|
-
{
|
115
|
-
\"errors\": [
|
116
|
-
{
|
117
|
-
\"status\": 400,
|
118
|
-
\"title\": \"Bad request\",
|
119
|
-
\"detail\": \"Too many values (limit: 20)\",
|
120
|
-
\"href\": \"https://api.sandbox.verygoodvault.com/aliases\"
|
121
|
-
}
|
122
|
-
]
|
123
|
-
}
|
124
|
-
```
|
125
|
-
|
126
|
-
|
127
|
-
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
128
|
-
|
129
|
-
- API version: 1.0.0
|
130
|
-
- Package version: 0.0.28
|
131
|
-
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
132
|
-
|
133
|
-
## Installation
|
134
|
-
|
135
|
-
### Build a gem
|
136
|
-
|
137
|
-
To build the Ruby code into a gem:
|
138
|
-
|
139
|
-
```shell
|
140
|
-
gem build vgs_api_client.gemspec
|
141
|
-
```
|
142
|
-
|
143
|
-
Then either install the gem locally:
|
144
|
-
|
145
|
-
```shell
|
146
|
-
gem install ./vgs_api_client-0.0.28.gem
|
147
|
-
```
|
148
|
-
|
149
|
-
(for development, run `gem install --dev ./vgs_api_client-0.0.28.gem` to install the development dependencies)
|
150
|
-
|
151
|
-
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
152
|
-
|
153
|
-
Finally add this to the Gemfile:
|
154
|
-
|
155
|
-
gem 'vgs_api_client', '~> 0.0.28'
|
156
|
-
|
157
|
-
### Install from Git
|
158
|
-
|
159
|
-
If the Ruby gem is hosted at a git repository: https://github.com/verygoodsecurity/vgs-api-client-ruby, then add the following in the Gemfile:
|
160
|
-
|
161
|
-
gem 'vgs_api_client', :git => 'https://github.com/verygoodsecurity/vgs-api-client-ruby.git'
|
162
|
-
|
163
|
-
### Include the Ruby code directly
|
164
|
-
|
165
|
-
Include the Ruby code directly using `-I` as follows:
|
166
|
-
|
167
|
-
```shell
|
168
|
-
ruby -Ilib script.rb
|
169
|
-
```
|
170
|
-
|
171
|
-
## Getting Started
|
172
|
-
|
173
|
-
Please follow the [installation](#installation) procedure and then run the following code:
|
174
|
-
|
175
|
-
```ruby
|
176
|
-
# Load the gem
|
177
|
-
require 'vgs_api_client'
|
178
|
-
|
179
|
-
# Setup authorization
|
180
|
-
VgsApiClient.configure do |config|
|
181
|
-
# Configure HTTP basic authorization: basicAuth
|
182
|
-
config.username = 'YOUR_USERNAME'
|
183
|
-
config.password = 'YOUR_PASSWORD'
|
184
|
-
end
|
185
|
-
|
186
|
-
api_instance = VgsApiClient::AliasesApi.new
|
187
|
-
opts = {
|
188
|
-
create_aliases_request: VgsApiClient::CreateAliasesRequest.new({data: [TODO]}) # CreateAliasesRequest |
|
189
|
-
}
|
190
|
-
|
191
|
-
begin
|
192
|
-
#Create aliases
|
193
|
-
result = api_instance.create_aliases(opts)
|
194
|
-
p result
|
195
|
-
rescue VgsApiClient::ApiError => e
|
196
|
-
puts "Exception when calling AliasesApi->create_aliases: #{e}"
|
197
|
-
end
|
198
|
-
|
199
|
-
```
|
200
|
-
|
201
|
-
## Documentation for API Endpoints
|
202
|
-
|
203
|
-
All URIs are relative to *https://api.sandbox.verygoodvault.com*
|
204
|
-
|
205
|
-
Class | Method | HTTP request | Description
|
206
|
-
------------ | ------------- | ------------- | -------------
|
207
|
-
*VgsApiClient::AliasesApi* | [**create_aliases**](docs/AliasesApi.md#create_aliases) | **POST** /aliases | Create aliases
|
208
|
-
*VgsApiClient::AliasesApi* | [**delete_alias**](docs/AliasesApi.md#delete_alias) | **DELETE** /aliases/{alias} | Delete alias
|
209
|
-
*VgsApiClient::AliasesApi* | [**reveal_alias**](docs/AliasesApi.md#reveal_alias) | **GET** /aliases/{alias} | Reveal single alias
|
210
|
-
*VgsApiClient::AliasesApi* | [**reveal_multiple_aliases**](docs/AliasesApi.md#reveal_multiple_aliases) | **GET** /aliases | Reveal multiple aliases
|
211
|
-
*VgsApiClient::AliasesApi* | [**update_alias**](docs/AliasesApi.md#update_alias) | **PUT** /aliases/{alias} | Update data classifiers
|
212
|
-
|
213
|
-
|
214
|
-
## Documentation for Models
|
215
|
-
|
216
|
-
- [VgsApiClient::AliasFormat](docs/AliasFormat.md)
|
217
|
-
- [VgsApiClient::ApiError](docs/ApiError.md)
|
218
|
-
- [VgsApiClient::CreateAliasesRequest](docs/CreateAliasesRequest.md)
|
219
|
-
- [VgsApiClient::CreateAliasesRequestExisting](docs/CreateAliasesRequestExisting.md)
|
220
|
-
- [VgsApiClient::CreateAliasesRequestNew](docs/CreateAliasesRequestNew.md)
|
221
|
-
- [VgsApiClient::InlineResponse200](docs/InlineResponse200.md)
|
222
|
-
- [VgsApiClient::InlineResponse2001](docs/InlineResponse2001.md)
|
223
|
-
- [VgsApiClient::InlineResponse201](docs/InlineResponse201.md)
|
224
|
-
- [VgsApiClient::InlineResponseDefault](docs/InlineResponseDefault.md)
|
225
|
-
- [VgsApiClient::ModelAlias](docs/ModelAlias.md)
|
226
|
-
- [VgsApiClient::RevealedData](docs/RevealedData.md)
|
227
|
-
- [VgsApiClient::UpdateAliasRequest](docs/UpdateAliasRequest.md)
|
228
|
-
- [VgsApiClient::UpdateAliasRequestData](docs/UpdateAliasRequestData.md)
|
229
|
-
|
230
|
-
|
231
|
-
## Documentation for Authorization
|
232
|
-
|
233
|
-
|
234
|
-
### basicAuth
|
235
|
-
|
236
|
-
- **Type**: HTTP basic authentication
|
237
|
-
|
data/docs/AliasFormat.md
DELETED