lib/evervault.rb in evervault-2.0.0 vs lib/evervault.rb in evervault-2.1.0

- old
+ new

@@ -1,5 +1,6 @@ +require "time" require_relative "evervault/version" require_relative "evervault/client" require_relative "evervault/errors/errors" require_relative "evervault/utils/validation_utils" @@ -24,9 +25,16 @@ client.enable_outbound_relay(decryption_domains) end def create_run_token(function_name, data = {}) client.create_run_token(function_name, data) + end + + def create_client_side_decrypt_token(data, expiry = nil) + if expiry != nil + expiry = (expiry.to_f * 1000).to_i + end + client.create_token("api:decrypt", data, expiry) end private def client Evervault::Utils::ValidationUtils.validate_app_uuid_and_api_key(app_id, api_key) @client ||= Evervault::Client.new(app_uuid: app_id, api_key: api_key)