pulumi/sdk/nodejs/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
..
codegen Allow mapping requests to install plugins 2023-05-29 14:53:04 +01:00
alias_grpc_pb.js feat(engine): Adds structured alias support to the engine 2022-10-11 17:56:32 -04:00
alias_pb.js feat(engine): Adds structured alias support to the engine 2022-10-11 17:56:32 -04:00
analyzer_grpc_pb.js Compile protobufs with "pulumi" namespace (#10074) 2022-07-12 14:45:03 +01:00
analyzer_pb.js feat(engine): Adds structured alias support to the engine 2022-10-11 17:56:32 -04:00
converter_grpc_pb.js Allow converter plugins to return diagnostics 2023-06-05 17:38:59 +01:00
converter_pb.js Allow converter plugins to return diagnostics 2023-06-05 17:38:59 +01:00
engine_grpc_pb.js Compile protobufs with "pulumi" namespace (#10074) 2022-07-12 14:45:03 +01:00
engine_pb.js Compile protobufs with "pulumi" namespace (#10074) 2022-07-12 14:45:03 +01:00
errors_grpc_pb.js Regenerate protocol buffers code 2020-02-28 11:53:47 +00:00
errors_pb.js Compile protobufs with "pulumi" namespace (#10074) 2022-07-12 14:45:03 +01:00
language_grpc_pb.js gRPC for GenerateProject/Program/Package 2023-05-06 13:14:59 +01:00
language_pb.js Make convert more lenient 2023-06-08 11:14:31 +01:00
plugin_grpc_pb.js Regenerate protocol buffers code 2020-02-28 11:53:47 +00:00
plugin_pb.js Compile protobufs with "pulumi" namespace (#10074) 2022-07-12 14:45:03 +01:00
provider_grpc_pb.js Phase 3 of the convert mapper 2022-12-01 23:43:43 +00:00
provider_pb.js proto/ConstructRequest: Add resource options fields 2023-04-21 10:57:19 -07:00
resource_grpc_pb.js feat(engine): Adds structured alias support to the engine 2022-10-11 17:56:32 -04:00
resource_pb.js Maintain alias compat for older Node.js SDKs on new CLIs 2023-06-14 08:34:32 -07:00
status_grpc_pb.js Regenerate protocol buffers code 2020-02-28 11:53:47 +00:00
status_pb.js Compile protobufs with "pulumi" namespace (#10074) 2022-07-12 14:45:03 +01:00