RPC flow permission


(kamlendra Tiwari) #1

Hello,
I am working on a POC where I am creating supply chain finance application using corda,
for this I have three nodes which are buyer, Supplier and a bank,
I have 4 flows, where buyer and bank should only have access to one flow each and, supplier should have access to 2 flow,
i have nodeDriver.java file where:

    Set<String> supplierPermissions = new HashSet<String>();
    Set<String> buyerPermissions = new HashSet<String>();
    Set<String> bankPermissions = new HashSet<String>();
    supplierPermissions.add("com.eaxmple.flow1");
    buyerPermissions.add("com.eaxmple.flow2");
    buyerPermissions.add("com.eaxmple.flow3");
    bankPermissions.add("com.eaxmple.flow4");

    final User supplier = new User("user1", "test",supplierPermissions );
    final User buyer = new User("user2", "test", buyerPermissions);
    final User bank = new User("user3", "test", bankPermissions);
    final User oracle = new User("user4", "test", emptySet());

when i build the project, i get a build folder where i have node.conf file for all the users, for example in buyer’s node.conf file i have:

hardcoded value

"p2pAddress" : "localhost:10008",
# hardcoded value
"rpcAddress" : "localhost:10009",
# hardcoded value
"rpcUsers" : [
    # hardcoded value
    {
        # hardcoded value
        "password" : "test",
        # hardcoded value
        "permissions" : [
            # hardcoded value
            "com.example.flow2",
            # hardcoded value
            "com.example.flow3"
        ],
        # hardcoded value
        "username" : "user2"
    }
]

but the problem is, when i try to run the flow from supplier’s node, it executes, anyways it gets failed in contract but i am still wondering why is the permissions not working as expected, waiting for your response., need to complete this task in 2 days.


(kamlendra Tiwari) #2

issue has been resolved…!