test client: update_secrets -> update_derived_secrets

It doesn't update the root password.
This commit is contained in:
Daniel Krol 2022-08-09 17:46:11 -04:00
parent 126f600cac
commit 58cefa4c1b
3 changed files with 7 additions and 7 deletions

View file

@ -30,7 +30,7 @@ Registered
Set up the other client. See that it got the same salt seed from the server in the process, which it needs to make sure we have the correct encryption key and login password.
```
>>> c2.update_secrets()
>>> c2.update_derived_secrets()
Generating keys...
Done generating keys
>>> c2.salt_seed
@ -276,7 +276,7 @@ Got auth token: 68a3db244e21709429e69e67352d02a3b26542c5ef2ac3377e19b17de71942d
Error 401
b'{"error":"Unauthorized: No match for email and/or password"}\n'
Failed to get the auth token. Do you need to update this client's password (set_local_password())?
Or, in the off-chance the user changed their password back and forth, try updating secrets (update_secrets()) to get the latest salt seed.
Or, in the off-chance the user changed their password back and forth, try updating secrets (update_derived_secrets()) to get the latest salt seed.
>>> c2.set_local_password("eggsandwich")
Generating keys...
Done generating keys

View file

@ -62,7 +62,7 @@ Set up the other client. See that it got the same salt seed from the server in t
""")
code_block("""
c2.update_secrets()
c2.update_derived_secrets()
c2.salt_seed
""")

View file

@ -339,9 +339,9 @@ class Client():
"""
# TODO - is UTF-8 appropriate for root_password? based on characters used etc.
self.root_password = root_password
self.update_secrets()
self.update_derived_secrets()
def update_secrets(self):
def update_derived_secrets(self):
"""
For clients other than the one that most recently registered or changed the
password, use this to get the salt seed from the server and generate keys
@ -404,9 +404,9 @@ class Client():
if not token:
# In a real client, this is where you may consider
# a) Offering to have the user change their password
# b) Try update_secrets() and get_auth_token() silently, for the unlikely case that the user changed their password back and forth
# b) Try update_derived_secrets() and get_auth_token() silently, for the unlikely case that the user changed their password back and forth
print ("Failed to get the auth token. Do you need to update this client's password (set_local_password())?")
print ("Or, in the off-chance the user changed their password back and forth, try updating secrets (update_secrets()) to get the latest salt seed.")
print ("Or, in the off-chance the user changed their password back and forth, try updating secrets (update_derived_secrets()) to get the latest salt seed.")
return
self.auth_token = token
print ("Got auth token: ", self.auth_token)