package aws

import "github.com/open-policy-agent/opa/internal/providers/aws"

modified from github.com/aws/aws-sdk-go-v2/internal/v4a@7a32d707af

Index

Constants

const (
	// AmzRegionSetKey represents the region set header used for sigv4a
	AmzRegionSetKey = "X-Amz-Region-Set"
)

Functions

func SetRandomSource

func SetRandomSource(reader io.Reader)

SetRandomSource used for testing to override rand so tests can expect stable output

func SignV4

func SignV4(headers map[string][]string, method string, theURL *url.URL, body []byte, service string, awsCreds Credentials, theTime time.Time) (string, map[string]string)

SignV4 modifies a map[string][]string of headers to generate an AWS V4 signature + headers based on the config/credentials provided.

func SignV4a

func SignV4a(headers map[string][]string, method string, theURL *url.URL, body []byte, service string, awsCreds Credentials, theTime time.Time) map[string][]string

SignV4a returns a map[string][]string of headers, including an added AWS V4a signature based on the config/credentials provided.

Types

type Credentials

type Credentials struct {
	AccessKey    string
	SecretKey    string
	RegionName   string
	SessionToken string
}

func CredentialsFromObject

func CredentialsFromObject(v ast.Object) Credentials

Source Files

signing_v4.go signing_v4a.go

Directories

PathSynopsis
internal/providers/aws/crypto
internal/providers/aws/v4
Version
v0.49.2
Published
Feb 24, 2023
Platform
js/wasm
Imports
23 packages
Last checked
3 minutes ago

Tools for package owners.