Merge pull request #3783 from AlanCoding/passwords_and_relaunching

Allow relaunching other user jobs with public vars

Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
softwarefactory-project-zuul[bot]
2019-05-03 12:03:26 +00:00
committed by GitHub
4 changed files with 44 additions and 10 deletions

View File

@@ -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