Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F7675301
D2608.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D2608.diff
View Options
diff --git a/_modules/zr.py b/_modules/zr.py
--- a/_modules/zr.py
+++ b/_modules/zr.py
@@ -10,6 +10,8 @@
# -------------------------------------------------------------
+import os
+
from salt.utils.path import which as path_which
@@ -23,6 +25,12 @@
)
+def _are_credentials_hidden():
+ return "CONFIG_PUBLISHER" in os.environ or "state.show_sls" in os.environ.get(
+ "SUDO_COMMAND", ""
+ )
+
+
def _build_pillar_key(expression):
return "zr_credentials:" + expression.replace(".", ":")
@@ -65,6 +73,9 @@
or a key in zr_credentials pillar entry
:return: The secret value
"""
+ if _are_credentials_hidden():
+ return "credential for " + credential_expression
+
credential_id = get_credential_id(credential_expression)
zr_command = "zr getcredentials {0}".format(credential_id)
@@ -104,6 +115,9 @@
or a key in zr_credentials pillar entry
:return: The secret value
"""
+ if _are_credentials_hidden():
+ return "credential for " + credential_expression
+
credential_id = get_credential_id(credential_expression)
zr_command = "zr getcredentials {0} token".format(credential_id)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, May 1, 21:05 (2 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2622458
Default Alt Text
D2608.diff (1 KB)
Attached To
Mode
D2608: Hide Zemke-Rhyne credentials in published config
Attached
Detach File
Event Timeline
Log In to Comment