vgs_api_client 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +70 -0
  4. data/README.md +237 -0
  5. data/Rakefile +10 -0
  6. data/docs/AliasFormat.md +15 -0
  7. data/docs/AliasesApi.md +366 -0
  8. data/docs/ApiError.md +24 -0
  9. data/docs/CreateAliasesRequest.md +18 -0
  10. data/docs/CreateAliasesRequestExisting.md +20 -0
  11. data/docs/CreateAliasesRequestNew.md +22 -0
  12. data/docs/InlineResponse200.md +18 -0
  13. data/docs/InlineResponse2001.md +18 -0
  14. data/docs/InlineResponse201.md +18 -0
  15. data/docs/InlineResponseDefault.md +18 -0
  16. data/docs/ModelAlias.md +20 -0
  17. data/docs/RevealedData.md +24 -0
  18. data/docs/UpdateAliasRequest.md +18 -0
  19. data/docs/UpdateAliasRequestData.md +18 -0
  20. data/git_push.sh +57 -0
  21. data/lib/vgs_api_client/api/aliases_api.rb +355 -0
  22. data/lib/vgs_api_client/api_client.rb +390 -0
  23. data/lib/vgs_api_client/api_error.rb +57 -0
  24. data/lib/vgs_api_client/configuration.rb +286 -0
  25. data/lib/vgs_api_client/models/alias_format.rb +44 -0
  26. data/lib/vgs_api_client/models/api_error.rb +249 -0
  27. data/lib/vgs_api_client/models/create_aliases_request.rb +225 -0
  28. data/lib/vgs_api_client/models/create_aliases_request_existing.rb +238 -0
  29. data/lib/vgs_api_client/models/create_aliases_request_new.rb +250 -0
  30. data/lib/vgs_api_client/models/inline_response200.rb +220 -0
  31. data/lib/vgs_api_client/models/inline_response2001.rb +221 -0
  32. data/lib/vgs_api_client/models/inline_response201.rb +221 -0
  33. data/lib/vgs_api_client/models/inline_response_default.rb +221 -0
  34. data/lib/vgs_api_client/models/model_alias.rb +228 -0
  35. data/lib/vgs_api_client/models/revealed_data.rb +253 -0
  36. data/lib/vgs_api_client/models/update_alias_request.rb +223 -0
  37. data/lib/vgs_api_client/models/update_alias_request_data.rb +226 -0
  38. data/lib/vgs_api_client/version.rb +15 -0
  39. data/lib/vgs_api_client.rb +53 -0
  40. data/spec/api/aliases_api_spec.rb +137 -0
  41. data/spec/api_client_spec.rb +226 -0
  42. data/spec/configuration_spec.rb +42 -0
  43. data/spec/models/alias_format_spec.rb +28 -0
  44. data/spec/models/api_error_spec.rb +52 -0
  45. data/spec/models/create_aliases_request_existing_spec.rb +40 -0
  46. data/spec/models/create_aliases_request_new_spec.rb +46 -0
  47. data/spec/models/create_aliases_request_spec.rb +34 -0
  48. data/spec/models/inline_response2001_spec.rb +34 -0
  49. data/spec/models/inline_response200_spec.rb +34 -0
  50. data/spec/models/inline_response201_spec.rb +34 -0
  51. data/spec/models/inline_response_default_spec.rb +34 -0
  52. data/spec/models/model_alias_spec.rb +40 -0
  53. data/spec/models/revealed_data_spec.rb +52 -0
  54. data/spec/models/update_alias_request_data_spec.rb +34 -0
  55. data/spec/models/update_alias_request_spec.rb +34 -0
  56. data/spec/spec_helper.rb +111 -0
  57. data/vgs_api_client.gemspec +38 -0
  58. metadata +156 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: aa58a9dafab3d45d960f49d470d79509bba961f316afbc3781db258fed4210d8
4
+ data.tar.gz: ca3de31ef5e4aa3c54c1f1affb04eafac0f27e522610a43f3b2fdf84729a3df4
5
+ SHA512:
6
+ metadata.gz: 7b607efeb9383e71d6cd91c77f33516af8e15de6e8fffb7afe6bf48da2c2f78d04f3c1cf73fe3344d723f6074bab6f92ffbae51be9e389c4b077e4cc70672752
7
+ data.tar.gz: 844366566921e3055a23339c3869edd7ed88ed5e11c10793fbb75bb50a01ae29205e7c4f67317b14403a7d0b7a01a135b865d5937f8e9449deb3e5dcfb579199
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development, :test do
6
+ gem 'rake', '~> 13.0.1'
7
+ gem 'pry-byebug'
8
+ gem 'rubocop', '~> 0.66.0'
9
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,70 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ vgs_api_client (0.0.1)
5
+ typhoeus (~> 1.0, >= 1.0.1)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.2)
11
+ byebug (11.1.3)
12
+ coderay (1.1.3)
13
+ diff-lcs (1.5.0)
14
+ ethon (0.15.0)
15
+ ffi (>= 1.15.0)
16
+ ffi (1.15.5)
17
+ jaro_winkler (1.5.4)
18
+ method_source (1.0.0)
19
+ parallel (1.21.0)
20
+ parser (3.1.1.0)
21
+ ast (~> 2.4.1)
22
+ pry (0.13.1)
23
+ coderay (~> 1.1)
24
+ method_source (~> 1.0)
25
+ pry-byebug (3.9.0)
26
+ byebug (~> 11.0)
27
+ pry (~> 0.13.0)
28
+ psych (4.0.3)
29
+ stringio
30
+ rainbow (3.1.1)
31
+ rake (13.0.6)
32
+ rspec (3.11.0)
33
+ rspec-core (~> 3.11.0)
34
+ rspec-expectations (~> 3.11.0)
35
+ rspec-mocks (~> 3.11.0)
36
+ rspec-core (3.11.0)
37
+ rspec-support (~> 3.11.0)
38
+ rspec-expectations (3.11.0)
39
+ diff-lcs (>= 1.2.0, < 2.0)
40
+ rspec-support (~> 3.11.0)
41
+ rspec-mocks (3.11.0)
42
+ diff-lcs (>= 1.2.0, < 2.0)
43
+ rspec-support (~> 3.11.0)
44
+ rspec-support (3.11.0)
45
+ rubocop (0.66.0)
46
+ jaro_winkler (~> 1.5.1)
47
+ parallel (~> 1.10)
48
+ parser (>= 2.5, != 2.5.1.1)
49
+ psych (>= 3.1.0)
50
+ rainbow (>= 2.2.2, < 4.0)
51
+ ruby-progressbar (~> 1.7)
52
+ unicode-display_width (>= 1.4.0, < 1.6)
53
+ ruby-progressbar (1.11.0)
54
+ stringio (3.0.1)
55
+ typhoeus (1.4.0)
56
+ ethon (>= 0.9.0)
57
+ unicode-display_width (1.5.0)
58
+
59
+ PLATFORMS
60
+ x86_64-darwin-20
61
+
62
+ DEPENDENCIES
63
+ pry-byebug
64
+ rake (~> 13.0.1)
65
+ rspec (~> 3.6, >= 3.6.0)
66
+ rubocop (~> 0.66.0)
67
+ vgs_api_client!
68
+
69
+ BUNDLED WITH
70
+ 2.2.22
data/README.md ADDED
@@ -0,0 +1,237 @@
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.1
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.1.gem
147
+ ```
148
+
149
+ (for development, run `gem install --dev ./vgs_api_client-0.0.1.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.1'
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/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ begin
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+ task default: :spec
8
+ rescue LoadError
9
+ # no rspec available
10
+ end
@@ -0,0 +1,15 @@
1
+ # VgsapiClient::AliasFormat
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+
8
+ ## Example
9
+
10
+ ```ruby
11
+ require 'vgs_api_client'
12
+
13
+ instance = VgsapiClient::AliasFormat.new()
14
+ ```
15
+