symantec_package.lib.legacyService package¶
Submodules¶
symantec_package.lib.legacyService.SymantecLegacyServices module¶
-
class
symantec_package.lib.legacyService.SymantecLegacyServices.
MyPlugin
¶ Bases:
suds.plugin.MessagePlugin
This class acts as a plugin to add in XML attributes into legacy client in order to get it working.
-
marshalled
(context)¶ Description: Adds in XML attributes Parameters: context – Context body where the plugin will add the XML attributes to get this legacy class working Returns: nothing Raises:
-
-
class
symantec_package.lib.legacyService.SymantecLegacyServices.
SymantecLegacyServices
¶ Bases:
object
This class acts as a layer of abstraction to handling Symantec VIP SOAP calls in Python.
You call this class to handle to managing users and credentials using authentication API.
- Example:
>>> client = Client("http://../vip_auth.wsdl", transport = HTTPSClientCertTransport('vip_certificate.crt','vip_certificate.crt')) >>> service = SymantecLegacyServices(client) >>> response = service.sendOtpSMS(<parameters here>) >>> print (response)
Note
Reference HTTPHandler for further information on how to setup the client.
-
activateCredentialSMS
(credentialId, otp1=None, otp2=None, authorizerAccountId=None)¶ Description: Use the ActivateToken API to activate new or inactive credentials. If the activation is successful, the credential is Enabled and ready for use.
Parameters: - credentialId (string) – The token ID (credential ID) identifies the credential to the VIP Service Web Services.
- otp1 (string) – One-time passwords (OTPs) are security codes generated using the credential. Optionally, send either none, one, or two consecutive security codes. The VIP Service Web Services check any security codes against the credential ID to verify the validity of the credential.
- otp2 (string) – One-time passwords (OTPs) are security codes generated using the credential. Optionally, send either none, one, or two consecutive security codes. The VIP Service Web Services check any security codes against the credential ID to verify the validity of the credential.
- authorizerAccountId (string) – an optional element that can be included with any operation. The AuthorizerAccountId element is used by a parent account (such as a reseller) to send operations on behalf of a child account (such as a customer). The element contains a unique jurisdiction identifier for the child account (the jurisdiction identifier is available from the VIP Manager). The parent account uses its own certificate in the operation request to authenticate the request to VIP Authentication Service.
Returns: the return SOAP response.
Raises:
-
deactivateCredentialSMS
(credentialId, reason=None, authorizerAccountId=None)¶ Description: Use the DeactivateToken API to deactivate credentials. If you no longer want to allow a credential to be used on your website, deactivate it by setting it to the Inactive state.
Parameters: - credentialId (string) – The token ID (credential ID) identifies the credential to the VIP Service Web Services.
- reason (string) – To specify the reason for deactivating the token.
- authorizerAccountId (string) – an optional element that can be included with any operation. The AuthorizerAccountId element is used by a parent account (such as a reseller) to send operations on behalf of a child account (such as a customer). The element contains a unique jurisdiction identifier for the child account (the jurisdiction identifier is available from the VIP Manager). The parent account uses its own certificate in the operation request to authenticate the request to VIP Authentication Service.
Returns: the return SOAP response.
Raises:
-
disableCredentialSMS
(credentialId, reason=None, authorizerAccountId=None)¶ Description: Use the DisableToken API to disable a credential. When you disable a token, you can also specify the reason you disabled it. This information is used in part to provide network-wide intelligence information for the token.
Parameters: - credentialId (string) – The token ID (credential ID) identifies the credential to the VIP Service Web Services.
- reason (string) – To specify the reason for deactivating the token.
- authorizerAccountId (string) – an optional element that can be included with any operation. The AuthorizerAccountId element is used by a parent account (such as a reseller) to send operations on behalf of a child account (such as a customer). The element contains a unique jurisdiction identifier for the child account (the jurisdiction identifier is available from the VIP Manager). The parent account uses its own certificate in the operation request to authenticate the request to VIP Authentication Service.
Returns: the return SOAP response.
Raises:
-
enableCredentialSMS
(credentialId, authorizerAccountId=None)¶ Description: Use this operation to change the state of a disabled credential to Enabled. When you Enable a credential, VIP Service Web Services check the validity of the credential ID and return a response. If the enable operation is successful, the credential changes from Disabled to Enabled and is ready for use.
Parameters: - credentialId (string) – The token ID (credential ID) identifies the credential to the VIP Service Web Services.
- authorizerAccountId (string) – an optional element that can be included with any operation. The AuthorizerAccountId element is used by a parent account (such as a reseller) to send operations on behalf of a child account (such as a customer). The element contains a unique jurisdiction identifier for the child account (the jurisdiction identifier is available from the VIP Manager). The parent account uses its own certificate in the operation request to authenticate the request to VIP Authentication Service.
Returns: the return SOAP response.
Raises:
-
getFieldContent
(fieldname)¶ Description: Get content of items in response message Note: Works only for one line item Parameters: fieldname (string) – Item name Returns: The content of input fieldname
-
getPreviousResponseFirstPairs
()¶ Description: Gets the 1st level of important main response fields from previous VIP SOAP call and tells what fields are accessible Note: This will not work if there was no previous call in the client. Returns: list – Containing all the first pair values of each tuple
-
getPreviousResponseValue
(firstPair)¶ Description: Gets the 1st level of important main response fields from the VIP SOAP call and tells what fields are accessible Note: This will not work if there was no previous call in the client. Parameters: firstPair (string) – The first pair in the tuple field Returns: The field value at the pair key
-
getResponseFirstPairs
(response)¶ Description: Gets the 1st level of important main response fields from the VIP SOAP call and tells what fields are accessible Note: This requires the SOAP response as a parameter. Parameters: response (list of tuples) – The SOAP response Returns: list – Containing all the first pair values of each tuple
-
getResponseValue
(response, firstPair)¶ Description: Gets the 1st level of important main response fields from the VIP SOAP call and tells what fields are accessible
Note: This requires the SOAP response as a parameter.
Parameters: - response (list of tuples) – The SOAP response
- firstPair (string) – The first pair in the tuple field
Returns: The field value at the pair key
-
registerSMSCredential
(credentialId, DeliverOTP=None)¶ Description: Registers a credential for usages in VIP through SMS
Parameters: - credentialId (string) – The token ID (credential ID) identifies the credential to the VIP Service Web Services.
- DeliverOTP (string) – One time password that is sent as confirmation for registering the credential
Returns: the return SOAP response.
Raises:
-
sendOtpSmsUsingCredentialId
(credentialId, authorizerAccountId=None, SMSFrom=None, message=None)¶
-
sendTemporaryPassword
(credentialId, phoneNumber, expirationDate=None)¶
-
setTemporaryPassword
(credentialId, password, expirationDate=None, oneTimeUseOnly=None)¶ Description: Use the SetTemporaryPassword API to set a temporary security code for a credential. You can optionally set an expiration date for the security code, or set it for one-time use only. The request requires the credential ID and the temporary security code string. You can also use the SetTemporaryPassword API to clear a temporary security code. To clear the temporary security code, send the SetTemporaryPassword API and leave the TemporaryPassword request parameter empty.
Note: The SetTemporaryPassword API works on both Disabled and Enabled credentials. Check the credential state before issuing a temporary security code. Checking the credential state prevents users from trying to authenticate using disabled credentials.
Parameters: - credentialId (string) – The token ID (credential ID) identifies the credential to the VIP Service Web Services.
- password (string) – The temporary security code is either empty or six numeric characters.
- expirationDate (datetime) – The temporary security code expiration date (maximum of 30 days). If no date is provided, the default expiration period set for your account in VIP Manager is used to calculate the security code expiration.
- oneTimeUseOnly (boolean) – If this field is set to “true,” the temporary security code expires after one use, or at the expiration date. The default value is “false.”
Returns: the return SOAP response.
Raises:
-
unlockToken
(credentialId, authorizerAccountId=None)¶
-
validateSMSSecurityCode
(credentialId, otp)¶
Module contents¶
The Symantec Python class that handles legacy Symantec VIP API SOAP calls.