Change default driver permissions such that NodeExplorer works. (#2086)

Also fix-up Kotlin doc.
This commit is contained in:
Viktor Kolomeyko 2017-11-20 12:33:21 +00:00 committed by GitHub
parent f26aa33553
commit 6413c66798
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,10 +71,21 @@ private val DEFAULT_POLL_INTERVAL = 500.millis
private const val DEFAULT_WARN_COUNT = 120 private const val DEFAULT_WARN_COUNT = 120
/**
* A sub-set of permissions that grant most of the essential operations used in the unit/integration tests as well as
* in demo application like NodeExplorer.
*/
private val DRIVER_REQUIRED_PERMISSIONS = setOf( private val DRIVER_REQUIRED_PERMISSIONS = setOf(
invokeRpc(CordaRPCOps::nodeInfo), invokeRpc(CordaRPCOps::nodeInfo),
invokeRpc(CordaRPCOps::networkMapFeed), invokeRpc(CordaRPCOps::networkMapFeed),
invokeRpc(CordaRPCOps::networkMapSnapshot) invokeRpc(CordaRPCOps::networkMapSnapshot),
invokeRpc(CordaRPCOps::notaryIdentities),
invokeRpc(CordaRPCOps::stateMachinesFeed),
invokeRpc(CordaRPCOps::stateMachineRecordedTransactionMappingFeed),
invokeRpc(CordaRPCOps::nodeInfoFromParty),
invokeRpc(CordaRPCOps::internalVerifiedTransactionsFeed),
invokeRpc("vaultQueryBy"),
invokeRpc("vaultTrackBy")
) )
/** /**
@ -145,7 +156,7 @@ interface DriverDSLExposedInterface : CordformContext {
* Helper function for starting a [Node] with custom parameters from Java. * Helper function for starting a [Node] with custom parameters from Java.
* *
* @param parameters The default parameters for the driver. * @param parameters The default parameters for the driver.
* @return The value returned in the [dsl] closure. * @return [NodeHandle] that will be available sometime in the future.
*/ */
fun startNode(parameters: NodeParameters): CordaFuture<NodeHandle> = startNode(defaultParameters = parameters) fun startNode(parameters: NodeParameters): CordaFuture<NodeHandle> = startNode(defaultParameters = parameters)
@ -314,8 +325,8 @@ data class NodeParameters(
* @param useTestClock If true the test clock will be used in Node. * @param useTestClock If true the test clock will be used in Node.
* @param startNodesInProcess Provides the default behaviour of whether new nodes should start inside this process or * @param startNodesInProcess Provides the default behaviour of whether new nodes should start inside this process or
* not. Note that this may be overridden in [DriverDSLExposedInterface.startNode]. * not. Note that this may be overridden in [DriverDSLExposedInterface.startNode].
* @param notarySpecs The notaries advertised in the [NetworkParameters] for this network. These nodes will be started * @param notarySpecs The notaries advertised for this network. These nodes will be started automatically and will be
* automatically and will be available from [DriverDSLExposedInterface.notaryHandles]. Defaults to a simple validating notary. * available from [DriverDSLExposedInterface.notaryHandles]. Defaults to a simple validating notary.
* @param dsl The dsl itself. * @param dsl The dsl itself.
* @return The value returned in the [dsl] closure. * @return The value returned in the [dsl] closure.
*/ */