Skip to content

Commit

Permalink
Merge commit 'dfe1f9181c37607191f394c67b922fde7a5531dd' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
Azure IoT Builder committed Nov 15, 2017
2 parents 7197629 + dfe1f91 commit d544d8c
Show file tree
Hide file tree
Showing 18 changed files with 301 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ provisioning/transport/http/lib/
provisioning/transport/mqtt/lib/
provisioning/device/lib/

security/x509/lib
security/tpm/lib

service/lib

ts-e2e/lib
Expand Down
6 changes: 6 additions & 0 deletions build/build_parallel/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@
"skip_build": true,
"skip_test": true,
"skip_ci": true
},
{
"directory": "security/x509"
},
{
"directory": "security/tpm"
}
]
}
6 changes: 6 additions & 0 deletions security/tpm/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
coverage/
devdoc/
test/
samples/
src/
lib/**/*.map
4 changes: 4 additions & 0 deletions security/tpm/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

export { TpmSecurityClient } from './lib/tpm';
8 changes: 8 additions & 0 deletions security/tpm/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

'use strict';

module.exports = {
TpmSecurityClient : require('lib/tpm').TpmSecurityClient
};
45 changes: 45 additions & 0 deletions security/tpm/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "azure-iot-security-tpm",
"version": "0.0.1",
"description": "Azure IoT TPM security client",
"author": "Microsoft Corporation",
"license": "MIT",
"main": "index.js",
"typings": "index.d.ts",
"dependencies": {
"azure-iot-common": "1.2.2",
"debug": "^3.0.1"
},
"devDependencies": {
"chai": "^3.5.0",
"istanbul": "^0.4.4",
"jshint": "^2.9.2",
"mocha": "^3.0.1",
"sinon": "^1.17.5",
"tslint": "^5.1.0",
"typescript": "2.2.2",
"@types/node": "^7.0.5"
},
"scripts": {
"lint": "tslint --project . -c ../../tslint.json",
"build": "tsc",
"unittest-min": "istanbul cover --report none node_modules/mocha/bin/_mocha -- --reporter dot test/_*_test.js",
"alltest-min": "istanbul cover --report none node_modules/mocha/bin/_mocha -- --reporter dot test/_*_test*.js",
"unittest": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter spec test/_*_test.js",
"alltest": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter spec test/_*_test*.js",
"ci": "npm -s run lint && npm -s run build && npm -s run alltest-min && npm -s run check-cover",
"test": "npm -s run lint && npm -s run build && npm -s run unittest",
"check-cover": "istanbul check-coverage --statements 50 --branches 50 --lines 50 --functions 50"
},
"engines": {
"node": ">= 0.10"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Azure/azure-iot-sdk-node.git"
},
"bugs": {
"url": "https://github.com/Azure/azure-iot-sdk-node/issues"
},
"homepage": "https://github.com/Azure/azure-iot-sdk-node#readme"
}
13 changes: 13 additions & 0 deletions security/tpm/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#azure-iot-security-tpm
Security module for Azure IoT TPM security

[![npm version](https://badge.fury.io/js/azure-iot-security-tpm.svg)](https://badge.fury.io/js/azure-iot-security-tpm)

## Install

`npm install -g azure-iot-security-tpm@latest` to get the latest (pre-release) version.

## Getting Started



24 changes: 24 additions & 0 deletions security/tpm/src/tpm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

'use strict';
import { errors } from 'azure-iot-common';

export class TpmSecurityClient {
getEndorsementKey(callback: (err?: Error) => void): void {
throw new errors.NotImplementedError();
}

getStorageRootKey(callback: (err?: Error) => void): void {
throw new errors.NotImplementedError();
}

signWithIdentity(callback: (err?: Error) => void): void {
throw new errors.NotImplementedError();
}

activateSymmetricIdentity(callback: (err?: Error) => void): void {
throw new errors.NotImplementedError();
}
}

47 changes: 47 additions & 0 deletions security/tpm/test/_tpm_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

'use strict';

var TpmSecurityClient = require('../lib/tpm').TpmSecurityClient ;
var assert = require('chai').assert;

describe('tpm', function () {
this.timeout(1000);

var obj = new TpmSecurityClient ();

describe('getEndorsementKey', function() {
it ('throws', function() {
assert.throws(function() {
obj.getEndorsementKey();
});
});
});

describe('getStorageRootKey', function() {
it ('throws', function() {
assert.throws(function() {
obj.getStorageRootKey();
});
});
});

describe('signWithIdentity', function() {
it ('throws', function() {
assert.throws(function() {
obj.signWithIdentity();
});
});
});

describe('activateSymmetricIdentity', function() {
it ('throws', function() {
assert.throws(function() {
obj.activateSymmetricIdentity();
});
});
});

});

11 changes: 11 additions & 0 deletions security/tpm/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"outDir": "./lib",
"target":"es5",
"sourceMap": true,
"declaration": true
},
"include": [
"./src/**/*.ts"
]
}
6 changes: 6 additions & 0 deletions security/x509/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
coverage/
devdoc/
test/
samples/
src/
lib/**/*.map
4 changes: 4 additions & 0 deletions security/x509/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

export { X509SecurityClient } from './lib/x509';
8 changes: 8 additions & 0 deletions security/x509/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

'use strict';

module.exports = {
X509SecurityClient: require('lib/x509').X509SecurityClient
};
45 changes: 45 additions & 0 deletions security/x509/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "azure-iot-security-x509",
"version": "0.0.1",
"description": "Azure IoT x509 security client",
"author": "Microsoft Corporation",
"license": "MIT",
"main": "index.js",
"typings": "index.d.ts",
"dependencies": {
"azure-iot-common": "1.2.2",
"debug": "^3.0.1"
},
"devDependencies": {
"chai": "^3.5.0",
"istanbul": "^0.4.4",
"jshint": "^2.9.2",
"mocha": "^3.0.1",
"sinon": "^1.17.5",
"tslint": "^5.1.0",
"typescript": "2.2.2",
"@types/node": "^7.0.5"
},
"scripts": {
"lint": "tslint --project . -c ../../tslint.json",
"build": "tsc",
"unittest-min": "istanbul cover --report none node_modules/mocha/bin/_mocha -- --reporter dot test/_*_test.js",
"alltest-min": "istanbul cover --report none node_modules/mocha/bin/_mocha -- --reporter dot test/_*_test*.js",
"unittest": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter spec test/_*_test.js",
"alltest": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter spec test/_*_test*.js",
"ci": "npm -s run lint && npm -s run build && npm -s run alltest-min && npm -s run check-cover",
"test": "npm -s run lint && npm -s run build && npm -s run unittest",
"check-cover": "istanbul check-coverage --statements 50 --branches 50 --lines 50 --functions 50"
},
"engines": {
"node": ">= 0.10"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Azure/azure-iot-sdk-node.git"
},
"bugs": {
"url": "https://github.com/Azure/azure-iot-sdk-node/issues"
},
"homepage": "https://github.com/Azure/azure-iot-sdk-node#readme"
}
13 changes: 13 additions & 0 deletions security/x509/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#azure-iot-security-x509
Security module for Azure IoT x509 security

[![npm version](https://badge.fury.io/js/azure-iot-security-x509.svg)](https://badge.fury.io/js/azure-iot-security-x509)

## Install

`npm install -g azure-iot-security-x509@latest` to get the latest (pre-release) version.

## Getting Started



16 changes: 16 additions & 0 deletions security/x509/src/x509.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

'use strict';
import { errors } from 'azure-iot-common';

export class X509SecurityClient {
getCertificate(callback: (err?: Error, cert?: string) => void): void {
throw new errors.NotImplementedError();
}

getCertificateChain(callback: (err?: Error, cert?: string) => void): void {
throw new errors.NotImplementedError();
}
}

31 changes: 31 additions & 0 deletions security/x509/test/_x509_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

'use strict';

var X509SecurityClient = require('../lib/x509').X509SecurityClient;
var assert = require('chai').assert;

describe('x509', function () {
this.timeout(1000);

var obj = new X509SecurityClient();

describe('getCertificate', function() {
it ('throws', function() {
assert.throws(function() {
obj.getCertificate();
});
});
});

describe('getCertificateChain', function() {
it ('throws', function() {
assert.throws(function() {
obj.getCertificateChain();
});
});
});

});

11 changes: 11 additions & 0 deletions security/x509/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"outDir": "./lib",
"target":"es5",
"sourceMap": true,
"declaration": true
},
"include": [
"./src/**/*.ts"
]
}

0 comments on commit d544d8c

Please sign in to comment.