aws/aws-sdk-js — pull request #78 by lsegal (2013-03-15 23:28:53+00:00)
Title: Load credentials from EC2 instance metadata

Updates the credential resolvers to work asynchronously. This adds a few semi-backward incompatible changes:

* `Credentials.refresh()` now takes a callback that returns a potential error from resolution.
* `CredentialProviderChain.resolve()` no longer returns a credentials object, instead takes a callback that returns (err, creds).
* Adds `Credentials.get()` that should be used in asynchronous scenarios.
* Adds `Config.getCredentials()` as the standard mechanism to get credentials with async support. This method will search the credentials object if set, and use the `credentialProvider` property otherwise.
* Adds the `Config.credentialProvider` option to resolve credentials if not statically assigned with `credentials`.
* Also adds `AWS.MetadataService` to query the instance metadata (used by `EC2MetadataCredentials` under the hood).