libkeepass / pykeepass

Python library to interact with keepass databases (supports KDBX3 and KDBX4)
https://pypi.org/project/pykeepass/
GNU General Public License v3.0
411 stars 96 forks source link

add_entry(): Make otp= protected #342

Closed rfinnie closed 1 year ago

rfinnie commented 1 year ago

When doing:

kp.add_entry(kp.root_group, "title", "username", "password", otp="otpauth://")

The OTP will not be marked as protected, while this will be:

entry = kp.add_entry(kp.root_group, "title", "username", "password")
entry.otp = "otpauth://"

This PR fixes add_entry() otp to be protected, in line with the property (and other clients).

(I did look into writing a unit test, but it looks like there's no way to know if the core properties are protected. is_custom_property_protected("otp") will not work.)