Skip to content

Commit

Permalink
Merge "[FABN-909] remove unused fabric-ca-client files"
Browse files Browse the repository at this point in the history
  • Loading branch information
harrisob authored and Gerrit Code Review committed Apr 5, 2019
2 parents ffa998a + 4555441 commit dc75c20
Show file tree
Hide file tree
Showing 133 changed files with 1,438 additions and 990 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
#
./test
coverage
node_modules
10 changes: 0 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,6 @@ fabric-client/.nyc_output
fabric-ca-client/.DS_Store
fabric-ca-client/node_modules/*
fabric-ca-client/.nyc_output
fabric-ca-client/lib/api.js
fabric-ca-client/lib/utils.js
fabric-ca-client/lib/BaseClient.js
fabric-ca-client/lib/Config.js
fabric-ca-client/lib/Remote.js
fabric-ca-client/lib/User.js
fabric-ca-client/lib/msp/*
fabric-ca-client/lib/protos/*
fabric-ca-client/lib/hash.js
fabric-ca-client/lib/impl/*
fabric-ca-client/types/base.d.ts
fabric-ca-client/types/tsconfig.json

Expand Down
35 changes: 0 additions & 35 deletions build/tasks/ca.js

This file was deleted.

19 changes: 3 additions & 16 deletions build/tasks/doc.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
/*
Copyright 2016 IBM All Rights Reserved.
/**
* SPDX-License-Identifier: Apache-2.0
*/

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
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.
*/

const gulp = require('gulp');
const jsdoc = require('gulp-jsdoc3');
Expand Down Expand Up @@ -42,8 +31,6 @@ const docSrc = [
'fabric-client/index.js',
'fabric-client/lib/**/*.js',
'!fabric-client/lib/protos/**',
'!fabric-client/lib/hash.js',
'!fabric-client/lib/utils.js',
'fabric-ca-client/index.js',
'fabric-ca-client/lib/FabricCAServices.js',
'fabric-ca-client/lib/FabricCAClient.js',
Expand Down
25 changes: 12 additions & 13 deletions build/tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ gulp.task('pre-test', () => {
'fabric-ca-client/lib/FabricCAClientImpl.js',
'fabric-ca-client/lib/helper.js',
'fabric-ca-client/lib/IdentityService.js',
'fabric-ca-client/lib/AffiliationService.js',
'fabric-ca-client/lib/AffiliationService.js'
]);
});

Expand Down Expand Up @@ -116,7 +116,7 @@ gulp.task('docker-ready', ['docker-clean'], shell.task([
gulp.task('lint', ['eslint', 'tslint']);

gulp.task('compile', shell.task([
'npm run compile',
'npm run compile'
], {
verbose: true, // so we can see the docker command output
ignoreErrors: false // once compile failed, throw error
Expand All @@ -143,7 +143,6 @@ gulp.task('run-test-mocha', (done) => {
const tasks = ['mocha-fabric-common', 'mocha-fabric-ca-client', 'mocha-fabric-client', 'mocha-fabric-network', 'mocha-fabric-protos'];
runSequence(...tasks, done);
});

gulp.task('mocha-fabric-common',
() => {
return gulp.src(['./fabric-common/test/**/*.js'], {read: false})
Expand Down Expand Up @@ -206,19 +205,19 @@ gulp.task('run-test-scenario', (done) => {
// Main test method to run all test suites
// - lint, unit first, then FV, then scenario
gulp.task('run-test', (done) => {
const tasks = ['clean-up', 'docker-clean', 'pre-test', 'ca', 'compile', 'lint', 'docs', 'test-mocha', 'run-tape-unit', 'test-fv-only'];
const tasks = ['clean-up', 'docker-clean', 'pre-test', 'compile', 'lint', 'docs', 'test-mocha', 'run-tape-unit', 'test-fv-only'];
runSequence(...tasks, done);
});

// fabric end-to-end test
gulp.task('run-end-to-end', (done) => {
const tasks = ['clean-up', 'docker-clean', 'pre-test', 'ca', 'compile', 'run-tape-e2e'];
const tasks = ['clean-up', 'docker-clean', 'pre-test', 'compile', 'run-tape-e2e'];
runSequence(...tasks, done);
});

// Run all non-integration tests
gulp.task('run-test-headless', (done) => {
const tasks = ['clean-up', 'pre-test', 'ca', 'lint', 'test-mocha', 'run-tape-unit'];
const tasks = ['clean-up', 'pre-test', 'lint', 'test-mocha', 'run-tape-unit'];
runSequence(...tasks, done);
});

Expand All @@ -232,7 +231,7 @@ gulp.task('run-tape-unit',
'test/unit/**/*.js',
'!test/unit/constants.js',
'!test/unit/util.js',
'!test/unit/logger.js',
'!test/unit/logger.js'
]))
.pipe(tape({
reporter: tapColorize()
Expand Down Expand Up @@ -302,7 +301,7 @@ gulp.task('run-tape-e2e', ['docker-ready'],
'test/integration/token.js',

// Typescript
'test/typescript/test.js',
'test/typescript/test.js'
]))
.pipe(tape({
reporter: tapColorize()
Expand All @@ -319,21 +318,21 @@ function shouldRunTests(tests) {
if (arch.indexOf('s390') === 0) {
tests.push('!test/unit/pkcs11.js');
tests.push('!test/integration/network-e2e/e2e-hsm.js');
// check to see if they want to test PKCS11
// check to see if they want to test PKCS11
} else if (typeof process.env.PKCS11_TESTS === 'string' && process.env.PKCS11_TESTS.toLowerCase() === 'true') {
tests.push('!test/integration/network-e2e/e2e.js');
// check to see if they do not want to test PKCS11
// check to see if they do not want to test PKCS11
} else if (typeof process.env.PKCS11_TESTS === 'string' && process.env.PKCS11_TESTS.toLowerCase() === 'false') {
tests.push('!test/unit/pkcs11.js');
tests.push('!test/integration/network-e2e/e2e-hsm.js');
// default is to run the PKCS11 tests so we need to disable the non HSM version
// default is to run the PKCS11 tests so we need to disable the non HSM version
} else {
tests.push('!test/integration/network-e2e/e2e.js');
}
// keep the java tests
if (typeof process.env.JAVA_TESTS === 'string' && process.env.JAVA_TESTS.toLowerCase() === 'true') {
// disable when z390 or when JAVA tests is off
} else if ((arch.indexOf('s390') === 0) || (typeof process.env.JAVA_TESTS === 'string' && process.env.JAVA_TESTS.toLowerCase() === 'false')) {
// disable when z390 or when JAVA tests is off
} else if ((arch.indexOf('s390') === 0) || (typeof process.env.JAVA_TESTS === 'string' && process.env.JAVA_TESTS.toLowerCase() === 'false')) {
tests.push('!test/integration/javachaincode/e2e.js');
}

Expand Down
33 changes: 0 additions & 33 deletions build/tasks/watch.js

This file was deleted.

6 changes: 3 additions & 3 deletions fabric-ca-client/config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"crypto-keysize": 256,
"crypto-hsm": false,
"crypto-suite-software": {
"EC": "fabric-ca-client/lib/impl/CryptoSuite_ECDSA_AES.js"
"EC": "fabric-common/lib/impl/CryptoSuite_ECDSA_AES.js"
},
"crypto-suite-hsm": {
"EC": "fabric-ca-client/lib/impl/bccsp_pkcs11.js"
"EC": "fabric-common/lib/impl/bccsp_pkcs11.js"
},
"key-value-store": "fabric-ca-client/lib/impl/FileKeyValueStore.js",
"key-value-store": "fabric-common/lib/impl/FileKeyValueStore.js",
"connection-timeout": 3000
}
13 changes: 5 additions & 8 deletions fabric-ca-client/lib/AffiliationService.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
/*
Copyright 2018 IBM All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
/**
* SPDX-License-Identifier: Apache-2.0
*/

'use strict';

const logger = require('./utils').getLogger('AffiliationService');
const {Utils} = require('fabric-common');
const logger = Utils.getLogger('AffiliationService');
const checkRegistrar = require('./helper').checkRegistrar;

/**
Expand Down
4 changes: 3 additions & 1 deletion fabric-ca-client/lib/CertificateService.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
*/

const querystring = require('querystring');
const logger = require('./utils.js').getLogger('CertificateService');
const {Utils} = require('fabric-common');

const logger = Utils.getLogger('CertificateService');
const checkRegistrar = require('./helper').checkRegistrar;

class CertificateService {
Expand Down
18 changes: 4 additions & 14 deletions fabric-ca-client/lib/FabricCAClient.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* 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.
/**
* SPDX-License-Identifier: Apache-2.0
*/

'use strict';

const utils = require('./utils.js');
const {Utils: utils} = require('fabric-common');
const config = utils.getConfig();
const logger = utils.getLogger('FabricCAClient.js');
const http = require('http');
Expand Down Expand Up @@ -54,7 +44,7 @@ const FabricCAClient = class {
}

this._caName = connect_opts.caname,
this._httpClient = (connect_opts.protocol === 'http') ? http : https;
this._httpClient = (connect_opts.protocol === 'http') ? http : https;
this._hostname = connect_opts.hostname;
if (connect_opts.port) {
this._port = connect_opts.port;
Expand Down
Loading

0 comments on commit dc75c20

Please sign in to comment.