Fix various small bugs
This commit is contained in:
@ -43,7 +43,10 @@ class PasswordContext:
|
||||
)
|
||||
if entry and overwrite:
|
||||
entry.password = secret
|
||||
elif entry:
|
||||
self.keepass.save()
|
||||
return
|
||||
|
||||
if entry:
|
||||
raise ValueError("Error: A secret with this name already exists.")
|
||||
LOG.debug("Add secret entry to keepass: %s", entry_name)
|
||||
entry = self.keepass.add_entry(
|
||||
|
||||
@ -85,7 +85,7 @@ class SecretUpdate(BaseModel):
|
||||
"""
|
||||
if isinstance(self.value, str):
|
||||
return self.value
|
||||
secret = secrets.token_urlsafe(self.value.length)
|
||||
secret = secrets.token_urlsafe(32)[:self.value.length]
|
||||
return secret
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user