platypush/plugins/otp/__init__.py
def refresh_secret(self, secret_path: Optional[str] = None) -> Response:
        """
        Refresh the secret token for key generation given a secret path.

        :param secret_path: Secret path to refresh (default: default configured path).
        """

        secret_path = secret_path or self.secret_path
        assert secret_path, 'No secret_path configured'

        os.makedirs(os.path.dirname(os.path.abspath(os.path.expanduser(secret_path))), exist_ok=True)
        secret = pyotp.random_base32()
        with open(secret_path, 'w') as f:
            f.writelines([secret])    # lgtm [py/clear-text-storage-sensitive-data]
        os.chmod(secret_path, 0o600)
        return secret

        Refresh the secret token for key generation given a secret path.

        :param secret_path: Secret path to refresh (default: default configured path).
        
Refresh the secret token for key generation given a secret path.
Refresh the secret token for key generation given a secret path .
def refresh_secret(self, secret_path: Optional[str] = None) -> Response:
        secret_path = secret_path or self.secret_path
        assert secret_path, 'No secret_path configured'
        os.makedirs(os.path.dirname(os.path.abspath(os.path.expanduser(secret_path))), exist_ok=True)
        secret = pyotp.random_base32()
        with open(secret_path, 'w') as f:
            f.writelines([secret])    
        os.chmod(secret_path, 0o600)
        return secret
def refresh_secret ( self , secret_path : Optional [ str ] = None ) -> Response : secret_path = secret_path or self . secret_path assert secret_path , 'No secret_path configured' os . makedirs ( os . path . dirname ( os . path . abspath ( os . path . expanduser ( secret_path ) ) ) , exist_ok = True ) secret = pyotp . random_base32 ( ) with open ( secret_path , 'w' ) as f : f . writelines ( [ secret ] ) os . chmod ( secret_path , 0o600 ) return secret
Refresh the secret token for key generation given a secret path.
Refresh the secret token for key generation given a secret path .
"""
        Refresh the secret token for key generation given a secret path.

        :param secret_path: Secret path to refresh (default: default configured path).
        """ # lgtm [py/clear-text-storage-sensitive-data]
self
secret_path
Optional[str]
Secret path to refresh (default: default configured path).
Secret path to refresh ( default : default configured path ) .