From 2ac43c00b33165e22cac565e2bf881d5482fcbaf Mon Sep 17 00:00:00 2001 From: Matt Oswalt Date: Wed, 29 Nov 2017 16:10:52 -0800 Subject: [PATCH 1/2] Add note about new Inquiry respond action and action alias, and masking behavior Signed-off-by: Matt Oswalt --- docs/source/inquiries.rst | 56 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/docs/source/inquiries.rst b/docs/source/inquiries.rst index f2f742952..c16c4707f 100644 --- a/docs/source/inquiries.rst +++ b/docs/source/inquiries.rst @@ -345,7 +345,61 @@ snippet to print the value of ``secondfactor`` in our response. We just printed screen in this example, but you can just as easily use this to pass a value into another action in your workflow. -.. TODO - Update with chatops when the core PR is merged and an action and action-alias has been added to st2 pack +The ``st2`` pack also now contains an ``inquiry.respond`` action, which may be useful for +responding to inquiries within another workflow: + +.. code-block:: bash + + ~$ st2 inquiry get 5a1f4411c4da5f4486b09364 + +----------+--------------------------------------------------------------+ + | Property | Value | + +----------+--------------------------------------------------------------+ + | id | 5a1f4411c4da5f4486b09364 | + | roles | | + | users | | + | route | developers | + | ttl | 1440 | + | schema | { | + | | "type": "object", | + | | "properties": { | + | | "secondfactor": { | + | | "required": true, | + | | "type": "string", | + | | "description": "Please enter second factor for | + | | authenticating to "foo" service" | + | | } | + | | } | + | | } | + +----------+--------------------------------------------------------------+ + vagrant@st2vagrant:~$ st2 run st2.inquiry.respond id=5a1f4411c4da5f4486b09364 response='{"secondfactor": "foo"}' + . + id: 5a1f444ec4da5f4486b09366 + status: succeeded + parameters: + id: 5a1f4411c4da5f4486b09364 + response: + secondfactor: '********' + result: + exit_code: 0 + result: null + stderr: '' + stdout: '' + +.. note:: + + You'll notice that the value for the key ``secondfactor`` is masked within the response body + in the execution output for this action. The ``st2.inquiry.respond`` action doesn't actually + know the inquiry response schema at all - it is merely a thin layer on top of the StackStorm + client. As a result, it doesn't know which fields are marked with the ``secret`` attribute. + To avoid potentially leaking secrets, all field values are masked in this way for the output + of this action, regardless of whether or not the schema has declared them as secrets. + +The ``st2`` pack also contains an action alias for responding to Inquiries via chatops. Using this +alias, you can respond to an Inquiry within Slack, as an example: + +.. code-block:: text + + !st2 respond to inquiry 5a1f4860c4da5f4486b093bf with {“secondfactor”: “supersecret”} .. _ref-securing-inquiries: From d8c571ab0285b8c01cbd4e797ce4c70c7cee1b71 Mon Sep 17 00:00:00 2001 From: Lindsay Hill Date: Thu, 30 Nov 2017 16:12:36 -0800 Subject: [PATCH 2/2] Minor style change s/chatops/ChatOps/ --- docs/source/inquiries.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/inquiries.rst b/docs/source/inquiries.rst index c16c4707f..533a536a4 100644 --- a/docs/source/inquiries.rst +++ b/docs/source/inquiries.rst @@ -389,12 +389,12 @@ responding to inquiries within another workflow: You'll notice that the value for the key ``secondfactor`` is masked within the response body in the execution output for this action. The ``st2.inquiry.respond`` action doesn't actually - know the inquiry response schema at all - it is merely a thin layer on top of the StackStorm + know the inquiry response schema at all - it is merely a thin layer on top of the |st2| client. As a result, it doesn't know which fields are marked with the ``secret`` attribute. To avoid potentially leaking secrets, all field values are masked in this way for the output of this action, regardless of whether or not the schema has declared them as secrets. -The ``st2`` pack also contains an action alias for responding to Inquiries via chatops. Using this +The ``st2`` pack also contains an action alias for responding to Inquiries via ChatOps. Using this alias, you can respond to an Inquiry within Slack, as an example: .. code-block:: text