Skip to content

Commit

Permalink
[chore]add generated status to sigv4authextension (#20326)
Browse files Browse the repository at this point in the history
  • Loading branch information
atoulme authored May 14, 2023
1 parent e1c7457 commit 64eea31
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 14 deletions.
15 changes: 8 additions & 7 deletions extension/sigv4authextension/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Authenticator - Sigv4
<!-- status autogenerated section -->
| 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
<!-- end autogenerated section -->

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).

Expand Down Expand Up @@ -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
6 changes: 4 additions & 2 deletions extension/sigv4authextension/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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))

Expand All @@ -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))
Expand Down
2 changes: 2 additions & 0 deletions extension/sigv4authextension/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 2 additions & 5 deletions extension/sigv4authextension/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 12 additions & 0 deletions extension/sigv4authextension/internal/metadata/generated_status.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions extension/sigv4authextension/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: sigv4auth

status:
class: extension
stability:
beta: [extension]
distributions: [contrib]

0 comments on commit 64eea31

Please sign in to comment.