Updated SQSPoster to accept token as optional parameter

This commit is contained in:
Trial97
2019-02-28 15:29:41 +02:00
committed by Dan Christian Bogos
parent 40a301676f
commit a661a4c88b
2 changed files with 2 additions and 3 deletions

View File

@@ -92,7 +92,7 @@
},
"sqs_test_file": {
"export_format": "*sqs_json_map",
"export_path": "http://localhost:4576/?aws_region=eu-west-1&aws_key=key1&aws_secret=secret&aws_token=token",
"export_path": "http://sqs.eu-west-2.amazonaws.com/?aws_region=eu-west-2&aws_key=testkey&aws_secret=testsecret",
"content_fields": [
{"tag": "CGRID", "type": "*composed", "value": "~CGRID", "field_id": "CGRID"},
],

View File

@@ -663,8 +663,7 @@ func (pstr *SQSPoster) newPosterSession() (s *sqs.SQS, err error) {
cfg.Region = aws.String(pstr.awsRegion)
}
if len(pstr.awsID) != 0 &&
len(pstr.awsKey) != 0 &&
len(pstr.awsToken) != 0 {
len(pstr.awsKey) != 0 {
cfg.Credentials = credentials.NewStaticCredentials(pstr.awsID, pstr.awsKey, pstr.awsToken)
}
ses, err = session.NewSessionWithOptions(