telesignenterprise-5.0.0/0000755000004100000410000000000015142167522015464 5ustar www-datawww-datatelesignenterprise-5.0.0/telesignenterprise.gemspec0000644000004100000410000000352315142167522022747 0ustar www-datawww-data######################################################### # This file has been automatically generated by gem2tgz # ######################################################### # -*- encoding: utf-8 -*- # stub: telesignenterprise 5.0.0 ruby lib Gem::Specification.new do |s| s.name = "telesignenterprise".freeze s.version = "5.0.0".freeze s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".freeze] s.authors = ["TeleSign".freeze] s.date = "2017-05-02" s.description = "TeleSign Enterprise Ruby SDK".freeze s.email = "support@telesign.com".freeze s.files = ["lib/telesignenterprise.rb".freeze, "lib/telesignenterprise/appverify.rb".freeze, "lib/telesignenterprise/constants.rb".freeze, "lib/telesignenterprise/messaging.rb".freeze, "lib/telesignenterprise/omniverify.rb".freeze, "lib/telesignenterprise/phoneid.rb".freeze, "lib/telesignenterprise/score.rb".freeze, "lib/telesignenterprise/telebureau.rb".freeze, "lib/telesignenterprise/verify.rb".freeze, "lib/telesignenterprise/voice.rb".freeze] s.homepage = "http://rubygems.org/gems/telesign".freeze s.licenses = ["MIT".freeze] s.rubygems_version = "3.4.10".freeze s.summary = "TeleSign Enterprise Ruby SDK".freeze s.specification_version = 4 s.add_development_dependency(%q.freeze, ["~> 0.6.0".freeze]) s.add_development_dependency(%q.freeze, ["~> 2.7".freeze]) s.add_development_dependency(%q.freeze, ["~> 13.2".freeze]) s.add_development_dependency(%q.freeze, ["~> 0.22.0".freeze]) s.add_runtime_dependency(%q.freeze, ["~> 4.0.0".freeze]) s.add_development_dependency(%q.freeze, ["~> 3.6".freeze]) s.add_development_dependency(%q.freeze, ["~> 2.3".freeze]) s.add_development_dependency(%q.freeze, ["~> 3.24".freeze]) end telesignenterprise-5.0.0/lib/0000755000004100000410000000000015142167522016232 5ustar www-datawww-datatelesignenterprise-5.0.0/lib/telesignenterprise/0000755000004100000410000000000015142167522022145 5ustar www-datawww-datatelesignenterprise-5.0.0/lib/telesignenterprise/phoneid.rb0000644000004100000410000000641215142167522024123 0ustar www-datawww-datarequire 'telesign/phoneid' require_relative 'constants' PHONEID_STANDARD_RESOURCE = '/v1/phoneid/standard/%{phone_number}' PHONEID_LIVE_RESOURCE = '/v1/phoneid/live/%{phone_number}' PHONEID_GET_INFO_PATH = '/v1/phoneid/%{phone_number}' PHONEID_GET_INFO_PATH_ALT = '/v1/phoneid' module TelesignEnterprise # A set of APIs that deliver deep phone number data attributes that help optimize the end user # verification process and evaluate risk. # # TeleSign PhoneID provides a wide range of risk assessment indicators on the number to help confirm user identity, # delivering real-time decision making throughout the number lifecycle and ensuring only legitimate users are # creating accounts and accessing your applications. class PhoneIdClient < Telesign::PhoneIdClient def initialize(customer_id, api_key, rest_endpoint: 'https://rest-ww.telesign.com', timeout: nil, source: 'ruby_telesign_enterprise', sdk_version_origin: TelesignEnterprise::SDK_VERSION, sdk_version_dependency: Gem.loaded_specs['telesign'].version) super(customer_id, api_key, rest_endpoint: rest_endpoint, timeout: timeout, source: source, sdk_version_origin: sdk_version_origin, sdk_version_dependency: sdk_version_dependency) end # The PhoneID Standard API that provides phone type and telecom carrier information to identify which phone # numbers can receive SMS messages and/or a potential fraud risk. # # See https://developer.telesign.com/docs/rest_phoneid-standard for detailed API documentation. def standard(phone_number, **params) self.get(PHONEID_STANDARD_RESOURCE % {:phone_number => phone_number}, **params) end # The PhoneID Live API delivers insights such as whether a phone is active or disconnected, a device is reachable # or unreachable and its roaming status. # # See https://developer.telesign.com/docs/rest_api-phoneid-live for detailed API documentation. def live(phone_number, ucid, **params) self.get(PHONEID_LIVE_RESOURCE % {:phone_number => phone_number}, ucid: ucid, **params) end # Enter a phone number with country code to receive detailed information about carrier, location, and other details. # Phone number provided in URL path: POST /v1/phoneid/{phone_number} # # See https://developer.telesign.com/enterprise/reference/submitphonenumberforidentity for detailed API documentation. def phone_id_path(phone_number, **params) params['consent'] ||= { 'method' => 1 } self.post(PHONEID_GET_INFO_PATH % {:phone_number => phone_number}, **params) end # Enter a phone number with country code to receive detailed information about carrier, location, and other details. # Phone number provided in body: POST /v1/phoneid # # See https://developer.telesign.com/enterprise/reference/submitphonenumberforidentityalt for detailed API documentation. def phone_id_body(phone_number, **params) params['phone_number'] = phone_number params['consent'] ||= { 'method' => 1 } self.post(PHONEID_GET_INFO_PATH_ALT, **params) end end end telesignenterprise-5.0.0/lib/telesignenterprise/messaging.rb0000644000004100000410000000332615142167522024453 0ustar www-datawww-datarequire 'telesign' require_relative 'constants' OMNI_MESSAGING_RESOURCE = '/v1/omnichannel' module TelesignEnterprise # TeleSign's Messaging API allows you to easily send SMS messages. You can send alerts, reminders, and notifications, # or you can send verification messages containing one-time passcodes (OTP). class MessagingClient < Telesign::MessagingClient def initialize(customer_id, api_key, rest_endpoint: 'https://rest-ww.telesign.com', timeout: nil, source: 'ruby_telesign_enterprise', sdk_version_origin: TelesignEnterprise::SDK_VERSION, sdk_version_dependency: Gem.loaded_specs['telesign'].version) super(customer_id, api_key, rest_endpoint: rest_endpoint, timeout: timeout, source: source, sdk_version_origin: sdk_version_origin, sdk_version_dependency: sdk_version_dependency) end # Telesign Messaging allows you to easily send a message to the target recipient using any of Telesign's supported channels. class OmniMessagingClient < Telesign::RestClient def initialize(customer_id, api_key, rest_endpoint, timeout: nil) super(customer_id, api_key, rest_endpoint: rest_endpoint, timeout: timeout) end def omni_message(**params) self.post(OMNI_MESSAGING_RESOURCE, **params) end private def content_type "application/json" end end def omni_message (**params) omni_msg = OmniMessagingClient.new(@customer_id, @api_key, @rest_endpoint) omni_msg.omni_message(**params) end end endtelesignenterprise-5.0.0/lib/telesignenterprise/omniverify.rb0000644000004100000410000000500515142167522024661 0ustar www-datawww-data require 'telesign/rest' require_relative 'constants' PATH_CREATE_VERIFICATION_PROCESS = '/verification' PATH_UPDATE_VERIFICATION_PROCESS = '/verification/%{reference_id}/state' PATH_RETRIEVE_VERIFICATION_PROCESS = '/verification/%{reference_id}' module TelesignEnterprise # The Telesign Verify API makes it easy for you to set up phone-based, multi-factor authentication (MFA) using multiple channels and methods. # See https://developer.telesign.com/enterprise/docs/verify-api-overview for detailed product documentation. class OmniVerifyClient < Telesign::RestClient def initialize(customer_id, api_key, rest_endpoint: 'https://verify.telesign.com', timeout: nil, source: 'ruby_telesign_enterprise', sdk_version_origin: TelesignEnterprise::SDK_VERSION, sdk_version_dependency: Gem.loaded_specs['telesign'].version) super(customer_id, api_key, rest_endpoint: rest_endpoint, timeout: timeout, source: source, sdk_version_origin: sdk_version_origin, sdk_version_dependency: sdk_version_dependency) end # Use this action to create a verification process for the specified phone number. # # See https://developer.telesign.com/enterprise/reference/createverificationprocess for detailed API documentation. def create_verification_process(phone_number, **params) params = params.merge({ recipient: { phone_number: phone_number } }) params[:verification_policy] ||= [{ method: 'sms', fallback_time: 30 }] self.post(PATH_CREATE_VERIFICATION_PROCESS, **params) end # Use this action to retrieve a verification process for the specified reference_id. # # See https://developer.telesign.com/enterprise/reference/getverificationprocess for detailed API documentation. def retrieve_verification_process(reference_id, **params) self.get(PATH_RETRIEVE_VERIFICATION_PROCESS % {:reference_id => reference_id}, **params) end # Use this action to update a verification process for the specified reference_id. # # See https://developer.telesign.com/enterprise/reference/updateverificationprocess for detailed API documentation. def update_verification_process(reference_id, **params) self.patch(PATH_UPDATE_VERIFICATION_PROCESS % {:reference_id => reference_id}, auth_method: 'Basic', **params) end private def content_type "application/json" end end end telesignenterprise-5.0.0/lib/telesignenterprise/verify.rb0000644000004100000410000000753015142167522024003 0ustar www-datawww-datarequire 'telesign/rest' require_relative 'omniverify' require_relative 'constants' VERIFY_SMS_RESOURCE = '/v1/verify/sms' VERIFY_VOICE_RESOURCE = '/v1/verify/call' VERIFY_SMART_RESOURCE = '/v1/verify/smart' VERIFY_STATUS_RESOURCE = '/v1/verify/%{reference_id}' VERIFY_COMPLETION_RESOURCE = '/v1/verify/completion/%{reference_id}' VERIFY_OMNICHANNEL_RESOURCE = '/verification' module TelesignEnterprise # The Verify API delivers phone-based verification and two-factor authentication using a time-based, one-time passcode # sent via SMS message and Voice call. class VerifyClient < Telesign::RestClient def initialize(customer_id, api_key, rest_endpoint: 'https://rest-ww.telesign.com', timeout: nil, source: 'ruby_telesign_enterprise', sdk_version_origin: TelesignEnterprise::SDK_VERSION, sdk_version_dependency: Gem.loaded_specs['telesign'].version, rest_endpoint_verify: 'https://verify.telesign.com') @omniVerifyClient = OmniVerifyClient.new(customer_id, api_key, rest_endpoint: rest_endpoint_verify) super(customer_id, api_key, rest_endpoint: rest_endpoint, timeout: timeout, source: source, sdk_version_origin: sdk_version_origin, sdk_version_dependency: sdk_version_dependency) end # The SMS Verify API delivers phone-based verification and two-factor authentication using a time-based, # one-time passcode sent over SMS. # # See https://developer.telesign.com/docs/rest_api-verify-sms for detailed API documentation. def sms(phone_number, **params) self.post(VERIFY_SMS_RESOURCE, phone_number: phone_number, **params) end # The Voice Verify API delivers patented phone-based verification and two-factor authentication using a one-time # passcode sent over voice message. # # See https://developer.telesign.com/docs/rest_api-verify-call for detailed API documentation. def voice(phone_number, **params) self.post(VERIFY_VOICE_RESOURCE, phone_number: phone_number, **params) end # The Smart Verify web service simplifies the process of verifying user identity by integrating several TeleSign # web services into a single API call. This eliminates the need for you to make multiple calls to the TeleSign # Verify resource. # # See https://developer.telesign.com/docs/rest_api-smart-verify for detailed API documentation. def smart(phone_number, ucid, **params) self.post(VERIFY_SMART_RESOURCE, phone_number: phone_number, ucid: ucid, **params) end # Retrieves the verification result for any verify resource. # # See https://developer.telesign.com/docs/rest_api-verify-transaction-callback for detailed API documentation. def status(reference_id, **params) self.get(VERIFY_STATUS_RESOURCE % {:reference_id => reference_id}, **params) end # Notifies TeleSign that a verification was successfully delivered to the user in order to help improve the # quality of message delivery routes. # # See https://developer.telesign.com/docs/completion-service-for-verify-products for detailed API documentation. def completion(reference_id, **params) self.put(VERIFY_COMPLETION_RESOURCE % {:reference_id => reference_id}, **params) end # Use this action to create a verification process for the specified phone number. # # See https://developer.telesign.com/enterprise/reference/createverificationprocess for detailed API documentation. def create_verification_process(phone_number, **params) @omniVerifyClient.create_verification_process(phone_number, **params) end end end telesignenterprise-5.0.0/lib/telesignenterprise/voice.rb0000644000004100000410000000171615142167522023604 0ustar www-datawww-datarequire 'telesign' require_relative 'constants' module TelesignEnterprise # TeleSign's Voice API allows you to easily send voice messages. You can send alerts, reminders, and notifications, # or you can send verification messages containing time-based, one-time passcodes (TOTP). class VoiceClient < Telesign::VoiceClient def initialize(customer_id, api_key, rest_endpoint: 'https://rest-ww.telesign.com', timeout: nil, source: 'ruby_telesign_enterprise', sdk_version_origin: TelesignEnterprise::SDK_VERSION, sdk_version_dependency: Gem.loaded_specs['telesign'].version) super(customer_id, api_key, rest_endpoint: rest_endpoint, timeout: timeout, source: source, sdk_version_origin: sdk_version_origin, sdk_version_dependency: sdk_version_dependency) end end endtelesignenterprise-5.0.0/lib/telesignenterprise/appverify.rb0000644000004100000410000000470115142167522024501 0ustar www-datawww-datarequire 'telesign' require_relative 'constants' module TelesignEnterprise # App Verify is a secure, lightweight SDK that integrates a frictionless user verification process into existing # native mobile applications. class AppVerifyClient < Telesign::RestClient APP_VERIFY_BASE_RESOURCE = "/v1/verify/auto/voice" INITIATE_RESOURCE = "#{APP_VERIFY_BASE_RESOURCE}/initiate" FINALIZE_RESOURCE = "#{APP_VERIFY_BASE_RESOURCE}/finalize" FINALIZE_CALLERID_RESOURCE = "#{APP_VERIFY_BASE_RESOURCE}/finalize/callerid" FINALIZE_TIMEOUT_RESOURCE = "#{APP_VERIFY_BASE_RESOURCE}/finalize/timeout" def initialize(customer_id, api_key, rest_endpoint: 'https://rest-ww.telesign.com', timeout: nil, source: 'ruby_telesign_enterprise', sdk_version_origin: TelesignEnterprise::SDK_VERSION, sdk_version_dependency: Gem.loaded_specs['telesign'].version) super(customer_id, api_key, rest_endpoint: rest_endpoint, timeout: timeout, source: source, sdk_version_origin: sdk_version_origin, sdk_version_dependency: sdk_version_dependency) end # Send call with verification code (Initiate) # See https://developer.telesign.com/enterprise/reference/sendappverifycode def initiate(phone_number, params = {}) post(INITIATE_RESOURCE, phone_number: phone_number, **params) end # End call (Finalize) # See https://developer.telesign.com/enterprise/reference/endappverifycall def finalize(reference_id, params = {}) post(FINALIZE_RESOURCE, reference_id: reference_id, **params) end # Report unknown caller ID # See https://developer.telesign.com/enterprise/reference/reportappverifycallerid def report_unknown_caller_id(reference_id, unknown_caller_id, params = {}) post(FINALIZE_CALLERID_RESOURCE, reference_id: reference_id, unknown_caller_id: unknown_caller_id, **params) end # Report timeout # See https://developer.telesign.com/enterprise/reference/reportappverifytimeout def report_timeout(reference_id) post(FINALIZE_TIMEOUT_RESOURCE, reference_id: reference_id) end # Get transaction status # See https://developer.telesign.com/enterprise/reference/getappverifystatus def get_transaction_status(reference_id) get("#{APP_VERIFY_BASE_RESOURCE}/#{reference_id}") end end endtelesignenterprise-5.0.0/lib/telesignenterprise/telebureau.rb0000644000004100000410000000500315142167522024625 0ustar www-datawww-datarequire 'telesign/rest' require_relative 'constants' TELEBUREAU_CREATE_RESOURCE = '/v1/telebureau/event' TELEBUREAU_RETRIEVE_RESOURCE = '/v1/telebureau/event/%{reference_id}' TELEBUREAU_DELETE_RESOURCE = '/v1/telebureau/event/%{reference_id}' module TelesignEnterprise # TeleBureau is a service is based on TeleSign's watchlist, which is a proprietary database containing verified phone # numbers of users known to have committed online fraud. TeleSign crowd-sources this information from its customers. # Participation is voluntary, but you have to contribute in order to benefit. class TelebureauClient < Telesign::RestClient def initialize(customer_id, api_key, rest_endpoint: 'https://rest-ww.telesign.com', timeout: nil, source: 'ruby_telesign_enterprise', sdk_version_origin: TelesignEnterprise::SDK_VERSION, sdk_version_dependency: Gem.loaded_specs['telesign'].version) super(customer_id, api_key, rest_endpoint: rest_endpoint, timeout: timeout, source: source, sdk_version_origin: sdk_version_origin, sdk_version_dependency: sdk_version_dependency) end # Creates a telebureau event corresponding to supplied data. # # See https://developer.telesign.com/docs/telebureau-api for detailed API documentation. def create_event(phone_number, fraud_type, occurred_at, **params) self.post(TELEBUREAU_CREATE_RESOURCE, phone_number: phone_number, fraud_type: fraud_type, occured_at: occurred_at, **params) end # Retrieves the fraud event status. You make this call in your web application after completion of create # transaction for a telebureau event. # # See https://developer.telesign.com/docs/telebureau-api for detailed API documentation. def retrieve_event(reference_id, **params) self.get(TELEBUREAU_RETRIEVE_RESOURCE % {:reference_id => reference_id}, **params) end # Deletes a previously submitted fraud event. You make this call in your web application after completion of the # create transaction for a telebureau event. # # See https://developer.telesign.com/docs/telebureau-api for detailed API documentation. def delete_event(reference_id, **params) self.delete(TELEBUREAU_DELETE_RESOURCE % {:reference_id => reference_id}, **params) end end end telesignenterprise-5.0.0/lib/telesignenterprise/constants.rb0000644000004100000410000000006715142167522024511 0ustar www-datawww-datamodule TelesignEnterprise SDK_VERSION = '5.0.0' endtelesignenterprise-5.0.0/lib/telesignenterprise/score.rb0000644000004100000410000000150015142167522023601 0ustar www-datawww-datarequire 'telesign' require_relative 'constants' module TelesignEnterprise # Score provides risk information about a specified phone number. class ScoreClient < Telesign::ScoreClient def initialize(customer_id, api_key, rest_endpoint: 'https://detect.telesign.com', timeout: nil, source: 'ruby_telesign_enterprise', sdk_version_origin: TelesignEnterprise::SDK_VERSION, sdk_version_dependency: Gem.loaded_specs['telesign'].version) super(customer_id, api_key, rest_endpoint: rest_endpoint, timeout: timeout, source: source, sdk_version_origin: sdk_version_origin, sdk_version_dependency: sdk_version_dependency) end end endtelesignenterprise-5.0.0/lib/telesignenterprise.rb0000644000004100000410000000045515142167522022476 0ustar www-datawww-datarequire 'telesignenterprise/phoneid' require 'telesignenterprise/telebureau' require 'telesignenterprise/verify' require 'telesignenterprise/omniverify' require 'telesignenterprise/score' require 'telesignenterprise/messaging' require 'telesignenterprise/voice' require 'telesignenterprise/appverify'