Skip to content

Commit

Permalink
Added more documentation to credentials.js
Browse files Browse the repository at this point in the history
  • Loading branch information
murgatroid99 committed Oct 7, 2015
1 parent 47f519e commit 4de94d4
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/node/src/credentials.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,29 @@

/**
* Credentials module
*
* This module contains factory methods for two different credential types:
* CallCredentials and ChannelCredentials. ChannelCredentials are things like
* SSL credentials that can be used to secure a connection, and are used to
* construct a Client object. CallCredentials genrally modify metadata, so they
* can be attached to an individual method call.
*
* CallCredentials can be composed with other CallCredentials to create
* CallCredentials. ChannelCredentials can be composed with CallCredentials
* to create ChannelCredentials. No combined credential can have more than
* one ChannelCredentials.
*
* For example, to create a client secured with SSL that uses Google
* default application credentials to authenticate:
*
* var channel_creds = credentials.createSsl(root_certs);
* (new GoogleAuth()).getApplicationDefault(function(err, credential) {
* var call_creds = credentials.createFromGoogleCredential(credential);
* var combined_creds = credentials.combineChannelCredentials(
* channel_creds, call_creds);
* var client = new Client(address, combined_creds);
* });
*
* @module
*/

Expand Down Expand Up @@ -134,7 +157,7 @@ exports.combineCallCredentials = function() {

/**
* Create an insecure credentials object. This is used to create a channel that
* does not use SSL.
* does not use SSL. This cannot be composed with anything.
* @return {ChannelCredentials} The insecure credentials object
*/
exports.createInsecure = ChannelCredentials.createInsecure;

0 comments on commit 4de94d4

Please sign in to comment.