mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-19 17:59:05 -05:00
Previously we were using a third-party library, but that doesn't have any
support for passing context.Context through its API and so isn't suitable
for our goals of adding OpenTelemetry tracing for all outgoing network
requests.
We now have our own fork that is updated to use context.Context. It also
has a slightly reduced scope no longer including various details that
are tightly-coupled to our cliconfig mechanism and so better placed in the
main OpenTofu codebase so we can evolve it in future without making
lockstep library releases.
The "registry-address" library also uses svchost and uses some of its types
in its public API, so this also incorporates v2 of that library that is
updated to use our own svchost module.
Unfortunately this commit is a mix of mechanical updates to the new
libraries and some new code dealing with the functionality that is removed
in our fork of svchost. The new code is primarily in the "svcauthconfig"
package, which is similar in purpose "ociauthconfig" but for OpenTofu's
own auth mechanism instead of the OCI Distribution protocol's auth
mechanism.
This includes some additional plumbing of context.Context where it was
possible to do so without broad changes to files that would not otherwise
have been included in this commit, but there are a few leftover spots that
are context.TODO() which we'll address separately in later commits.
This removes the temporary workaround from d079da6e9e, since we are now
able to plumb the OpenTelemetry span tree all the way to the service
discovery requests.
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
21 lines
1.0 KiB
Go
21 lines
1.0 KiB
Go
// Copyright (c) The OpenTofu Authors
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
// Copyright (c) 2023 HashiCorp, Inc.
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
// Package svcauthconfig contains some helper functions and types to support
|
|
// the cliconfig package's use of [github.com/opentofu/svchost/svcauth],
|
|
// which is our mechanism for representing the policy for authenticating to
|
|
// OpenTofu-native services such as implementations OpenTofu's provider registry
|
|
// protocol.
|
|
//
|
|
// The intended separation of concerns is that the upstream library provides
|
|
// the "vocabulary types" that other parts of OpenTofu interact with, while
|
|
// this package contains concrete implementations of those types and helpers
|
|
// to assist in constructing them which should be used _only_ by package
|
|
// cliconfig to satisfy the upstream interfaces. This separation means that
|
|
// we can evolve the implementation details of service authentication by
|
|
// changes only in this repository, thereby avoiding the complexity of always
|
|
// having to update both codebases in lockstep.
|
|
package svcauthconfig
|