Search in sources :

Example 1 with ClusterConfiguration

use of org.hyperledger.besu.tests.acceptance.dsl.node.cluster.ClusterConfiguration in project besu by hyperledger.

the class MultiTenancyValidationFailAcceptanceTest method setUp.

@Before
public void setUp() throws Exception {
    final ClusterConfiguration clusterConfiguration = new ClusterConfigurationBuilder().awaitPeerDiscovery(false).build();
    multiTenancyCluster = new Cluster(clusterConfiguration, net);
    node = besu.createNodeWithMultiTenantedPrivacy("node1", "http://127.0.0.1:" + wireMockRule.port(), "authentication/auth_priv.toml", "authentication/auth_priv_key", false);
    multiTenancyCluster.start(node);
    final String token = node.execute(permissioningTransactions.createSuccessfulLogin("failUser", "pegasys"));
    node.useAuthenticationTokenInHeaderForJsonRpc(token);
}
Also used : ClusterConfigurationBuilder(org.hyperledger.besu.tests.acceptance.dsl.node.cluster.ClusterConfigurationBuilder) Cluster(org.hyperledger.besu.tests.acceptance.dsl.node.cluster.Cluster) ClusterConfiguration(org.hyperledger.besu.tests.acceptance.dsl.node.cluster.ClusterConfiguration) Before(org.junit.Before)

Example 2 with ClusterConfiguration

use of org.hyperledger.besu.tests.acceptance.dsl.node.cluster.ClusterConfiguration in project besu by hyperledger.

the class SECP256R1AcceptanceTest method setUp.

@Before
public void setUp() throws Exception {
    KeyPair minerNodeKeyPair = createKeyPair(MINER_NODE_PRIVATE_KEY);
    KeyPair otherNodeKeyPair = createKeyPair(OTHER_NODE_PRIVATE_KEY);
    final ClusterConfiguration clusterConfiguration = new ClusterConfigurationBuilder().awaitPeerDiscovery(false).build();
    noDiscoveryCluster = new Cluster(clusterConfiguration, net);
    minerNode = besu.createNodeWithNonDefaultSignatureAlgorithm("minerNode", GENESIS_FILE, minerNodeKeyPair);
    noDiscoveryCluster.start(minerNode);
    otherNode = besu.createNodeWithNonDefaultSignatureAlgorithm("otherNode", GENESIS_FILE, otherNodeKeyPair, List.of(minerNode));
    noDiscoveryCluster.addNode(otherNode);
}
Also used : KeyPair(org.hyperledger.besu.crypto.KeyPair) ClusterConfigurationBuilder(org.hyperledger.besu.tests.acceptance.dsl.node.cluster.ClusterConfigurationBuilder) Cluster(org.hyperledger.besu.tests.acceptance.dsl.node.cluster.Cluster) ClusterConfiguration(org.hyperledger.besu.tests.acceptance.dsl.node.cluster.ClusterConfiguration) Before(org.junit.Before)

Example 3 with ClusterConfiguration

use of org.hyperledger.besu.tests.acceptance.dsl.node.cluster.ClusterConfiguration in project besu by hyperledger.

the class NodeLocalConfigPermissioningAcceptanceTest method setUp.

@Before
public void setUp() throws Exception {
    final ClusterConfiguration clusterConfiguration = new ClusterConfigurationBuilder().awaitPeerDiscovery(false).build();
    permissionedCluster = new Cluster(clusterConfiguration, net);
    bootnode = besu.createArchiveNode("bootnode");
    forbiddenNode = besu.createArchiveNodeThatMustNotBeTheBootnode("forbidden-node");
    allowedNode = besu.createArchiveNode("allowed-node");
    permissionedCluster.start(bootnode, allowedNode, forbiddenNode);
    permissionedNode = permissionedNodeBuilder.nodesPermittedInConfig(bootnode, allowedNode).build();
    permissionedCluster.addNode(permissionedNode);
}
Also used : ClusterConfigurationBuilder(org.hyperledger.besu.tests.acceptance.dsl.node.cluster.ClusterConfigurationBuilder) Cluster(org.hyperledger.besu.tests.acceptance.dsl.node.cluster.Cluster) ClusterConfiguration(org.hyperledger.besu.tests.acceptance.dsl.node.cluster.ClusterConfiguration) Before(org.junit.Before)

Example 4 with ClusterConfiguration

use of org.hyperledger.besu.tests.acceptance.dsl.node.cluster.ClusterConfiguration in project besu by hyperledger.

the class JsonRpcHttpAuthenticationAcceptanceTest method setUp.

@Before
public void setUp() throws IOException, URISyntaxException {
    final ClusterConfiguration clusterConfiguration = new ClusterConfigurationBuilder().awaitPeerDiscovery(false).build();
    authenticatedCluster = new Cluster(clusterConfiguration, net);
    nodeUsingAuthFile = besu.createNodeWithAuthentication("node1", AUTH_FILE);
    nodeUsingRsaJwtPublicKey = besu.createNodeWithAuthenticationUsingRsaJwtPublicKey("node2");
    nodeUsingEcdsaJwtPublicKey = besu.createNodeWithAuthenticationUsingEcdsaJwtPublicKey("node3");
    nodeUsingAuthFileWithNoAuthApi = besu.createNodeWithAuthFileAndNoAuthApi("node4", AUTH_FILE, NO_AUTH_API_METHODS);
    authenticatedCluster.start(nodeUsingAuthFile, nodeUsingRsaJwtPublicKey, nodeUsingEcdsaJwtPublicKey, nodeUsingAuthFileWithNoAuthApi);
    nodeUsingAuthFile.verify(login.awaitResponse("user", "badpassword"));
    nodeUsingRsaJwtPublicKey.verify(login.awaitResponse("user", "badpassword"));
    nodeUsingEcdsaJwtPublicKey.verify(login.awaitResponse("user", "badpassword"));
    nodeUsingAuthFileWithNoAuthApi.verify(login.awaitResponse("user", "badpassword"));
}
Also used : ClusterConfigurationBuilder(org.hyperledger.besu.tests.acceptance.dsl.node.cluster.ClusterConfigurationBuilder) Cluster(org.hyperledger.besu.tests.acceptance.dsl.node.cluster.Cluster) ClusterConfiguration(org.hyperledger.besu.tests.acceptance.dsl.node.cluster.ClusterConfiguration) Before(org.junit.Before)

Example 5 with ClusterConfiguration

use of org.hyperledger.besu.tests.acceptance.dsl.node.cluster.ClusterConfiguration in project besu by hyperledger.

the class JsonRpcWebsocketAuthenticationAcceptanceTest method setUp.

@Before
public void setUp() throws IOException, URISyntaxException {
    final ClusterConfiguration clusterConfiguration = new ClusterConfigurationBuilder().awaitPeerDiscovery(false).build();
    authenticatedCluster = new Cluster(clusterConfiguration, net);
    nodeUsingAuthFile = besu.createNodeWithAuthentication("node1", AUTH_FILE);
    nodeUsingRsaJwtPublicKey = besu.createNodeWithAuthenticationUsingRsaJwtPublicKey("node2");
    nodeUsingEcdsaJwtPublicKey = besu.createNodeWithAuthenticationUsingEcdsaJwtPublicKey("node3");
    nodeUsingAuthFileWithNoAuthApi = besu.createWsNodeWithAuthFileAndNoAuthApi("node4", AUTH_FILE, NO_AUTH_API_METHODS);
    authenticatedCluster.start(nodeUsingAuthFile, nodeUsingRsaJwtPublicKey, nodeUsingEcdsaJwtPublicKey, nodeUsingAuthFileWithNoAuthApi);
    nodeUsingAuthFile.useWebSocketsForJsonRpc();
    nodeUsingRsaJwtPublicKey.useWebSocketsForJsonRpc();
    nodeUsingEcdsaJwtPublicKey.useWebSocketsForJsonRpc();
    nodeUsingAuthFileWithNoAuthApi.useWebSocketsForJsonRpc();
    nodeUsingAuthFile.verify(login.awaitResponse("user", "badpassword"));
    nodeUsingRsaJwtPublicKey.verify(login.awaitResponse("user", "badpassword"));
    nodeUsingEcdsaJwtPublicKey.verify(login.awaitResponse("user", "badpassword"));
    nodeUsingAuthFileWithNoAuthApi.verify(login.awaitResponse("user", "badpassword"));
}
Also used : ClusterConfigurationBuilder(org.hyperledger.besu.tests.acceptance.dsl.node.cluster.ClusterConfigurationBuilder) Cluster(org.hyperledger.besu.tests.acceptance.dsl.node.cluster.Cluster) ClusterConfiguration(org.hyperledger.besu.tests.acceptance.dsl.node.cluster.ClusterConfiguration) Before(org.junit.Before)

Aggregations

Cluster (org.hyperledger.besu.tests.acceptance.dsl.node.cluster.Cluster)11 ClusterConfiguration (org.hyperledger.besu.tests.acceptance.dsl.node.cluster.ClusterConfiguration)11 ClusterConfigurationBuilder (org.hyperledger.besu.tests.acceptance.dsl.node.cluster.ClusterConfigurationBuilder)11 Before (org.junit.Before)11 KeyPair (org.hyperledger.besu.crypto.KeyPair)1 BesuNode (org.hyperledger.besu.tests.acceptance.dsl.node.BesuNode)1 BesuNodeRunner (org.hyperledger.besu.tests.acceptance.dsl.node.BesuNodeRunner)1 ThreadBesuNodeRunner (org.hyperledger.besu.tests.acceptance.dsl.node.ThreadBesuNodeRunner)1