src/eric7/WebBrowser/WebAuth/Fido2Management.py

branch
eric7
changeset 10859
399d19fc7eb5
parent 10858
8a03d5f6146c
child 10863
88c6e062aa76
--- a/src/eric7/WebBrowser/WebAuth/Fido2Management.py	Mon Jul 22 16:54:49 2024 +0200
+++ b/src/eric7/WebBrowser/WebAuth/Fido2Management.py	Mon Jul 22 17:07:46 2024 +0200
@@ -169,9 +169,7 @@
         # PIN related data
         if self.__ctap2.info.options["clientPin"]:
             msg1 = (
-                self.tr(
-                    "PIN is disabled and must be changed before it can be used!"
-                )
+                self.tr("PIN is disabled and must be changed before it can be used!")
                 if self.__ctap2.info.force_pin_change
                 else ""
             )
@@ -869,18 +867,15 @@
         """
         Public method to check, if the 'forcePinChange' function is supported by the
         selected security key.
-        
+
         @return flag indicating support
         @rtype bool
         """
-        if (
+        return not (
             self.__ctap2 is None
             or self.__ctap2.info is None
             or not self.__ctap2.info.options.get("setMinPINLength")
-        ):
-            return False
-        else:
-            return True
+        )
 
     def forcePinChange(self, pin):
         """
@@ -900,7 +895,7 @@
         @return flag indicating availability
         @rtype bool
         """
-        if (
+        return not (
             self.__ctap2 is None
             or self.__ctap2.info is None
             or not self.__ctap2.info.options.get("setMinPINLength")
@@ -908,10 +903,7 @@
                 self.__ctap2.info.options.get("alwaysUv")
                 and not self.__ctap2.info.options.get("clientPin")
             )
-        ):
-            return False
-        else:
-            return True
+        )
 
     def setMinimumPinLength(self, pin, minLength):
         """
@@ -921,6 +913,7 @@
         @type str
         @param minLength minimum PIN length
         @type int
+        @exception Fido2PinError raised to indicate an issue with the PIN length
         """
         if minLength < 4 or minLength > 63:
             raise Fido2PinError(
@@ -944,19 +937,19 @@
         @return flag indicating availability
         @rtype bool
         """
-        if (
+        return not (
             self.__ctap2 is None
             or self.__ctap2.info is None
             or "alwaysUv" not in self.__ctap2.info.options
-        ):
-            return False
-        else:
-            return True
+        )
 
     def getAlwaysUv(self):
         """
         Public method to get the value of the 'alwaysUv' flag of the current security
         key.
+
+        @return return value of the 'alwaysUv' flag
+        @rtype bool
         """
         if self.__ctap2 is None:
             return False

eric ide

mercurial