mirror of
https://github.com/corda/corda.git
synced 2025-06-16 14:18:20 +00:00
docs: Create users separately for different parties with minimum required permission. (#440)
This commit is contained in:
@ -29,25 +29,26 @@ class IntegrationTestingTutorial {
|
|||||||
fun `alice bob cash exchange example`() {
|
fun `alice bob cash exchange example`() {
|
||||||
// START 1
|
// START 1
|
||||||
driver {
|
driver {
|
||||||
val testUser = User("testUser", "testPassword", permissions = setOf(
|
val aliceUser = User("aliceUser", "testPassword1", permissions = setOf(
|
||||||
startFlowPermission<CashIssueFlow>(),
|
startFlowPermission<CashIssueFlow>()
|
||||||
|
))
|
||||||
|
val bobUser = User("bobUser", "testPassword2", permissions = setOf(
|
||||||
startFlowPermission<CashPaymentFlow>()
|
startFlowPermission<CashPaymentFlow>()
|
||||||
))
|
))
|
||||||
val (alice, bob, notary) = Futures.allAsList(
|
val (alice, bob, notary) = Futures.allAsList(
|
||||||
startNode("Alice", rpcUsers = listOf(testUser)),
|
startNode("Alice", rpcUsers = listOf(aliceUser)),
|
||||||
startNode("Bob", rpcUsers = listOf(testUser)),
|
startNode("Bob", rpcUsers = listOf(bobUser)),
|
||||||
startNode("Notary", advertisedServices = setOf(ServiceInfo(ValidatingNotaryService.type)))
|
startNode("Notary", advertisedServices = setOf(ServiceInfo(ValidatingNotaryService.type)))
|
||||||
).getOrThrow()
|
).getOrThrow()
|
||||||
// END 1
|
// END 1
|
||||||
|
|
||||||
// START 2
|
// START 2
|
||||||
val aliceClient = alice.rpcClientToNode()
|
val aliceClient = alice.rpcClientToNode()
|
||||||
|
aliceClient.start("aliceUser", "testPassword1")
|
||||||
aliceClient.start("testUser", "testPassword")
|
|
||||||
val aliceProxy = aliceClient.proxy()
|
val aliceProxy = aliceClient.proxy()
|
||||||
val bobClient = bob.rpcClientToNode()
|
|
||||||
|
|
||||||
bobClient.start("testUser", "testPassword")
|
val bobClient = bob.rpcClientToNode()
|
||||||
|
bobClient.start("bobUser", "testPassword2")
|
||||||
val bobProxy = bobClient.proxy()
|
val bobProxy = bobClient.proxy()
|
||||||
// END 2
|
// END 2
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user