Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* Either a pair of cert / key values need to be pass or a pem file location.
*
* @param {string} credentials.username The username.
* @param {string} credentials.password The password.
* @return {BasicAuthenticationCloudCredentials}
*/
exports.createBasicAuthenticationCloudCredentials = azureWebSite.createBasicAuthenticationCloudCredentials;
exports.Constants = azureCommon.Constants;
exports.ServiceClient = azureCommon.ServiceClient;
exports.ServiceClientConstants = azureCommon.ServiceClientConstants;
exports.ConnectionStringParser = azureCommon.ConnectionStringParser;
exports.Logger = azureCommon.Logger;
exports.WebResource = azureCommon.WebResource;
exports.Validate = azureCommon.validate;
exports.date = azureCommon.date;
exports.ServiceSettings = azureCommon.ServiceSettings;
exports.ServiceBusSettings = azureCommon.ServiceBusSettings;
exports.ServiceManagementSettings = azureCommon.ServiceManagementSettings;
exports.StorageServiceSettings = azureCommon.StorageServiceSettings;
// Credentials
exports.CertificateCloudCredentials = azureCommon.CertificateCloudCredentials;
exports.TokenCloudCredentials = azureCommon.TokenCloudCredentials;
exports.AnonymousCloudCredentials = azureCommon.AnonymousCloudCredentials;
exports.SharedAccessSignature = storage.SharedAccessSignature;
exports.SharedKey = storage.SharedKey;
exports.SharedKeyLite = storage.SharedKeyLite;
exports.SharedKeyTable = storage.SharedKeyTable;
exports.SharedKeyLiteTable = storage.SharedKeyLiteTable;
* Either a pair of cert / key values need to be pass or a pem file location.
* @method
* @param {string} credentials.username The username.
* @param {string} credentials.password The password.
* @return {BasicAuthenticationCloudCredentials}
*/
exports.createBasicAuthenticationCloudCredentials = azureWebSite.createBasicAuthenticationCloudCredentials;
exports.Constants = azureCommon.Constants;
exports.ServiceClient = azureCommon.ServiceClient;
exports.ServiceClientConstants = azureCommon.ServiceClientConstants;
exports.ConnectionStringParser = azureCommon.ConnectionStringParser;
exports.Logger = azureCommon.Logger;
exports.WebResource = azureCommon.WebResource;
exports.Validate = azureCommon.validate;
exports.date = azureCommon.date;
exports.ServiceSettings = azureCommon.ServiceSettings;
exports.ServiceBusSettings = azureCommon.ServiceBusSettings;
exports.ServiceManagementSettings = azureCommon.ServiceManagementSettings;
exports.StorageServiceSettings = azureCommon.StorageServiceSettings;
// Credentials
exports.CertificateCloudCredentials = azureCommon.CertificateCloudCredentials;
exports.TokenCloudCredentials = azureCommon.TokenCloudCredentials;
exports.AnonymousCloudCredentials = azureCommon.AnonymousCloudCredentials;
exports.SharedAccessSignature = storage.SharedAccessSignature;
exports.SharedKey = storage.SharedKey;
exports.SharedKeyLite = storage.SharedKeyLite;
exports.SharedKeyTable = storage.SharedKeyTable;
exports.SharedKeyLiteTable = storage.SharedKeyLiteTable;
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
var util = require('util');
var crypto = require('crypto');
var azureCommon = require('azure-common');
var date = azureCommon.date;
var azureutil = azureCommon.util;
var HmacSha256Sign = azureCommon.HmacSha256Sign;
var Constants = azureCommon.Constants;
var HeaderConstants = Constants.HeaderConstants;
/**
* Creates a new SharedAccessSignature object.
*
* @constructor
* @param {string} keyName The shared access signature key name.
* @param {array} keyValue The shared access signature key value.
*/
function SharedAccessSignature(keyName, keyValue) {
this.keyName = keyName;
this.keyValue = keyValue;
it('should create the container sas', function (done) {
var expiry = azureCommon.date.minutesFromNow(5).toISOString();
suite.execute('storage table sas create %s rau %s --json', tableName, expiry, function (result) {
var sas = JSON.parse(result.text);
sas.sas.should.not.be.empty;
result.errorText.should.be.empty;
done();
});
});
});
it('should create the queue sas and show the queue with sas', function (done) {
var expiry = azureCommon.date.minutesFromNow(5).toISOString();
suite.execute('storage queue sas create %s rau %s --json', queueName, expiry, function (result) {
var sas = JSON.parse(result.text);
sas.sas.should.not.be.empty;
result.errorText.should.be.empty;
if (!suite.isMocked) {
var account = fetchAccountName(process.env.AZURE_STORAGE_CONNECTION_STRING);
suite.execute('storage queue show %s -a %s --sas %s --json', queueName, account, sas.sas, function (showResult) {
showResult.errorText.should.be.empty;
done();
});
} else {
done();
}
});
});