Permalink
Browse files

Document AWS.Credentials class

  • Loading branch information...
1 parent bb93b0c commit 5c6cd653de379c0d145c424266871d2a29e469e0 @lsegal lsegal committed Dec 4, 2012
Showing with 35 additions and 2 deletions.
  1. +35 −2 lib/config.js
View
37 lib/config.js
@@ -188,6 +188,38 @@ AWS.Config = inherit({
}
});
+/**
+ * Represents your AWS security credentials, specifically the
+ * {accessKeyId}, {secretAcessKey}, and optional {sessionToken}.
+ * Creating a +Credentials+ object allows you to pass around your
+ * security information to configuration and service objects.
+ *
+ * Note that this class typically does not need to be constructed manually,
+ * as the {AWS.Config} and {AWS.Client} classes both accept simple
+ * options hashes with the three keys. These structures will be converted
+ * into Credentials objects automatically.
+ *
+ * == Expiring and Refreshing Credentials
+ *
+ * Occasionally credentials can expire in the middle of a long-running
+ * application. In this case, the SDK will automatically attempt to
+ * refresh the credentials from the storage location if the Credentials
+ * class implements the {refresh} method.
+ *
+ * If you are implementing a credential storage location, you
+ * will want to create a subclass of the +Credentials+ class and
+ * override the {refresh} method. This method allows credentials to be
+ * retrieved from the backing store, be it a file system, database, or
+ * some network storage. The method should reset the credential attributes
+ * on the object.
+ *
+ * @!attribute accessKeyId
+ * @return [String] the AWS access key ID
+ * @!attribute secretAccessKey
+ * @return [String] the AWS secret access key
+ * @!attribute sessionToken
+ * @return [String] an optional AWS session token
+ */
AWS.Credentials = inherit({
/**
@@ -229,8 +261,9 @@ AWS.Credentials = inherit({
/**
* Refreshes the credentials.
*
- * @note Subclasses should override this class to provide credential
- * refresh behavior.
+ * @note Subclasses should override this class to reset the
+ * {accessKeyId}, {secretAccessKey} and optional {sessionToken}
+ * on the credentials object.
*/
refresh: function refresh() { }

0 comments on commit 5c6cd65

Please sign in to comment.