64 Commits

Author SHA1 Message Date
weeniearms
b5da4d09ed Added possibility to specify custom S3 key prefix instead of the standard 'serverless' 2018-09-17 09:35:40 +02:00
Frank Schmid
c713f439e5
Add retry unit tests, check credential errors for one retry. 2018-05-22 12:35:50 +02:00
Frank Schmid
6b2eb9f126
Add unit test for 429 and retryable = false 2018-05-17 15:22:37 +02:00
horike37
04a8d17041 revived getAccountId 2018-05-05 17:23:37 +09:00
Mariusz Nowak
80c00b91e8 Recognize recoverable errors by retryable property 2018-04-05 16:40:45 +02:00
Takahiro Horike
5c886b5b2c
Merge branch 'master' into sls-govcloud 2018-03-13 06:02:22 +09:00
Erik Erikson
4400ffc9e4 fix #4311 & #4734, separate PromiseTracker, minutiae
#4311
  see prepopulateService - attempts to pre-populate the region and stage settings necessary for making a request to AWS, rejecting and dependencies thereon it runs into during that process
  see the `deep` variable work.  this was a knock-on effect of providing pre-population.  it actually represents an obscure class of bugs where the recursive population previously in getDeepValue caused the caller not to be in charge of population choices (thus fixing for pre-population) but also caused potential deadlocks resulting from getDeepValue creating circular dependencies.

#4734
  see splitByComma - a regex to do the splitting but ignore quoted commas was getting very deep and involved.  Instead, identify quoted string boundaries, then identify commas (including white space around them) and take those commas not contained by quotes as the locations for splitting the given string.  Trim the string as well (removing leading and trailing white space).
  add sophistication to the overwrite syntax, allowing for whitespace and repetitions (for robustness)
  add sophistication to the string ref syntax, allowing for use in identifying multiple quoted strings in a variable (i.e. for overwrites)

#NotCreated
  fix a bug I created earlier in the branch that caused reporting to be less informative (see renderMatches)

separate PromiseTracker
  move this class into its own file for the purpose of increasing testability and offering reuse

minutiae
  filter the properties given to populateVariables so as to avoid attempting resolution on non-variables.  Efficiency and noise reduction change.  Also cleans up the code (e.g. see populateObject and its use)
  cleaning of overwrite as a side effect
  offer variable cleaning as a idiom
  reorder the Variables.js `require`s to be in alphabetical order
2018-02-16 17:13:03 -08:00
Mike Pugh
113ec4cceb Updae tests 2018-01-19 14:59:49 -05:00
Frank Schmid
81c896bc12
Removed reintroduction of stage+region in request. Added options.
Delete bucket was still using them

Hopefully all :)

Further test fixes.

.... worked too long yesterday

Fixed Variable tests

Remove not used parameters from request() and add options with warning
2017-12-11 12:33:35 +01:00
Frank Schmid
5526802a1b
Added request cache and queue to AWS provider
Make sure that requests are throttled. Use a queue for the requests.

Added new expected parameter to request() call in variables test

Added request cache tests
Check that request is indeed called 1000 times

Cache promises, not values

Use request cache for AWS variable requests

Use fromCallback instead of "new Promise" anti-pattern.

Added request cache to AWS provider
2017-12-05 12:39:39 +01:00
Rafal Wilinski
8a02d2a4a3
Merge pull request #4118 from geofflancaster/master
Updated awsProvider to allow manual specification of certificate auth…
2017-12-03 09:00:47 +01:00
Alex Casalboni
5c5f893e69 Added tests (increased coverage) 2017-10-28 01:51:42 +02:00
Alex Casalboni
64ccb046a7
Merge branch 'master' into issue4252-s3-transfer-acceleration 2017-10-28 00:59:18 +02:00
Alex Casalboni
61a9d433dc removed enableBucketAcceleration (no API call should be needed -> CloudFormation support!) 2017-10-27 15:58:44 +02:00
Geoffrey Lancaster
de342e9044 resolved merge issues 2017-10-18 22:50:34 -06:00
Geoffrey Lancaster
39274ed8e1 resolved eslint issues 2017-10-18 22:15:03 -06:00
Geoffrey Lancaster
3a0be84201 fixed typo 2017-10-18 22:09:28 -06:00
Geoffrey Lancaster
2a524aaf9c updated test suite per requests 2017-10-18 21:54:08 -06:00
horike37
4b623b0e18 change position which false is assigned 2017-10-07 18:54:09 +09:00
Alex Casalboni
2c93221e9b jslint 2017-09-22 17:53:17 -04:00
Alex Casalboni
c7a7ceeb87 100% coverage for awsProvider.js (refactor & new tests, plus a minor test nesting fix) 2017-09-22 17:49:19 -04:00
Geoffrey Lancaster
5862aa5498 removed comments 2017-09-22 10:17:43 -05:00
Geoffrey Lancaster
b7ecaf737f fixed lint error 2017-09-21 20:11:29 -05:00
Geoffrey Lancaster
e4c26a0d03 updated to use path.join and afterEarch for env variable clean up 2017-09-21 20:06:13 -05:00
Geoffrey Lancaster
e520c6bd02 Merge remote-tracking branch 'parent/master' 2017-09-21 17:23:31 -05:00
Rafal Wilinski
daffd05788 Fix throw condition and add tests 2017-09-11 23:37:11 +02:00
Philipp Muens
490f517d12 Fix failing AWS provider test 2017-08-26 12:41:25 +02:00
Geoffrey Lancaster
d4430dca53 lint fixes 2017-08-17 18:27:35 -05:00
Geoffrey Lancaster
6114750bcc using string templates 2017-08-17 18:21:54 -05:00
Geoffrey Lancaster
ee4010c7c7 updated multiline string and spacing 2017-08-17 18:13:54 -05:00
Geoffrey Lancaster
c32f2cb6aa Now using arrow callbacks and shortened line in test script 2017-08-17 18:07:43 -05:00
Geoffrey Lancaster
cf91751c63 Updated awsProvider to allow manual specification of certificate authorities. 2017-08-17 17:32:19 -05:00
mpuittinen
5325d3a0b9 Fix #3979. CLI option aws-profile overrides AWS_PROFILE env var 2017-07-24 10:42:48 +03:00
Eslam λ Hefnawy
40d529ced5 Revert "Improves invalid security token message per issue #3862" 2017-07-12 17:49:37 +07:00
Philipp Muens
4ed4a8e9bb Update to match two security token related cases 2017-07-07 16:40:17 +02:00
Ralph Dugue
a91c827633 Fixing error with matching in test 2017-07-07 08:37:53 -04:00
Ralph Dugue
c15ec99d9c Fixed some issues per recommendations and added test 2017-07-07 07:13:14 -04:00
Philipp Muens
526d3a6da4 Refactor code to support deploymentBucket object representation globally 2017-06-16 11:50:51 +01:00
Philipp Muens
1d9aed5219 Add tests for setting the signatureVersion 2017-06-16 10:55:05 +01:00
Philipp Muens
8ca5f214f8 Add aws-profile option support 2017-05-29 13:50:03 +02:00
Philipp Muens
8d348da0ce Merge master into PR 2017-03-23 12:29:07 +01:00
Philipp Muens
fef124e800 Restore global setTimeout to get into a clean state again 2017-03-15 12:12:38 +01:00
Ryan S. Brown
c95b40c584 Use stub on setTimeout instead 2017-03-14 18:14:05 -04:00
Ryan S. Brown
1ee36e798f Reduce test time by 50%
This commit removes a hardcoded 5 second sleep intended to help handle
rate limits. The retry interval is changed during the test to 250ms from
5 seconds, with no change to the runtime behavior of the framework.
2017-03-14 09:16:48 -04:00
Doug Moscrop
1012c351b7 add sinon-bluebird to make promises in tests a bit cleaner 2017-02-08 12:59:18 -05:00
Erik Erikson
5bd31687b5 Use STS getCallerIdentity instead of IAM getUser
A possible fix for https://github.com/serverless/serverless/issues/3151
Switch from using IAM `getUser` to get the account ID of the current user to calling STS `getCallerIdentity`.  It is expected that this is a less protected segment of rights and will, as a result, impact fewer users.  Of course, this is hard to guarantee.
Changes tests appropriately

Related Docs:
http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/STS.html#getCallerIdentity-property
2017-01-26 18:14:15 -08:00
Philipp Muens
116c79dbf8 Refactor function arn generation for info plugin 2017-01-20 14:45:11 +01:00
Erik Erikson
3210aff617 Detect Successful Async Credential Loading
Check for the roleArn attribute on ini file loaded credentials.  If that exists, then asynchronous (assume role) credentials are being loaded but they may not yet be received.  Accept these as valid credentials and use the containing credentials object as the current credentials object.

Clean up the test data (fakeCredentials didn't need so much)
Create a test that verifies the async credential loading functionality
Create a test that ensures a non-existent profile one attempts to load does not load any credentials

Bump the version of the aws-sdk so that the modified aws-sdk will be demanded for proper handling of this feature.
2016-12-01 01:45:14 -08:00
Erik Erikson
0ddd4ec804 Credential Fixes Roundup
Merge fixes from both #2373 & #2695, adding editorial suggestions and future-proofing them a bit (probably)

Clean up tests to broadly clean and restore process/test environment and simplify test code.
This work uncovered that we were returning profiles when no profile credentials were loaded.  This seems inappropriate.  The tests were modified to use the temporary credential file code that @stevecaldwell77 wrote, exclusively.  This way there are actual credentials to load from the given profile.

I am not sure how to test the assume-role/asynchronous STS credential loading capability and would love some help making sure that is right
2016-11-29 03:16:47 -08:00
Erik Erikson
e317399da4 Merge remote-tracking branch 'journeyapps/fix-async-credentials' into credentials-fixes 2016-11-28 23:06:03 -08:00