- users.yaml is now versioned, and a backup is made on version change. Thus, before any of the new hashes are being saved to it, a backup with the old ones will be made, here users.v1.yaml. - The no longer needed salt is removed from the config if no legacy hashes are left in users.yaml. Prior to this removal however, a backup of config.yaml is made, config.cleanup_legacy_hashes.yaml. When rolling back to an earlier version of OctoPrint, moving both backups back over to config.yaml and users.yaml respectively and restarting will restore the ability to login again.
24 lines
609 B
Python
24 lines
609 B
Python
"""
|
|
Unit tests for octoprint.access.users.UserManager
|
|
"""
|
|
|
|
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
|
|
__copyright__ = "Copyright (C) 2017 The OctoPrint Project - Released under terms of the AGPLv3 License"
|
|
|
|
import unittest
|
|
|
|
import ddt
|
|
|
|
import octoprint.access.users
|
|
|
|
|
|
@ddt.ddt
|
|
class UserManagerTest(unittest.TestCase):
|
|
def test_createPasswordHash_nonascii(self):
|
|
"""Test for issue #1891"""
|
|
|
|
password = "password with ümläutß"
|
|
|
|
# should not throw an exception
|
|
octoprint.access.users.UserManager.create_password_hash(password)
|