Commit graph

7 commits

Author SHA1 Message Date
Nick Fagerlund
7a1c49c61d Append cloud plugin config metadata in plugin client requests
- The cloud plugin wants a go-tfe client to get stuff from TFC.

- Terraform knows how to find all the info you need in order to configure a
go-tfe client, but it's sometimes scattered across configs and env vars and
credentials helpers, and trying to re-implement the resolution logic identically
in another codebase would be error-prone.

- Therefore, it'd be best if Terraform did that resolution and just passed the
plugin all the config info it needs.

There are two options for that handoff:

1. Adding it as an additional argument to the primary Execute RPC interface.

2. Passing it as gRPC metadata, which is a pile of arbitrary key => list-of-strings
   pairs transmitted via HTTP/2 headers.

The crux of the decision here is whether a proliferation of plugin protocol
versions whenever we need to add more config data is better or worse than a
fuzzy and typeless key/value bag.

This PR is an implementation of option 2, for discussion and evaluation. (And
after all, this is considered an experimental feature anyway.) It assembles the
necessary information, translates it to the required metadata format, and
attaches it to the request at the proper moment to get everything over to the
plugin.

As previous commits foreshadowed, we're leaning on the existing logic in the
Cloud backend for pretty much all of this.
2024-01-04 14:42:36 -08:00
Brandon Croft
114f876f81
Merge pull request #33602 from hashicorp/TF-8071-download-and-verify-the-plugin-in-terraform
Download and authenticate the cloudplugin
2023-08-18 07:08:33 -06:00
Brandon Croft
3d1e07dcf3
Write command output to Meta.Streams, more plugin err handling 2023-08-18 06:53:25 -06:00
CJ Horton
98b81d3c50 add missing copyright headers 2023-08-16 11:21:49 -07:00
Brandon Croft
e5ce25099c
Apply suggestions from code review
Co-authored-by: Sebastian Rivera <sebastian.rivera@hashicorp.com>
2023-07-25 09:28:32 -06:00
Brandon Croft
a806f6220a
Tests the cloudplugin1 gRPC client 2023-07-25 09:28:31 -06:00
Brandon Croft
539e140d3e
Introduces cloudproto1 plugin interface 2023-07-25 09:28:31 -06:00