mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-10 04:06:47 +00:00
fix: the views that take a password or a key keep it out of error reports
No view used sensitive_post_parameters, so once ADMINS is set the error mail of a failing POST would carry the password or key in plain text. The user create, edit and password views, the password change, the compute forms, the host secrets, the VM's root password and its console settings now mark their POST data sensitive.
This commit is contained in:
parent
d3178154c3
commit
2cbcb8ab2c
6 changed files with 44 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ from django.shortcuts import get_object_or_404, redirect, render
|
|||
from django.urls import reverse
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.views.decorators.debug import sensitive_post_parameters
|
||||
from instances.models import Instance
|
||||
from instances.utils import read_list_rows
|
||||
from libvirt import libvirtError
|
||||
|
|
@ -145,6 +146,7 @@ def instances(request, compute_id):
|
|||
)
|
||||
|
||||
|
||||
@sensitive_post_parameters()
|
||||
@superuser_only
|
||||
def compute_create(request, FormClass):
|
||||
form = FormClass(request.POST or None)
|
||||
|
|
@ -157,6 +159,7 @@ def compute_create(request, FormClass):
|
|||
return render(request, "computes/form.html", {"form": form})
|
||||
|
||||
|
||||
@sensitive_post_parameters()
|
||||
@superuser_only
|
||||
def compute_update(request, compute_id):
|
||||
compute = get_object_or_404(Compute, pk=compute_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue