Ryan Petrello
af457ad8eb
clarify valid CredentialType field types
...
almost all of our current credential values are strings, but under the
v1 Credential model, `authorize` is boolean
additionally, if a field is specified with no type, fall back to
`string` as a default (this is almost always what people creating custom
types will want)
see: #6406
2017-06-01 13:23:51 -04:00
Ryan Petrello
fd4b86349c
fix a 500 error in /api/v1/credentials/ backwards compat
...
see: #6414
2017-06-01 11:26:18 -04:00
Ryan Petrello
e0a629db58
improve error formatting for jsonschema failures on Credential.inputs
...
this provides error messages keyed by input fields, so that instead of
e.g.,
{
'inputs': ['Invalid certificate or key: u'XYZ']
}
...you get:
{
'inputs': {
'ssh_key_data': ['Invalid certificate or key: u'XYZ']
}
}
Includes /api/v1/ compatability for error message format. Requests to
/api/v1/ will get:
{'ssh_key_data': ['Invalid certificate or key: u'XYZ']}
2017-06-01 09:48:42 -04:00
Ryan Petrello
98fa654be2
enforce dict for credential API input payloads
...
see: #6363
2017-06-01 09:19:21 -04:00
Ryan Petrello
462b2c6696
improve a few permission-related errors for CredentialType update/delete
...
see: #6385
2017-05-31 15:48:34 -04:00
Ryan Petrello
23a1c94d38
OpenStack CredentialType needs a domain input field
...
see: #6380
2017-05-31 13:44:38 -04:00
Ryan Petrello
2d0ae56d94
fix incorrect AWS Credential Type labels
...
see: #6372
2017-05-31 13:29:22 -04:00
Ryan Petrello
34b4270b1c
add more context for default extra_credentials to the JT launch endpoint
...
see: #6394
2017-05-31 13:22:46 -04:00
Ryan Petrello
5a34f3a1a4
remove a hook QE no longer uses for testing task execution
2017-05-18 15:59:36 -04:00
Ryan Petrello
1ba71acf07
fix a typo causing tests to fail
2017-05-12 15:34:23 -04:00
Ryan Petrello
b9007997eb
squash together a few credential-related migrations
2017-05-12 14:42:12 -04:00
Ryan Petrello
0ac4f71e5b
refactor and fix ssh_private_key and ssh_key_unlock validation
...
`clean_ssh_key_data` and `clean_ssh_key_unlock` no longer work because
they're not actual fields on `model.Credential` anymore. This change
refactors/moves their validation to a place that works (and makes more
sense).
2017-05-12 09:42:29 -04:00
Ryan Petrello
53c3ece32b
add prompting for JT.extra_credentials
...
see: #2913
2017-05-11 07:29:53 -04:00
Ryan Petrello
3126bfa1a2
add tooling to aid in remote debugging sessions
2017-05-09 15:36:13 -04:00
Ryan Petrello
9a6dc4d0ef
add a view for /api/v2/credential_types/N/activity_stream/
2017-05-09 15:01:04 -04:00
Ryan Petrello
f7660e1778
properly filter User.password from ActivityStream entries
...
see: #6160
2017-05-09 14:56:27 -04:00
Ryan Petrello
2feb7d5a69
add a new read-only view for /api/v2/credential_types/N/credentials/
2017-05-08 17:11:09 -04:00
Ryan Petrello
1568fddde1
Make CredentialType conditionally editable/readonly.
...
* CredentialTypes should not be editable *or* deletable if they're
"managed_by_tower".
* CredentialTypes should not be deletable if they're in use by one or
more Credentials.
* CredentialType.inputs should not be editable if they're in use by one
or more Credentials.
see: #6077
2017-05-08 16:13:26 -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
422a62fb34
fix broken credential type migration upgrade
2017-05-05 13:19:59 -04:00
Ryan Petrello
ef09744b75
enforce variable name syntax and uniqueness for Credential Types
...
see: #6158
2017-05-04 16:18:56 -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
4a438e044e
acceptance docs for [AUDIC] Arbitrary User-Defined Inventory & Credential
2017-05-03 14:09:46 -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
accf7cdea2
Replace Job/JT cloud/network credentials with a single M2M relation.
...
The following fields:
* (Job | JobTemplate).cloud_credential
* (Job | JobTemplate).network_credential
...are replaced by M2M relationships:
* Job.extra_credentials
* JobTemplate.extra_credentials
Includes support for task execution with multiple cloud credentials.
see: #5807
2017-05-03 13:36:59 -04:00
Ryan Petrello
61b3f7afb7
disallow ask_at_runtime fields for custom credential types
2017-05-02 10:45:43 -04:00
Ryan Petrello
a1fa9243bc
split machine CredentialType into two distinct (ssh and vault) kinds
2017-05-02 10:26:37 -04:00
Ryan Petrello
f6046d47c9
work around a change in ansible 2.3 to Task.get_name()
...
Properly detect setup tasks so that we can filter out sensitive
variables from the `ansible_facts` portion of the event payload.
2017-05-01 10:38:05 -04:00
Ryan Petrello
def2034883
add a new vault_credential relationship to Job/JobTemplate
...
additionally, properly assign vault credentials to Jobs and JobTemplates
as they're migrated to the new split model
see: #5807
see: #5878
2017-04-28 15:00:01 -04:00
Ryan Petrello
03460b311e
treat tower as a reserved field name for custom CredentialTypes
2017-04-28 11:26:18 -04:00
Ryan Petrello
66e004a9db
fix a few more migration-related issues for credentials
2017-04-26 09:24:33 -04:00
Ryan Petrello
c0add33212
properly migrate vault credentials to the new credentialtype model
2017-04-25 15:03:16 -04:00
Ryan Petrello
80df1523b0
refactor API v2 version detection and feature inclusion
2017-04-25 09:35:03 -04:00
Ryan Petrello
83dc4f6757
for /api/v1/ requests, filter out v2 (custom) credentials
...
see: #5877
2017-04-24 15:21:30 -04:00
Ryan Petrello
aff25c914e
blacklist special env vars from being used in CredentialType injectors
...
see: #5877
2017-04-24 15:03:50 -04:00
Ryan Petrello
a36a53fe40
implement CredentialType env, file, and extra_vars injectors
...
see: #5877
2017-04-24 15:03:33 -04:00
Ryan Petrello
97b2524156
migrate v1 credentials to the new v2 credentialtype + credential model
...
see: #5878
2017-04-24 13:00:13 -04:00
Ryan Petrello
3067435799
add additional test coverage for tasks.py credential usage
2017-04-21 15:42:27 -04:00
Ryan Petrello
7e64a6fd60
add "added_in_api_version" metadata to OPTIONS requests
2017-04-21 15:42:27 -04:00
Ryan Petrello
ba259e0ad4
Introduce a new CredentialTemplate model
...
Credentials now have a required CredentialType, which defines inputs
(i.e., username, password) and injectors (i.e., assign the username to
SOME_ENV_VARIABLE at job runtime)
This commit only implements the model changes necessary to support the
new inputs model, and includes code for the credential serializer that
allows backwards-compatible support for /api/v1/credentials/; tasks.py
still needs to be updated to actually respect CredentialType injectors.
This change *will* break the UI for credentials (because it needs to be
updated to use the new v2 endpoint).
see: #5877
see: #5876
see: #5805
2017-04-21 15:42:26 -04:00
Ryan Petrello
9f46b3c704
add tacacs_plus package as a dependency
2017-04-12 15:39:11 -04:00
Ryan Petrello
d1eb33bca0
Be more restrictive in catching LDAP exceptions.
...
django-auth-ldap can throw exceptions, like TypeError if it's
misconfigured. If we encounter an exception attempting to log into an
LDAP server, log it and move on (otherwise, an uncaught exception will
cause local login to fail, too).
see: #5933
2017-04-11 16:43:26 -04:00
Ryan Petrello
5623f16249
fix a bug in the v1/v2 API switch
2017-04-07 13:58:17 -04:00
Ryan Petrello
95ea370e5e
add API versioning for /api/v2/
2017-03-30 15:11:12 -04:00
Ryan Petrello
f9b5b9aa91
property filter no_log for item event loops
...
see: #5691
2017-03-22 11:15:33 -04:00
Ryan Petrello
a69dfced74
Merge remote-tracking branch 'origin/release_3.1.2' into devel
2017-03-21 10:39:16 -04:00
Ryan Petrello
ba0e9ab775
copy extra_vars when relaunching ad-hoc commands
...
see: #1744
2017-03-21 09:45:30 -04:00
Ryan Petrello
d0ae818685
show extra variables (if any) in the adhoc command results UI
...
see: #1744
2017-03-21 09:45:25 -04:00
Ryan Petrello
6a7743b274
fix a callback bug that causes a task_args leak between job events
...
see: #5802
2017-03-20 12:05:41 -04:00
Ryan Petrello
999a304c3b
add no_log filtering for runner_item_on_xyz events
...
see: #5691
2017-03-17 09:54:46 -04:00
Ryan Petrello
75ba0208ad
output logs to /logstash.conf in our default compose file
2017-03-16 13:20:33 -04:00
Ryan Petrello
98ad2684d3
when async log shipping fails, log an explanation
2017-03-15 17:23:44 -04:00
Ryan Petrello
b3733d233e
always use async http logging - even in celery workers
...
additionally, add a timeout to requests to avoid thread starvation
see: #5718
see: #5729
2017-03-15 13:17:01 -04:00
Ryan Petrello
ba9ce56c35
add callback plugin tests to CI
2017-03-14 14:07:56 -04:00
Ryan Petrello
66c786b971
simplify memcache patching in our callback plugin tests
2017-03-14 14:07:53 -04:00
Ryan Petrello
a5ea468bfe
add a test to ensure that job events properly strip out environment vars
...
see: #5601
2017-03-14 12:56:44 -04:00
Ryan Petrello
5bbb824865
add tests for no_log filtering
...
see: #5691
2017-03-14 12:56:44 -04:00
Ryan Petrello
1005782ee9
add tests for our custom ansible callback plugin
2017-03-14 12:56:40 -04:00
Ryan Petrello
6af9638d81
job event data marked with _ansible_no_log should be censored
...
see: #5691
2017-03-10 15:47:39 -05:00
Ryan Petrello
d4cd9d355f
add ui support for specifying extra vars for ad-hoc commands
...
see: #1744
2017-03-10 15:29:42 -05:00
Ryan Petrello
bad9670a0b
Merge remote-tracking branch 'origin/release_3.1.2' into devel
2017-03-10 10:57:03 -05:00
Ryan Petrello
f4d4c43d94
prohibit order_by= for sensitive fields
...
see: #5526
2017-03-10 08:49:59 -05:00
Ryan Petrello
9bc162cada
start a CHANGELOG
2017-03-09 16:29:40 -05:00
Ryan Petrello
8c1de7f109
add an API endpoint for testing external log aggregrator connectivity
...
see: #5164
2017-03-09 13:19:56 -05:00
Ryan Petrello
9a6913f184
don't toggle the dropdown when removing items from multiselect fields
...
see: #5466
2017-03-08 17:37:16 -05:00
Ryan Petrello
255d6afb49
fix a traceback if tower doesn't have LOG_AGGREGATOR_TOWER_UUID set
...
see: #5527
2017-03-07 16:48:51 -05:00
Ryan Petrello
ec52e18be8
allow is_system_auditor with AUTH_LDAP_USER_FLAGS_BY_GROUP
...
see: #4959
2017-03-07 16:48:51 -05:00
Ryan Petrello
ae321536cd
fix a regex that doesn't properly strip certain environment variables
...
see: #5601
2017-03-07 16:48:48 -05:00
Ryan Petrello
ed5a01c0cf
strip ansible_env from job event callback data
...
this often contains sensitive details, and the data is already filtered
and stored on the job itself
see: #5601
2017-03-07 16:48:48 -05: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
Ryan Petrello
45819f6b9a
requeue websocket messages that don't (yet) have an established user
...
There's a race between our `ws_connect` and `ws_receive` methods;
it's possible to fall into a scenario where we're handling a legitimate
message *before* django-channels is able to persist the `user_id` into
the channel session. This results in a scenario where a user can open
a browser tab and never receive new websocket messages. In this
scenario, we should just toss the message back into the queue and try
again later (up to a reasonable limit of retries).
2017-02-28 11:12:59 -05:00
Ryan Petrello
e8ecc4226b
use Unicode apostrophes - not single quotes - for French i18n strings
...
see: #5536
2017-02-27 12:23:07 -05:00
Ryan Petrello
30a3439aa9
pin appdirs==1.4.2
...
setuptools requires appdirs >= 1.4.0
https://github.com/pypa/setuptools/commit/ff371f18f0076bc63da05334f7e551c1cc29e10d#diff-2eeaed663bd0d25b7e608891384b7298
2017-02-27 12:06:35 -05:00
Ryan Petrello
5dfdef6e6b
retain the default interstitial value for TOWER_URL_BASE
...
to support #5470 , check for the presence of this special interstitial
value and replace it with the request hostname for settings OPTIONS
requests
2017-02-23 16:38:16 -05:00
Ryan Petrello
b7e48c437d
always refetch license config
...
see: #4931
2017-02-23 12:22:44 -05:00
Ryan Petrello
0c0f3b236f
allow idempotent save when editing an inventory script
...
see: #5094
2017-02-23 11:34:04 -05:00
Ryan Petrello
fc583ead21
allow AD_HOC_COMMANDS to be set to [] in the settings ui
...
see: #4975
2017-02-23 10:51:54 -05:00
Ryan Petrello
6b75ed3dcb
move a tall tooltip's placement on the credentials UI to avoid cutoff
...
when browser text size is increased, this tooltip gets cut off at the
top of the browser window
see: #4979
2017-02-23 09:48:52 -05:00
Ryan Petrello
94ad12ab0d
set the default in OPTIONS for TOWER_URL_BASE to the request hostname
...
see: #5470
2017-02-22 11:16:08 -05:00
Ryan Petrello
c8d943ccb1
mark ON/OFF i18n for certain toggle switches
2017-02-21 16:32:12 -05:00
Ryan Petrello
73a5a1e61e
mark i18n strings for denied API search parameters
2017-02-21 16:18:06 -05:00
Ryan Petrello
d24fb32358
blacklist certain sensitive fields and relations as search arguments
...
see: #5465
see: #5478
2017-02-21 16:18:02 -05:00
Ryan Petrello
8abf084211
disable the on/off toggle button for hosts from dynamic inventory.
...
see: #5420
2017-02-21 16:15:47 -05:00
Ryan Petrello
e36cd17c16
fix a minor bug in survey_spec password field handling
...
see: #5477
2017-02-20 16:50:07 -05:00
Ryan Petrello
46fdc123f4
more i18n string marking for host forms
...
see: #5476
2017-02-20 16:12:58 -05:00
Ryan Petrello
e13e817984
mark i18n strings for the inventory host form
...
see: #5453
2017-02-20 16:03:01 -05:00
Ryan Petrello
e4e599c891
mark i18n strings for the dashboard host list
...
see: #5453
2017-02-20 16:03:01 -05:00
Ryan Petrello
176a0aa84b
mark i18n strings for the dashboard host form
...
see: #5453
2017-02-20 16:02:55 -05:00
Ryan Petrello
d08fd82260
fix a visual bug for limited screen widths on the job view UI
...
see: #5431
2017-02-17 17:13:08 -05:00
Ryan Petrello
bda089e3f5
properly count hosts based on job event task state
...
the intention of the host summary view is that each host belongs in at
most *one* state - determined by the state of the tasks that ran on it.
this change examines each host for a job and determines its state based
on whether tasks passed, resulted in changes, were skipped, failed,
etc...
see: #5407
2017-02-17 11:36:52 -05:00
Ryan Petrello
689dd45c28
don't trim newlines from custom inventory scripts; they may be relevant
...
see: #5387
angular defaults ngTrim to `true` for <textarea>:
https://docs.angularjs.org/api/ng/directive/textarea
override this for the custom inventory script form
2017-02-15 16:26:08 -05:00
Ryan Petrello
4cbdeb0d30
don't allow private key passphrases for unencrypted private ssh keys
...
see: #5311
2017-02-15 12:27:27 -05:00
Ryan Petrello
28f3f178f0
only allow single selection for LOG_AGGREGATOR_TYPE
...
see: #5000
2017-02-14 17:06:44 -05:00
Ryan Petrello
045994a472
properly detect the backend name in failed social_auth callbacks
...
don't assume that the callback URL contains the correct social_auth
backend name; instead, store it temporarily in the session at
`/login/sso/`
see: #5324
2017-02-14 16:19:39 -05:00
Ryan Petrello
ee8c82df4a
fix a test that fails due to a race between async logging requests
2017-02-14 15:18:03 -05:00
Ryan Petrello
cae8950723
don't cache social-auth-core backends
...
social-auth-core uses a global variable to cache backend settings:
https://github.com/python-social-auth/social-core/blob/78da4eb201dd22fd2d8a4e38a1d17a73beabad24/social_core/backends/utils.py#L9
when loading backends, forcibly ignore this behavior to avoid
a thread-safety issue that causes #4788 #4045
2017-02-14 11:35:42 -05:00
Ryan Petrello
5a8a647cf0
default log aggregator username and password to an empty string
...
other configuration options seem to follow this pattern; the UI code
seems to expect that it can send across an empty string
see: #5276
2017-02-13 16:09:31 -05:00
Ryan Petrello
64a973ae02
work around a unicode handling bug in python-memcached that affects py2
...
see: https://github.com/linsomniac/python-memcached/issues/79
see: #5276
2017-02-13 16:09:31 -05:00
Ryan Petrello
2c7cb4a370
add utf-8 support to utils.common.encrypt_field/decrypt_field
2017-02-13 16:09:31 -05:00
Ryan Petrello
1ebb641c1e
work around a DRF issue that causes CharField to cast None to "None"
...
see: #5322
2017-02-13 12:43:13 -05:00