Commit Graph

174 Commits

Author SHA1 Message Date
Ryan Petrello
0c6be1f4d7 Merge branch 'downstream' into devel 2020-08-05 14:48:36 -04:00
Ryan Petrello
860183f178 update the named URL code to properly return 404 vs 403 2020-07-22 12:15:34 -04:00
Ryan Petrello
78229f5871 replace certain terms with more inclusive language
see: https://www.redhat.com/en/blog/making-open-source-more-inclusive-eradicating-problematic-language
2020-06-30 10:49:19 -04:00
Rebeccah
118e1b8df1 removing memchache mentions in comments
remove memcached folder as it is no longer needed, also address a couple grammatical errors
2020-06-18 15:52:59 -04:00
Ryan Petrello
edd9972435 include the AWX version as a header in all responses 2020-04-22 12:07:31 -04:00
Ryan Petrello
1caa2e0287 work around a limitation in postgres notify to properly support copying
postgres has a limitation on its notify message size (8k), and the
messages we generate for deep copying functionality easily go over this
limit; instead of passing a giant nested data structure across the
message bus, this change makes it so that we temporarily store the JSON
structure in memcached, and look it up from *within* the task

see: https://github.com/ansible/tower/issues/4162
2020-03-18 16:10:20 -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
Alan Rominger
768280c9ba [last PR stuff] + Add warning if configs specified in 2 params (#5)
* Lean on API validation for tower_inventory_source arg errors

used for
 - validating needed credential is given
 - missing source_project for scm sources

* Add warning when config is specified in 2 places

Fix up unit tests, address multiple comments re: backwards compatibility, redundant methods, etc.

Update new_name and variables parameters, update unit tests
2020-02-26 09:26:55 -05:00
Seth Foster
58e84a40e5 Fix 500 error when creating a job schedule
- 500 error occurs when a non-admin user attempts to add an invalid
  credential during schedule creation
- This change checks that the user can add the object to
  serializer.validated_data, instead of serializer.initial_data
- The invalid credential field is purged in .validated_data, so the
  request passes through cleanly
- Fix for awx issue #4147
2019-10-23 14:22:07 -04:00
Ryan Petrello
f86d647571 Merge branch 'hardening' into devel 2019-10-21 12:09:27 -04:00
Bill Nottingham
a664c5eabe Log the remote IP for logged in users 2019-10-18 14:28:10 -04:00
Ryan Petrello
c8a29bac66 warn about endpoint deprecation in the CLI 2019-10-16 15:26:59 -04:00
beeankha
5aa6a94710 Enable approval notifications to show up at...
...workflow jobs notifications endpoint
2019-09-27 15:48:00 -04:00
Ryan Petrello
7814592285 when copying workflows w/ pause nodes, copy the WorkflowApprovalTemplate 2019-08-27 15:36:26 -04:00
Jeff Bradberry
bcbb768dd3 Remove the use of the deprecated Field.rel attribute
Also, rename a number of variables named `rel` for ease of searching.
2019-07-12 15:11:21 -04:00
Jeff Bradberry
aa548442ce Ensure the request is on the Metadata object
in order to correctly populate the default for the TOWER_URL_BASE
field, which is specific to the host and preferred scheme.
2019-06-12 14:12:59 -04:00
Jeff Bradberry
ab587e7e6c Update get_view_description to conform to changes in DRF's version
related encode/django-rest-framework#5605
2019-06-12 14:12:59 -04:00
Jeff Bradberry
f94959d120 Remove the custom get_view_name function
It appeared to not be doing anything that we were making use of that
couldn't already be done, slightly differently, using DRF's built-in
one.
2019-06-12 14:12:59 -04:00
Ryan Petrello
6da445f7c0 remove /api/v1 and deprecated credential fields 2019-06-06 12:23:00 -04:00
AlanCoding
f4c18843a3 Resolve default ordering warnings from tests 2019-05-20 10:58:36 -04:00
Vismay Golwala
0154d80f19 Raise meaningful error when permission denied to copy JT
When a user doesn't have access to all the credentials of a job
template, they cannot copy the JT. However, currently we raise a
default `PermissionDenied`, which doesn't give the user insight
into what's wrong. So, this PR just adds a custom message indicating
that access to credentials is missing.

Signed-off-by: Vismay Golwala <vgolwala@redhat.com>
2019-05-06 15:02:36 -04:00
Vismay Golwala
cc001c9892 Copy credential bug - add owner too
While copying a credentials, we should set the new owner to person
who copies it. There was a bug while trying to do so and this PR
tries to address it.

Link: #3750

Signed-off-by: Vismay Golwala <vgolwala@redhat.com>
2019-05-01 13:15:16 -04:00
Bill Nottingham
1b3ae50076 Add originating address for the failed login message 2019-03-20 11:34:35 -04:00
Hideki Saito
ef3b1ee195 Add action to output login failure to logger
Signed-off-by: Hideki Saito <saito@fgrep.org>
2019-02-20 14:27:44 +00:00
Ryan Petrello
9bebf3217e remove usage of import * and enforce F405 in our linter
import * is a scourge upon the earth
2019-02-13 17:10:33 -05:00
Ryan Petrello
daeeaf413a clean up unnecessary usage of the six library (awx only supports py3) 2019-01-25 00:19:48 -05:00
Jake McDermott
a8728670e1 handle credential.inputs in decryption utils 2019-01-22 22:56:24 -05:00
Ryan Petrello
8cb8e63db5 fix a py3 bug that breaks the SSO complete endpoint 2019-01-21 17:04:13 -05:00
Ryan Petrello
f223df303f convert py2 -> py3 2019-01-15 14:09:01 -05:00
adamscmRH
05d988349c make current_user ck secure and httponly 2018-11-21 10:36:35 -05:00
AlanCoding
a9d88f728d Pre-delete bulk delete related, fix parallel request conflicts 2018-11-15 11:39:48 -05:00
Wayne Witzel III
198a0db808 move organization views to their own file 2018-11-07 18:18:41 -05:00
Ryan Petrello
3b997cdd3a remove extraneous OPTIONS content re: the new named URL feature 2018-08-15 10:22:42 -04:00
Ryan Petrello
ec735b7b47 check oauth_scopes in _every_ view
see: https://github.com/ansible/tower/issues/2759
2018-08-06 11:05:59 -04: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
adamscmRH
896ffb2065 Fixes sessions in multiple tabs 2018-07-13 16:31:23 -04:00
Ryan Petrello
090c585be5 remove unnecessary spaces 2018-07-11 09:50:50 -04:00
Ryan Petrello
2916edd70f Add a Location header to HTTP 201 for POST to copy endpoints 2018-07-09 08:47:01 -04:00
adamscmRH
ae0793f374 Hookup UI session expiration 2018-07-03 16:53:27 -04:00
Yunfan Zhang
b4890ee331 Handle exception with invalid HTTP content_type.
Signed-off-by: Yunfan Zhang <yz322@duke.edu>
2018-07-03 13:55:18 -04:00
Ryan Petrello
b8ed78ee9d Never send WWW-Authenticate: Basic... headers for the API 2018-06-28 13:00:23 -04:00
Ryan Petrello
3b0f7de3e6 Properly return HTTP 403 when CSRF fails (not HTTP 500) 2018-06-28 09:33:59 -04:00
Ryan Petrello
7880f83d97 don't send WWW-Authenticate: Basic for AJAX, and properly detect 401 2018-06-26 08:40:21 -04:00
adamscmRH
b7f5161835 try-except auth_header 2018-06-21 17:11:34 -04:00
Alan Rominger
bcd9c5dada Merge pull request #2098 from AlanCoding/u_no_copy
Prohibit users without read_role from viewing copy endpoint
2018-06-08 08:54:32 -04:00
AlanCoding
ed762fd4b6 prohibit users without read_role from viewing copy endpoint 2018-06-07 15:14:49 -04:00
AlanCoding
8509a43b95 exclude m2m copies from activity stream 2018-06-07 13:34:58 -04:00
AlanCoding
c690da4058 make copy endpoints specific to v2 2018-05-30 14:01:58 -04:00
Ryan Petrello
a0433773d8 don't allow Accept:application/json on /api/login/
see: https://github.com/ansible/tower/issues/1672
2018-05-25 14:21:22 -04:00
AlanCoding
ec1e94376c correctly check credential permission on WFJT copy 2018-05-03 07:42:59 -04:00