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

Allow Python dynamic providers to capture secrets #15864

Merged
merged 7 commits into from
Aug 3, 2024

Commits on Aug 1, 2024

  1. Allow Python dynamic providers to capture secrets

    This allows the serialization used by dynamic providers to capture secrets, and if so, marks the resulting input value as a secret so that the `__provider` property will be a secret in the state.
    
    The `__provider` property will no longer always be a secret. It will only be marked as a secret if a secret was captured during serialization of the provider.
    
    Note: Previously, it wasn't possible to capture Outputs when serializing the resource provider. This change makes it possible and allows secrets to be captured.
    justinvp committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    37a141d View commit details
    Browse the repository at this point in the history
  2. Make the new behavior opt-in

    By default, we continue to always make `__provider` a secret, unless `auto_secret` is set to `True`, in which case we only make `__provider` a secret if any secret Outputs were captured.
    justinvp committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    b77e509 View commit details
    Browse the repository at this point in the history
  3. Add some more comments

    justinvp committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    4c21332 View commit details
    Browse the repository at this point in the history
  4. Adjust Output.get docstring

    justinvp committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    c199799 View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2024

  1. Rename auto_secret to serialize_as_secret_always

    This commit renames `auto_secret` to `serialize_as_secret_always` and changes the polarity. `serialize_as_secret_always` defaults to `True`, which is the current behavior. A subclass can set it to `False` to make the serialized provider a secret only if any secret Outputs were captured, otherwise, it will not be a secret.
    justinvp committed Aug 2, 2024
    Configuration menu
    Copy the full SHA
    f2bc308 View commit details
    Browse the repository at this point in the history
  2. make format

    justinvp committed Aug 2, 2024
    Configuration menu
    Copy the full SHA
    598b983 View commit details
    Browse the repository at this point in the history
  3. Remove use of typing.ParamSpec

    ParamSpec isn't available in Python 3.8. For our usage, it's sufficient to relax the typing.
    justinvp committed Aug 2, 2024
    Configuration menu
    Copy the full SHA
    991ca66 View commit details
    Browse the repository at this point in the history