Skip to content

Commit

Permalink
move ca to ca folder
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkhala committed Jan 9, 2024
1 parent 82f74df commit d84e04a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
1 change: 0 additions & 1 deletion docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export binPath=$CURRENT/common/bin/
down() {

npm stop
sudo rm -rf $CURRENT/stateVolumes/*
}

prepareNetwork() {
Expand Down
29 changes: 27 additions & 2 deletions test/caTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {consoleLogger} from '@davidkhala/logger/log4.js';
import * as caCryptoGen from '../config/caCryptoGen.js';
import {importFrom} from '@davidkhala/light/es6.mjs';
import {ping} from '../common/nodejs/ca/ca.js';
import CertificateServiceWrapper from '../common/nodejs/ca/certificateService.js';

const logger = consoleLogger('ca service');
const {TLS} = importFrom(import.meta, '../config/orgs.json');
Expand All @@ -32,8 +33,6 @@ describe('caCryptoGen', () => {
});

describe('ca service', () => {
const org = 'icdd';
const admin = helper.getOrgAdmin(org);
const protocol = `http${TLS ? 's' : ''}`;
const hostname = 'localhost';
const port = 8054;
Expand Down Expand Up @@ -93,5 +92,31 @@ describe('identity service', function () {
assert.ifError(await idService.getOne({enrollmentID: 'admin'}));

});
it('delete: on not exist', async () => {
assert.ifError(await idService.delete({enrollmentID: 'admin'}));
});
it('delete: on exist', async () => {
const newUser = 'new';
await idService.createIfNotExist({
enrollmentID: newUser,
affiliation: org,
role: 'client'
});
const result = await idService.delete({enrollmentID: newUser});
logger.debug(result);
});
});
describe('certificateService', function () {
const org = 'icdd';
const admin = helper.getOrgAdmin(org);
const protocol = `http${TLS ? 's' : ''}`;
const hostname = 'localhost';
const port = 8054;

const caService = new CAService({protocol, hostname, port});
const certService = new CertificateServiceWrapper(caService, admin, logger);
it('get all', async () => {
const results = await certService.getAll();
logger.info(results);
});
});

0 comments on commit d84e04a

Please sign in to comment.