Skip to content

Commit

Permalink
New Release 2.6.7 (#84)
Browse files Browse the repository at this point in the history
* Fix an issue with CORS when a preflight request has an empty headers list.

Without this fix, azurite would fail because it was trying to call

  request.httpProps[N.ACCESS_CONTROL_REQUEST_HEADERS].toLowerCase()

which will result in trying to call undefined.toLowerCase() if the preflight
request doesn't specify access-control-request-headers.

In addition, when validating a request against the CORS, the request would
fail to be validated if access-control-request-headers was empty.

* fixed so that when requesting single entity with PartitionKey and RowKey the emulator responds in the same way that the real azure table

* Always set the copyProgress field.

* Entity generator now accepts optional partition and row key

* Dockerfile: deterministic builds

Use explicit version tag 10.6-alpine instead of alpine to ensure a known
version is used. Copy package-lock.json before npm install to ensure
known dependencies are installed.

* Fixed #47 Copied blob has incorrect content type

* Update release-notes.md

* Added Azure/azure-storage-node as test submodule

Tests from azure-storage-node are invoked via
test/azure-storage-shim.js for direct npm run test support.

Submodule needs to be initialized with git submodule update --init first.

* Fix environment variable configuration

Added env-cmd package and test/.env to automatically set envs for
testing.

* Fix NOCK_OFF env and separate test folders

* Focus on test subset for easier fixing

* Updates to testing, requires changes to vscode launch.json with correct env args for each storage-node test, to ensure no nock etc

* Updated documentation for Azure storage testing

* Update azure-storage-node_tdd.md

* Updates to Table Storage API and associated tests (#78)

* Updated Readme and Package files

* Updates to table storage API and created corresponding tests using Azure-storage-node, this will form the basis of fixing further table API issues currently logged

* fixed up singleEntity response for QueryEntites action to return to method used by Karl Persson

* small correction to test logic

* Fixes for table queries not returning 404 for missing entities (#80)

* Updated Readme and Package files

* Updates to table storage API and created corresponding tests using Azure-storage-node, this will form the basis of fixing further table API issues currently logged
* fixed up singleEntity response for QueryEntites action to return to method used by Karl Persson
* small correction to test logic
* Changes to correctly return 404 for missing entities and failed queries.
* Updates errorCodes with EntityNotFound, updated tests
* minor updates to obj assignments
* added test to validate insertEntity returns Etag in metadata
* added jsHint config
* Updated table service error codes
* Corrected a few variable definitions let vs const

* Prettier Config for pull request

* fixed Create Entity Response to begin to conform to Azure Storage Response, we might need to do some more work here, but this should be enough for basic API functionality (#83)

* Update .prettierrc.json

* now everything is pretty, but still needs some refactoring

* Revert "now everything is pretty, but still needs some refactoring"

This reverts commit 4524b3b.
Need to rebase on dev branch before making super pretty...

* rebased onto dev and then pretified

* package.json update

* Prettier applied to conflicting files
  • Loading branch information
edwin-huber authored Sep 4, 2018
1 parent 4009e7b commit 9413bd7
Show file tree
Hide file tree
Showing 194 changed files with 9,990 additions and 7,406 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "test/azure-storage-node"]
path = externaltests/azure-storage-node
url = https://github.com/Azure/azure-storage-node
3 changes: 3 additions & 0 deletions .jshintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/*
packages
.git
21 changes: 21 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"esversion": 6,
"bitwise": true,
"curly": false,
"eqeqeq": false,
"forin": true,
"latedef": true,
"maxparams": false,
"maxdepth": false,
"maxstatements": false,
"maxcomplexity": false,
"noarg": true,
"node": true,
"nonew": true,
"plusplus": false,
"strict": false,
"trailingcomma": true,
"undef": true,
"unused": true,
"shadow": "inner"
}
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package.json
package-lock.json
azurite-testdrive/
externaltests/azure-storage-node/
node_modules/
.vscode/
nuget/
14 changes: 14 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"printWidth": 80,
"parser": "typescript",
"arrowParens" : "always",
"tabWidth": 2,
"useTabs":false,
"semi":true,
"singleQuote": false,
"trailingComma": "es5",
"bracketSpacing": true,
"requirePragma": false,
"insertPragma": true,
"proseWrap": "never"
}
5 changes: 3 additions & 2 deletions Dockerfile
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
FROM node:alpine
FROM node:10.6-alpine

WORKDIR /opt/azurite

COPY package.json /opt/azurite
COPY package.json package-lock.json /opt/azurite/
RUN npm install

COPY bin /opt/azurite/bin
COPY lib /opt/azurite/lib
COPY test /opt/azurite/test

VOLUME /opt/azurite/folder

Expand Down
43 changes: 40 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ After installation you can install Azurite simply with `npm` which is Node.js pa

`$ npm install -g azurite`

Then simply start it with the following command:
## Running Azurite

Simply start it with the following command:

`$ azurite -l path/to/localfolder`

Expand All @@ -32,6 +34,7 @@ For Table Storage Emulator only:

`$ azurite-table -l path/to/azurite/workspace`


## Nuget
Azurite is also available as Nuget package at [https://www.nuget.org/packages/Azurite/](https://www.nuget.org/packages/Azurite/).
You can install it via the [Package Manager Console](https://docs.nuget.org/docs/start-here/using-the-package-manager-console) with the following command:
Expand Down Expand Up @@ -90,6 +93,31 @@ $ az storage container create --name 'test' --connection-string 'DefaultEndpoint
}
```

## Current List of Command Line Options

```
-a
```
Enables sharedkey authentication check
```
-l c:\tmp\emulatorPath
--location c:\tmp\emulatorPath
```
Allows the specification of a path
```
--blobPort 101000
```
Sets the TCP Port for blob storage to the value following the argument.
```
--queuePort 10001
```
Sets the TCP Port for queue storage to the value following the argument.
```
--tablePort 10002
```
Sets the TCP Port for table storage to the value following the argument.



# Contributions
## What do I need to know to help?
Expand All @@ -101,10 +129,16 @@ If you are interested in making a code contribution and would like to learn more
- Azurite makes heavy use of [Bluebird](http://bluebirdjs.com/docs/getting-started.html) which is a fully featured promises library with unmatched performance.

## What TODOs are there?
The current status of Azurite's support of the [Official Blob Storage REST API Specification](https://docs.microsoft.com/rest/api/storageservices/blob-service-rest-api) is listed in below section [API Support](https://github.com/arafato/azurite/#api-support). Features that are still unimplemented are marked with `[TODO]`. Features that are currently being worked on are marked with `[IN-PROGRESS]`.
We are using a combination of community feedback, and the Azure Storage Node package tests to validate Azurite's support of the [Official Blob Storage REST API Specification](https://docs.microsoft.com/rest/api/storageservices/blob-service-rest-api).
We shall create issues based on failing tests to help direct and prioritize our development efforts.
See also section below: [API Support](https://github.com/Azure/Azurite/#api-support).

Current bugs that need to be fixed are listed at our [issues site on Github](https://github.com/Azure/Azurite/issues) and tagged with a red label `bug`.

Issues which we think might be a good place for newcomers to start, are tagged with [**"good first issue"**](https://github.com/Azure/Azurite/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22).

Details on how to setup tests with the Azure Storage submodule, can be found under [Testing with Azure Storage Node](./doc/azure-storage-node_tdd.md).

## Need Help?
Be sure to check out the Microsoft Azure Developer Forums on MSDN or the Developer Forums on Stack Overflow if you have trouble with the provided code.

Expand All @@ -115,6 +149,8 @@ If you encounter any bugs with the library please file an issue in the [Issues](

When sending pull requests, please send **non-breaking PRs** to the dev branch and breaking changes to the **dev_breaking** branch. Please do not make PRs against master.

- **Please include a Unit or Integration test with any code submission, this is a significant help when validating changes and helps reduce the time we need to spend on pull requests.**

## Where can I go for help?

If you need help, you can ask questions directly at our [issues site on Github](https://github.com/Azure/Azurite/issues).
Expand All @@ -125,7 +161,8 @@ Alternatively, check out the following links:
[Azure Storage Team Blog](https://blogs.msdn.com/b/windowsazurestorage/)

# API Support
Currently, Azurite only supports the [Blob Storage APIs](https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/blob-service-rest-api), the [Queue Storage API](https://docs.microsoft.com/en-us/rest/api/storageservices/queue-service-rest-api), and the [Table Storage API](https://docs.microsoft.com/en-us/rest/api/storageservices/table-service-rest-api). Support for Azure Storage Files is planned, but currently not available.
Currently, Azurite only supports the [Blob Storage APIs](https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/blob-service-rest-api), the [Queue Storage API](https://docs.microsoft.com/en-us/rest/api/storageservices/queue-service-rest-api), and the [Table Storage API](https://docs.microsoft.com/en-us/rest/api/storageservices/table-service-rest-api).
Support for Azure Storage Files is planned, but currently not available.

The Standard Emulator Connection String is the same as required by [Microsoft's Official Storage Emulator](https://go.microsoft.com/fwlink/?LinkId=717179):

Expand Down
94 changes: 51 additions & 43 deletions bin/azurite
Original file line number Diff line number Diff line change
@@ -1,59 +1,67 @@
#!/usr/bin/env node

'use strict';
"use strict";

const BbPromise = require('bluebird');
const BbPromise = require("bluebird");

process.on('unhandledRejection', (e) => {
console.error('**PANIC** Something unexpected happened! Emulator may be in an inconsistent state!');
console.error(e);
process.on("unhandledRejection", (e) => {
console.error(
"**PANIC** Something unexpected happened! Emulator may be in an inconsistent state!"
);
console.error(e);
});
process.noDeprecation = true;

(() => BbPromise.resolve().then(() => {
// requiring here so that if anything went wrong,
// during require, it will be caught.
const argv = require('minimist')(process.argv.slice(2)),
env = require('./../lib/core/env'),
cli = require('./../lib/core/cli');
(() =>
BbPromise.resolve()
.then(() => {
// requiring here so that if anything went wrong,
// during require, it will be caught.
const argv = require("minimist")(process.argv.slice(2)),
env = require("./../lib/core/env"),
cli = require("./../lib/core/cli");

return env.init(argv)
return env
.init(argv)
.then(() => {
if (!env.silent) {
cli.asciiGreeting();
}
if (!env.silent) {
cli.asciiGreeting();
}
})
.then(() => {
// Forking individual modules to spread them across different cores if possible
// and restarting them automatically in case of a crash.
const fork = require('child_process').fork;

(function forkBlobModule(code, signal) {
const mod = fork(env.blobModulePath, process.argv);
mod.on('exit', forkBlobModule);
})();
(function forkQueueModule(code, signal) {
const mod = fork(env.queueModulePath, process.argv);
mod.on('exit', forkQueueModule);
})();
(function forkTableModule(code, signal) {
const mod = fork(env.tableModulePath, process.argv);
mod.on('exit', forkTableModule);
})();
// Forking individual modules to spread them across different cores if possible
// and restarting them automatically in case of a crash.
const fork = require("child_process").fork;

(function forkBlobModule(code, signal) {
const mod = fork(env.blobModulePath, process.argv);
mod.on("exit", forkBlobModule);
})();
(function forkQueueModule(code, signal) {
const mod = fork(env.queueModulePath, process.argv);
mod.on("exit", forkQueueModule);
})();
(function forkTableModule(code, signal) {
const mod = fork(env.tableModulePath, process.argv);
mod.on("exit", forkTableModule);
})();
});
}).catch(e => {
process.exitCode = 1;
console.error(e);
}))();
})
.catch((e) => {
process.exitCode = 1;
console.error(e);
}))();

// If this is a child process (e.g. forked by NPM through '$ npm start') we are propagating the signals from the
// If this is a child process (e.g. forked by NPM through '$ npm start') we are propagating the signals from the
// parent (i.e. NPM) to exit from this process and its child processes.
process.on('SIGINT', () => { // e.g. STRG+C
process.exitCode = 1;
process.exit();
process.on("SIGINT", () => {
// e.g. STRG+C
process.exitCode = 1;
process.exit();
});

process.on('SIGTERM', () => { // e.g. end process from taskmanager
process.exitCode = 1;
process.exit();
});
process.on("SIGTERM", () => {
// e.g. end process from taskmanager
process.exitCode = 1;
process.exit();
});
37 changes: 21 additions & 16 deletions bin/blob
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
#!/usr/bin/env node

'use strict';
"use strict";

const BbPromise = require('bluebird');
const BbPromise = require("bluebird");

process.on('unhandledRejection', (e) => {
console.error('**PANIC** Something unexpected happened! Blob Storage Emulator may be in an inconsistent state!');
console.error(e);
process.on("unhandledRejection", (e) => {
console.error(
"**PANIC** Something unexpected happened! Blob Storage Emulator may be in an inconsistent state!"
);
console.error(e);
});
process.noDeprecation = true;

(() => BbPromise.resolve().then(() => {
// requiring here so that if anything went wrong,
// during require, it will be caught.
const argv = require('minimist')(process.argv.slice(2));
const A = require('../lib/AzuriteBlob'),
azurite = new A();
azurite.init(argv);
}).catch(e => {
process.exitCode = 1;
console.error(e);
}))();
(() =>
BbPromise.resolve()
.then(() => {
// requiring here so that if anything went wrong,
// during require, it will be caught.
const argv = require("minimist")(process.argv.slice(2));
const A = require("../lib/AzuriteBlob"),
azurite = new A();
azurite.init(argv);
})
.catch((e) => {
process.exitCode = 1;
console.error(e);
}))();
37 changes: 21 additions & 16 deletions bin/queue
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
#!/usr/bin/env node

'use strict';
"use strict";

const BbPromise = require('bluebird');
const BbPromise = require("bluebird");

process.on('unhandledRejection', (e) => {
console.error('**PANIC** Something unexpected happened! Queue Storage Emulator may be in an inconsistent state!');
console.error(e);
process.on("unhandledRejection", (e) => {
console.error(
"**PANIC** Something unexpected happened! Queue Storage Emulator may be in an inconsistent state!"
);
console.error(e);
});
process.noDeprecation = true;

(() => BbPromise.resolve().then(() => {
// requiring here so that if anything went wrong,
// during require, it will be caught.
const argv = require('minimist')(process.argv.slice(2));
const A = require('../lib/AzuriteQueue'),
azurite = new A();
azurite.init(argv);
}).catch(e => {
process.exitCode = 1;
console.error(e);
}))();
(() =>
BbPromise.resolve()
.then(() => {
// requiring here so that if anything went wrong,
// during require, it will be caught.
const argv = require("minimist")(process.argv.slice(2));
const A = require("../lib/AzuriteQueue"),
azurite = new A();
azurite.init(argv);
})
.catch((e) => {
process.exitCode = 1;
console.error(e);
}))();
Loading

0 comments on commit 9413bd7

Please sign in to comment.