mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-11 04:36:48 +00:00
fix(virtsecrets): a secret's value never reaches the page
The edit dialog of a secret was filled with its current value, so every readable secret's value was in the secrets page's HTML. A private secret, or one with no value yet, cannot be read: its field held the text "None", which is valid base64, and saving the dialog unchanged set the secret to the three bytes it decodes to. The dialog now only writes a new value: the field starts empty, is a password field and is required. The page no longer reads secret values, and get_secret_value, used only for that, is gone.
This commit is contained in:
parent
ce7c772aae
commit
4ece22230e
5 changed files with 35 additions and 16 deletions
|
|
@ -42,16 +42,11 @@ def secrets(request, compute_id):
|
|||
|
||||
for uuid in secrets:
|
||||
secrt = conn.get_secret(uuid)
|
||||
try:
|
||||
secrt_value = conn.get_secret_value(uuid)
|
||||
except libvirtError:
|
||||
secrt_value = None
|
||||
secrets_all.append(
|
||||
{
|
||||
"usage": secrt.usageID(),
|
||||
"uuid": secrt.UUIDString(),
|
||||
"usageType": secret_usage_types[secrt.usageType()],
|
||||
"value": secrt_value,
|
||||
}
|
||||
)
|
||||
if request.method == "POST":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue