-
Notifications
You must be signed in to change notification settings - Fork 111
QA Create encrypted-parameters.md #1774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
qahmed1998
wants to merge
2
commits into
ManageIQ:master
Choose a base branch
from
qahmed1998:QA-master-addprotectedfields-info
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
--- | ||
|
||
# Encrypted Input Parameters | ||
|
||
The parameters passed to a playbook method are often encrypted, either by definition as a “password” data type in the list of input parameters, or by being encrypted elsewhere in a workflow. | ||
|
||
## Encrypted Input Parameters | ||
|
||
An input parameter can be defined as being of type “password”, for example: | ||
|
||
Input Parameters | ||
|
||
| | | | | ||
| ------------------------- | ------------------------- |----------------------------- | | ||
| **Input Name** | **Data Type** | **Default value** | | ||
| this | string | that | | ||
| manageiq_validate_certs | boolean | false | | ||
| scrambled_this | password | ******** | | ||
|
||
{: caption="Table. Input Paramaters" caption-side="bottom"} | ||
Fryguy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
A parameter of this type is decrypted automatically and is available to the playbook as the named extra variable, for example *{{ scrambled_this }}*. Note that an input parameter that has the text string “password” anywhere in the name cannot be passed as a method parameter, and hence cannot appear in the list of method parameters that are returned by the `get_method_parameters` function. The variable will however be available as an extra_var with the password value decrypted correctly. | ||
|
||
## Password Defined Earlier in Workflow | ||
|
||
A variable encrypted earlier in the workflow (for example when input into a service dialog) can generally be identified as a name prefixed by the string “password::”. This signifies that the object is of type *MiqPassword*. | ||
|
||
A password object of this type can be used as an input parameter if it is passed as a *string* data type, also prefixed by the string “password::”. The encrypted value is automatically decrypted and is usable by the playbook as the named extra variable. | ||
|
||
For example, to inject the *root_password* value from the previous service dialog by using substitution syntax, an input parameter must be defined with a *string* data type and the following input parameter value: | ||
|
||
``` sh | ||
password::${/#miq_provision.miq_provision_request.get_option(:dialog).fetch(password::dialog_option_0_root_password)} | ||
``` | ||
|
||
|
||
See the following table for the illustration of input parameters: | ||
|
||
Input Parameters | ||
|
||
| | | | | ||
| ------------------------- | ------------------------- |------------------------------------------------------------------------------------------------------------------------------- | | ||
| **Input Name** | **Data Type** | **Default value** | | ||
Fryguy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| manageiq_validate_certs | boolean | false | | ||
| cores_per_socket | string | ${/#miq_provision.miq_provision_request.get_option(:dialog).fetch(dialog_option_0_cores_per_socket)} | | ||
| root_password | string | password::${/#miq_provision.miq_provision_request.get_option(:dialog).fetch(password::dialog_option_0_root_password)} | | ||
|
||
{: caption="Table. Input Paramaters" caption-side="bottom"} | ||
Fryguy marked this conversation as resolved.
Show resolved
Hide resolved
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.