From cd79e35059f67132454714b53f1f8313d91a6d28 Mon Sep 17 00:00:00 2001 From: Alexander Wert Date: Fri, 3 Jun 2022 10:43:08 +0200 Subject: [PATCH 1/8] Added Secret Manager support --- apm-lambda-extension/extension/process_env.go | 67 ++++++++++++++++++- apm-lambda-extension/go.mod | 2 + apm-lambda-extension/go.sum | 11 +++ 3 files changed, 77 insertions(+), 3 deletions(-) diff --git a/apm-lambda-extension/extension/process_env.go b/apm-lambda-extension/extension/process_env.go index c7e5485e..d59bb7de 100644 --- a/apm-lambda-extension/extension/process_env.go +++ b/apm-lambda-extension/extension/process_env.go @@ -23,6 +23,10 @@ import ( "os" "strconv" "strings" + "github.com/aws/aws-sdk-go/service/secretsmanager" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/session" + "encoding/base64" ) type extensionConfig struct { @@ -62,6 +66,39 @@ func getIntFromEnv(name string) (int, error) { return value, nil } +func getSecret(secretName string) (string, error) { + region := os.Getenv("AWS_REGION") + + sess, err := session.NewSession() + if err != nil { + return "", err + } + svc := secretsmanager.New(sess, aws.NewConfig().WithRegion(region)) + input := &secretsmanager.GetSecretValueInput{ + SecretId: aws.String(secretName), + VersionStage: aws.String("AWSCURRENT"), + } + + result, err := svc.GetSecretValue(input) + if err != nil { + return "", err + } + + var secretString string + if result.SecretString != nil { + secretString = *result.SecretString + } else { + decodedBinarySecretBytes := make([]byte, base64.StdEncoding.DecodedLen(len(result.SecretBinary))) + len, err := base64.StdEncoding.Decode(decodedBinarySecretBytes, result.SecretBinary) + if err != nil { + return "", err + } + secretString = string(decodedBinarySecretBytes[:len]) + } + + return secretString, nil +} + // ProcessEnv extracts ENV variables into globals func ProcessEnv() *extensionConfig { dataReceiverTimeoutSeconds, err := getIntFromEnv("ELASTIC_APM_DATA_RECEIVER_TIMEOUT_SECONDS") @@ -82,7 +119,7 @@ func ProcessEnv() *extensionConfig { normalizedApmLambdaServer = normalizedApmLambdaServer + "/" } - logLevel, err := ParseLogLevel(os.Getenv("ELASTIC_APM_LOG_LEVEL")) + logLevel, err := ParseLogLevel(strings.ToLower(os.Getenv("ELASTIC_APM_LOG_LEVEL"))) if err != nil { logLevel = zapcore.InfoLevel Log.Warnf("Could not read ELASTIC_APM_LOG_LEVEL, defaulting to %s", logLevel) @@ -95,10 +132,34 @@ func ProcessEnv() *extensionConfig { normalizedSendStrategy = Background } + apmServerApiKey := os.Getenv("ELASTIC_APM_API_KEY") + apmServerApiKeySMSecretId := os.Getenv("ELASTIC_APM_SECRET_MANAGER_API_KEY_ID") + if apmServerApiKeySMSecretId != "" { + result, err := getSecret(apmServerApiKeySMSecretId) + if err != nil { + Log.Fatalf("Failed loading APM Server ApiKey from Secret Manager: %v", err) + } else { + Log.Infof("Using the APM API key retrieved from Secret Manager.") + apmServerApiKey = result + } + } + + apmServerSecretToken := os.Getenv("ELASTIC_APM_SECRET_TOKEN") + apmServerSecretTokenSMSecretId := os.Getenv("ELASTIC_APM_SECRET_MANAGER_SECRET_TOKEN_ID") + if apmServerSecretTokenSMSecretId != "" { + result, err := getSecret(apmServerSecretTokenSMSecretId) + if err != nil { + Log.Fatalf("Failed loading APM Server Secret Token from Secret Manager: %v", err) + } else { + Log.Infof("Using the APM secret token retrieved from Secret Manager.") + apmServerSecretToken = result + } + } + config := &extensionConfig{ apmServerUrl: normalizedApmLambdaServer, - apmServerSecretToken: os.Getenv("ELASTIC_APM_SECRET_TOKEN"), - apmServerApiKey: os.Getenv("ELASTIC_APM_API_KEY"), + apmServerSecretToken: apmServerSecretToken, + apmServerApiKey: apmServerApiKey, dataReceiverServerPort: fmt.Sprintf(":%s", os.Getenv("ELASTIC_APM_DATA_RECEIVER_SERVER_PORT")), SendStrategy: normalizedSendStrategy, dataReceiverTimeoutSeconds: dataReceiverTimeoutSeconds, diff --git a/apm-lambda-extension/go.mod b/apm-lambda-extension/go.mod index f36283cc..cb532e06 100644 --- a/apm-lambda-extension/go.mod +++ b/apm-lambda-extension/go.mod @@ -3,6 +3,7 @@ module elastic/apm-lambda-extension go 1.17 require ( + github.com/aws/aws-sdk-go v1.44.27 github.com/google/uuid v1.3.0 github.com/joho/godotenv v1.4.0 github.com/magefile/mage v1.13.0 // indirect @@ -18,6 +19,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/google/go-cmp v0.5.6 // indirect + github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/apm-lambda-extension/go.sum b/apm-lambda-extension/go.sum index a15011b3..4a908e66 100644 --- a/apm-lambda-extension/go.sum +++ b/apm-lambda-extension/go.sum @@ -1,3 +1,5 @@ +github.com/aws/aws-sdk-go v1.44.27 h1:8CMspeZSrewnbvAwgl8qo5R7orDLwQnTGBf/OKPiHxI= +github.com/aws/aws-sdk-go v1.44.27/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -7,6 +9,10 @@ github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= @@ -47,6 +53,7 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -54,9 +61,13 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= From b869db36248ba3ecd0dd9fac1b24cee6cccb61f6 Mon Sep 17 00:00:00 2001 From: Alexander Wert Date: Fri, 3 Jun 2022 14:47:27 +0200 Subject: [PATCH 2/8] fixed secrets manager name --- apm-lambda-extension/extension/process_env.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apm-lambda-extension/extension/process_env.go b/apm-lambda-extension/extension/process_env.go index d59bb7de..81fc6271 100644 --- a/apm-lambda-extension/extension/process_env.go +++ b/apm-lambda-extension/extension/process_env.go @@ -133,25 +133,25 @@ func ProcessEnv() *extensionConfig { } apmServerApiKey := os.Getenv("ELASTIC_APM_API_KEY") - apmServerApiKeySMSecretId := os.Getenv("ELASTIC_APM_SECRET_MANAGER_API_KEY_ID") + apmServerApiKeySMSecretId := os.Getenv("ELASTIC_APM_SECRETS_MANAGER_API_KEY_ID") if apmServerApiKeySMSecretId != "" { result, err := getSecret(apmServerApiKeySMSecretId) if err != nil { - Log.Fatalf("Failed loading APM Server ApiKey from Secret Manager: %v", err) + Log.Fatalf("Failed loading APM Server ApiKey from Secrets Manager: %v", err) } else { - Log.Infof("Using the APM API key retrieved from Secret Manager.") + Log.Infof("Using the APM API key retrieved from Secrets Manager.") apmServerApiKey = result } } apmServerSecretToken := os.Getenv("ELASTIC_APM_SECRET_TOKEN") - apmServerSecretTokenSMSecretId := os.Getenv("ELASTIC_APM_SECRET_MANAGER_SECRET_TOKEN_ID") + apmServerSecretTokenSMSecretId := os.Getenv("ELASTIC_APM_SECRETS_MANAGER_SECRET_TOKEN_ID") if apmServerSecretTokenSMSecretId != "" { result, err := getSecret(apmServerSecretTokenSMSecretId) if err != nil { - Log.Fatalf("Failed loading APM Server Secret Token from Secret Manager: %v", err) + Log.Fatalf("Failed loading APM Server Secret Token from Secrets Manager: %v", err) } else { - Log.Infof("Using the APM secret token retrieved from Secret Manager.") + Log.Infof("Using the APM secret token retrieved from Secrets Manager.") apmServerSecretToken = result } } From 2d09174d4f15f8b27d985bfe7074c52b16d43cbe Mon Sep 17 00:00:00 2001 From: stuart nelson Date: Tue, 7 Jun 2022 16:25:22 +0200 Subject: [PATCH 3/8] comments --- apm-lambda-extension/extension/process_env.go | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/apm-lambda-extension/extension/process_env.go b/apm-lambda-extension/extension/process_env.go index 81fc6271..86e16161 100644 --- a/apm-lambda-extension/extension/process_env.go +++ b/apm-lambda-extension/extension/process_env.go @@ -18,15 +18,17 @@ package extension import ( + "encoding/base64" + "errors" "fmt" - "go.uber.org/zap/zapcore" "os" "strconv" "strings" - "github.com/aws/aws-sdk-go/service/secretsmanager" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" - "encoding/base64" + "github.com/aws/aws-sdk-go/service/secretsmanager" + "go.uber.org/zap/zapcore" ) type extensionConfig struct { @@ -67,7 +69,10 @@ func getIntFromEnv(name string) (int, error) { } func getSecret(secretName string) (string, error) { - region := os.Getenv("AWS_REGION") + region := strings.TrimSpace(os.Getenv("AWS_REGION")) + if region == "" { + return "", errors.New("must set AWS_REGION") + } sess, err := session.NewSession() if err != nil { @@ -89,11 +94,11 @@ func getSecret(secretName string) (string, error) { secretString = *result.SecretString } else { decodedBinarySecretBytes := make([]byte, base64.StdEncoding.DecodedLen(len(result.SecretBinary))) - len, err := base64.StdEncoding.Decode(decodedBinarySecretBytes, result.SecretBinary) + _, err := base64.StdEncoding.Decode(decodedBinarySecretBytes, result.SecretBinary) if err != nil { return "", err } - secretString = string(decodedBinarySecretBytes[:len]) + secretString = string(decodedBinarySecretBytes) } return secretString, nil @@ -138,10 +143,9 @@ func ProcessEnv() *extensionConfig { result, err := getSecret(apmServerApiKeySMSecretId) if err != nil { Log.Fatalf("Failed loading APM Server ApiKey from Secrets Manager: %v", err) - } else { - Log.Infof("Using the APM API key retrieved from Secrets Manager.") - apmServerApiKey = result } + Log.Infof("Using the APM API key retrieved from Secrets Manager.") + apmServerApiKey = result } apmServerSecretToken := os.Getenv("ELASTIC_APM_SECRET_TOKEN") @@ -150,10 +154,9 @@ func ProcessEnv() *extensionConfig { result, err := getSecret(apmServerSecretTokenSMSecretId) if err != nil { Log.Fatalf("Failed loading APM Server Secret Token from Secrets Manager: %v", err) - } else { - Log.Infof("Using the APM secret token retrieved from Secrets Manager.") - apmServerSecretToken = result } + Log.Infof("Using the APM secret token retrieved from Secrets Manager.") + apmServerSecretToken = result } config := &extensionConfig{ From c9163eb0b854a37179e69a4014155e42015d54c5 Mon Sep 17 00:00:00 2001 From: stuart nelson Date: Tue, 7 Jun 2022 17:24:12 +0200 Subject: [PATCH 4/8] test secret manager --- apm-lambda-extension/extension/process_env.go | 24 ++---- .../extension/process_env_test.go | 76 +++++++++++++++---- apm-lambda-extension/main.go | 14 +++- 3 files changed, 84 insertions(+), 30 deletions(-) diff --git a/apm-lambda-extension/extension/process_env.go b/apm-lambda-extension/extension/process_env.go index 86e16161..93a0200e 100644 --- a/apm-lambda-extension/extension/process_env.go +++ b/apm-lambda-extension/extension/process_env.go @@ -19,14 +19,12 @@ package extension import ( "encoding/base64" - "errors" "fmt" "os" "strconv" "strings" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/secretsmanager" "go.uber.org/zap/zapcore" ) @@ -68,23 +66,17 @@ func getIntFromEnv(name string) (int, error) { return value, nil } -func getSecret(secretName string) (string, error) { - region := strings.TrimSpace(os.Getenv("AWS_REGION")) - if region == "" { - return "", errors.New("must set AWS_REGION") - } +type secretManager interface { + GetSecretValue(*secretsmanager.GetSecretValueInput) (*secretsmanager.GetSecretValueOutput, error) +} - sess, err := session.NewSession() - if err != nil { - return "", err - } - svc := secretsmanager.New(sess, aws.NewConfig().WithRegion(region)) +func getSecret(manager secretManager, secretName string) (string, error) { input := &secretsmanager.GetSecretValueInput{ SecretId: aws.String(secretName), VersionStage: aws.String("AWSCURRENT"), } - result, err := svc.GetSecretValue(input) + result, err := manager.GetSecretValue(input) if err != nil { return "", err } @@ -105,7 +97,7 @@ func getSecret(secretName string) (string, error) { } // ProcessEnv extracts ENV variables into globals -func ProcessEnv() *extensionConfig { +func ProcessEnv(manager secretManager) *extensionConfig { dataReceiverTimeoutSeconds, err := getIntFromEnv("ELASTIC_APM_DATA_RECEIVER_TIMEOUT_SECONDS") if err != nil { dataReceiverTimeoutSeconds = defaultDataReceiverTimeoutSeconds @@ -140,7 +132,7 @@ func ProcessEnv() *extensionConfig { apmServerApiKey := os.Getenv("ELASTIC_APM_API_KEY") apmServerApiKeySMSecretId := os.Getenv("ELASTIC_APM_SECRETS_MANAGER_API_KEY_ID") if apmServerApiKeySMSecretId != "" { - result, err := getSecret(apmServerApiKeySMSecretId) + result, err := getSecret(manager, apmServerApiKeySMSecretId) if err != nil { Log.Fatalf("Failed loading APM Server ApiKey from Secrets Manager: %v", err) } @@ -151,7 +143,7 @@ func ProcessEnv() *extensionConfig { apmServerSecretToken := os.Getenv("ELASTIC_APM_SECRET_TOKEN") apmServerSecretTokenSMSecretId := os.Getenv("ELASTIC_APM_SECRETS_MANAGER_SECRET_TOKEN_ID") if apmServerSecretTokenSMSecretId != "" { - result, err := getSecret(apmServerSecretTokenSMSecretId) + result, err := getSecret(manager, apmServerSecretTokenSMSecretId) if err != nil { Log.Fatalf("Failed loading APM Server Secret Token from Secrets Manager: %v", err) } diff --git a/apm-lambda-extension/extension/process_env_test.go b/apm-lambda-extension/extension/process_env_test.go index 74fec439..3412fb45 100644 --- a/apm-lambda-extension/extension/process_env_test.go +++ b/apm-lambda-extension/extension/process_env_test.go @@ -18,12 +18,19 @@ package extension import ( - "go.uber.org/zap/zapcore" + "encoding/base64" + "fmt" "os" "testing" + + "github.com/aws/aws-sdk-go/service/secretsmanager" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.uber.org/zap/zapcore" ) func TestProcessEnv(t *testing.T) { + sm := new(mockSecretManager) if err := os.Setenv("ELASTIC_APM_LAMBDA_APM_SERVER", "bar.example.com/"); err != nil { t.Fail() return @@ -32,7 +39,7 @@ func TestProcessEnv(t *testing.T) { t.Fail() return } - config := ProcessEnv() + config := ProcessEnv(sm) t.Logf("%v", config) if config.apmServerUrl != "bar.example.com/" { @@ -49,7 +56,7 @@ func TestProcessEnv(t *testing.T) { return } - config = ProcessEnv() + config = ProcessEnv(sm) t.Logf("%v", config) // config normalizes string to ensure it ends in a `/` @@ -82,7 +89,7 @@ func TestProcessEnv(t *testing.T) { t.Fail() return } - config = ProcessEnv() + config = ProcessEnv(sm) if config.dataReceiverServerPort != ":8201" { t.Log("Env port not set correctly") t.Fail() @@ -92,7 +99,7 @@ func TestProcessEnv(t *testing.T) { t.Fail() return } - config = ProcessEnv() + config = ProcessEnv(sm) if config.dataReceiverTimeoutSeconds != 10 { t.Log("APM data receiver timeout not set correctly") t.Fail() @@ -102,7 +109,7 @@ func TestProcessEnv(t *testing.T) { t.Fail() return } - config = ProcessEnv() + config = ProcessEnv(sm) if config.dataReceiverTimeoutSeconds != 15 { t.Log("APM data receiver timeout not set correctly") t.Fail() @@ -112,7 +119,7 @@ func TestProcessEnv(t *testing.T) { t.Fail() return } - config = ProcessEnv() + config = ProcessEnv(sm) if config.DataForwarderTimeoutSeconds != 10 { t.Log("APM data forwarder timeout not set correctly") t.Fail() @@ -122,7 +129,7 @@ func TestProcessEnv(t *testing.T) { t.Fail() return } - config = ProcessEnv() + config = ProcessEnv(sm) if config.DataForwarderTimeoutSeconds != 3 { t.Log("APM data forwarder not set correctly") t.Fail() @@ -132,7 +139,7 @@ func TestProcessEnv(t *testing.T) { t.Fail() return } - config = ProcessEnv() + config = ProcessEnv(sm) if config.apmServerApiKey != "foo" { t.Log("API Key not set correctly") t.Fail() @@ -142,7 +149,7 @@ func TestProcessEnv(t *testing.T) { t.Fail() return } - config = ProcessEnv() + config = ProcessEnv(sm) if config.SendStrategy != "background" { t.Log("Background send strategy not set correctly") t.Fail() @@ -152,7 +159,7 @@ func TestProcessEnv(t *testing.T) { t.Fail() return } - config = ProcessEnv() + config = ProcessEnv(sm) if config.SendStrategy != "syncflush" { t.Log("Syncflush send strategy not set correctly") t.Fail() @@ -162,7 +169,7 @@ func TestProcessEnv(t *testing.T) { t.Fail() return } - config = ProcessEnv() + config = ProcessEnv(sm) if config.LogLevel != zapcore.DebugLevel { t.Log("Log level not set correctly") t.Fail() @@ -172,9 +179,52 @@ func TestProcessEnv(t *testing.T) { t.Fail() return } - config = ProcessEnv() + config = ProcessEnv(sm) if config.LogLevel != zapcore.InfoLevel { t.Log("Log level not set correctly") t.Fail() } } + +func TestGetSecretCalled(t *testing.T) { + originalSecretToken := os.Getenv("ELASTIC_APM_SECRETS_MANAGER_SECRET_TOKEN_ID") + originalApiKey := os.Getenv("ELASTIC_APM_SECRETS_MANAGER_API_KEY_ID") + defer func() { + os.Setenv("ELASTIC_APM_SECRETS_MANAGER_SECRET_TOKEN_ID", originalSecretToken) + os.Setenv("ELASTIC_APM_SECRETS_MANAGER_API_KEY_ID", originalApiKey) + }() + + require.NoError(t, os.Setenv("ELASTIC_APM_LAMBDA_APM_SERVER", "bar.example.com/")) + + require.NoError(t, os.Setenv("ELASTIC_APM_SECRETS_MANAGER_SECRET_TOKEN_ID", "secrettoken")) + require.NoError(t, os.Setenv("ELASTIC_APM_SECRETS_MANAGER_API_KEY_ID", "apikey")) + + sm := new(mockSecretManager) + + config := ProcessEnv(sm) + assert.Equal(t, "secrettoken", config.apmServerSecretToken) + assert.Equal(t, "apikey", config.apmServerApiKey) + + require.NoError(t, os.Setenv("ELASTIC_APM_SECRETS_MANAGER_SECRET_TOKEN_ID", "")) + require.NoError(t, os.Setenv("ELASTIC_APM_SECRETS_MANAGER_API_KEY_ID", "")) + + config = ProcessEnv(sm) + assert.Equal(t, "", config.apmServerSecretToken) + assert.Equal(t, "", config.apmServerApiKey) +} + +type mockSecretManager struct{} + +func (s *mockSecretManager) GetSecretValue(input *secretsmanager.GetSecretValueInput) (*secretsmanager.GetSecretValueOutput, error) { + switch s := *input.SecretId; s { + case "secrettoken": + return &secretsmanager.GetSecretValueOutput{SecretString: input.SecretId}, nil + case "apikey": + data := []byte(s) + secretBinary := make([]byte, base64.StdEncoding.EncodedLen(len(data))) + base64.StdEncoding.Encode(secretBinary, data) + return &secretsmanager.GetSecretValueOutput{SecretBinary: secretBinary}, nil + default: + return nil, fmt.Errorf("unrecognized secret input value %s", s) + } +} diff --git a/apm-lambda-extension/main.go b/apm-lambda-extension/main.go index 5e7d9f58..ae16b15f 100644 --- a/apm-lambda-extension/main.go +++ b/apm-lambda-extension/main.go @@ -28,6 +28,10 @@ import ( "elastic/apm-lambda-extension/extension" "elastic/apm-lambda-extension/logsapi" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/service/secretsmanager" ) var ( @@ -51,8 +55,16 @@ func main() { extension.Log.Infof("Received %v\n, exiting", s) }() + sess, err := session.NewSession() + if err != nil { + extension.Log.Fatalf("failed to create new session: %v", err) + } + // AWS_REGION is automatically set by AWS. + // https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime + region := os.Getenv("AWS_REGION") + manager := secretsmanager.New(sess, aws.NewConfig().WithRegion(region)) // pulls ELASTIC_ env variable into globals for easy access - config := extension.ProcessEnv() + config := extension.ProcessEnv(manager) extension.Log.Level.SetLevel(config.LogLevel) // register extension with AWS Extension API From 076c320caf2401935bf5640bcddd37b804ed30dd Mon Sep 17 00:00:00 2001 From: stuart nelson Date: Tue, 7 Jun 2022 17:24:45 +0200 Subject: [PATCH 5/8] built binary already executable --- apm-lambda-extension/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apm-lambda-extension/Makefile b/apm-lambda-extension/Makefile index b0339735..8d68cdde 100644 --- a/apm-lambda-extension/Makefile +++ b/apm-lambda-extension/Makefile @@ -36,7 +36,7 @@ lint: build: check-licenses GOOS=linux go build -o bin/extensions/apm-lambda-extension main.go - chmod +x bin/extensions/apm-lambda-extension + build-and-publish: check-licenses validate-layer-name validate-aws-default-region ifndef AWS_ACCESS_KEY_ID $(error AWS_ACCESS_KEY_ID is undefined) From fd0e76b71aad73f30ad13ad31c5bdd2923d88711 Mon Sep 17 00:00:00 2001 From: stuart nelson Date: Tue, 7 Jun 2022 17:41:35 +0200 Subject: [PATCH 6/8] NOTICE.txt --- apm-lambda-extension/NOTICE.txt | 664 ++++++++------------- apm-lambda-extension/dependencies.asciidoc | 9 +- 2 files changed, 249 insertions(+), 424 deletions(-) diff --git a/apm-lambda-extension/NOTICE.txt b/apm-lambda-extension/NOTICE.txt index 99c203f9..b9b94e59 100644 --- a/apm-lambda-extension/NOTICE.txt +++ b/apm-lambda-extension/NOTICE.txt @@ -18,146 +18,12 @@ Third party libraries used by the Elastic APM AWS Lambda extension. -------------------------------------------------------------------------------- -Module : github.com/google/uuid -Version : v1.3.0 -Time : 2021-07-12T22:33:52Z -Licence : BSD-3-Clause - -Contents of probable licence file $GOMODCACHE/github.com/google/uuid@v1.3.0/LICENSE: - -Copyright (c) 2009,2014 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Module : github.com/joho/godotenv -Version : v1.4.0 -Time : 2021-03-04T09:35:31Z -Licence : MIT - -Contents of probable licence file $GOMODCACHE/github.com/joho/godotenv@v1.4.0/LICENCE: - -Copyright (c) 2013 John Barton - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - - --------------------------------------------------------------------------------- -Module : github.com/pkg/errors -Version : v0.9.1 -Time : 2020-01-14T19:47:44Z -Licence : BSD-2-Clause - -Contents of probable licence file $GOMODCACHE/github.com/pkg/errors@v0.9.1/LICENSE: - -Copyright (c) 2015, Dave Cheney -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------------------------------------------------------------------------------- -Module : github.com/stretchr/testify -Version : v1.7.0 -Time : 2021-01-13T09:54:11Z -Licence : MIT - -Contents of probable licence file $GOMODCACHE/github.com/stretchr/testify@v1.7.0/LICENSE: - -MIT License - -Copyright (c) 2012-2020 Mat Ryer, Tyler Bunnell and contributors. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - --------------------------------------------------------------------------------- -Module : go.elastic.co/ecszap -Version : v1.0.1 -Time : 2022-02-17T08:43:34Z +Module : github.com/aws/aws-sdk-go +Version : v1.44.27 +Time : 2022-06-02T18:32:20Z Licence : Apache-2.0 -Contents of probable licence file $GOMODCACHE/go.elastic.co/ecszap@v1.0.1/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/aws/aws-sdk-go@v1.44.27/LICENSE.txt: Apache License @@ -348,7 +214,7 @@ Contents of probable licence file $GOMODCACHE/go.elastic.co/ecszap@v1.0.1/LICENS same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2020 Elastic and contributors + Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -362,129 +228,16 @@ Contents of probable licence file $GOMODCACHE/go.elastic.co/ecszap@v1.0.1/LICENS See the License for the specific language governing permissions and limitations under the License. --------------------------------------------------------------------------------- -Module : go.uber.org/zap -Version : v1.21.0 -Time : 2022-02-07T16:54:02Z -Licence : MIT - -Contents of probable licence file $GOMODCACHE/go.uber.org/zap@v1.21.0/LICENSE.txt: - -Copyright (c) 2016-2017 Uber Technologies, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -------------------------------------------------------------------------------- -Module : gotest.tools -Version : v2.2.0+incompatible -Time : 2018-11-11T18:29:05Z -Licence : Apache-2.0 - -Contents of probable licence file $GOMODCACHE/gotest.tools@v2.2.0+incompatible/LICENSE: - -Copyright 2018 gotest.tools authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - - - - -================================================================================ -Indirect dependencies - - --------------------------------------------------------------------------------- -Module : github.com/benbjohnson/clock -Version : v1.1.0 -Time : 2020-11-24T13:07:21Z -Licence : MIT - -Contents of probable licence file $GOMODCACHE/github.com/benbjohnson/clock@v1.1.0/LICENSE: - -The MIT License (MIT) - -Copyright (c) 2014 Ben Johnson - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - --------------------------------------------------------------------------------- -Module : github.com/davecgh/go-spew -Version : v1.1.1 -Time : 2018-02-21T23:26:28Z -Licence : ISC - -Contents of probable licence file $GOMODCACHE/github.com/davecgh/go-spew@v1.1.1/LICENSE: - -ISC License - -Copyright (c) 2012-2016 Dave Collins - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - --------------------------------------------------------------------------------- -Module : github.com/google/go-cmp -Version : v0.5.6 -Time : 2021-05-25T02:50:45Z +Module : github.com/google/uuid +Version : v1.3.0 +Time : 2021-07-12T22:33:52Z Licence : BSD-3-Clause -Contents of probable licence file $GOMODCACHE/github.com/google/go-cmp@v0.5.6/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/google/uuid@v1.3.0/LICENSE: -Copyright (c) 2017 The Go Authors. All rights reserved. +Copyright (c) 2009,2014 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -514,45 +267,82 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -Module : github.com/kr/pretty -Version : v0.1.0 -Time : 2018-05-06T08:33:45Z +Module : github.com/joho/godotenv +Version : v1.4.0 +Time : 2021-03-04T09:35:31Z Licence : MIT -Contents of probable licence file $GOMODCACHE/github.com/kr/pretty@v0.1.0/License: +Contents of probable licence file $GOMODCACHE/github.com/joho/godotenv@v1.4.0/LICENCE: -The MIT License (MIT) +Copyright (c) 2013 John Barton -Copyright 2012 Keith Rarick +MIT License -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -------------------------------------------------------------------------------- -Module : github.com/kr/text -Version : v0.1.0 -Time : 2018-05-06T08:24:08Z +Module : github.com/pkg/errors +Version : v0.9.1 +Time : 2020-01-14T19:47:44Z +Licence : BSD-2-Clause + +Contents of probable licence file $GOMODCACHE/github.com/pkg/errors@v0.9.1/LICENSE: + +Copyright (c) 2015, Dave Cheney +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Module : github.com/stretchr/testify +Version : v1.7.0 +Time : 2021-01-13T09:54:11Z Licence : MIT -Contents of probable licence file $GOMODCACHE/github.com/kr/text@v0.1.0/License: +Contents of probable licence file $GOMODCACHE/github.com/stretchr/testify@v1.7.0/LICENSE: -Copyright 2012 Keith Rarick +MIT License + +Copyright (c) 2012-2020 Mat Ryer, Tyler Bunnell and contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -561,25 +351,26 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. -------------------------------------------------------------------------------- -Module : github.com/magefile/mage -Version : v1.13.0 -Time : 2022-03-16T16:23:18Z +Module : go.elastic.co/ecszap +Version : v1.0.1 +Time : 2022-02-17T08:43:34Z Licence : Apache-2.0 -Contents of probable licence file $GOMODCACHE/github.com/magefile/mage@v1.13.0/LICENSE: +Contents of probable licence file $GOMODCACHE/go.elastic.co/ecszap@v1.0.1/LICENSE: + Apache License Version 2.0, January 2004 @@ -761,7 +552,7 @@ Contents of probable licence file $GOMODCACHE/github.com/magefile/mage@v1.13.0/L APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" + boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a @@ -769,7 +560,7 @@ Contents of probable licence file $GOMODCACHE/github.com/magefile/mage@v1.13.0/L same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2017 the Mage authors + Copyright 2020 Elastic and contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -783,53 +574,15 @@ Contents of probable licence file $GOMODCACHE/github.com/magefile/mage@v1.13.0/L See the License for the specific language governing permissions and limitations under the License. - --------------------------------------------------------------------------------- -Module : github.com/pmezard/go-difflib -Version : v1.0.0 -Time : 2016-01-10T10:55:54Z -Licence : BSD-3-Clause - -Contents of probable licence file $GOMODCACHE/github.com/pmezard/go-difflib@v1.0.0/LICENSE: - -Copyright (c) 2013, Patrick Mezard -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - The names of its contributors may not be used to endorse or promote -products derived from this software without specific prior written -permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -------------------------------------------------------------------------------- -Module : go.uber.org/atomic -Version : v1.9.0 -Time : 2021-07-15T17:19:10Z +Module : go.uber.org/zap +Version : v1.21.0 +Time : 2022-02-07T16:54:02Z Licence : MIT -Contents of probable licence file $GOMODCACHE/go.uber.org/atomic@v1.9.0/LICENSE.txt: +Contents of probable licence file $GOMODCACHE/go.uber.org/zap@v1.21.0/LICENSE.txt: -Copyright (c) 2016 Uber Technologies, Inc. +Copyright (c) 2016-2017 Uber Technologies, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -851,74 +604,68 @@ THE SOFTWARE. -------------------------------------------------------------------------------- -Module : go.uber.org/goleak -Version : v1.1.11 -Time : 2021-09-08T23:26:58Z -Licence : MIT +Module : gotest.tools +Version : v2.2.0+incompatible +Time : 2018-11-11T18:29:05Z +Licence : Apache-2.0 -Contents of probable licence file $GOMODCACHE/go.uber.org/goleak@v1.1.11/LICENSE: +Contents of probable licence file $GOMODCACHE/gotest.tools@v2.2.0+incompatible/LICENSE: -The MIT License (MIT) +Copyright 2018 gotest.tools authors -Copyright (c) 2018 Uber Technologies, Inc. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + http://www.apache.org/licenses/LICENSE-2.0 -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. + + + +================================================================================ +Indirect dependencies -------------------------------------------------------------------------------- -Module : go.uber.org/multierr -Version : v1.8.0 -Time : 2022-02-28T20:35:35Z -Licence : MIT +Module : github.com/davecgh/go-spew +Version : v1.1.1 +Time : 2018-02-21T23:26:28Z +Licence : ISC -Contents of probable licence file $GOMODCACHE/go.uber.org/multierr@v1.8.0/LICENSE.txt: +Contents of probable licence file $GOMODCACHE/github.com/davecgh/go-spew@v1.1.1/LICENSE: -Copyright (c) 2017-2021 Uber Technologies, Inc. +ISC License -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Copyright (c) 2012-2016 Dave Collins -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -------------------------------------------------------------------------------- -Module : golang.org/x/xerrors -Version : v0.0.0-20200804184101-5ec99f83aff1 -Time : 2020-08-04T18:41:01Z +Module : github.com/google/go-cmp +Version : v0.5.6 +Time : 2021-05-25T02:50:45Z Licence : BSD-3-Clause -Contents of probable licence file $GOMODCACHE/golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/google/go-cmp@v0.5.6/LICENSE: -Copyright (c) 2019 The Go Authors. All rights reserved. +Copyright (c) 2017 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -948,47 +695,35 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -Module : gopkg.in/check.v1 -Version : v1.0.0-20180628173108-788fd7840127 -Time : 2018-06-28T17:31:08Z -Licence : BSD-2-Clause +Module : github.com/jmespath/go-jmespath +Version : v0.4.0 +Time : 2020-09-18T23:53:51Z +Licence : Apache-2.0 -Contents of probable licence file $GOMODCACHE/gopkg.in/check.v1@v1.0.0-20180628173108-788fd7840127/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/jmespath/go-jmespath@v0.4.0/LICENSE: -Gocheck - A rich testing framework for Go - -Copyright (c) 2010-2013 Gustavo Niemeyer +Copyright 2015 James Saryerwinnie -All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. -------------------------------------------------------------------------------- -Module : gopkg.in/yaml.v2 -Version : v2.2.8 -Time : 2020-01-21T17:19:40Z +Module : github.com/magefile/mage +Version : v1.13.0 +Time : 2022-03-16T16:23:18Z Licence : Apache-2.0 -Contents of probable licence file $GOMODCACHE/gopkg.in/yaml.v2@v2.2.8/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/magefile/mage@v1.13.0/LICENSE: Apache License Version 2.0, January 2004 @@ -1178,7 +913,7 @@ Contents of probable licence file $GOMODCACHE/gopkg.in/yaml.v2@v2.2.8/LICENSE: same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright {yyyy} {name of copyright owner} + Copyright 2017 the Mage authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -1193,6 +928,101 @@ Contents of probable licence file $GOMODCACHE/gopkg.in/yaml.v2@v2.2.8/LICENSE: limitations under the License. +-------------------------------------------------------------------------------- +Module : github.com/pmezard/go-difflib +Version : v1.0.0 +Time : 2016-01-10T10:55:54Z +Licence : BSD-3-Clause + +Contents of probable licence file $GOMODCACHE/github.com/pmezard/go-difflib@v1.0.0/LICENSE: + +Copyright (c) 2013, Patrick Mezard +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + The names of its contributors may not be used to endorse or promote +products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Module : go.uber.org/atomic +Version : v1.9.0 +Time : 2021-07-15T17:19:10Z +Licence : MIT + +Contents of probable licence file $GOMODCACHE/go.uber.org/atomic@v1.9.0/LICENSE.txt: + +Copyright (c) 2016 Uber Technologies, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +-------------------------------------------------------------------------------- +Module : go.uber.org/multierr +Version : v1.8.0 +Time : 2022-02-28T20:35:35Z +Licence : MIT + +Contents of probable licence file $GOMODCACHE/go.uber.org/multierr@v1.8.0/LICENSE.txt: + +Copyright (c) 2017-2021 Uber Technologies, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + -------------------------------------------------------------------------------- Module : gopkg.in/yaml.v3 Version : v3.0.0-20210107192922-496545a6307b diff --git a/apm-lambda-extension/dependencies.asciidoc b/apm-lambda-extension/dependencies.asciidoc index fe39d0a8..18ed5e8b 100644 --- a/apm-lambda-extension/dependencies.asciidoc +++ b/apm-lambda-extension/dependencies.asciidoc @@ -14,6 +14,7 @@ This page lists the third-party dependencies used to build {n}. |=== | Name | Version | Licence +| link:https://github.com/aws/aws-sdk-go[$$github.com/aws/aws-sdk-go$$] | v1.44.27 | Apache-2.0 | link:https://github.com/google/uuid[$$github.com/google/uuid$$] | v1.3.0 | BSD-3-Clause | link:https://github.com/joho/godotenv[$$github.com/joho/godotenv$$] | v1.4.0 | MIT | link:https://github.com/pkg/errors[$$github.com/pkg/errors$$] | v0.9.1 | BSD-2-Clause @@ -32,19 +33,13 @@ This page lists the third-party dependencies used to build {n}. |=== | Name | Version | Licence -| link:https://github.com/benbjohnson/clock[$$github.com/benbjohnson/clock$$] | v1.1.0 | MIT | link:https://github.com/davecgh/go-spew[$$github.com/davecgh/go-spew$$] | v1.1.1 | ISC | link:https://github.com/google/go-cmp[$$github.com/google/go-cmp$$] | v0.5.6 | BSD-3-Clause -| link:https://github.com/kr/pretty[$$github.com/kr/pretty$$] | v0.1.0 | MIT -| link:https://github.com/kr/text[$$github.com/kr/text$$] | v0.1.0 | MIT +| link:https://github.com/jmespath/go-jmespath[$$github.com/jmespath/go-jmespath$$] | v0.4.0 | Apache-2.0 | link:https://github.com/magefile/mage[$$github.com/magefile/mage$$] | v1.13.0 | Apache-2.0 | link:https://github.com/pmezard/go-difflib[$$github.com/pmezard/go-difflib$$] | v1.0.0 | BSD-3-Clause | link:https://go.uber.org/atomic[$$go.uber.org/atomic$$] | v1.9.0 | MIT -| link:https://go.uber.org/goleak[$$go.uber.org/goleak$$] | v1.1.11 | MIT | link:https://go.uber.org/multierr[$$go.uber.org/multierr$$] | v1.8.0 | MIT -| link:https://golang.org/x/xerrors[$$golang.org/x/xerrors$$] | v0.0.0-20200804184101-5ec99f83aff1 | BSD-3-Clause -| link:https://gopkg.in/check.v1[$$gopkg.in/check.v1$$] | v1.0.0-20180628173108-788fd7840127 | BSD-2-Clause -| link:https://gopkg.in/yaml.v2[$$gopkg.in/yaml.v2$$] | v2.2.8 | Apache-2.0 | link:https://gopkg.in/yaml.v3[$$gopkg.in/yaml.v3$$] | v3.0.0-20210107192922-496545a6307b | MIT |=== From 1fe080973a24ba917b8effd88e91f33b87b37114 Mon Sep 17 00:00:00 2001 From: stuart nelson Date: Tue, 7 Jun 2022 18:13:58 +0200 Subject: [PATCH 7/8] NOTICE.txt --- apm-lambda-extension/NOTICE.txt | 436 +++++++++++++++++++++ apm-lambda-extension/dependencies.asciidoc | 8 + 2 files changed, 444 insertions(+) diff --git a/apm-lambda-extension/NOTICE.txt b/apm-lambda-extension/NOTICE.txt index b9b94e59..cceb01c0 100644 --- a/apm-lambda-extension/NOTICE.txt +++ b/apm-lambda-extension/NOTICE.txt @@ -632,6 +632,37 @@ limitations under the License. Indirect dependencies +-------------------------------------------------------------------------------- +Module : github.com/benbjohnson/clock +Version : v1.1.0 +Time : 2020-11-24T13:07:21Z +Licence : MIT + +Contents of probable licence file $GOMODCACHE/github.com/benbjohnson/clock@v1.1.0/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2014 Ben Johnson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + -------------------------------------------------------------------------------- Module : github.com/davecgh/go-spew Version : v1.1.1 @@ -717,6 +748,97 @@ See the License for the specific language governing permissions and limitations under the License. +-------------------------------------------------------------------------------- +Module : github.com/jmespath/go-jmespath/internal/testify +Version : v1.5.1 +Time : 2020-09-18T22:50:35Z +Licence : MIT + +Contents of probable licence file $GOMODCACHE/github.com/jmespath/go-jmespath/internal/testify@v1.5.1/LICENSE: + +MIT License + +Copyright (c) 2012-2018 Mat Ryer and Tyler Bunnell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +-------------------------------------------------------------------------------- +Module : github.com/kr/pretty +Version : v0.1.0 +Time : 2018-05-06T08:33:45Z +Licence : MIT + +Contents of probable licence file $GOMODCACHE/github.com/kr/pretty@v0.1.0/License: + +The MIT License (MIT) + +Copyright 2012 Keith Rarick + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +-------------------------------------------------------------------------------- +Module : github.com/kr/text +Version : v0.1.0 +Time : 2018-05-06T08:24:08Z +Licence : MIT + +Contents of probable licence file $GOMODCACHE/github.com/kr/text@v0.1.0/License: + +Copyright 2012 Keith Rarick + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + -------------------------------------------------------------------------------- Module : github.com/magefile/mage Version : v1.13.0 @@ -994,6 +1116,37 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +Module : go.uber.org/goleak +Version : v1.1.11 +Time : 2021-09-08T23:26:58Z +Licence : MIT + +Contents of probable licence file $GOMODCACHE/go.uber.org/goleak@v1.1.11/LICENSE: + +The MIT License (MIT) + +Copyright (c) 2018 Uber Technologies, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + -------------------------------------------------------------------------------- Module : go.uber.org/multierr Version : v1.8.0 @@ -1023,6 +1176,289 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +Module : golang.org/x/xerrors +Version : v0.0.0-20200804184101-5ec99f83aff1 +Time : 2020-08-04T18:41:01Z +Licence : BSD-3-Clause + +Contents of probable licence file $GOMODCACHE/golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1/LICENSE: + +Copyright (c) 2019 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Module : gopkg.in/check.v1 +Version : v1.0.0-20180628173108-788fd7840127 +Time : 2018-06-28T17:31:08Z +Licence : BSD-2-Clause + +Contents of probable licence file $GOMODCACHE/gopkg.in/check.v1@v1.0.0-20180628173108-788fd7840127/LICENSE: + +Gocheck - A rich testing framework for Go + +Copyright (c) 2010-2013 Gustavo Niemeyer + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- +Module : gopkg.in/yaml.v2 +Version : v2.2.8 +Time : 2020-01-21T17:19:40Z +Licence : Apache-2.0 + +Contents of probable licence file $GOMODCACHE/gopkg.in/yaml.v2@v2.2.8/LICENSE: + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + -------------------------------------------------------------------------------- Module : gopkg.in/yaml.v3 Version : v3.0.0-20210107192922-496545a6307b diff --git a/apm-lambda-extension/dependencies.asciidoc b/apm-lambda-extension/dependencies.asciidoc index 18ed5e8b..116b10b3 100644 --- a/apm-lambda-extension/dependencies.asciidoc +++ b/apm-lambda-extension/dependencies.asciidoc @@ -33,13 +33,21 @@ This page lists the third-party dependencies used to build {n}. |=== | Name | Version | Licence +| link:https://github.com/benbjohnson/clock[$$github.com/benbjohnson/clock$$] | v1.1.0 | MIT | link:https://github.com/davecgh/go-spew[$$github.com/davecgh/go-spew$$] | v1.1.1 | ISC | link:https://github.com/google/go-cmp[$$github.com/google/go-cmp$$] | v0.5.6 | BSD-3-Clause | link:https://github.com/jmespath/go-jmespath[$$github.com/jmespath/go-jmespath$$] | v0.4.0 | Apache-2.0 +| link:https://github.com/jmespath/go-jmespath[$$github.com/jmespath/go-jmespath/internal/testify$$] | v1.5.1 | MIT +| link:https://github.com/kr/pretty[$$github.com/kr/pretty$$] | v0.1.0 | MIT +| link:https://github.com/kr/text[$$github.com/kr/text$$] | v0.1.0 | MIT | link:https://github.com/magefile/mage[$$github.com/magefile/mage$$] | v1.13.0 | Apache-2.0 | link:https://github.com/pmezard/go-difflib[$$github.com/pmezard/go-difflib$$] | v1.0.0 | BSD-3-Clause | link:https://go.uber.org/atomic[$$go.uber.org/atomic$$] | v1.9.0 | MIT +| link:https://go.uber.org/goleak[$$go.uber.org/goleak$$] | v1.1.11 | MIT | link:https://go.uber.org/multierr[$$go.uber.org/multierr$$] | v1.8.0 | MIT +| link:https://golang.org/x/xerrors[$$golang.org/x/xerrors$$] | v0.0.0-20200804184101-5ec99f83aff1 | BSD-3-Clause +| link:https://gopkg.in/check.v1[$$gopkg.in/check.v1$$] | v1.0.0-20180628173108-788fd7840127 | BSD-2-Clause +| link:https://gopkg.in/yaml.v2[$$gopkg.in/yaml.v2$$] | v2.2.8 | Apache-2.0 | link:https://gopkg.in/yaml.v3[$$gopkg.in/yaml.v3$$] | v3.0.0-20210107192922-496545a6307b | MIT |=== From e67eb0a919327371343d4f4e5c82da2e195810e2 Mon Sep 17 00:00:00 2001 From: stuart nelson Date: Tue, 7 Jun 2022 18:35:39 +0200 Subject: [PATCH 8/8] test managed and unmanaged secret priority --- apm-lambda-extension/extension/process_env_test.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apm-lambda-extension/extension/process_env_test.go b/apm-lambda-extension/extension/process_env_test.go index 3412fb45..06e6da83 100644 --- a/apm-lambda-extension/extension/process_env_test.go +++ b/apm-lambda-extension/extension/process_env_test.go @@ -189,13 +189,18 @@ func TestProcessEnv(t *testing.T) { func TestGetSecretCalled(t *testing.T) { originalSecretToken := os.Getenv("ELASTIC_APM_SECRETS_MANAGER_SECRET_TOKEN_ID") originalApiKey := os.Getenv("ELASTIC_APM_SECRETS_MANAGER_API_KEY_ID") + originalUnmanagedSecretToken := os.Getenv("ELASTIC_APM_SECRET_TOKEN") + originalUnmanagedApiKey := os.Getenv("ELASTIC_APM_API_KEY") defer func() { os.Setenv("ELASTIC_APM_SECRETS_MANAGER_SECRET_TOKEN_ID", originalSecretToken) os.Setenv("ELASTIC_APM_SECRETS_MANAGER_API_KEY_ID", originalApiKey) + os.Setenv("ELASTIC_APM_SECRET_TOKEN", originalUnmanagedSecretToken) + os.Setenv("ELASTIC_APM_API_KEY", originalUnmanagedApiKey) }() require.NoError(t, os.Setenv("ELASTIC_APM_LAMBDA_APM_SERVER", "bar.example.com/")) - + require.NoError(t, os.Setenv("ELASTIC_APM_SECRET_TOKEN", "unmanagedsecret")) + require.NoError(t, os.Setenv("ELASTIC_APM_API_KEY", "unmanagedapikey")) require.NoError(t, os.Setenv("ELASTIC_APM_SECRETS_MANAGER_SECRET_TOKEN_ID", "secrettoken")) require.NoError(t, os.Setenv("ELASTIC_APM_SECRETS_MANAGER_API_KEY_ID", "apikey")) @@ -209,8 +214,8 @@ func TestGetSecretCalled(t *testing.T) { require.NoError(t, os.Setenv("ELASTIC_APM_SECRETS_MANAGER_API_KEY_ID", "")) config = ProcessEnv(sm) - assert.Equal(t, "", config.apmServerSecretToken) - assert.Equal(t, "", config.apmServerApiKey) + assert.Equal(t, "unmanagedsecret", config.apmServerSecretToken) + assert.Equal(t, "unmanagedapikey", config.apmServerApiKey) } type mockSecretManager struct{}