mirror of
https://github.com/ansible/awx.git
synced 2026-04-28 05:05:25 -02:30
Add support for encrypting settings that are passwords.
This commit is contained in:
@@ -45,6 +45,8 @@ class SettingFieldMixin(object):
|
||||
"""Mixin to use a registered setting field class for API display/validation."""
|
||||
|
||||
def to_representation(self, obj):
|
||||
if getattr(self, 'encrypted', False) and isinstance(obj, basestring) and obj:
|
||||
return '$encrypted$'
|
||||
return obj
|
||||
|
||||
def to_internal_value(self, value):
|
||||
|
||||
Reference in New Issue
Block a user