Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit e444146

Browse files
authored
change references to public key, acl property ref (#4065)
Playground docs incorrectly refer to public key, should be private key Changed tests to specify certificate rather than public key ACL reference incorrectly says you can control access to a property of an asset. Signed-off-by: Dave Kelsey <[email protected]>
1 parent 3e15c89 commit e444146

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

packages/composer-common/test/connectionmanager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe('ConnectionManager', () => {
6262
describe('#importIdentity', () => {
6363

6464
it('should throw as abstract', async () => {
65-
await connectionManager.importIdentity('profile', { connect: 'options' }, 'bob1', 'public key', 'private key')
65+
await connectionManager.importIdentity('profile', { connect: 'options' }, 'bob1', 'certificate', 'private key')
6666
.should.be.rejectedWith(/abstract function called/);
6767
});
6868

packages/composer-connector-proxy/test/proxyconnectionmanager.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,19 +144,19 @@ describe('ProxyConnectionManager', () => {
144144
});
145145

146146
it('should send a importIdentity call to the connector server', () => {
147-
mockSocket.emit.withArgs('/api/connectionManagerImportIdentity', connectionProfile, connectionOptions, 'bob1', 'public key', 'private key', sinon.match.func).yields(null);
147+
mockSocket.emit.withArgs('/api/connectionManagerImportIdentity', connectionProfile, connectionOptions, 'bob1', 'certificate', 'private key', sinon.match.func).yields(null);
148148
sinon.stub(ProxyConnectionManager, 'createConnection').returns(mockConnection);
149-
return connectionManager.importIdentity(connectionProfile, connectionOptions, 'bob1', 'public key', 'private key')
149+
return connectionManager.importIdentity(connectionProfile, connectionOptions, 'bob1', 'certificate', 'private key')
150150
.then(() => {
151151
sinon.assert.calledOnce(mockSocket.emit);
152-
sinon.assert.calledWith(mockSocket.emit, '/api/connectionManagerImportIdentity', connectionProfile, connectionOptions, 'bob1', 'public key', 'private key', sinon.match.func);
152+
sinon.assert.calledWith(mockSocket.emit, '/api/connectionManagerImportIdentity', connectionProfile, connectionOptions, 'bob1', 'certificate', 'private key', sinon.match.func);
153153
sinon.assert.calledTwice(mockSocket.on);
154154
});
155155
});
156156

157157
it('should handle an error from the connector server', () => {
158-
mockSocket.emit.withArgs('/api/connectionManagerImportIdentity', connectionProfile, connectionOptions, 'bob1', 'public key', 'private key', sinon.match.func).yields(serializedError);
159-
return connectionManager.importIdentity(connectionProfile, connectionOptions, 'bob1', 'public key', 'private key')
158+
mockSocket.emit.withArgs('/api/connectionManagerImportIdentity', connectionProfile, connectionOptions, 'bob1', 'certificate', 'private key', sinon.match.func).yields(serializedError);
159+
return connectionManager.importIdentity(connectionProfile, connectionOptions, 'bob1', 'certificate', 'private key')
160160
.should.be.rejectedWith(TypeError, /such type error/);
161161
});
162162

packages/composer-connector-server/test/connectorserver.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,10 @@ describe('ConnectorServer', () => {
327327
mockConnectionProfileManager.getConnectionManagerByType.withArgs(connectionType).resolves(mockConnectionManager);
328328
mockConnectionManager.importIdentity.resolves();
329329
const cb = sinon.stub();
330-
return connectorServer.connectionManagerImportIdentity(connectionProfile, connectionOptions, 'bob1', 'public key', 'private key', cb)
330+
return connectorServer.connectionManagerImportIdentity(connectionProfile, connectionOptions, 'bob1', 'certificate', 'private key', cb)
331331
.then(() => {
332332
sinon.assert.calledOnce(mockConnectionManager.importIdentity);
333-
sinon.assert.calledWith(mockConnectionManager.importIdentity, connectionProfile, connectionOptions, 'bob1', 'public key', 'private key');
333+
sinon.assert.calledWith(mockConnectionManager.importIdentity, connectionProfile, connectionOptions, 'bob1', 'certificate', 'private key');
334334
sinon.assert.calledOnce(cb);
335335
sinon.assert.calledWith(cb, null);
336336
});
@@ -340,7 +340,7 @@ describe('ConnectorServer', () => {
340340
mockConnectionProfileManager.getConnectionManagerByType.withArgs(connectionType).resolves(mockConnectionManager);
341341
mockConnectionManager.importIdentity.rejects(new Error('import error'));
342342
const cb = sinon.stub();
343-
return connectorServer.connectionManagerImportIdentity(connectionProfile, connectionOptions, 'bob1', 'public key', 'private key', cb)
343+
return connectorServer.connectionManagerImportIdentity(connectionProfile, connectionOptions, 'bob1', 'certificate', 'private key', cb)
344344
.then(() => {
345345
sinon.assert.calledOnce(cb);
346346
const serializedError = cb.args[0][0];
@@ -356,10 +356,10 @@ describe('ConnectorServer', () => {
356356
const cb = sinon.stub();
357357
mockBusinessNetworkCardStore.getWallet.returns('CORRECT');
358358
connectionOptions.wallet='WRONG';
359-
return connectorServer.connectionManagerImportIdentity(connectionProfile, connectionOptions, 'bob1', 'public key', 'private key', cb)
359+
return connectorServer.connectionManagerImportIdentity(connectionProfile, connectionOptions, 'bob1', 'certificate', 'private key', cb)
360360
.then(() => {
361361
sinon.assert.calledWith(mockBusinessNetworkCardStore.getWallet,connectionOptions.cardName);
362-
sinon.assert.calledWith(mockConnectionManager.importIdentity,connectionProfile, sinon.match({wallet:'CORRECT'}), 'bob1', 'public key', 'private key');
362+
sinon.assert.calledWith(mockConnectionManager.importIdentity,connectionProfile, sinon.match({wallet:'CORRECT'}), 'bob1', 'certificate', 'private key');
363363
});
364364
});
365365

packages/composer-website/jekylldocs/managing/id-cards-playground.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Importing and exporting business network cards is the simplest way to grant acce
101101

102102
2. On the **My Wallet** page, click the **Export** icon on the business network card you wish to export. The business network card should download as a `.card` file.
103103

104-
_Please note_: If you export a business network card that has never been used, for example to send to a new participant, it will contain the enrollment ID and enrollment secret required to obtain the certificate and public key which are then used to identify participants. Alternatively, if you export a business network card that has been used before, it will already contain the certificate and public key.
104+
_Please note_: If you export a business network card that has never been used, for example to send to a new participant, it will contain the enrollment ID and enrollment secret required to obtain the certificate and private key which are then used to identify participants. Alternatively, if you export a business network card that has been used before, it will already contain the certificate and private key.
105105

106106
**Important**: Exported identity cards should be handled with care since they contain unprotected credentials. For example, you should never send identity cards via email or other unencrypted means of communication.
107107

packages/composer-website/jekylldocs/reference/acl_language.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ ACL rules are defined in a file called `permissions.acl` in the root of the busi
106106

107107
## Access Control Rule Grammar
108108

109-
There are two types of ACL rules: simple ACL rules and conditional ACL rules. Simple rules are used to control access to a namespace, asset or property of an asset by a participant type or participant instance.
109+
There are two types of ACL rules: simple ACL rules and conditional ACL rules. Simple rules are used to control access to a namespace or asset by a participant type or participant instance.
110110

111111
For example, the rule below states that any instance of the `org.example.SampleParticipant` type can perform ALL operations on all instances of `org.example.SampleAsset`.
112112

0 commit comments

Comments
 (0)