mirror of
https://github.com/corda/corda.git
synced 2025-01-18 10:46:38 +00:00
Merge branch 'release/os/4.6' into dan/os-4.6-to-4.7-merge-2021-02-05
# Conflicts: # node/src/main/kotlin/net/corda/node/internal/rpc/proxies/AuthenticatedRpcOpsProxy.kt
This commit is contained in:
commit
d807082cee
@ -61,6 +61,38 @@ class FlowWithClientIdTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test(timeout = 300_000)
|
||||
fun `start flow with client id permissions`() {
|
||||
val user = User("TonyStark", "I AM IRONMAN", setOf("StartFlow.net.corda.node.flows.FlowWithClientIdTest\$ResultFlow"))
|
||||
driver(DriverParameters(startNodesInProcess = true, cordappsForAllNodes = emptySet())) {
|
||||
val nodeA = startNode(rpcUsers = listOf(user)).getOrThrow()
|
||||
nodeA.rpc.startFlowWithClientId(UUID.randomUUID().toString(), ::ResultFlow, 5).returnValue.getOrThrow(20.seconds)
|
||||
nodeA.rpc.startFlowDynamicWithClientId(
|
||||
UUID.randomUUID().toString(),
|
||||
ResultFlow::class.java,
|
||||
5
|
||||
).returnValue.getOrThrow(20.seconds)
|
||||
}
|
||||
}
|
||||
|
||||
@Test(timeout = 300_000)
|
||||
fun `start flow with client id without permissions`() {
|
||||
val user = User("TonyStark", "I AM IRONMAN", setOf())
|
||||
driver(DriverParameters(startNodesInProcess = true, cordappsForAllNodes = emptySet())) {
|
||||
val nodeA = startNode(rpcUsers = listOf(user)).getOrThrow()
|
||||
assertFailsWith<PermissionException> {
|
||||
nodeA.rpc.startFlowWithClientId(UUID.randomUUID().toString(), ::ResultFlow, 5).returnValue.getOrThrow(20.seconds)
|
||||
}
|
||||
assertFailsWith<PermissionException> {
|
||||
nodeA.rpc.startFlowDynamicWithClientId(
|
||||
UUID.randomUUID().toString(),
|
||||
ResultFlow::class.java,
|
||||
5
|
||||
).returnValue.getOrThrow(20.seconds)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test(timeout = 300_000)
|
||||
fun `remove client id`() {
|
||||
val clientId = UUID.randomUUID().toString()
|
||||
|
Loading…
Reference in New Issue
Block a user