Commit graph

3610 commits

Author SHA1 Message Date
Dominik-K a80d29c897 NodeJS: add semver as dependency (imported in runtime/closure/v8Hooks.js) (#2763) 2019-05-23 12:26:47 -06:00
Justin Van Patten da7c8f1dde
Improvements to the gen-markdown command for Hugo (#2764)
Updates to the gen-markdown command for the Hugo migration.
2019-05-23 10:37:10 -07:00
James Nugent 26fc9af630
Merge pull request #2760 from pulumi/stack72/fixup-pulumi-whoami-release-date
cmd/whoami: Move the changelog entry to unreleased
2019-05-23 13:41:11 +02:00
stack72 19bf51d89a cmd/whoami: Move the changelog entry to unreleased
This was originally part of an older release but it has since been
moved to unreleased as it was only recently merged
2019-05-23 12:37:19 +02:00
Chris Smith 6577784114
Reduce overhead of emitting engine events (#2735)
* Reduce size of most common apitype EngineEvents

* Update endpoint names for trace logging
2019-05-22 12:22:40 -07:00
Paul Stack fa691d8c40
cli/whoami: Addition of the currently connected backend to whoami (#2686)
cli/whoami: Addition of the currently connected backend to whoami
2019-05-22 15:57:52 +03:00
stack72 6ab390a815 cli/whoami: Addition of the currently connected backend to whoami
This is an attempt towards #2684

I am not sure if this is too simplistic for now OR we need to
consider if this will break anyones automation as they maybe using
the output of that command as plain text

Before:

```
▶ pulumi whoami
stack72
```

After:

```
▶ pulumi whoami
User: stack72
Backend URL: https://app.pulumi.com/stack72
```
2019-05-22 14:45:04 +02:00
Matt Ellis 61bff0c3a4 Do not parse version from resource providers
Until we can come up with a solution for #2753, just ignore the
version that comes in as part of a resource monitor RPC.
2019-05-21 19:20:18 -07:00
Fraser Waters d5b45ac5ad Move windows path fix changelog entry to 17.13 (#2749)
Was merged into the 17.11 changelog
2019-05-21 18:11:44 -07:00
Matt Ellis 31bd463264 Gracefully handle the case where secrets_provider is uninitalized
A customer reported an issue where operations would fail with the
following error:

```
error: could not deserialize deployment: unknown secrets provider type
```

The problem here was the customer's deployment had a
`secrets_provider` section which looked like the following:

```
"secrets_providers": {
    "type": ""
}
```

And so our code to try to construct a secrets manager from this thing
would fail, as our registry does not contain any information about a
provider with an empty type.

We do two things in this change:

1. When serializing a deployment, if there is no secrets manager,
don't even write the `secrets_provider` block. This helps for cases
where we are roundtripping deployments that did not have a provider
configured (i.e. they were older stacks that did not use secrets)

2. When deserializing, if we see an empty secrets provider like the
above, interpret it to mean "this deployment has no secrets". We set
up a decrypter such that if it ends up haiving secrets, we panic
eagerly (since this is a logical bug in our system somewhere).
2019-05-21 17:11:54 -07:00
CyrusNajmabadi b32892e0c1
Simplify signature of pulumi.all (#2527) 2019-05-21 13:13:23 -04:00
CyrusNajmabadi 3639d1e998
Serialized function parameter count. (#2748) 2019-05-20 22:19:22 -04:00
CyrusNajmabadi 2246a97c17
Always normalize paths to forward slashes to properly work with gocloud (#2747) 2019-05-20 14:46:00 -04:00
Matt Ellis 7ca9721d23 Apply colorization to the ---outputs--- line
We were not actually calling our colorization routines, which lead to
printing this very confusing text:

```
<{%reset%}>    --outputs:--<{%reset%}>
```

When running updates with `--diff` or when drilling into details of a
proposed operation, like a refresh.
2019-05-20 11:43:02 -07:00
Matt Ellis 4f693af023 Do not pass arguments as secrets to CheckConfig/Configure
Providers from plugins require that configuration value be
strings. This means if we are passing a secret string to a
provider (for example, trying to configure a kubernetes provider based
on some secret kubeconfig) we need to be careful to remove the
"secretness" before actually making the calls into the provider.

Failure to do this resulted in errors saying that the provider
configuration values had to be strings, and of course, the values
logically where, they were just marked as secret strings

Fixes #2741
2019-05-17 16:42:29 -07:00
Matt Ellis 2cd4409c0d Fix a panic during property diffing
We have to actually return the value we compute instead of just
dropping it on the floor and treating the underlying values as
primitive.

I ran into this during dogfooding, the added test case would
previously panic.
2019-05-15 16:20:25 -07:00
Matt Ellis 9f66cda318
Merge pull request #2734 from pulumi/ellismg/flow-secrets
Correctly flow secretness across structured values
2019-05-15 13:41:19 -07:00
Matt Ellis 137b517c13 Prepare for release 2019-05-15 12:04:43 -07:00
Matt Ellis ccbc84ecc1 Add an additional test case
This was used as a motivating example during an in person discussion
with Luke.
2019-05-15 12:03:48 -07:00
Matt Ellis 4368830448 Rework secret annotation algorithm slightly
We adopt a new algoritm for annotating secrets, which works as
follows:

If the source and destinations are both property maps, annotate their
secrets deeply.

Otherwise, if there is an property in both the input and output arrays
with the same name and the value in the inputs has secrets /anywhere/
in it, mark the output itself a secret.

This means, for example, an array in the inputs with a secret value as
one of the elmenets will mean in the outputs the entire array value is
marked as a secret. This is done because arrays often are treated as
sets by providers and so we really shouldn't consider ordering. It
also means that if a value is added to the array as part of the
operation we still mark the new array as an output even though the
values may not be indentical to the inputs.
2019-05-15 09:33:02 -07:00
Matt Ellis b4cca4a108 Update CHANGELOG.md 2019-05-15 09:33:02 -07:00
Matt Ellis af2a2d0f42 Correctly flow secretness across structured values
For providers which do not natively support secrets (which is all of
them today), we annotate output values coming back from the provider
if there is a coresponding secret input in the inputs we passed in.

This logic was not tearing into rich objects, so if you passed a
secret as a member of an array or object into a resource provider, we
would lose the secretness on the way back.

Because of the interaction with Check (where we call Check and then
take the values returned by the provider as inputs for all calls to
Diff/Update), this would apply not only to the Output values of a
resource but also the Inputs (because the secret metadata would not
flow from the inputs of check to the outputs).

This change augments our logic which transfers secrets metadata from
one property map to another to handle these additional cases.
2019-05-15 09:32:25 -07:00
Matt Ellis 70bf3bee73
Merge pull request #2736 from pulumi/ellismg/cache-passphrase
Do not prompt for passphrase multiple times
2019-05-15 09:32:03 -07:00
Matt Ellis 145fdd9a7c Fix spelling issues 2019-05-15 08:32:49 -07:00
Matt Ellis 5be8b5da12 Fix lint issues
The linter had been warning me for a while that some comments we had
confused it.  I fixed this.  Then the linter found a place where we
were ignoring a return value.  Looking at it, it feels like we want to
continue in this case, so I just `contract.IgnoreError`'d it.
2019-05-15 00:02:35 -07:00
Matt Ellis e453c7db9e Eagerly validate secrets-provider option
Validate the value is well formed much earlier so you don't end up
seeing you've picked a bad value in the middle of trying to create
your new stack. Update the helptext to list currently supported
values.

Fixes #2727
2019-05-15 00:02:29 -07:00
Matt Ellis c91ddf996b Do not prompt for passphrase multiple times
The change does two things:

- Reorders some calls in the CLI to prevent trying to create a secrets
  manager twice (which would end up prompting twice).

- Adds a cache inside the passphrase secrets manager such that when
  decrypting a deployment, we can re-use the one created earlier in
  the update. This is sort of a hack, but is needed because otherwise
  we would fail to decrypt the deployment, meaning that if you had a
  secret value in your deployment *and* you were using local
  passphrase encryption *and* you had not set PULUMI_CONFIG_PASSPHRASE
  you would get an error asking you to do so.

Fixes #2729
2019-05-14 23:35:27 -07:00
Tomáš Hübelbauer 247edadd69 Make the timer demo more concise
Easier on the eyes this way IMO
2019-05-14 13:27:38 -07:00
Matt Ellis f6c25b7d2d Update Changelog for 0.17.11 2019-05-13 17:38:19 -07:00
Matt Ellis 825a461b2e Fix a SxS issue with isSecret
Because of our Proxy types, every output will return something when
you call `.isSecret` on it. However, if you call it on an output from
a version of `@pulumi/pulumi` which did not support secrets, the thing
you will get back is not undefined but rather an `Output` which wraps
undefined.

Because of this, care must be taken when reading this property and so
a small helper is introduced and used in places we care about.
2019-05-13 15:45:08 -07:00
Matt Ellis 1af821db9c Don't capture secret outputs in closures.
Until #2718 is addressed, we will just disallow capturing secret
outputs when we serialize closures.
2019-05-13 15:45:08 -07:00
Matt Ellis 5659875b18 Handel nulls/undefined correctly in marshalling
Undefined values can come as stack output during previewing, and nulls
may also be present.  Guard against both cases.
2019-05-13 10:53:35 -07:00
Matt Ellis 120bf897ed
Merge pull request #2678 from pulumi/ellismg/secrets-secretsmanager
Encrypt secrets in deployment and allow encryption scheme to vary
2019-05-10 19:35:58 -07:00
Matt Ellis 5a5d320b7d Wordsmith CHNAGELOG.md 2019-05-10 17:12:35 -07:00
Matt Ellis 8a865acf11 Don' fail early when loading passphrase secrets managers from state
This is helpful some round trip cases where we many not be able to
build the encrypter or decrypter but we will end up not needing
them. When we fail to load the manager, we return a manager that has
the correct state, but will error when it tries to preform any
operations.  However, if there are no secrets in the deployment, these
methods will never be called and we'll be able to correctly roundtrip
checkpoints even without having access to the password (since there
were no secret values to decrypt or encrypt).
2019-05-10 17:07:52 -07:00
Matt Ellis ffc6053c88 Fix --json output
We were dropping new and old states on the floor instead of including
them as part of the previewed operation due to a logic error (we want
to append them when there are no errors from serialization, vs when
there are errors).
2019-05-10 17:07:52 -07:00
Matt Ellis cad1949dba Fix an issue updating a newly created stack from the local backend
When creating a new stack using the local backend, the default
checkpoint has no deployment. That means there's a nil snapshot
created, which means our strategy of using the base snapshot's secrets
manager was not going to work. Trying to do so would result in a panic
because the baseSnapshot is nil in this case.

Using the secrets manager we are going to use to persist the snapshot
is a better idea anyhow, as that's what's actually going to be burned
into the deployment when we serialize the snapshot, so let's use that
instead.
2019-05-10 17:07:52 -07:00
Matt Ellis 25453d88bf Fix a bug in out logic for replacing secrets with [secret] 2019-05-10 17:07:52 -07:00
Matt Ellis 9926071e19 Set a passphrase in more tests 2019-05-10 17:07:52 -07:00
Matt Ellis 16932873a4 Update CHANGELOG.md 2019-05-10 17:07:52 -07:00
Matt Ellis fb1ebd0e06 Add an End to End test of secrets
This test ensures that our secrets support works by deploying
resources with a mix of secret and plantext inputs and then checks the
deployment file to ensure that everything is marked as a secret.
2019-05-10 17:07:52 -07:00
Matt Ellis 75744f1d6c Add some convience methods to pulumi.Config for getting secrets 2019-05-10 17:07:52 -07:00
Matt Ellis 7b4d6f9d5a Do not support secrets natively in the dynamic provider
All existing implementations would fail if secret values were passed
to the dyanmic provider. When the provider says it does not support
secrets, the engine will do basic secrets tracking (any outputs with
the same names as secret inputs become secrets themselves).
2019-05-10 17:07:52 -07:00
Matt Ellis a5ef966caf Update --json output for preview in light of secrets
Replace any secret properties with the string `[secret]` for now. We
can consider allowing something like allowing `--show-secrets` to show
them.
2019-05-10 17:07:52 -07:00
Matt Ellis 2ff54fa150 Push secretness "up" while deserializing objects.
Since we don't support nesting secrets (as they are modeled as
Outputs), as we deserialize, we push the secretness up to top level,
where we will correctly use it to mark the output as secret.

This fixes an issue where if you created a StackReference resource,
with a mix of secret and non secret properties, you would see the
"wire form" of the secrets as values on the `outputs` map of the
StackReference resource.
2019-05-10 17:07:52 -07:00
Matt Ellis ade9cd4588 Flush out comment on isSecret promise 2019-05-10 17:07:52 -07:00
Matt Ellis f705dde7fb Remove acceptsSecrets from InvokeRequest
In our system, we model secrets as outputs with an additional bit of
metadata that says they are secret. For Read and Register resource
calls, our RPC interface says if the client side of the interface can
handle secrets being returned (i.e. the language SDK knows how to
sniff for the special signiture and resolve the output with the
special bit set).

For Invoke, we have no such model. Instead, we return a `Promise<T>`
where T's shape has just regular property fields.  There's no place
for us to tack the secretness onto, since there are no Outputs.

So, for now, don't even return secret values back across the invoke
channel. We can still take them as arguments (which is good) but we
can't even return secrets as part of invoke calls. This is not ideal,
but given the way we model these sources, there's no way around
this.  Fortunately, the result of these invoke calls are not stored in
the checkpoint and since the type is not Output<T> it will be clear
that the underlying value is just present in plaintext. A user that
wants to pass the result of an invoke into a resource can turn an
existing property into a secret via `pulumi.secret`.
2019-05-10 17:07:52 -07:00
Matt Ellis cb59c21c01 Rename SecretOutputs to AdditionalSecretOutputs
This makes the intention of this field clearer.
2019-05-10 17:07:52 -07:00
Matt Ellis ae4d126d8c Support Secrets in Python SDK
A new static method, `secret` now exists on `pulumi.Output` which can
be used to create secrets.
2019-05-10 17:07:52 -07:00
Matt Ellis b7fbe74404 Remove errant import 2019-05-10 17:07:52 -07:00