diff --git a/extension/sigv4authextension/README.md b/extension/sigv4authextension/README.md index 458989ff2c6f..80aed5858956 100644 --- a/extension/sigv4authextension/README.md +++ b/extension/sigv4authextension/README.md @@ -1,9 +1,13 @@ # Authenticator - Sigv4 + +| Status | | +| ------------- |-----------| +| Stability | [beta] | +| Distributions | [contrib] | -| Status | | -| ------------------------ |----------------------| -| Stability | [beta] | -| Distributions | [contrib] | +[beta]: https://github.com/open-telemetry/opentelemetry-collector#beta +[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib + This extension provides Sigv4 authentication for making requests to AWS services. For more information on the Sigv4 process, please look [here](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). @@ -53,6 +57,3 @@ service: ## Notes * The collector must have valid AWS credentials as used by the [AWS SDK for Go](https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/#specifying-credentials) - -[beta]:https://github.com/open-telemetry/opentelemetry-collector#beta -[contrib]:https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib diff --git a/extension/sigv4authextension/config_test.go b/extension/sigv4authextension/config_test.go index 523e259ed5b2..d5555249a77c 100644 --- a/extension/sigv4authextension/config_test.go +++ b/extension/sigv4authextension/config_test.go @@ -23,6 +23,8 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/confmap/confmaptest" + + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension/internal/metadata" ) func TestLoadConfig(t *testing.T) { @@ -36,7 +38,7 @@ func TestLoadConfig(t *testing.T) { require.NoError(t, err) factory := NewFactory() cfg := factory.CreateDefaultConfig() - sub, err := cm.Sub(component.NewID(typeStr).String()) + sub, err := cm.Sub(component.NewID(metadata.Type).String()) require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) @@ -58,7 +60,7 @@ func TestLoadConfigError(t *testing.T) { require.NoError(t, err) factory := NewFactory() cfg := factory.CreateDefaultConfig() - sub, err := cm.Sub(component.NewIDWithName(typeStr, "missing_credentials").String()) + sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "missing_credentials").String()) require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) assert.Error(t, component.ValidateConfig(cfg)) diff --git a/extension/sigv4authextension/doc.go b/extension/sigv4authextension/doc.go index 6b665322e1f4..80ea73459a0d 100644 --- a/extension/sigv4authextension/doc.go +++ b/extension/sigv4authextension/doc.go @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:generate mdatagen metadata.yaml + // Package sigv4authextension implements the `auth.Client` interface. // This extension provides the Sigv4 process of adding authentication information to AWS API requests sent by HTTP. // As such, the extension can be used for HTTP based exporters that export to AWS services. diff --git a/extension/sigv4authextension/factory.go b/extension/sigv4authextension/factory.go index aef97fb123d8..7fe2bbf0a7a4 100644 --- a/extension/sigv4authextension/factory.go +++ b/extension/sigv4authextension/factory.go @@ -21,16 +21,13 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/extension" -) -const ( - // The value of extension "type" in configuration. - typeStr = "sigv4auth" + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension/internal/metadata" ) // NewFactory creates a factory for the Sigv4 Authenticator extension. func NewFactory() extension.Factory { - return extension.NewFactory(typeStr, createDefaultConfig, createExtension, component.StabilityLevelBeta) + return extension.NewFactory(metadata.Type, createDefaultConfig, createExtension, metadata.ExtensionStability) } // createDefaultConfig() creates a Config struct with default values. diff --git a/extension/sigv4authextension/internal/metadata/generated_status.go b/extension/sigv4authextension/internal/metadata/generated_status.go new file mode 100644 index 000000000000..dc66d270b99e --- /dev/null +++ b/extension/sigv4authextension/internal/metadata/generated_status.go @@ -0,0 +1,12 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package metadata + +import ( + "go.opentelemetry.io/collector/component" +) + +const ( + Type = "sigv4auth" + ExtensionStability = component.StabilityLevelBeta +) diff --git a/extension/sigv4authextension/metadata.yaml b/extension/sigv4authextension/metadata.yaml new file mode 100644 index 000000000000..ecd3dfc5145a --- /dev/null +++ b/extension/sigv4authextension/metadata.yaml @@ -0,0 +1,7 @@ +type: sigv4auth + +status: + class: extension + stability: + beta: [extension] + distributions: [contrib] \ No newline at end of file