How to use the keyper.set_password function in keyper

To help you get started, we’ve selected a few keyper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / keyper / tests / test_passwords.py View on Github external
def test_password_write_read(self):
        """Test that passwords written to a keychain can be read back."""

        with keyper.TemporaryKeychain() as keychain:
            for index, password in enumerate(KeyperPasswordTests.SAMPLE_PASSWORDS):
                keyper.set_password(password, account=f"account_{index}", service=f"service_{index}", keychain=keychain)
                returned_password = keyper.get_password(account=f"account_{index}", service=f"service_{index}", keychain=keychain)
                self.assertEqual(password, returned_password)