Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from Azure/master
Browse files Browse the repository at this point in the history
.
  • Loading branch information
huangpf committed Jun 23, 2015
2 parents 343251c + 897ff89 commit d217973
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 13 deletions.
21 changes: 17 additions & 4 deletions lib/services/keyVault/lib/jwk.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,45 @@
/* jshint latedef:false */
/* jshint camelcase:false */

/** @class
/** Constants that identify encryption algorithms.
* @namespace
*/
function JsonWebKeyEncryptionAlgorithms() {
}

/** @inner */
JsonWebKeyEncryptionAlgorithms.RSAOAEP = 'RSA-OAEP';
/** @inner */
JsonWebKeyEncryptionAlgorithms.RSA15 = 'RSA1_5';

/** @class
/** Constants that identify signing algorithms.
* @namespace
*/
function JsonWebKeySignatureAlgorithms() {
}

/** @inner */
JsonWebKeySignatureAlgorithms.RS256 = 'RS256';
/** @inner */
JsonWebKeySignatureAlgorithms.RS384 = 'RS384';
/** @inner */
JsonWebKeySignatureAlgorithms.RS512 = 'RS512';
JsonWebKeySignatureAlgorithms.RS256 = 'RSNULL';
/** @inner */
JsonWebKeySignatureAlgorithms.RSNULL = 'RSNULL';

/** @class
/** Constants that identify JWK (Json Web Key) types.
* @namespace
*/
function JsonWebKeyType() {
}

/** @inner */
JsonWebKeyType.EC = 'EC';
/** @inner */
JsonWebKeyType.RSA = 'RSA';
/** @inner */
JsonWebKeyType.RSAHSM = 'RSA-HSM';
/** @inner */
JsonWebKeyType.OCT = 'oct';

/** @class
Expand Down
7 changes: 5 additions & 2 deletions lib/services/keyVault/lib/keyVault.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ var kvcreds = require('./keyVaultCredentials');

var exports = module.exports;

exports.Jwk = jwk;
exports.JsonWebKey = jwk.JsonWebKey;
exports.JsonWebKeyEncryptionAlgorithms = jwk.JsonWebKeyEncryptionAlgorithms;
exports.JsonWebKeySignatureAlgorithms = jwk.JsonWebKeySignatureAlgorithms;
exports.KeyVaultCredentials = kvcreds.KeyVaultCredentials;

/** Identifier of the resource on which Key Vault users and service principals must authenticate.
Expand Down Expand Up @@ -466,7 +468,8 @@ KeyVaultClient.prototype.getSecretVersionsNext = function(nextLink, callback) {
*/

/** An identifier for an Azure Key Vault resource.
*/
* @class
*/
function ObjectIdentifier(collection, vault, name, version) {

/** The vault URI.
Expand Down
3 changes: 2 additions & 1 deletion lib/services/keyVault/lib/keyVaultCredentials.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var requestPipeline = AzureCommon.requestPipeline;

/**
* An object that performs authentication for Key Vault.
* @class
* @param {KeyVaultCredentials~authRequest} authenticator A callback that receives a challenge and returns an authentication token.
*/
function KeyVaultCredentials(authenticator) {
Expand Down Expand Up @@ -127,7 +128,7 @@ KeyVaultCredentials.prototype.addChallengeToCache = function(resource, challenge
/**
* @callback KeyVaultCredentials~authResponse
* @param {object} err An error object. Must be null if the authentication was successful.
* @param {string} authorization The contents of an 'authorization' header that answers the challenge. Typically a string in the format 'Bearer <token>'.
* @param {string} authorization The contents of an 'authorization' header that answers the challenge. Typically a string in the format 'Bearer &lt;token&gt;'.
*/

module.exports.KeyVaultCredentials = KeyVaultCredentials;
Expand Down
6 changes: 3 additions & 3 deletions lib/services/keyVault/lib/keyVaultInternalClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var DEFAULT_API_VERSION = '2015-06-01';
var API_VERSION_QUERY_PARAM = 'api-version=' + DEFAULT_API_VERSION;

var KeyVaultInternalClient = ( /** @lends KeyVaultInternalClient */ function() {
/**
/* (jsdoc off)
* @class
* Initializes a new instance of the KeyVaultInternalClient class.
* @constructor
Expand Down Expand Up @@ -89,7 +89,7 @@ var KeyVaultInternalClient = ( /** @lends KeyVaultInternalClient */ function() {
exports.KeyVaultInternalClient = KeyVaultInternalClient;

var KeyOperations = ( /** @lends KeyOperations */ function() {
/**
/* (jsdoc off)
* @class
* Cryptographic and management operations for keys in a vault
* __NOTE__: An instance of this class is automatically created for an
Expand Down Expand Up @@ -1370,7 +1370,7 @@ var KeyOperations = ( /** @lends KeyOperations */ function() {
})();

var SecretOperations = ( /** @lends SecretOperations */ function() {
/**
/* (jsdoc off)
* @class
* Operations for secrets in a vault
* __NOTE__: An instance of this class is automatically created for an
Expand Down
2 changes: 1 addition & 1 deletion lib/services/keyVault/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"Zavery, Amar <[email protected]>",
"Wang, Yugang <[email protected]>"
],
"version": "0.10.0",
"version": "0.10.1",
"description": "Microsoft Azure Key Vault Client Library for node",
"tags": [
"azure",
Expand Down
3 changes: 1 addition & 2 deletions test/services/keyVault/kv-test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

var Testutil = require('../../util/util');
var KeyVault = Testutil.libRequire('services/keyVault');
var Jwk = KeyVault.Jwk;
var AuthenticationContext = require('adal-node').AuthenticationContext;
var Forge = require('node-forge');
var BigInteger = Forge.jsbn.BigInteger;
Expand Down Expand Up @@ -113,7 +112,7 @@ function clone(obj) {
return new Buffer(obj);
}
if (obj instanceof Object) {
if (obj instanceof Jwk.JsonWebKey) result = new Jwk.JsonWebKey();
if (obj instanceof KeyVault.JsonWebKey) result = new KeyVault.JsonWebKey();
else
if (obj instanceof KeyVault.KeyAttributes) result = new KeyVault.KeyAttributes();
else
Expand Down

0 comments on commit d217973

Please sign in to comment.