def getSupportLicenseInfo(): """ get the current support and subscription information :param validate: inform program to validate or not the license info :return: tuple of dict with the license information and signature in case of an error, the dict and the signature are empty """ refreshConfig() lic_dict = LicenseInfo() lic_sign = "" try: licString = getFromConfig("license", '') if licString: lic_text = binascii.unhexlify(licString.encode('utf-8')).decode() lic_dict, lic_sign = parseSupportLicense(lic_text) lic_dict['expire'] = get_expiration_date(lic_dict) except InvalidLicenseException as exx: log.info('Invalid license error: %r' % exx) return lic_dict, lic_sign
def test_lar_case_sensitive_resolver_names(app): admin_realm_name = app.config["ADMIN_REALM_NAME"] admin_resolvers_key = f"useridresolver.group.{admin_realm_name}" admin_resolvers = getFromConfig(admin_resolvers_key, "") lar = LocalAdminResolver(app) # Replace the local admin resolver name in the realm with a # name that is the same but in uppercase. If we then try to # re-add the original local admin resolver using the officially # approved `.add_to_admin_realm()` method, it should show # up if names are compared case-sensitively. prefix, _, name = admin_resolvers.rpartition(".") new_name = f"{prefix}.{name.upper()}" set_config( key=admin_resolvers_key, value=new_name, typ="text", description="None", update=True, ) db.session.commit() refreshConfig() # force config reload lar.add_to_admin_realm() refreshConfig() # force config reload new_admin_resolvers = getFromConfig(admin_resolvers_key, "") assert ( new_admin_resolvers == admin_resolvers + "," + new_name), "local admin resolver name comparison is not case-sensitive"
def setup_class(cls): '''setup - create clean execution context by resetting database ''' LOG.info("######## setup_class: %r" % cls) SetupCommand('setup-app').run([config['__file__']]) from linotp.lib.config import refreshConfig refreshConfig() return
def getSupportLicenseInfo(): """ get the current support and subscription information :return: dict with the license informstion """ info = {} refreshConfig() licString = getFromConfig("license", None) if licString: try: lic_str = binascii.unhexlify(licString) except TypeError: lic_str = licString (info, _lic_sign, _lic_txt) = parseSupportLicense(lic_str) else: # if we have no licens in the config, we compose the # comuninity edition text info.update(support_info) version = get_version_number() info['version'] = 'LinOTP %s' % version return info
def getSupportLicenseInfo(): """ get the current support and subscription information :return: dict with the license informstion """ info = {} refreshConfig() licString = getFromConfig("license", None) if licString: try: lic_str = binascii.unhexlify(licString) except TypeError: lic_str = licString (info, _lic_sign, _lic_txt) = parseSupportLicense(lic_str) else: # if we have no licens in the config, we compose the # comuninity edition text info.update(support_info) version = get_version_number() info["version"] = "LinOTP %s" % version return info
def setup_class(cls): """setup - create clean execution context by resetting database """ LOG.info("######## setup_class: %r" % cls) SetupCommand("setup-app").run([config["__file__"]]) from linotp.lib.config import refreshConfig refreshConfig() # provide the info of environment we are running in cls.env["pylons"] = LooseVersion(pkg_resources.get_distribution("pylons").version) return
def setup_class(cls): '''setup - create clean execution context by resetting database ''' LOG.info("######## setup_class: %r" % cls) SetupCommand('setup-app').run([config['__file__']]) from linotp.lib.config import refreshConfig refreshConfig() # provide the info of environment we are running in cls.env['pylons'] = LooseVersion( pkg_resources.get_distribution('pylons').version) TestController.run_state = 0 return
def setup_class(cls): '''setup - create clean execution context by resetting database ''' LOG.info("######## setup_class: %r" % cls) SetupCommand('setup-app').run([config['__file__']]) from linotp.lib.config import refreshConfig refreshConfig() # provide the info of environment we are running in cls.env['pylons'] = LooseVersion( pkg_resources.get_distribution('pylons').version ) TestController.run_state = 0 return
def getSupportLicenseInfo(): """ get the current support and subscription information :return: dict with the license informstion """ info = {} refreshConfig() licString = getFromConfig("license", None) if licString: try: lic_str = binascii.unhexlify(licString) except TypeError: lic_str = licString (info, _lic_sign, _lic_txt) = parseSupportLicense(lic_str) return info
def getSupportLicenseInfo(): """ get the current support and subscription information :return: tuple of dict with the license information and signature in case of an error, the dict and the signature are empty """ refreshConfig() lic_dict = LicenseInfo() lic_sign = "" try: licString = getFromConfig("license", '') if licString: licBin = binascii.unhexlify(licString) lic_dict, lic_sign = parseSupportLicense(licBin) except InvalidLicenseException as exx: log.info('invalid license error %r' % exx) return lic_dict, lic_sign