README.md in evervault-1.3.2 vs README.md in evervault-2.0.0

- old
+ new

@@ -46,16 +46,20 @@ To make Evervault available for use in your app: ```ruby require "evervault" -# Initialize the client with your team's API key +# Initialize the client with your App's ID and App's API key +Evervault.app_id = <YOUR-APP-ID> Evervault.api_key = <YOUR-API-KEY> # Encrypt your data -encrypted_data = Evervault.encrypt({ hello: 'World!' }) +encrypted_data = Evervault.encrypt('Hello World!') +# Decrypt your data +decrypted = Evervault.decrypt(encrypted_data) + # Process the encrypted data using a Function result = Evervault.run(<FUNCTION-NAME>, encrypted_data) # Send the decrypted data to a third-party API Evervault.enable_outbound_relay @@ -63,10 +67,11 @@ req = Net::HTTP::Post.new(uri.path, 'Content-Type' => 'application/json') req.body = encrypted_data.to_json http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true res = http.request(req) + ``` ## Reference The Evervault Ruby SDK exposes four methods. @@ -77,17 +82,30 @@ ```ruby Evervault.encrypt(data = String | Number | Boolean | Hash | Array) ``` -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| data | `String`, `Number`, `Boolean`, `Hash`, `Array` | Data to be encrypted | +| Parameter | Type | Description | +| --------- | ---------------------------------------------- | -------------------- | +| data | `String`, `Number`, `Boolean`, `Hash`, `Array` | Data to be encrypted | +### Evervault.decrypt + +`Evervault.decrypt` decrypts data previously encrypted with the `encrypt()` function or through Evervault's Relay (Evervault's encryption proxy). +An API Key with the `decrypt` permission must be used to perform this operation. + +```ruby +Evervault.decrypt(data = String | Array | Hash) +``` + +| Parameter | Type | Description | +| --------- | ------------------------- | -------------------- | +| data | `String`, `Array`, `Hash` | Data to be decrypted | + ### Evervault.enable_outbound_relay -`Evervault.enable_outbound_relay` configures your application to proxy HTTP requests using Outbound Relay based on the configuration created in the Evervault UI. See [Outbound Relay](https://docs.evervault.com/concepts/outbound-relay/overview) to learn more. +`Evervault.enable_outbound_relay` configures your application to proxy HTTP requests using Outbound Relay based on the configuration created in the Evervault UI. See [Outbound Relay](https://docs.evervault.com/concepts/outbound-relay/overview) to learn more. ```ruby Evervault.enable_outbound_relay([decryption_domains = Array]) ``` @@ -96,10 +114,11 @@ | decryption_domains | `Array` | Optional -- Requests sent to any of the domains listed will be proxied through Outbound Relay. This will override the configuration created using the Evervault UI. | ### Evervault.run `Evervault.run` invokes a Function with a given payload. +An API Key with the `run Function` permission must be used to perform this operation. ```ruby Evervault.run(function_name = String, data = Hash[, options = Hash]) ``` @@ -117,9 +136,10 @@ | `version` | `Integer` | `nil` | Specify the version of your Function to run. By default, the latest version will be run. | ### Evervault.create_run_token `Evervault.create_run_token` creates a single use, time bound token for invoking a Function. +An API Key with the `create Run Token` permission must be used to perform this operation. ```ruby Evervault.create_run_token(function_name = String, data = Hash) ```