mirror of
https://github.com/ansible/awx.git
synced 2026-02-21 13:10:11 -03:30
allow relaunching other user jobs with public vars
This commit is contained in:
@@ -11,6 +11,7 @@ from awx.main.access import (
|
||||
JobTemplateAccess,
|
||||
WorkflowJobTemplateAccess,
|
||||
SystemJobTemplateAccess,
|
||||
vars_are_encrypted
|
||||
)
|
||||
|
||||
from awx.main.models import (
|
||||
@@ -114,6 +115,20 @@ class TestRelatedFieldAccess:
|
||||
'related', mocker.MagicMock, data, obj=resource, mandatory=True)
|
||||
|
||||
|
||||
def test_encrypted_vars_detection():
|
||||
assert vars_are_encrypted({
|
||||
'aaa': {'b': 'c'},
|
||||
'alist': [],
|
||||
'test_var_eight': '$encrypted$UTF8$AESCBC$Z0FBQUF...==',
|
||||
'test_var_five': 'four',
|
||||
})
|
||||
assert not vars_are_encrypted({
|
||||
'aaa': {'b': 'c'},
|
||||
'alist': [],
|
||||
'test_var_five': 'four',
|
||||
})
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def job_template_with_ids(job_template_factory):
|
||||
# Create non-persisted objects with IDs to send to job_template_factory
|
||||
|
||||
Reference in New Issue
Block a user