From decfe79015d404bd2a818ef824a7c29c32eeeeb1 Mon Sep 17 00:00:00 2001 From: muneebkq Date: Mon, 8 Jul 2024 16:39:09 +0530 Subject: [PATCH 01/22] feat: add permission flag --- cryptlex/lexfloatclient/__init__.py | 2 +- cryptlex/lexfloatclient/lexfloatclient.py | 27 +++++++++++++++++++ .../lexfloatclient/lexfloatclient_native.py | 4 +++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/cryptlex/lexfloatclient/__init__.py b/cryptlex/lexfloatclient/__init__.py index 2a0e3db..6d85a8c 100644 --- a/cryptlex/lexfloatclient/__init__.py +++ b/cryptlex/lexfloatclient/__init__.py @@ -1 +1 @@ -from cryptlex.lexfloatclient.lexfloatclient import LexFloatClient, LexFloatStatusCodes, LexFloatClientException +from cryptlex.lexfloatclient.lexfloatclient import LexFloatClient, LexFloatStatusCodes, LexFloatClientException, PermissionFlags diff --git a/cryptlex/lexfloatclient/lexfloatclient.py b/cryptlex/lexfloatclient/lexfloatclient.py index 13f2e2c..fa1f5e3 100644 --- a/cryptlex/lexfloatclient/lexfloatclient.py +++ b/cryptlex/lexfloatclient/lexfloatclient.py @@ -5,6 +5,9 @@ callback_list = [] +class PermissionFlags: + LF_USER = 10 + LF_ALL_USERS = 11 class HostLicenseMeterAttribute(object): def __init__(self, name, allowed_uses, total_uses, gross_uses): @@ -278,6 +281,30 @@ def RequestFloatingLicense(): if LexFloatStatusCodes.LF_OK != status: raise LexFloatClientException(status) + @staticmethod + def SetPermissionFlag(flags): + """Sets the permission flags. + + This function must be called on every start of your program after SetHostProductId() + function in case the application allows borrowing of licenses or system wide activation. + + Args: + flags : depending on your application's requirements, choose one of + the following values: LF_USER, LF_ALL_USERS. + + LF_USER: This flag indicates that the application does not require + admin or root permissions to run. + + LF_ALL_USERS: This flag is specifically designed for Windows and should be used + for system-wide activations. + + Raises: + LexFloatClientException + """ + status = LexFloatClientNative.SetPermissionFlag(flags) + if LexFloatStatusCodes.LF_OK != status: + raise LexFloatClientException(status) + @staticmethod def DropFloatingLicense(): """Sends the request to the LexFloatServer to free the license. diff --git a/cryptlex/lexfloatclient/lexfloatclient_native.py b/cryptlex/lexfloatclient/lexfloatclient_native.py index e116d62..baaadd8 100644 --- a/cryptlex/lexfloatclient/lexfloatclient_native.py +++ b/cryptlex/lexfloatclient/lexfloatclient_native.py @@ -163,6 +163,10 @@ def byte_to_string(input): RequestFloatingLicense.argtypes = [] RequestFloatingLicense.restype = c_int +SetPermissionFlag = library.SetPermissionFlag +SetPermissionFlag.argtypes = [c_uint32] +SetPermissionFlag.restype = c_int + DropFloatingLicense = library.DropFloatingLicense DropFloatingLicense.argtypes = [] DropFloatingLicense.restype = c_int From 6999c07eb1285996f7da12e86742c25242e3919c Mon Sep 17 00:00:00 2001 From: muneebkq Date: Mon, 8 Jul 2024 16:41:54 +0530 Subject: [PATCH 02/22] feat: add function get-floating-license-mode --- cryptlex/lexfloatclient/lexfloatclient.py | 19 ++++++++++++++++++- .../lexfloatclient/lexfloatclient_native.py | 4 ++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/cryptlex/lexfloatclient/lexfloatclient.py b/cryptlex/lexfloatclient/lexfloatclient.py index 13f2e2c..f50351b 100644 --- a/cryptlex/lexfloatclient/lexfloatclient.py +++ b/cryptlex/lexfloatclient/lexfloatclient.py @@ -103,7 +103,7 @@ def SetFloatingClientMetadata(key, value): @staticmethod def GetFloatingClientLibraryVersion(): - """Gets the floating client library version. + """Gets the mode of the floating license (online or offline). Raises: LexFloatClientException @@ -266,6 +266,23 @@ def GetFloatingClientMeterAttributeUses(name): return uses.value else: raise LexFloatClientException(status) + + @staticmethod + def GetFloatingLicenseMode(): + """Gets the mode of the floating license (online or offline). + + Raises: + LexActivatorException + + Returns: + ActivationMode: mode of floating license. + """ + buffer_size = 256 + buffer = LexFloatClientNative.get_ctype_string_buffer(buffer_size) + status = LexFloatClientNative.GetFloatingLicenseMode(buffer,buffer_size) + if status != LexFloatStatusCodes.LF_OK: + raise LexFloatClientException(status) + return LexFloatClientNative.byte_to_string(buffer.value) @staticmethod def RequestFloatingLicense(): diff --git a/cryptlex/lexfloatclient/lexfloatclient_native.py b/cryptlex/lexfloatclient/lexfloatclient_native.py index e116d62..42d815d 100644 --- a/cryptlex/lexfloatclient/lexfloatclient_native.py +++ b/cryptlex/lexfloatclient/lexfloatclient_native.py @@ -139,6 +139,10 @@ def byte_to_string(input): GetHostProductVersionDisplayName.argtypes = [STRTYPE, c_uint32] GetHostProductVersionDisplayName.restype = c_int +GetFloatingLicenseMode = library.GetFloatingLicenseMode +GetFloatingLicenseMode.argtypes = [STRTYPE, c_uint32] +GetFloatingLicenseMode.restype = c_int + GetHostProductVersionFeatureFlag = library.GetHostProductVersionFeatureFlag GetHostProductVersionFeatureFlag.argtypes = [CSTRTYPE, POINTER(c_uint32), STRTYPE, c_uint32] GetHostProductVersionFeatureFlag.restype = c_int From 3b9322f60047e394ef1a6d2e7ce24ed9786adae9 Mon Sep 17 00:00:00 2001 From: muneebkq Date: Fri, 12 Jul 2024 11:07:23 +0530 Subject: [PATCH 03/22] feat: add floating client metadata --- cryptlex/lexfloatclient/lexfloatclient.py | 22 +++++++++++++++++++ .../lexfloatclient/lexfloatclient_native.py | 5 +++++ 2 files changed, 27 insertions(+) diff --git a/cryptlex/lexfloatclient/lexfloatclient.py b/cryptlex/lexfloatclient/lexfloatclient.py index 13f2e2c..7a60bc8 100644 --- a/cryptlex/lexfloatclient/lexfloatclient.py +++ b/cryptlex/lexfloatclient/lexfloatclient.py @@ -267,6 +267,28 @@ def GetFloatingClientMeterAttributeUses(name): else: raise LexFloatClientException(status) + @staticmethod + def GetFloatingClientMetadata(key): + """Gets the value of the floating client metadata. + + Args: + key (str): metadata key to retrieve the value + + Raises: + LexFloatClientException + + Returns: + str: value of metadata for the key + """ + cstring_key = LexFloatClientNative.get_ctype_string(key) + buffer_size = 256 + buffer = LexFloatClientNative.get_ctype_string_buffer(buffer_size) + status = LexFloatClientNative.GetFloatingClientMetadata( + cstring_key, buffer, buffer_size) + if status != LexFloatStatusCodes.LF_OK: + raise LexFloatClientException(status) + return LexFloatClientNative.byte_to_string(buffer.value) + @staticmethod def RequestFloatingLicense(): """Sends the request to lease the license from the LexFloatServer. diff --git a/cryptlex/lexfloatclient/lexfloatclient_native.py b/cryptlex/lexfloatclient/lexfloatclient_native.py index e116d62..5523197 100644 --- a/cryptlex/lexfloatclient/lexfloatclient_native.py +++ b/cryptlex/lexfloatclient/lexfloatclient_native.py @@ -159,6 +159,11 @@ def byte_to_string(input): GetFloatingClientMeterAttributeUses.argtypes = [CSTRTYPE, POINTER(c_uint32)] GetFloatingClientMeterAttributeUses.restype = c_int +GetFloatingClientMetadata = library.GetFloatingClientMetadata +GetFloatingClientMetadata.argtypes = [CSTRTYPE, STRTYPE, c_uint32] +GetFloatingClientMetadata.restype = c_int + + RequestFloatingLicense = library.RequestFloatingLicense RequestFloatingLicense.argtypes = [] RequestFloatingLicense.restype = c_int From ad13cd76fa029bb3405dada618f0a0241dd4c1e6 Mon Sep 17 00:00:00 2001 From: muneebkq Date: Tue, 16 Jul 2024 10:45:49 +0530 Subject: [PATCH 04/22] feat: add get-host-config function --- cryptlex/lexfloatclient/lexfloatclient.py | 31 ++++++++++++++++++- .../lexfloatclient/lexfloatclient_native.py | 4 +++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/cryptlex/lexfloatclient/lexfloatclient.py b/cryptlex/lexfloatclient/lexfloatclient.py index 13f2e2c..961ffb9 100644 --- a/cryptlex/lexfloatclient/lexfloatclient.py +++ b/cryptlex/lexfloatclient/lexfloatclient.py @@ -1,4 +1,5 @@ import ctypes +import json from cryptlex.lexfloatclient import lexfloatclient_native as LexFloatClientNative from cryptlex.lexfloatclient.lexfloatstatus_codes import LexFloatStatusCodes from cryptlex.lexfloatclient.lexfloatclient_exception import LexFloatClientException @@ -19,6 +20,11 @@ def __init__(self, name, enabled, data): self.enabled = enabled self.data = data +class HostConfig(object): + def __init__(self, hostConfig): + self.maxOfflineLeaseDuration = hostConfig.get("maxOfflineLeaseDuration") + + class LexFloatClient: @staticmethod def SetHostProductId(product_id): @@ -117,7 +123,30 @@ def GetFloatingClientLibraryVersion(): status = LexFloatClientNative.GetFloatingClientLibraryVersion(buffer,buffer_size) if status != LexFloatStatusCodes.LF_OK: raise LexFloatClientException(status) - return LexFloatClientNative.byte_to_string(buffer.value) + return LexFloatClientNative.byte_to_string(buffer.value) + + @staticmethod + def GetHostConfig(): + """Gets the host configuration. + + Raises: + LexFloatClientException + + Returns: + str: host configuration. + """ + buffer_size = 4096 + buffer = LexFloatClientNative.get_ctype_string_buffer(buffer_size) + status = LexFloatClientNative.GetHostConfig(buffer, buffer_size) + if status == LexFloatStatusCodes.LF_OK: + host_config_json = LexFloatClientNative.byte_to_string(buffer.value) + if not host_config_json.strip(): + return [] + else: + host_config = json.loads(host_config_json) + return [HostConfig(host_config_details) for host_config_details in host_config] + else: + raise LexFloatClientException(status) @staticmethod def GetHostProductVersionName(): diff --git a/cryptlex/lexfloatclient/lexfloatclient_native.py b/cryptlex/lexfloatclient/lexfloatclient_native.py index e116d62..5a0eed7 100644 --- a/cryptlex/lexfloatclient/lexfloatclient_native.py +++ b/cryptlex/lexfloatclient/lexfloatclient_native.py @@ -143,6 +143,10 @@ def byte_to_string(input): GetHostProductVersionFeatureFlag.argtypes = [CSTRTYPE, POINTER(c_uint32), STRTYPE, c_uint32] GetHostProductVersionFeatureFlag.restype = c_int +GetHostConfig = library.GetHostConfigInternal +GetHostConfig.argtypes = [STRTYPE, c_uint32] +GetHostConfig.restype = c_int + GetHostLicenseMetadata = library.GetHostLicenseMetadata GetHostLicenseMetadata.argtypes = [CSTRTYPE, STRTYPE, c_uint32] GetHostLicenseMetadata.restype = c_int From beb27fcb488b0781f2886f4eb4d3346b16f17b80 Mon Sep 17 00:00:00 2001 From: muneebkq Date: Tue, 16 Jul 2024 14:16:11 +0530 Subject: [PATCH 05/22] refactor: jsdoc --- cryptlex/lexfloatclient/lexfloatclient.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cryptlex/lexfloatclient/lexfloatclient.py b/cryptlex/lexfloatclient/lexfloatclient.py index f50351b..8cc8c2c 100644 --- a/cryptlex/lexfloatclient/lexfloatclient.py +++ b/cryptlex/lexfloatclient/lexfloatclient.py @@ -103,8 +103,7 @@ def SetFloatingClientMetadata(key, value): @staticmethod def GetFloatingClientLibraryVersion(): - """Gets the mode of the floating license (online or offline). - + """Gets floating client library version. Raises: LexFloatClientException From c6b48658d474c355cb0f884279c46e93e351de77 Mon Sep 17 00:00:00 2001 From: muneebkq Date: Tue, 16 Jul 2024 14:23:16 +0530 Subject: [PATCH 06/22] feat: add get floating client lease expiry --- cryptlex/lexfloatclient/lexfloatclient.py | 18 ++++++++++++++++++ .../lexfloatclient/lexfloatclient_native.py | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/cryptlex/lexfloatclient/lexfloatclient.py b/cryptlex/lexfloatclient/lexfloatclient.py index 13f2e2c..4bbf5fa 100644 --- a/cryptlex/lexfloatclient/lexfloatclient.py +++ b/cryptlex/lexfloatclient/lexfloatclient.py @@ -244,6 +244,24 @@ def GetHostLicenseExpiryDate(): return expiry_date.value else: raise LexFloatClientException(status) + + @staticmethod + def GetFloatingClientLeaseExpiryDate(): + """Gets the lease expiry date timestamp of the floating client. + + Raises: + LexFloatClientException + + Returns: + int: the timestamp + """ + leaseExpiryDate = ctypes.c_uint() + status = LexFloatClientNative.GetFloatingClientLeaseExpiryDate( + ctypes.byref(leaseExpiryDate)) + if status == LexFloatStatusCodes.LF_OK: + return leaseExpiryDate.value + else: + raise LexFloatClientException(status) @staticmethod def GetFloatingClientMeterAttributeUses(name): diff --git a/cryptlex/lexfloatclient/lexfloatclient_native.py b/cryptlex/lexfloatclient/lexfloatclient_native.py index e116d62..6813cf6 100644 --- a/cryptlex/lexfloatclient/lexfloatclient_native.py +++ b/cryptlex/lexfloatclient/lexfloatclient_native.py @@ -155,6 +155,10 @@ def byte_to_string(input): GetHostLicenseExpiryDate.argtypes = [POINTER(c_uint32)] GetHostLicenseExpiryDate.restype = c_int +GetFloatingClientLeaseExpiryDate = library.GetFloatingClientLeaseExpiryDate +GetFloatingClientLeaseExpiryDate.argtypes = [POINTER(c_uint32)] +GetFloatingClientLeaseExpiryDate.restype = c_int + GetFloatingClientMeterAttributeUses = library.GetFloatingClientMeterAttributeUses GetFloatingClientMeterAttributeUses.argtypes = [CSTRTYPE, POINTER(c_uint32)] GetFloatingClientMeterAttributeUses.restype = c_int From 4d8aa6955331c9d82a2be6fb34b0714fc7bf939a Mon Sep 17 00:00:00 2001 From: muneebkq Date: Tue, 16 Jul 2024 14:26:08 +0530 Subject: [PATCH 07/22] feat: request-float-license --- cryptlex/lexfloatclient/lexfloatclient.py | 16 ++++- .../lexfloatclient/lexfloatclient_native.py | 4 ++ .../lexfloatclient/lexfloatstatus_codes.py | 70 +++++++++++-------- 3 files changed, 61 insertions(+), 29 deletions(-) diff --git a/cryptlex/lexfloatclient/lexfloatclient.py b/cryptlex/lexfloatclient/lexfloatclient.py index 13f2e2c..6076116 100644 --- a/cryptlex/lexfloatclient/lexfloatclient.py +++ b/cryptlex/lexfloatclient/lexfloatclient.py @@ -270,7 +270,7 @@ def GetFloatingClientMeterAttributeUses(name): @staticmethod def RequestFloatingLicense(): """Sends the request to lease the license from the LexFloatServer. - + Raises: LexFloatClientException """ @@ -278,6 +278,20 @@ def RequestFloatingLicense(): if LexFloatStatusCodes.LF_OK != status: raise LexFloatClientException(status) + @staticmethod + def RequestOfflineFloatingLicense(leaseDuration): + """Sends the request to lease the license from the LexFloatServer for offline usage. + + Args: + leaseDuration (int): seconds for which the lease should be obtained. + + Raises: + LexFloatClientException + """ + status = LexFloatClientNative.RequestOfflineFloatingLicense(leaseDuration) + if LexFloatStatusCodes.LF_OK != status: + raise LexFloatClientException(status) + @staticmethod def DropFloatingLicense(): """Sends the request to the LexFloatServer to free the license. diff --git a/cryptlex/lexfloatclient/lexfloatclient_native.py b/cryptlex/lexfloatclient/lexfloatclient_native.py index e116d62..6ab42c1 100644 --- a/cryptlex/lexfloatclient/lexfloatclient_native.py +++ b/cryptlex/lexfloatclient/lexfloatclient_native.py @@ -163,6 +163,10 @@ def byte_to_string(input): RequestFloatingLicense.argtypes = [] RequestFloatingLicense.restype = c_int +RequestOfflineFloatingLicense = library.RequestOfflineFloatingLicense +RequestOfflineFloatingLicense.argtypes = [c_uint32] +RequestOfflineFloatingLicense.restype = c_int + DropFloatingLicense = library.DropFloatingLicense DropFloatingLicense.argtypes = [] DropFloatingLicense.restype = c_int diff --git a/cryptlex/lexfloatclient/lexfloatstatus_codes.py b/cryptlex/lexfloatclient/lexfloatstatus_codes.py index d8bacad..c0cedb4 100644 --- a/cryptlex/lexfloatclient/lexfloatstatus_codes.py +++ b/cryptlex/lexfloatclient/lexfloatstatus_codes.py @@ -1,59 +1,73 @@ class LexFloatStatusCodes: - + LF_OK = 0 LF_FAIL = 1 - + LF_E_PRODUCT_ID = 40 - + LF_E_CALLBACK = 41 - + LF_E_HOST_URL = 42 - + LF_E_TIME = 43 - + LF_E_INET = 44 - + LF_E_NO_LICENSE = 45 - + LF_E_LICENSE_EXISTS = 46 - + LF_E_LICENSE_NOT_FOUND = 47 - + LF_E_LICENSE_EXPIRED_INET = 48 - + LF_E_LICENSE_LIMIT_REACHED = 49 - + LF_E_BUFFER_SIZE = 50 - + LF_E_METADATA_KEY_NOT_FOUND = 51 - + LF_E_METADATA_KEY_LENGTH = 52 - + LF_E_METADATA_VALUE_LENGTH = 53 - + LF_E_FLOATING_CLIENT_METADATA_LIMIT = 54 - + LF_E_METER_ATTRIBUTE_NOT_FOUND = 55 - + LF_E_METER_ATTRIBUTE_USES_LIMIT_REACHED = 56 - + LF_E_PRODUCT_VERSION_NOT_LINKED = 57 - + LF_E_FEATURE_FLAG_NOT_FOUND = 58 - + + LF_E_SYSTEM_PERMISSION = 59 + LF_E_IP = 60 - + + LF_E_INVALID_PERMISSION_FLAG = 61 + + LF_E_OFFLINE_FLOATING_LICENSE_NOT_ALLOWED = 62 + + LF_E_MAX_OFFLINE_LEASE_DURATION_EXCEEDED = 63 + + LF_E_ALLOWED_OFFLINE_FLOATING_CLIENTS_LIMIT_REACHED = 64 + + LF_E_WMIC = 65 + + LF_E_MACHINE_FINGERPRINT = 66 + LF_E_CLIENT = 70 - + LF_E_SERVER = 71 - + LF_E_SERVER_TIME_MODIFIED = 72 - + LF_E_SERVER_LICENSE_NOT_ACTIVATED = 73 - + LF_E_SERVER_LICENSE_EXPIRED = 74 - + LF_E_SERVER_LICENSE_SUSPENDED = 75 - + LF_E_SERVER_LICENSE_GRACE_PERIOD_OVER = 76 From 8723c2619a2087e8178c6a2f2fa56a261c4fc9df Mon Sep 17 00:00:00 2001 From: muneebkq Date: Tue, 30 Jul 2024 14:42:16 +0530 Subject: [PATCH 08/22] fix: change type defintion --- cryptlex/lexfloatclient/lexfloatclient.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cryptlex/lexfloatclient/lexfloatclient.py b/cryptlex/lexfloatclient/lexfloatclient.py index 961ffb9..38c2a80 100644 --- a/cryptlex/lexfloatclient/lexfloatclient.py +++ b/cryptlex/lexfloatclient/lexfloatclient.py @@ -21,8 +21,8 @@ def __init__(self, name, enabled, data): self.data = data class HostConfig(object): - def __init__(self, hostConfig): - self.maxOfflineLeaseDuration = hostConfig.get("maxOfflineLeaseDuration") + def __init__(self, maxOfflineLeaseDuration): + self.maxOfflineLeaseDuration = maxOfflineLeaseDuration class LexFloatClient: @@ -133,18 +133,18 @@ def GetHostConfig(): LexFloatClientException Returns: - str: host configuration. + HostConfig: host configuration. """ - buffer_size = 4096 + buffer_size = 1024 buffer = LexFloatClientNative.get_ctype_string_buffer(buffer_size) status = LexFloatClientNative.GetHostConfig(buffer, buffer_size) if status == LexFloatStatusCodes.LF_OK: host_config_json = LexFloatClientNative.byte_to_string(buffer.value) if not host_config_json.strip(): - return [] + return None else: host_config = json.loads(host_config_json) - return [HostConfig(host_config_details) for host_config_details in host_config] + return HostConfig(host_config["maxOfflineLeaseDuration"]) else: raise LexFloatClientException(status) From 0a0b60d6fbc38e84374dfcdc84d1c854e03beb12 Mon Sep 17 00:00:00 2001 From: muneebkq Date: Wed, 31 Jul 2024 17:35:24 +0530 Subject: [PATCH 09/22] feat: add status codes --- .../lexfloatclient/lexfloatstatus_codes.py | 74 +++++++++++-------- 1 file changed, 45 insertions(+), 29 deletions(-) diff --git a/cryptlex/lexfloatclient/lexfloatstatus_codes.py b/cryptlex/lexfloatclient/lexfloatstatus_codes.py index d8bacad..067f3e7 100644 --- a/cryptlex/lexfloatclient/lexfloatstatus_codes.py +++ b/cryptlex/lexfloatclient/lexfloatstatus_codes.py @@ -1,59 +1,75 @@ class LexFloatStatusCodes: - LF_OK = 0 + LF_OK: 0 - LF_FAIL = 1 + LF_FAIL: 1 - LF_E_PRODUCT_ID = 40 + LF_E_PRODUCT_ID: 40 - LF_E_CALLBACK = 41 + LF_E_CALLBACK: 41 - LF_E_HOST_URL = 42 + LF_E_HOST_URL: 42 - LF_E_TIME = 43 + LF_E_TIME: 43 - LF_E_INET = 44 + LF_E_INET: 44 - LF_E_NO_LICENSE = 45 + LF_E_NO_LICENSE: 45 - LF_E_LICENSE_EXISTS = 46 + LF_E_LICENSE_EXISTS: 46 - LF_E_LICENSE_NOT_FOUND = 47 + LF_E_LICENSE_NOT_FOUND: 47 - LF_E_LICENSE_EXPIRED_INET = 48 + LF_E_LICENSE_EXPIRED_INET: 48 - LF_E_LICENSE_LIMIT_REACHED = 49 + LF_E_LICENSE_LIMIT_REACHED: 49 - LF_E_BUFFER_SIZE = 50 + LF_E_BUFFER_SIZE: 50 - LF_E_METADATA_KEY_NOT_FOUND = 51 + LF_E_METADATA_KEY_NOT_FOUND: 51 - LF_E_METADATA_KEY_LENGTH = 52 + LF_E_METADATA_KEY_LENGTH: 52 - LF_E_METADATA_VALUE_LENGTH = 53 + LF_E_METADATA_VALUE_LENGTH: 53 - LF_E_FLOATING_CLIENT_METADATA_LIMIT = 54 + LF_E_FLOATING_CLIENT_METADATA_LIMIT: 54 - LF_E_METER_ATTRIBUTE_NOT_FOUND = 55 + LF_E_METER_ATTRIBUTE_NOT_FOUND: 55 - LF_E_METER_ATTRIBUTE_USES_LIMIT_REACHED = 56 + LF_E_METER_ATTRIBUTE_USES_LIMIT_REACHED: 56 - LF_E_PRODUCT_VERSION_NOT_LINKED = 57 + LF_E_PRODUCT_VERSION_NOT_LINKED: 57 - LF_E_FEATURE_FLAG_NOT_FOUND = 58 + LF_E_FEATURE_FLAG_NOT_FOUND: 58 - LF_E_IP = 60 + LF_E_SYSTEM_PERMISSION: 59 - LF_E_CLIENT = 70 + LF_E_IP: 60 - LF_E_SERVER = 71 + LF_E_INVALID_PERMISSION_FLAG: 61 - LF_E_SERVER_TIME_MODIFIED = 72 + LF_E_OFFLINE_FLOATING_LICENSE_NOT_ALLOWED: 62 - LF_E_SERVER_LICENSE_NOT_ACTIVATED = 73 + LF_E_MAX_OFFLINE_LEASE_DURATION_EXCEEDED: 63 - LF_E_SERVER_LICENSE_EXPIRED = 74 + LF_E_ALLOWED_OFFLINE_FLOATING_CLIENTS_LIMIT_REACHED: 64 - LF_E_SERVER_LICENSE_SUSPENDED = 75 + LF_E_WMIC: 65 - LF_E_SERVER_LICENSE_GRACE_PERIOD_OVER = 76 + LF_E_MACHINE_FINGERPRINT: 66 + + LF_E_PROXY_NOT_TRUSTED: 67 + + LF_E_CLIENT: 70 + + LF_E_SERVER: 71 + + LF_E_SERVER_TIME_MODIFIED: 72 + + LF_E_SERVER_LICENSE_NOT_ACTIVATED: 73 + + LF_E_SERVER_LICENSE_EXPIRED: 74 + + LF_E_SERVER_LICENSE_SUSPENDED: 75 + + LF_E_SERVER_LICENSE_GRACE_PERIOD_OVER: 76 \ No newline at end of file From fd79356819c92c3d8174b41a7c82ece6280b5dfc Mon Sep 17 00:00:00 2001 From: muneebkq Date: Fri, 2 Aug 2024 12:44:13 +0530 Subject: [PATCH 10/22] refacor: status code --- .../lexfloatclient_exception.py | 14 +++ .../lexfloatclient/lexfloatstatus_codes.py | 90 +++++++++---------- 2 files changed, 58 insertions(+), 46 deletions(-) diff --git a/cryptlex/lexfloatclient/lexfloatclient_exception.py b/cryptlex/lexfloatclient/lexfloatclient_exception.py index 391efca..f6207d4 100644 --- a/cryptlex/lexfloatclient/lexfloatclient_exception.py +++ b/cryptlex/lexfloatclient/lexfloatclient_exception.py @@ -64,4 +64,18 @@ def get_error_message(code): return 'The server license has been suspended.' if code == LexFloatStatusCodes.LF_E_SERVER_LICENSE_GRACE_PERIOD_OVER: return 'The grace period for server license is over.' + if code == LexFloatStatusCodes.LF_E_SYSTEM_PERMISSION: + return 'Insufficient system permissions.' + if code == LexFloatStatusCodes.LF_E_INVALID_PERMISSION_FLAG: + return 'Invalid permission flag.' + if code == LexFloatStatusCodes.LF_E_OFFLINE_FLOATING_LICENSE_NOT_ALLOWED: + return 'Offline floating license is not allowed for per-instance leasing strategy.' + if code == LexFloatStatusCodes.LF_E_MAX_OFFLINE_LEASE_DURATION_EXCEEDED: + return 'Maximum offline lease duration exceeded.' + if code == LexFloatStatusCodes.LF_E_ALLOWED_OFFLINE_FLOATING_CLIENTS_LIMIT_REACHED: + return 'Allowed offline floating clients limit reached.' + if code == LexFloatStatusCodes.LF_E_WMIC: + return "Fingerprint couldn't be generated because Windows Management Instrumentation (WMI) service has been disabled. This error is specific to Windows only." + if code == LexFloatStatusCodes.LF_E_MACHINE_FINGERPRINT: + return 'Machine fingerprint has changed since activation.' return 'Unknown error!' diff --git a/cryptlex/lexfloatclient/lexfloatstatus_codes.py b/cryptlex/lexfloatclient/lexfloatstatus_codes.py index 067f3e7..f87384c 100644 --- a/cryptlex/lexfloatclient/lexfloatstatus_codes.py +++ b/cryptlex/lexfloatclient/lexfloatstatus_codes.py @@ -1,75 +1,73 @@ class LexFloatStatusCodes: - LF_OK: 0 + LF_OK = 0 - LF_FAIL: 1 + LF_FAIL = 1 - LF_E_PRODUCT_ID: 40 + LF_E_PRODUCT_ID = 40 - LF_E_CALLBACK: 41 + LF_E_CALLBACK = 41 - LF_E_HOST_URL: 42 + LF_E_HOST_URL = 42 - LF_E_TIME: 43 + LF_E_TIME = 43 - LF_E_INET: 44 + LF_E_INET = 44 - LF_E_NO_LICENSE: 45 + LF_E_NO_LICENSE = 45 - LF_E_LICENSE_EXISTS: 46 + LF_E_LICENSE_EXISTS = 46 - LF_E_LICENSE_NOT_FOUND: 47 + LF_E_LICENSE_NOT_FOUND = 47 - LF_E_LICENSE_EXPIRED_INET: 48 + LF_E_LICENSE_EXPIRED_INET = 48 - LF_E_LICENSE_LIMIT_REACHED: 49 + LF_E_LICENSE_LIMIT_REACHED = 49 - LF_E_BUFFER_SIZE: 50 + LF_E_BUFFER_SIZE = 50 - LF_E_METADATA_KEY_NOT_FOUND: 51 + LF_E_METADATA_KEY_NOT_FOUND = 51 - LF_E_METADATA_KEY_LENGTH: 52 + LF_E_METADATA_KEY_LENGTH = 52 - LF_E_METADATA_VALUE_LENGTH: 53 + LF_E_METADATA_VALUE_LENGTH = 53 - LF_E_FLOATING_CLIENT_METADATA_LIMIT: 54 + LF_E_FLOATING_CLIENT_METADATA_LIMIT = 54 - LF_E_METER_ATTRIBUTE_NOT_FOUND: 55 + LF_E_METER_ATTRIBUTE_NOT_FOUND = 55 - LF_E_METER_ATTRIBUTE_USES_LIMIT_REACHED: 56 + LF_E_METER_ATTRIBUTE_USES_LIMIT_REACHED = 56 - LF_E_PRODUCT_VERSION_NOT_LINKED: 57 + LF_E_PRODUCT_VERSION_NOT_LINKED = 57 + + LF_E_FEATURE_FLAG_NOT_FOUND = 58 + + LF_E_SYSTEM_PERMISSION = 59 + + LF_E_IP = 60 + + LF_E_INVALID_PERMISSION_FLAG = 61 + + LF_E_OFFLINE_FLOATING_LICENSE_NOT_ALLOWED = 62 + + LF_E_MAX_OFFLINE_LEASE_DURATION_EXCEEDED = 63 + + LF_E_ALLOWED_OFFLINE_FLOATING_CLIENTS_LIMIT_REACHED = 64 + + LF_E_WMIC = 65 - LF_E_FEATURE_FLAG_NOT_FOUND: 58 + LF_E_MACHINE_FINGERPRINT = 66 - LF_E_SYSTEM_PERMISSION: 59 + LF_E_CLIENT = 70 - LF_E_IP: 60 + LF_E_SERVER = 71 - LF_E_INVALID_PERMISSION_FLAG: 61 + LF_E_SERVER_TIME_MODIFIED = 72 - LF_E_OFFLINE_FLOATING_LICENSE_NOT_ALLOWED: 62 + LF_E_SERVER_LICENSE_NOT_ACTIVATED = 73 - LF_E_MAX_OFFLINE_LEASE_DURATION_EXCEEDED: 63 + LF_E_SERVER_LICENSE_EXPIRED = 74 - LF_E_ALLOWED_OFFLINE_FLOATING_CLIENTS_LIMIT_REACHED: 64 + LF_E_SERVER_LICENSE_SUSPENDED = 75 - LF_E_WMIC: 65 - - LF_E_MACHINE_FINGERPRINT: 66 - - LF_E_PROXY_NOT_TRUSTED: 67 - - LF_E_CLIENT: 70 - - LF_E_SERVER: 71 - - LF_E_SERVER_TIME_MODIFIED: 72 - - LF_E_SERVER_LICENSE_NOT_ACTIVATED: 73 - - LF_E_SERVER_LICENSE_EXPIRED: 74 - - LF_E_SERVER_LICENSE_SUSPENDED: 75 - - LF_E_SERVER_LICENSE_GRACE_PERIOD_OVER: 76 \ No newline at end of file + LF_E_SERVER_LICENSE_GRACE_PERIOD_OVER = 76 From 7e5f75162eb70ca464ec9f042956b481640af411 Mon Sep 17 00:00:00 2001 From: muneebkq Date: Fri, 2 Aug 2024 12:48:45 +0530 Subject: [PATCH 11/22] refactor: jsdoc --- cryptlex/lexfloatclient/lexfloatclient.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cryptlex/lexfloatclient/lexfloatclient.py b/cryptlex/lexfloatclient/lexfloatclient.py index 6076116..5d6dd00 100644 --- a/cryptlex/lexfloatclient/lexfloatclient.py +++ b/cryptlex/lexfloatclient/lexfloatclient.py @@ -279,7 +279,7 @@ def RequestFloatingLicense(): raise LexFloatClientException(status) @staticmethod - def RequestOfflineFloatingLicense(leaseDuration): + def RequestOfflineFloatingLicense(lease_duration): """Sends the request to lease the license from the LexFloatServer for offline usage. Args: @@ -288,7 +288,7 @@ def RequestOfflineFloatingLicense(leaseDuration): Raises: LexFloatClientException """ - status = LexFloatClientNative.RequestOfflineFloatingLicense(leaseDuration) + status = LexFloatClientNative.RequestOfflineFloatingLicense(lease_duration) if LexFloatStatusCodes.LF_OK != status: raise LexFloatClientException(status) From e471bb9fc3652e53b9cdb98e763a33714bc767db Mon Sep 17 00:00:00 2001 From: muneebkq Date: Fri, 2 Aug 2024 12:54:20 +0530 Subject: [PATCH 12/22] refactor: arg name --- cryptlex/lexfloatclient/lexfloatclient.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cryptlex/lexfloatclient/lexfloatclient.py b/cryptlex/lexfloatclient/lexfloatclient.py index fa1f5e3..399b13c 100644 --- a/cryptlex/lexfloatclient/lexfloatclient.py +++ b/cryptlex/lexfloatclient/lexfloatclient.py @@ -282,8 +282,8 @@ def RequestFloatingLicense(): raise LexFloatClientException(status) @staticmethod - def SetPermissionFlag(flags): - """Sets the permission flags. + def SetPermissionFlag(flag): + """Sets the permission flag. This function must be called on every start of your program after SetHostProductId() function in case the application allows borrowing of licenses or system wide activation. @@ -301,7 +301,7 @@ def SetPermissionFlag(flags): Raises: LexFloatClientException """ - status = LexFloatClientNative.SetPermissionFlag(flags) + status = LexFloatClientNative.SetPermissionFlag(flag) if LexFloatStatusCodes.LF_OK != status: raise LexFloatClientException(status) From b9e508fc04e1481a7b95b3254e50c0883e58b99b Mon Sep 17 00:00:00 2001 From: muneebkq Date: Fri, 2 Aug 2024 12:58:28 +0530 Subject: [PATCH 13/22] refactor: jsdoc --- cryptlex/lexfloatclient/lexfloatclient.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cryptlex/lexfloatclient/lexfloatclient.py b/cryptlex/lexfloatclient/lexfloatclient.py index 8cc8c2c..4a817be 100644 --- a/cryptlex/lexfloatclient/lexfloatclient.py +++ b/cryptlex/lexfloatclient/lexfloatclient.py @@ -104,6 +104,7 @@ def SetFloatingClientMetadata(key, value): @staticmethod def GetFloatingClientLibraryVersion(): """Gets floating client library version. + Raises: LexFloatClientException From ae91277bce2df8ddf749997dc9c293ea3847dbaa Mon Sep 17 00:00:00 2001 From: muneebkq Date: Fri, 2 Aug 2024 13:46:38 +0530 Subject: [PATCH 14/22] refactor: jsdoc --- cryptlex/lexfloatclient/lexfloatclient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptlex/lexfloatclient/lexfloatclient.py b/cryptlex/lexfloatclient/lexfloatclient.py index 7a60bc8..32677f5 100644 --- a/cryptlex/lexfloatclient/lexfloatclient.py +++ b/cryptlex/lexfloatclient/lexfloatclient.py @@ -278,7 +278,7 @@ def GetFloatingClientMetadata(key): LexFloatClientException Returns: - str: value of metadata for the key + str: value of the floating client metadata """ cstring_key = LexFloatClientNative.get_ctype_string(key) buffer_size = 256 From 4c7b0f4b19cc9815ac17d3e3236f6eac953697ab Mon Sep 17 00:00:00 2001 From: muneebkq Date: Fri, 2 Aug 2024 13:47:27 +0530 Subject: [PATCH 15/22] refactor: remove extra line --- cryptlex/lexfloatclient/lexfloatclient_native.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cryptlex/lexfloatclient/lexfloatclient_native.py b/cryptlex/lexfloatclient/lexfloatclient_native.py index 5523197..53a025d 100644 --- a/cryptlex/lexfloatclient/lexfloatclient_native.py +++ b/cryptlex/lexfloatclient/lexfloatclient_native.py @@ -163,7 +163,6 @@ def byte_to_string(input): GetFloatingClientMetadata.argtypes = [CSTRTYPE, STRTYPE, c_uint32] GetFloatingClientMetadata.restype = c_int - RequestFloatingLicense = library.RequestFloatingLicense RequestFloatingLicense.argtypes = [] RequestFloatingLicense.restype = c_int From 096c864663fea4f43cf02a92755ab0eacd0c00ca Mon Sep 17 00:00:00 2001 From: muneebkq Date: Fri, 2 Aug 2024 14:19:00 +0530 Subject: [PATCH 16/22] refactor: arg format chnaged to snakecase --- cryptlex/lexfloatclient/lexfloatclient.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cryptlex/lexfloatclient/lexfloatclient.py b/cryptlex/lexfloatclient/lexfloatclient.py index 38c2a80..12233b1 100644 --- a/cryptlex/lexfloatclient/lexfloatclient.py +++ b/cryptlex/lexfloatclient/lexfloatclient.py @@ -21,8 +21,8 @@ def __init__(self, name, enabled, data): self.data = data class HostConfig(object): - def __init__(self, maxOfflineLeaseDuration): - self.maxOfflineLeaseDuration = maxOfflineLeaseDuration + def __init__(self, max_offline_lease_duration): + self.max_offline_lease_duration = max_offline_lease_duration class LexFloatClient: @@ -127,7 +127,7 @@ def GetFloatingClientLibraryVersion(): @staticmethod def GetHostConfig(): - """Gets the host configuration. + """This function sends a network request to LexFloatServer to get the configuration details. Raises: LexFloatClientException From 645282b9a13e81b479ab266a428520668643d825 Mon Sep 17 00:00:00 2001 From: muneebkq Date: Fri, 2 Aug 2024 14:25:09 +0530 Subject: [PATCH 17/22] refactor: jsdoc --- cryptlex/lexfloatclient/lexfloatclient.py | 2 +- examples/sample.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cryptlex/lexfloatclient/lexfloatclient.py b/cryptlex/lexfloatclient/lexfloatclient.py index 4a817be..64c7fba 100644 --- a/cryptlex/lexfloatclient/lexfloatclient.py +++ b/cryptlex/lexfloatclient/lexfloatclient.py @@ -103,7 +103,7 @@ def SetFloatingClientMetadata(key, value): @staticmethod def GetFloatingClientLibraryVersion(): - """Gets floating client library version. + """Gets the floating client library version. Raises: LexFloatClientException diff --git a/examples/sample.py b/examples/sample.py index d2c9a02..1b06773 100755 --- a/examples/sample.py +++ b/examples/sample.py @@ -18,13 +18,14 @@ def licence_callback_fn(status): def main(): try: # Set the product id - LexFloatClient.SetHostProductId("PASTE_PRODUCT_ID") + LexFloatClient.SetHostProductId("de5c962f-75b0-417d-a72a-5b474b8cb4bb") # Set the float server LexFloatClient.SetHostUrl("http://localhost:8090") # Set the license callback LexFloatClient.SetFloatingLicenseCallback(licence_callback_fn) # Request license lease LexFloatClient.RequestFloatingLicense() + print("honfig",LexFloatClient.GetHostConfig().max_offline_lease_duration ) print("Success! License acquired. Press enter to get the license metadata...") sys.stdin.read(1) # Request license metadata From 0cb96099ba2281f71f92cd9880f668f9677f70a6 Mon Sep 17 00:00:00 2001 From: muneebkq Date: Tue, 6 Aug 2024 10:52:23 +0530 Subject: [PATCH 18/22] add: error code 67 --- cryptlex/lexfloatclient/lexfloatclient_exception.py | 2 ++ cryptlex/lexfloatclient/lexfloatstatus_codes.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cryptlex/lexfloatclient/lexfloatclient_exception.py b/cryptlex/lexfloatclient/lexfloatclient_exception.py index f6207d4..4c15166 100644 --- a/cryptlex/lexfloatclient/lexfloatclient_exception.py +++ b/cryptlex/lexfloatclient/lexfloatclient_exception.py @@ -78,4 +78,6 @@ def get_error_message(code): return "Fingerprint couldn't be generated because Windows Management Instrumentation (WMI) service has been disabled. This error is specific to Windows only." if code == LexFloatStatusCodes.LF_E_MACHINE_FINGERPRINT: return 'Machine fingerprint has changed since activation.' + if code == LexFloatStatusCodes.LF_E_PROXY_NOT_TRUSTED: + return 'Request blocked due to untrusted proxy.' return 'Unknown error!' diff --git a/cryptlex/lexfloatclient/lexfloatstatus_codes.py b/cryptlex/lexfloatclient/lexfloatstatus_codes.py index f87384c..2418b0a 100644 --- a/cryptlex/lexfloatclient/lexfloatstatus_codes.py +++ b/cryptlex/lexfloatclient/lexfloatstatus_codes.py @@ -58,6 +58,8 @@ class LexFloatStatusCodes: LF_E_MACHINE_FINGERPRINT = 66 + LF_E_PROXY_NOT_TRUSTED = 67 + LF_E_CLIENT = 70 LF_E_SERVER = 71 From 60a6b139d9ba4a07d68d92a8c63d11119749c76c Mon Sep 17 00:00:00 2001 From: muneebkq Date: Tue, 6 Aug 2024 16:00:48 +0530 Subject: [PATCH 19/22] fix: buffer size ->4096 --- cryptlex/lexfloatclient/lexfloatclient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptlex/lexfloatclient/lexfloatclient.py b/cryptlex/lexfloatclient/lexfloatclient.py index 32677f5..292316d 100644 --- a/cryptlex/lexfloatclient/lexfloatclient.py +++ b/cryptlex/lexfloatclient/lexfloatclient.py @@ -281,7 +281,7 @@ def GetFloatingClientMetadata(key): str: value of the floating client metadata """ cstring_key = LexFloatClientNative.get_ctype_string(key) - buffer_size = 256 + buffer_size = 4096 buffer = LexFloatClientNative.get_ctype_string_buffer(buffer_size) status = LexFloatClientNative.GetFloatingClientMetadata( cstring_key, buffer, buffer_size) From 74bf813db7a6b9aeaa8c884c3f1dab982352566c Mon Sep 17 00:00:00 2001 From: muneebkq Date: Tue, 6 Aug 2024 17:10:53 +0530 Subject: [PATCH 20/22] refactor: jsdoc --- cryptlex/lexfloatclient/lexfloatclient.py | 2 +- .../lexfloatclient/lexfloatstatus_codes.py | 70 +++++++++---------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/cryptlex/lexfloatclient/lexfloatclient.py b/cryptlex/lexfloatclient/lexfloatclient.py index 5d6dd00..99a6873 100644 --- a/cryptlex/lexfloatclient/lexfloatclient.py +++ b/cryptlex/lexfloatclient/lexfloatclient.py @@ -270,7 +270,7 @@ def GetFloatingClientMeterAttributeUses(name): @staticmethod def RequestFloatingLicense(): """Sends the request to lease the license from the LexFloatServer. - + Raises: LexFloatClientException """ diff --git a/cryptlex/lexfloatclient/lexfloatstatus_codes.py b/cryptlex/lexfloatclient/lexfloatstatus_codes.py index c0cedb4..8385729 100644 --- a/cryptlex/lexfloatclient/lexfloatstatus_codes.py +++ b/cryptlex/lexfloatclient/lexfloatstatus_codes.py @@ -1,73 +1,73 @@ class LexFloatStatusCodes: - + LF_OK = 0 LF_FAIL = 1 - + LF_E_PRODUCT_ID = 40 - + LF_E_CALLBACK = 41 - + LF_E_HOST_URL = 42 - + LF_E_TIME = 43 - + LF_E_INET = 44 - + LF_E_NO_LICENSE = 45 - + LF_E_LICENSE_EXISTS = 46 - + LF_E_LICENSE_NOT_FOUND = 47 - + LF_E_LICENSE_EXPIRED_INET = 48 - + LF_E_LICENSE_LIMIT_REACHED = 49 - + LF_E_BUFFER_SIZE = 50 - + LF_E_METADATA_KEY_NOT_FOUND = 51 - + LF_E_METADATA_KEY_LENGTH = 52 - + LF_E_METADATA_VALUE_LENGTH = 53 - + LF_E_FLOATING_CLIENT_METADATA_LIMIT = 54 - + LF_E_METER_ATTRIBUTE_NOT_FOUND = 55 - + LF_E_METER_ATTRIBUTE_USES_LIMIT_REACHED = 56 - + LF_E_PRODUCT_VERSION_NOT_LINKED = 57 - + LF_E_FEATURE_FLAG_NOT_FOUND = 58 - + LF_E_SYSTEM_PERMISSION = 59 - + LF_E_IP = 60 - + LF_E_INVALID_PERMISSION_FLAG = 61 - + LF_E_OFFLINE_FLOATING_LICENSE_NOT_ALLOWED = 62 - + LF_E_MAX_OFFLINE_LEASE_DURATION_EXCEEDED = 63 - + LF_E_ALLOWED_OFFLINE_FLOATING_CLIENTS_LIMIT_REACHED = 64 - + LF_E_WMIC = 65 - + LF_E_MACHINE_FINGERPRINT = 66 - + LF_E_CLIENT = 70 - + LF_E_SERVER = 71 - + LF_E_SERVER_TIME_MODIFIED = 72 - + LF_E_SERVER_LICENSE_NOT_ACTIVATED = 73 - + LF_E_SERVER_LICENSE_EXPIRED = 74 - + LF_E_SERVER_LICENSE_SUSPENDED = 75 - + LF_E_SERVER_LICENSE_GRACE_PERIOD_OVER = 76 From 019af2bcf8af9f591984ecaef8d18e3b5f52edc4 Mon Sep 17 00:00:00 2001 From: muneebkq Date: Tue, 6 Aug 2024 17:14:49 +0530 Subject: [PATCH 21/22] refactor: jsdoc --- examples/sample.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/sample.py b/examples/sample.py index 1b06773..d2c9a02 100755 --- a/examples/sample.py +++ b/examples/sample.py @@ -18,14 +18,13 @@ def licence_callback_fn(status): def main(): try: # Set the product id - LexFloatClient.SetHostProductId("de5c962f-75b0-417d-a72a-5b474b8cb4bb") + LexFloatClient.SetHostProductId("PASTE_PRODUCT_ID") # Set the float server LexFloatClient.SetHostUrl("http://localhost:8090") # Set the license callback LexFloatClient.SetFloatingLicenseCallback(licence_callback_fn) # Request license lease LexFloatClient.RequestFloatingLicense() - print("honfig",LexFloatClient.GetHostConfig().max_offline_lease_duration ) print("Success! License acquired. Press enter to get the license metadata...") sys.stdin.read(1) # Request license metadata From 3d28f10a1e4e6be8b4c2293a5ab6a0fd93cfd5be Mon Sep 17 00:00:00 2001 From: muneebkq Date: Tue, 6 Aug 2024 17:15:52 +0530 Subject: [PATCH 22/22] refactor: jsdoc --- cryptlex/lexfloatclient/lexfloatclient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptlex/lexfloatclient/lexfloatclient.py b/cryptlex/lexfloatclient/lexfloatclient.py index 64c7fba..7c7f0b7 100644 --- a/cryptlex/lexfloatclient/lexfloatclient.py +++ b/cryptlex/lexfloatclient/lexfloatclient.py @@ -104,7 +104,7 @@ def SetFloatingClientMetadata(key, value): @staticmethod def GetFloatingClientLibraryVersion(): """Gets the floating client library version. - + Raises: LexFloatClientException