def save_password(ident: str, details: Password, new_password: bool = False) -> None: password_store = PasswordStore() entries = password_store.load_for_modification() entries[ident] = details password_store.save(entries) _add_change(ident, change_type="new" if new_password else "edit")
def test_password_store_save(store: PasswordStore): entries = { "ding": Password({ "title": "Title", "comment": "Comment", "docu_url": "http://no/url", "password": "******", "owned_by": None, "shared_with": [], }) } store.save(entries) assert store.load_for_reading() == entries
def remove_password(ident: str): password_store = PasswordStore() entries = load_passwords_to_modify() _ = entries.pop(ident) password_store.save(entries) _add_change(ident, new_password=False)
def save_password(ident: str, details: Password, new_password=False): password_store = PasswordStore() entries = password_store.load_for_modification() entries[ident] = details password_store.save(entries) _add_change(ident, new_password=new_password)
def remove_password(ident: str): password_store = PasswordStore() entries = load_passwords_to_modify() _ = entries.pop(ident) password_store.save(entries) _add_change(ident, change_type="delete")
def save_password(ident: str, details: PASSWORD): password_store = PasswordStore() entries = password_store.load_for_modification() entries[ident] = details password_store.save(entries)