telesignenterprise-2.6.0/0000755000004100000410000000000015031134233015455 5ustar www-datawww-datatelesignenterprise-2.6.0/telesignenterprise.gemspec0000644000004100000410000000450615031134233022742 0ustar www-datawww-data######################################################### # This file has been automatically generated by gem2tgz # ######################################################### # -*- encoding: utf-8 -*- # stub: telesignenterprise 2.6.0 ruby lib Gem::Specification.new do |s| s.name = "telesignenterprise".freeze s.version = "2.6.0" 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.3.15".freeze s.summary = "TeleSign Enterprise Ruby SDK".freeze if s.respond_to? :specification_version then s.specification_version = 4 end if s.respond_to? :add_runtime_dependency then s.add_development_dependency(%q.freeze, ["~> 0.6.0"]) s.add_development_dependency(%q.freeze, ["~> 2.7"]) s.add_development_dependency(%q.freeze, ["~> 13.2"]) s.add_development_dependency(%q.freeze, ["~> 0.22.0"]) s.add_runtime_dependency(%q.freeze, ["~> 2.4.0"]) s.add_development_dependency(%q.freeze, ["~> 3.6"]) s.add_development_dependency(%q.freeze, ["~> 2.3"]) s.add_development_dependency(%q.freeze, ["~> 3.24"]) else s.add_dependency(%q.freeze, ["~> 0.6.0"]) s.add_dependency(%q.freeze, ["~> 2.7"]) s.add_dependency(%q.freeze, ["~> 13.2"]) s.add_dependency(%q.freeze, ["~> 0.22.0"]) s.add_dependency(%q.freeze, ["~> 2.4.0"]) s.add_dependency(%q.freeze, ["~> 3.6"]) s.add_dependency(%q.freeze, ["~> 2.3"]) s.add_dependency(%q.freeze, ["~> 3.24"]) end end telesignenterprise-2.6.0/lib/0000755000004100000410000000000015031134233016223 5ustar www-datawww-datatelesignenterprise-2.6.0/lib/telesignenterprise/0000755000004100000410000000000015031134233022136 5ustar www-datawww-datatelesignenterprise-2.6.0/lib/telesignenterprise/phoneid.rb0000644000004100000410000000743115031134233024116 0ustar www-datawww-datarequire 'telesign/phoneid' require_relative 'constants' PHONEID_STANDARD_RESOURCE = '/v1/phoneid/standard/%{phone_number}' PHONEID_SCORE_RESOURCE = '/v1/phoneid/score/%{phone_number}' PHONEID_CONTACT_RESOURCE = '/v1/phoneid/contact/%{phone_number}' PHONEID_LIVE_RESOURCE = '/v1/phoneid/live/%{phone_number}' PHONEID_NUMBER_DEACTIVATION_RESOURCE = '/v1/phoneid/number_deactivation/%{phone_number}' 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 # Score is an API that delivers reputation scoring based on phone number intelligence, traffic patterns, machine # learning, and a global data consortium. # # See https://developer.telesign.com/docs/rest_api-phoneid-score for detailed API documentation. def score(phone_number, ucid, **params) self.get(PHONEID_SCORE_RESOURCE % {:phone_number => phone_number}, ucid: ucid, **params) end # The PhoneID Contact API delivers contact information related to the subscriber's phone number to provide another # set of indicators for established risk engines. # # See https://developer.telesign.com/docs/rest_api-phoneid-contact for detailed API documentation. def contact(phone_number, ucid, **params) self.get(PHONEID_CONTACT_RESOURCE % {:phone_number => phone_number}, ucid: ucid, **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 # The PhoneID Number Deactivation API determines whether a phone number has been deactivated and when, based on # carriers' phone number data and TeleSign's proprietary analysis. # # See https://developer.telesign.com/docs/rest_api-phoneid-number-deactivation for detailed API documentation. def number_deactivation(phone_number, ucid, **params) self.get(PHONEID_NUMBER_DEACTIVATION_RESOURCE % {:phone_number => phone_number}, ucid: ucid, **params) end end end telesignenterprise-2.6.0/lib/telesignenterprise/messaging.rb0000644000004100000410000000332615031134233024444 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-2.6.0/lib/telesignenterprise/omniverify.rb0000644000004100000410000000500515031134233024652 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-2.6.0/lib/telesignenterprise/verify.rb0000644000004100000410000000753015031134233023774 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-2.6.0/lib/telesignenterprise/voice.rb0000644000004100000410000000171615031134233023575 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-2.6.0/lib/telesignenterprise/appverify.rb0000644000004100000410000000163015031134233024470 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::AppVerifyClient 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-2.6.0/lib/telesignenterprise/telebureau.rb0000644000004100000410000000500315031134233024616 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-2.6.0/lib/telesignenterprise/constants.rb0000644000004100000410000000006715031134233024502 0ustar www-datawww-datamodule TelesignEnterprise SDK_VERSION = '2.6.0' endtelesignenterprise-2.6.0/lib/telesignenterprise/score.rb0000644000004100000410000000150115031134233023573 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://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-2.6.0/lib/telesignenterprise.rb0000644000004100000410000000045515031134233022467 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'