linotp.provider package¶
provider handling
- exception linotp.provider.ProviderNotAvailable¶
- Bases: - Exception- to be thrown when a provider is unavailable, eg. on a connection or response timeout error 
- linotp.provider.default_func(composite_key, value)¶
- Sets the attribute pair {default: True} to the default provider in the tree. - Parameters
- provider_type – A string identifier (such as ‘sms’, ‘email’, etc) 
 
- linotp.provider.delProvider(provider_type, provider_name)¶
- delete a provider - Parameters
- provider_type – the type of Provider: push, sms or email 
- provider_name – the name of the provider 
 
- Returns
- the number of deleted entries 
 
- linotp.provider.func(composite_key, value)¶
- Parses provider data from a config entry - Parameters
- provider_prefix – A short provider prefix (such as ‘SMSProvider’, ‘PushProvider’ - all without the leading ‘linotp.’) 
 
- linotp.provider.getProvider(provider_type, provider_name=None, decrypted=False)¶
- return a dict with providers, each with it’s description as dict - Parameters
- provider_type – either push, sms or email 
- provider_name – name of the provider (optional) 
 
- Returns
- the dict with all providers 
 
- linotp.provider.get_all_new_providers(provider_type, show_managed_config=False)¶
- get all providers of the new format :param provider_type: the type of the provider :return: dict with all providers 
- linotp.provider.get_default_provider(provider_type)¶
- find out, which provider is declared as default - Parameters
- provider_type – push, sms or email 
- Returns
- the name of the default provider 
 
- linotp.provider.get_legacy_provider(provider_type)¶
- return a dict with legacy email or sms providers - Parameters
- provider_type – either sms or email 
- Returns
- dict with the provider 
 
- linotp.provider.get_provider_from_policy(provider_type, realm=None, user=None, scope='authentication', action=None)¶
- interface for the provider user like email token or sms token - Parameters
- provider_type – ‘push’, ‘email’ or ‘sms 
- user – the user, who should receive the message, used for the policy lookup 
 
- Returns
- the list of all identified providers by name 
 
- linotp.provider.loadProvider(provider_type, provider_name=None)¶
- interface for the provider user like email token or sms token - Parameters
- provider_type – ‘push’, ‘email’ or ‘sms 
- provider_name – the name of the provider configuration 
 
- Returns
- the instantiated provider with already loaded configuration 
 
- linotp.provider.loadProviderFromPolicy(provider_type, realm=None, user=None)¶
- interface for the provider user like email token or sms token - Parameters
- provider_type – ‘push’, ‘email’ or ‘sms 
- user – the user, who should receive the message, used for the policy lookup 
 
- Returns
- the instantiated provider with already loaded config 
 
- linotp.provider.load_provider_classes()¶
- iterates through the modules in this package and import every single one of them. This will trigger the registration of the providers in the global provider_registry (s.o.), which registers all available provider classes - Sideeffect
- the classes in the submodules are registrated in the provider registry 
 
- linotp.provider.load_provider_ini(ini_file)¶
- load the provider from a ini config file format 
- linotp.provider.parse_default_provider(provider_type, composite_key, value)¶
- Sets the attribute pair {default: True} to the default provider in the tree. - Parameters
- provider_type – A string identifier (such as ‘sms’, ‘email’, etc) 
 
- linotp.provider.parse_legacy_provider(provider_type, composite_key, value)¶
- Parses legacy provider data from a config entry - Parameters
- provider_prefix – A short provider prefix (such as ‘SMSProvider’, ‘PushProvider’ - all without the leading ‘linotp.’) 
 
- linotp.provider.parse_provider(provider_type, composite_key, value)¶
- Parses provider data from a config entry - Parameters
- provider_prefix – A short provider prefix (such as ‘SMSProvider’, ‘PushProvider’ - all without the leading ‘linotp.’) 
 
- linotp.provider.save_legacy_provider(provider_type, params)¶
- save the provider to the legacy format - Parameters
- provider_type – push, sms or email provider 
- params – the provider description dict with ‘class’, ‘config’ and ‘timeout’ 
 
 
- linotp.provider.save_new_provider(provider_type, provider_name, params)¶
- save the provider in the new provider format - remarks:
- alternative to storing the whole config in encrypted way, we might look if it’s a json and store the next Config. level and look for the reserved additional appended type: encrypted_data 
 - Parameters
- provider_type – push, sms or email provider 
- provider_name – the name of the provider 
- params – the provider description dict with ‘class’, ‘config’, and ‘timeout’ 
 
 
- linotp.provider.setDefaultProvider(provider_type, provider_name)¶
- interface to set the default provider wo. storing the provider - Parameters
- provider_type – the type of the provider: sms or email 
- provider_name – the name of the provider - must exist 
 
- Returns
- boolean, success of storing default provider information 
 
- linotp.provider.setProvider(params)¶
- save the provider info in linotp config - Parameters
- params – generic parameter dictionary to support later more complex provider definitions in the dictionary currently required keys are :param type: push,sms or email :param name: the provider name :param config: the provider config :param timeout: the provider timeout :param: default: boolean 
- Returns
- success - boolean 
 
Subpackages¶
- linotp.provider.emailprovider package- IEmailProvider
- SMTPEmailProvider- SMTPEmailProvider.DEFAULT_EMAIL_FROM
- SMTPEmailProvider.DEFAULT_EMAIL_SUBJECT
- SMTPEmailProvider.get_template_root()
- SMTPEmailProvider.loadConfig()
- SMTPEmailProvider.render_message()
- SMTPEmailProvider.render_simple_message()
- SMTPEmailProvider.render_template_message()
- SMTPEmailProvider.submitMessage()
 
 
- linotp.provider.pushprovider package
- linotp.provider.smsprovider package- ISMSProvider
- getSMSProviderClass()
- Submodules- linotp.provider.smsprovider.DeviceSMSProvider module
- linotp.provider.smsprovider.FileSMSProvider module
- linotp.provider.smsprovider.HttpSMSProvider module
- linotp.provider.smsprovider.RestSMSProvider module
- linotp.provider.smsprovider.SMPPSMSProvider module
- linotp.provider.smsprovider.SmtpSMSProvider module
 
 
- linotp.provider.voiceprovider package