sigv4

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

README

github.com/prometheus/sigv4 module

sigv4 provides a http.RoundTripper that will sign requests using Amazon's Signature Verification V4 signing procedure, using credentials from the default AWS credential chain.

This is a separate module from github.com/prometheus/common to prevent it from having and propagating a dependency on the AWS SDK.

This module is considered internal to Prometheus, without any stability guarantees for external usage.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSigV4RoundTripper

func NewSigV4RoundTripper(cfg *SigV4Config, next http.RoundTripper) (http.RoundTripper, error)

NewSigV4RoundTripper returns a new http.RoundTripper that will sign requests using Amazon's Signature Verification V4 signing procedure. The request will then be handed off to the next RoundTripper provided by next. If next is nil, http.DefaultTransport will be used.

Credentials for signing are retrieved using the the default AWS credential chain. If credentials cannot be found, an error will be returned.

Types

type SigV4Config

type SigV4Config struct {
	Region             string        `yaml:"region,omitempty"`
	AccessKey          string        `yaml:"access_key,omitempty"`
	SecretKey          config.Secret `yaml:"secret_key,omitempty"`
	Profile            string        `yaml:"profile,omitempty"`
	RoleARN            string        `yaml:"role_arn,omitempty"`
	UseFIPSSTSEndpoint bool          `yaml:"use_fips_sts_endpoint,omitempty"`
}

SigV4Config is the configuration for signing remote write requests with AWS's SigV4 verification process. Empty values will be retrieved using the AWS default credentials chain.

func (*SigV4Config) UnmarshalYAML

func (c *SigV4Config) UnmarshalYAML(unmarshal func(interface{}) error) error

func (*SigV4Config) Validate

func (c *SigV4Config) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL