Commit Graph

42 Commits

Author SHA1 Message Date
Ryan Petrello
f223df303f convert py2 -> py3 2019-01-15 14:09:01 -05:00
AlanCoding
f09b8efa87 tests and optimizations for UJT list with non-joblet recent_jobs 2018-12-04 16:16:05 -05:00
AlanCoding
b763c51f8a add type to recent_jobs 2018-11-30 15:16:09 -05:00
Yunfan Zhang
cb6d7dfe69 Fix credential leak when copying Job Templates.
Signed-off-by: Yunfan Zhang <yz322@duke.edu>
2018-07-25 11:51:17 -04:00
AlanCoding
8ae979908c Enforce unified list field consistency
Discovered via bug: controller_node field present in
project update list but not in detail view

Added tests to assert that "unified" list serializer
produces same fields as the ordinary serializer,
for unified jobs & unified JTs

Added test to check that list serializers do differ
from detail serializer except for allowed differences

Added test to check that list serializers are applied
correctly - only on list views, and that detail views,
likewise, do not use list serializers

Fix the many many bugs discovered by these new
testing mechanisms
2018-06-29 14:03:52 -04:00
Yunfan Zhang
9fec43c643 Disallow posting dictionary as credentials to JT launch API endpoint. 2018-06-20 13:05:47 -04:00
Jake McDermott
92ae09e163 add host_status_counts and playbook_counts to project update details 2018-06-08 22:27:41 -04:00
Jake McDermott
f8f59c8c8c add host_status, play, and task counts to job details 2018-06-06 18:02:31 -04:00
Alan Rominger
2e1a2f0a95 Merge pull request #1184 from AlanCoding/validate_scope
Validate token scope
2018-04-02 09:36:12 -04:00
AlanCoding
a4721dc9e7 validate token scope 2018-03-29 15:43:25 -04:00
AlanCoding
9244989a14 test for all models in ActivityStreamSerializer 2018-03-29 14:57:26 -04:00
AlanCoding
4f1f578fde make user_capabilities False for read tokens 2018-03-21 13:14:14 -04:00
AlanCoding
58a94be428 Omit placeholder vars with survey password defaults
WFJT nodes & schedules (launch configs) will accept POST/PATCH/PUT
with variables in extra_data that have $encrypted$ for their value
if a valid survey default exists.

In this case, the variable is simply removed from the extra_data.
This is done so that it does not affect pre-existing value
substitution for $encrypted$ values from the config itself
2018-02-13 09:07:59 -05:00
cclauss
e1a8b69736 from six.moves import xrange for Python 3 2018-02-08 22:41:33 +01:00
AlanCoding
c8e10adc96 fix bug saving extra_data and follow prompts rules
display_extra_vars was not taking a copy of the data before
acting on it - this causes a bug where the activity stream will
modify the existing object on the model. That leads to new data
not being accepted.

Also moved the processing of extra_data to prior to the accept
or ignore kwargs logic so that we pass the right (post-encryption)
form of the variables.
2017-12-18 10:50:22 -05:00
AlanCoding
74bf058d62 encrypt password answers on config save 2017-12-15 07:48:55 -05:00
AlanCoding
659d31324d hide survey passwords in saved launch configs 2017-12-12 09:35:46 -05:00
AlanCoding
72a8854c27 Make ask_mapping a simple class property
from PR feedback of saved launchtime configurations
2017-12-08 13:45:23 -05:00
AlanCoding
34a8e0a9b6 Feature: saved launchtime configurations
Consolidate prompts accept/reject logic in unified models
Break out accept/reject logic for variables
Surface new promptable fields on WFJT nodes, schedules

Make schedules and workflows accurately reject variables
  that are not allowed by the prompting
  rules or the survey rules on the template

Validate against unallowed extra_data in system job schedules
Prevent schedule or WFJT node POST/PATCH with unprompted data
Move system job days validation to new mechanism
Add new psuedo-field for WFJT node credential
Add validation for node related credentials
Add related config model to unified job
Use JobLaunchConfig model for launch RBAC check

Support credential overwrite behavior with multi-creds
  change modern manual launch to use merge behavior
Refactor JobLaunchSerializer, self.instance=None
Modularize job launch view to create "modern" data
Auto-create config object with every job
Add create schedule endpoint for jobs
2017-12-08 13:38:54 -05:00
Ryan Petrello
28ce9b700e replace all Job/JT relations with a single M2M credentials relation
Includes backwards compatibility for now-deprecated .credential,
.vault_credential, and .extra_credentials

This is a building block for multi-vault implementation and Alan's saved
launch configurations (both coming soon)

see: https://github.com/ansible/awx/issues/352
see: https://github.com/ansible/awx/issues/169
2017-11-14 12:49:12 -05:00
Wayne Witzel III
96904968d8 Fix migration issues, tests, and templates 2017-11-09 17:29:48 -05:00
Ryan Petrello
7192d5c4bb include extra_credentials data in summary fields for JT/Job detail view
see: https://github.com/ansible/ansible-tower/issues/7521
2017-08-30 11:56:24 -04:00
Aaron Tan
636147f7f0 Stablize summary field display for host serializer. 2017-07-13 16:30:47 -04:00
Aaron Tan
f25391fe86 Implement named URL feature. 2017-05-31 12:09:54 -04:00
Jake McDermott
be56912dc3 unit test inventory source serializer get_related (#6214) 2017-05-09 12:07:39 -04:00
Ryan Petrello
95ea370e5e add API versioning for /api/v2/ 2017-03-30 15:11:12 -04:00
AlanCoding
c9f424ea74 unit test update for use pattern change 2017-02-06 09:50:48 -05:00
Matthew Jones
bfda6ff8b5 Fix up some unit tests 2017-01-26 16:01:54 -05:00
AlanCoding
a93ad270f2 update workflow serializer fixture to use serializer instance 2017-01-13 14:44:58 -05:00
Aaron Tan
7af675b031 Merge pull request #4111 from jangsutsr/4086_provide_linkage_from_spawned_job_to_wfj
Provide linkage from spawned job to wfj
2016-12-01 21:59:47 -05:00
Aaron Tan
88bf975368 Pytest fixture adjustment. 2016-11-29 12:58:04 -05:00
Aaron Tan
a458bb3c89 Remove source_workflow_job and use workflow_job_id instead. 2016-11-29 11:55:04 -05:00
Aaron Tan
3e8e9480d1 Pytest fixture adjustment. 2016-11-25 22:28:52 -05:00
AlanCoding
dc3e744dda change unit tests to work with JobTemplateMixin serializer 2016-11-23 16:06:23 -05:00
Matthew Jones
ccd284526d Fix serializer related unit tests 2016-11-21 23:11:12 -05:00
Chris Meyers
ef0df1fefd more j -> workflow_job renaming 2016-11-17 10:51:06 -05:00
Aaron Tan
2d1a5425d1 Fix flake8 E302 errors second round. 2016-11-16 09:56:07 -05:00
Aaron Tan
9e4655419e Fix flake8 E302 errors. 2016-11-15 20:59:39 -05:00
AlanCoding
1ca9426270 Remove in-place operation on User in unit test 2016-11-15 08:06:40 -05:00
AlanCoding
78fc6df59d fix up the PATCH scenario with the char_prompts in WFJT node 2016-09-28 15:02:05 -04:00
AlanCoding
7ff5c40564 Merge branch 'devel' of https://github.com/ansible/ansible-tower into can_CRUD 2016-09-15 17:19:38 -04:00
Chris Meyers
32461574ae add unit tests 2016-09-13 15:24:20 -04:00