deckhand/deckhand/engine/schemas
Felipe Monteiro c9d71a6509 substitution: Recursive pattern replacement
Patterns may now be replaced recursively. This can be
achieved by using specifying a ``pattern`` value and
``recurse`` (with a required ``depth`` argument).

Example:

    substitutions:
      - dest:
          path: .
          pattern: REGEX
          recurse:
            depth: -1
        src:
          schema: deckhand/Passphrase/v1
          name: example-password
          path: .

NOTE:

  Recursive selection of patterns will only consider
  matching patterns. Non-matching patterns will be ignored.
  Thus, even if recursion can "pass over" non-matching patterns,
  they will be silently ignored.

This is useful for reducing the number of substitution
stanzas that are required for the purposes of performing
all the string pattern replacements that are required.
Best practice is to limit the scope of the recursion
as much as possible: e.g. avoid passing in "$" as the
``jsonpath``, but rather a JSON path that lives closer
to the nested strings in question.

Included in this patch set:

* recursive implementation for pattern replacement
* unit tests for most scenarios and edge cases
* docstring updates
* documentation updates
* schema updates for validation

Change-Id: I85048349097ed696667fae80f1180808d264bbcf
2018-09-12 09:24:46 -06:00
..
base_schema.yaml Simplify schema validation 2018-07-03 02:07:33 +00:00
certificate_authority_key_schema.yaml Simplify schema validation 2018-07-03 02:07:33 +00:00
certificate_authority_schema.yaml Simplify schema validation 2018-07-03 02:07:33 +00:00
certificate_key_schema.yaml Simplify schema validation 2018-07-03 02:07:33 +00:00
certificate_schema.yaml Simplify schema validation 2018-07-03 02:07:33 +00:00
layering_policy_schema.yaml Simplify schema validation 2018-07-03 02:07:33 +00:00
metadata_control.yaml Simplify schema validation 2018-07-03 02:07:33 +00:00
metadata_document.yaml substitution: Recursive pattern replacement 2018-09-12 09:24:46 -06:00
passphrase_schema.yaml Simplify schema validation 2018-07-03 02:07:33 +00:00
private_key_schema.yaml Simplify schema validation 2018-07-03 02:07:33 +00:00
public_key_schema.yaml Simplify schema validation 2018-07-03 02:07:33 +00:00
validation_policy_schema.yaml Simplify schema validation 2018-07-03 02:07:33 +00:00