Commit Graph

51 Commits

Author SHA1 Message Date
Chris Meyers
aeba4a1a3f Revert "Change remote host finding logic"
This reverts commit 08f1507f70.
2026-02-17 14:46:45 -05:00
Chris Meyers
08f1507f70 Change remote host finding logic
* When the remote host header values contains a comma separated list,
  only consider the first entry. Previously we considered every item in
  the list.
2026-02-16 15:46:47 -05:00
Chris Meyers
8645fe5c57 Add support for x-trusted-proxy
* Increase the surface area of the set of headers that the proxy list
  feature looks at for the remote proxy IF x-trusted-proxy is valid.
2024-06-18 16:41:45 -04:00
Gabriel Muniz
cd5cc64d6a Fix 500 on missing inventory for provisioning callbacks (#13862)
* Fix 500 on missing inventory for provisioning callbacks

* Added test to cover bug fix

* Reworded msg to clear what is missing to start the callback
2023-04-19 09:27:41 -04:00
Ryan Petrello
c2ef0a6500 move code linting to a stricter pep8-esque auto-formatting tool, black 2021-03-23 09:39:58 -04:00
Ryan Petrello
4c60999161 remove custom_virtualenv support from the AWX collection and docs 2021-03-05 15:38:46 -05:00
Ryan Petrello
18607107a7 remove the deprecated extra_credentials endpoints 2020-04-30 10:22:02 -04:00
AlanCoding
7d0b207571 Organization on JT as read-only field
Set JT.organization with value from its project

Remove validation requiring JT.organization

Undo some of the additional org definitions in tests

Revert some tests no longer needed for feature

exclude workflow approvals from unified organization field

revert awxkit changes for providing organization

Roll back additional JT creation permission requirement

Fix up more issues by persisting organization field when project is removed

Restrict project org editing, logging, and testing

Grant removed inventory org admin permissions in migration

Add special validate_unique for job templates
  this deals with enforcing name-organization uniqueness

Add back in special message where config is unknown
  when receiving 403 on job relaunch

Fix logical and performance bugs with data migration

within JT.inventory.organization make-permission-explicit migration

remove nested loops so we do .iterator() on JT queryset

in reverse migration, carefully remove execute role on JT
  held by org admins of inventory organization,
  as well as the execute_role holders

Use current state of Role model in logic, with 1 notable exception
  that is used to filter on ancestors
  the ancestor and descentent relationship in the migration model
    is not reliable
  output of this is saved as an integer list to avoid future
    compatibility errors

make the parents rebuilding logic skip over irrelevant models
  this is the largest performance gain for small resource numbers
2020-03-12 15:45:46 -04:00
AlanCoding
daa9282790 Initial (editable) pass of adding JT.organization
This is the old version of this feature from 2019
  this allows setting the organization in the data sent
  to the API when creating a JT, and exposes the field
  in the UI as well

Subsequent commit changes the field from editable
  to read-only, but as of this commit, the machinery
  is not hooked up to infer it from project
2020-03-12 15:45:46 -04:00
Jake McDermott
0d98a1980e Add a configurable limit for job forks 2020-01-15 13:51:59 -05:00
Ryan Petrello
4e6b0e1580 clean up old v2 versioning in API tests 2019-08-22 15:14:06 -04:00
AlanCoding
6baba10abe Add scm_revision to project updates and cleanup
Add validation around prompted scm_branch requiring
  project allow_override field to be true

Updated related process isolation docs

Fix invalid comarision in serializer

from PR review, clarify pre-check logging, minor docs additions
2019-08-12 11:01:10 -04:00
Ryan Petrello
6da445f7c0 remove /api/v1 and deprecated credential fields 2019-06-06 12:23:00 -04:00
AlanCoding
eb58a6cc0e add test for launching with deleted inventory 2018-11-19 12:51:26 -05:00
Ryan Petrello
b99f211c7e add some additional validation to JT.credentials
see: https://github.com/ansible/tower/issues/2612
2018-07-30 14:08:27 -04:00
AlanCoding
fd468ac766 raise 400 instead of ignoring if fields mismatch v1/v2 2018-07-16 09:36:43 -04:00
Ryan Petrello
5b55e3cb2b fix a bug that prevented JT admins from editing custom virtualenvs
see: https://github.com/ansible/tower/issues/1754
2018-05-14 14:12:22 -04:00
AlanCoding
c1f1921995 add test for JT credential summary_fields 2018-04-09 09:56:43 -04:00
AlanCoding
482c159ac6 prohibit config callback with no inventory 2018-04-03 10:56:35 -04:00
Ryan Petrello
8955e6bc1c normalize custom_virtualenv empty values to null
see: https://github.com/ansible/ansible-tower/issues/7923
2018-03-05 17:05:10 -05:00
Ryan Petrello
1e8c89f536 implement support for per-playbook/project/org virtualenvs
see: https://github.com/ansible/awx/issues/34
2018-01-09 22:47:01 -05:00
AlanCoding
9fe524cd20 adjust assertions about JT credentials to be correct 2017-11-21 10:03:57 -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
Chris Meyers
802f722e95 do not accept array as extra_vars
related to #5645

* Since we pass extra_vars to ansible as -e; we require that the top
most data-structure be a key-value. NOT an array.
2017-07-19 17:07:50 -04:00
Chris Meyers
318b1aebd1 remove special scan job logic 2017-07-05 10:32:45 -04:00
Ryan Petrello
97562fc4df block job template launches when an inventory is being deleted
see: #4382
2017-06-22 15:33:55 -04:00
Ryan Petrello
d4afa41acb key prompting of all credentials off of ask_credential_on_launch
see: #6371
2017-06-12 12:26:58 -04:00
AlanCoding
c6a3a7cc34 JT RBAC edits for extra_credentials and vault_credential 2017-05-12 17:13:58 -04:00
Ryan Petrello
53c3ece32b add prompting for JT.extra_credentials
see: #2913
2017-05-11 07:29:53 -04:00
Ryan Petrello
b7b9fb531e properly support (cloud|network)_credential for JT update *and* create
fix a bug which caused `POST /api/v1/job_templates/` to not properly set
`JobTemplate.extra_credentials`.

see: #5807
2017-05-08 13:50:28 -04:00
Ryan Petrello
f3591b81a7 more multicredential JobTemplate changes
* allow for filtering Jobs and JobTemplates by v1 `cloud_credential` and
 `network_credential` fields
* properly validate uniqueness of `extra_credentials` types

see: #5807
2017-05-04 16:18:48 -04:00
Ryan Petrello
d0a848d49a Add a new extra_credentials endpoint for Jobs and JobTemplates
additionally, add backwards compatible support for `cloud_credential`
and `network_credential` in /api/v1/job_templates/ and /api/v1/jobs/.

see: #5807
2017-05-03 13:38:10 -04:00
Ryan Petrello
95ea370e5e add API versioning for /api/v2/ 2017-03-30 15:11:12 -04:00
Ryan Petrello
d97ff57cda prohibit API payloads that represent something other than a JSON object
The JSON serializer for our API uses ``json.loads``, which permits *any*
valid JSON (including bare integers, boolean values, etc).  Lots of our
code, however, assumes that inbound JSON content will be a dict.

see: #4756
2017-02-28 13:23:03 -05:00
AlanCoding
f07cd69012 corresponding test for dict extra_vars bug 2017-01-06 10:09:01 -05:00
Aaron Tan
9e4655419e Fix flake8 E302 errors. 2016-11-15 20:59:39 -05:00
AlanCoding
7da6d2978a remove test imports 2016-10-24 21:30:03 -04:00
AlanCoding
3b4b1412fc fix tests for project playbook mocking 2016-10-24 21:04:01 -04:00
AlanCoding
9da00c2d38 RBAC copy/edit displays test refactor 2016-09-07 17:08:07 -04:00
AlanCoding
6559118f40 tests for saving survey passwords to job 2016-08-08 13:06:07 -04:00
AlanCoding
0271aa611c add field to JT for asking to skip tags 2016-08-01 16:49:34 -04:00
Matthew Jones
df1c1ae473 Fix up flake8 2016-07-15 12:50:59 -04:00
Matthew Jones
eb97b8c916 Switch disallowed object delete to 409
In the case of running job conflicts
2016-07-15 11:47:02 -04:00
AlanCoding
7b0f20e90d job template serializer can_add calc to avoid lookups of known related objects 2016-06-28 10:18:30 -04:00
Wayne Witzel III
112d271ccb combining job_template api tests 2016-06-07 10:13:51 -04:00
Matthew Jones
b0de8038d0 Fix validation issues for scan job templates
Also adding some jobtemplate serializer-based validation unit tests
2016-06-06 12:01:56 -04:00
AlanCoding
74beca5b74 cleanup of Job Template tests and fixtures 2016-05-31 16:03:03 -04:00
AlanCoding
1a4c92f027 make some JT tests unit tests and update others 2016-05-31 14:34:51 -04:00
AlanCoding
07cc99b4c7 start updating tests to JT factory 2016-05-31 14:34:51 -04:00
AlanCoding
cfd9d5d4f1 Refactor of JT related field checking 2016-05-31 14:34:51 -04:00