Skip to content
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

Proposal: Introduce a Parameter Set #1053

Closed
vdice opened this issue May 19, 2020 · 2 comments
Closed

Proposal: Introduce a Parameter Set #1053

vdice opened this issue May 19, 2020 · 2 comments
Assignees
Labels
1 - 🍫 Eat chocolate _after_ emergency donuts enhancement New code incoming!

Comments

@vdice
Copy link
Member

vdice commented May 19, 2020

This proposal is intended to cover the feature request in #878, while also adding a bit more functionality in the process.

#878 requests the ability to inject secrets into parameter values (similar to what is supported for a credential today). Here I propose accomplishing this via introducing a Parameter Set, very much like the existing Credential Set.

UX

  • User can designate a parameter value as sourced from one of the following:

    • env var
    • command result
    • path
    • value
    • secret (if supported by plugin like the Azure plugin)

    Here would be an example for a parameter set file listing a parameter with a secret source:

    {
      "name": "mybunz",
      "created": "2019-11-27T15:50:58.194017952-07:00",
      "modified": "2019-11-27T15:50:58.194017952-07:00",
      "parameters": {
        "name": "myparam",
        "source": {
          "secret": "myparam"
        }
      }
    }

    We intend to re-use the same format as is currently used for a Credential Set (or more specifically, a CredentialStrategy).

    NOTE: in contrast to credentials, these (potentially secret) parameter values will be saved to the claim after a given action. Porter's current vision is to encrypt claims as a layer of protection.

  • User can supply this parameter info at action runtime

    porter install --parameter-set myparam-set.json

High-level work items:

Separated into sections corresponding to separate PRs.

Addition of Parameter Set

  • Introduce the concept of a Parameter Set, using the current Credential Set/CredentialStrategy as a model.

  • Any parameters that require looking up their values via a source (one of the sources listed in the UX section above) must be listed in a Parameter Set.

  • Parameters with raw value sources may be listed in a Parameter Set, but may also just be passed on the CLI via --param myparam=myparamvalue. (Or via both methods; see precedence rules mentioned below.)

  • Add flag for all actions (porter install, etc.): -p/--parameter-set to supply the parameter set file.

    • Precedence for parameters: If a param is set via the CLI invocation (via --param), this value takes precedence over the same parameter value if listed in a supplied parameter set file. (Thought: or, should it simply boil down to the last supplied flag wins?)

Interactive Parameter Set Generation

  • Interactive parameter set generation should be added. A separate PR may be preferable for this work, as it may involve refactoring for reusing the existing interactive credential set generation logic.

Replace/deprecate param file

  • Proposal: Remove the existing --param-file functionality, to be replaced by the parameter set file.
    • Currently, --param-file allows only for a key=value listing for parameters
    • This same functionality will be retained in the parameter set file, as it has support for value source

Add Azure Plugin secret support

  • Add support for deriving the secret source for applicable parameters in the azure plugin edit: this already is working!

Allow mixed sources when at least one is a secret

  • Currently, Porter only allows all credential sources be of type secret (aligning with the use of the Azure plugin) or none
  • The same would apply for the proposed/forthcoming parameter sources, currently. The work to enable mixed sources is encapsulated/tracked in Always have the filesystem plugin available #1050
@carolynvs
Copy link
Member

💯 Let's do this!

@carolynvs carolynvs added 1 - 🍫 Eat chocolate _after_ emergency donuts enhancement New code incoming! labels May 22, 2020
@vdice vdice self-assigned this May 26, 2020
@carolynvs carolynvs moved this from Inbox to In Progress in Porter and Mixins [OLD] Jun 2, 2020
vdice added a commit that referenced this issue Jun 9, 2020
Introduce Parameter Sets (ref #1053)

Co-authored-by: Carolyn Van Slyck <carolyn.vanslyck@microsoft.com>
@vdice
Copy link
Member Author

vdice commented Jun 22, 2020

All PRs associated with this epic have been merged; closing.

@vdice vdice closed this as completed Jun 22, 2020
Porter and Mixins [OLD] automation moved this from In Progress to Done Jun 22, 2020
@vdice vdice removed this from Done in Porter and Mixins [OLD] Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - 🍫 Eat chocolate _after_ emergency donuts enhancement New code incoming!
Projects
None yet
Development

No branches or pull requests

2 participants