Skip to content

Commit d380860

Browse files
XiaoningLiuvinjiang
authored andcommitted
Remove SharedKey auth & SAS generation from browser bundle
1 parent 1e31548 commit d380860

6 files changed

Lines changed: 2213 additions & 1938 deletions

File tree

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ coverage
4141
# Tests artefacts
4242
fileservice_test_*
4343
blobservice_test.tmp
44+
*.tmp
45+
*.appendtest
46+
*.pagetest
47+
*.test
48+
*.blocktest
4449

4550
# Browserify bundle scripts
4651
browser/bundle

browser/bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ if (!fs.existsSync(outputFolderPath)) {
4343
}
4444

4545
function build(exportFilePath, outputFilePath, moduleName, isMinify) {
46-
browserify(exportFilePath, {standalone: moduleName}).bundle(function (err, src) {
46+
browserify(exportFilePath, {standalone: moduleName, browserField: "browserify"}).bundle(function (err, src) {
4747
if (err) {
4848
console.error('Failed when parsing', exportFilePath, err);
4949
return;

lib/common/signing/sharedaccesssignature.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515
//
16-
var HmacSha256Sign = require('./hmacsha256sign');
1716
var Constants = require('./../util/constants');
1817
var SR = require('./../util/sr');
1918

@@ -25,7 +24,6 @@ var SR = require('./../util/sr');
2524
*/
2625
function SharedAccessSignature(sasToken) {
2726
this.sasToken = sasToken;
28-
this.signer = new HmacSha256Sign(sasToken);
2927
}
3028

3129
/**
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//
2+
// Copyright (c) Microsoft and contributors. All rights reserved.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
//
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//
16+
17+
/**
18+
* Creates a new SharedKey object.
19+
*
20+
* @constructor
21+
* @param {string} storageAccount The storage account.
22+
* @param {string} storageAccessKey The storage account's access key.
23+
* @param {bool} usePathStyleUri Boolean value indicating if the path, or the hostname, should include the storage account.
24+
*/
25+
function SharedKey(storageAccount, storageAccessKey, usePathStyleUri) {
26+
throw Error('Key based authentication or SAS generation is only available in Node.js runtime!');
27+
}
28+
29+
module.exports = SharedKey;

0 commit comments

Comments
 (0)