mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-03 09:26:03 +00:00
fix(instances): the root password and SSH key a setting turns off are refused
Settings > "Show Root Password" and "Show SSH Keys" hid their forms on the Access tab, but an owner who may change the VM could still post to them and reset its root password or install a key. Both are now refused while their setting is off. A password longer than 4096 characters or with a NUL character, which passlib does not hash, ended in a 500; it is now refused with a message.
This commit is contained in:
parent
8e990e7d1a
commit
87f7100fc9
9 changed files with 306 additions and 253 deletions
|
|
@ -24,6 +24,7 @@ from django.test import Client, TestCase
|
|||
from django.urls import NoReverseMatch, URLPattern, URLResolver, get_resolver, resolve, reverse
|
||||
|
||||
from accounts.models import UserInstance, UserSSHKey
|
||||
from appsettings.models import AppSettings
|
||||
from computes.models import Compute
|
||||
from instances.models import Instance
|
||||
|
||||
|
|
@ -178,6 +179,8 @@ class AuthorizationMatrixTestCase(TestCase):
|
|||
uuid="22222222-3333-4444-5555-666666666666",
|
||||
)
|
||||
self.client = Client(raise_request_exception=True)
|
||||
# the Access forms on: a setting that turns them off refuses everyone (test_root_pass)
|
||||
AppSettings.objects.filter(key__startswith="SHOW_ACCESS_").update(value="True")
|
||||
|
||||
def _kwargs(self, params):
|
||||
kwargs = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue