summaryrefslogtreecommitdiffstats
path: root/custodia/message/simple.py
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2015-10-27 14:47:35 -0400
committerSimo Sorce <simo@redhat.com>2015-11-06 20:55:12 -0500
commit3b7eed15c3f9da7381d240a762b0e557dd18ce96 (patch)
treeb67710d589c55657f7757ab1b6bb489068b2ecae /custodia/message/simple.py
parent2780854f1e206563b7451087984f729d0b748d35 (diff)
downloadcustodia-3b7eed15c3f9da7381d240a762b0e557dd18ce96.tar.gz
custodia-3b7eed15c3f9da7381d240a762b0e557dd18ce96.tar.xz
custodia-3b7eed15c3f9da7381d240a762b0e557dd18ce96.zip
Add support in the client for the kem message type
This allows to easily use end-to-end encrypted requests and replies to fetch secrets. Signed-off-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'custodia/message/simple.py')
-rw-r--r--custodia/message/simple.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/custodia/message/simple.py b/custodia/message/simple.py
index 7186d12..6482c53 100644
--- a/custodia/message/simple.py
+++ b/custodia/message/simple.py
@@ -28,8 +28,13 @@ class SimpleKey(MessageHandler):
if not isinstance(msg, string_types):
raise InvalidMessage("The 'value' attribute is not a string")
+ self.name = name
self.payload = msg
def reply(self, output):
+ if self.name.endswith('/'):
+ # directory listings are pass-through with simple messages
+ return output
+
return json.dumps({'type': 'simple', 'value': output},
separators=(',', ':'))