pulumi/proto
Justin Van Patten f5b117505c Maintain alias compat for older Node.js SDKs on new CLIs
This change updates the engine to detect if a `RegisterResource` request
is coming from an older Node.js SDK that is using incorrect alias specs
and, if so, transforms the aliases to be correct. This allows us to
maintain compatibility for users who have upgraded their CLI but are
still using an older version of the Node.js SDK with incorrect alias
specs.

We detect if the request is from a Node.js SDK by looking at the gRPC
request's metadata headers, specifically looking at the "pulumi-runtime"
and "user-agent" headers.

First, if the request has a "pulumi-runtime" header with a value of
"nodejs", we know it's coming from the Node.js plugin. The Node.js
language plugin proxies gRPC calls from the Node.js SDK to the resource
monitor and the proxy now sets the "pulumi-runtime" header to "nodejs"
for `RegisterResource` calls.

Second, if the request has a "user-agent" header that starts with
"grpc-node-js/", we know it's coming from the Node.js SDK. This is the
case for inline programs in the automation API, which connects directly
to the resource monitor, rather than going through the language plugin's
proxy.

We can't just look at "user-agent", because in the proxy case it will
have a Go-specific "user-agent".

Updated Node.js SDKs set a new `aliasSpecs` field on the
`RegisterResource` request, which indicates that the alias specs are
correct, and no transforms are needed.
2023-06-14 08:34:32 -07:00
..
build-container Support subdirectories in proto 2023-03-05 16:05:58 +00:00
google/protobuf Compile protobufs with "pulumi" namespace (#10074) 2022-07-12 14:45:03 +01:00
pulumi Maintain alias compat for older Node.js SDKs on new CLIs 2023-06-14 08:34:32 -07:00
.checksum.txt Maintain alias compat for older Node.js SDKs on new CLIs 2023-06-14 08:34:32 -07:00
generate.sh Support subdirectories in proto 2023-03-05 16:05:58 +00:00
grpc_version.txt Add getOrganization to nodejs and python (#10504) 2022-08-31 10:33:29 +01:00