sigv4

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 20 Imported by: 8

README

github.com/prometheus/sigv4 module

Go Reference Build Status Go Report Card

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, opts ...Option) (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 Option added in v0.5.0

type Option func(*options)

Option configures NewSigV4RoundTripper.

func WithContext added in v0.5.0

func WithContext(ctx context.Context) Option

WithContext sets the context used during AWS configuration loading and credential retrieval.

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"`
	ExternalID         string            `yaml:"external_id,omitempty"`
	SessionName        string            `yaml:"session_name,omitempty"`
	Tags               map[string]string `yaml:"tags,omitempty"`
	UseFIPSSTSEndpoint bool              `yaml:"use_fips_sts_endpoint,omitempty"`
	ServiceName        string            `yaml:"service_name,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(any) 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