|
|
|
@ -59,6 +59,7 @@ import org.hyperledger.besu.ethereum.GasLimitCalculator; |
|
|
|
|
import org.hyperledger.besu.ethereum.api.graphql.GraphQLConfiguration; |
|
|
|
|
import org.hyperledger.besu.ethereum.api.handlers.TimeoutOptions; |
|
|
|
|
import org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcConfiguration; |
|
|
|
|
import org.hyperledger.besu.ethereum.api.jsonrpc.authentication.JwtAlgorithm; |
|
|
|
|
import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration; |
|
|
|
|
import org.hyperledger.besu.ethereum.api.tls.TlsConfiguration; |
|
|
|
|
import org.hyperledger.besu.ethereum.core.MiningParameters; |
|
|
|
@ -4215,6 +4216,28 @@ public class BesuCommandTest extends CommandTestAbstract { |
|
|
|
|
.containsEntry(block2, Hash.fromHexStringLenient(hash2)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void httpAuthenticationAlgorithIsConfigured() { |
|
|
|
|
parseCommand("--rpc-http-authentication-jwt-algorithm", "ES256"); |
|
|
|
|
|
|
|
|
|
verify(mockRunnerBuilder).jsonRpcConfiguration(jsonRpcConfigArgumentCaptor.capture()); |
|
|
|
|
verify(mockRunnerBuilder).build(); |
|
|
|
|
|
|
|
|
|
assertThat(jsonRpcConfigArgumentCaptor.getValue().getAuthenticationAlgorithm()) |
|
|
|
|
.isEqualTo(JwtAlgorithm.ES256); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void webSocketAuthenticationAlgorithIsConfigured() { |
|
|
|
|
parseCommand("--rpc-ws-authentication-jwt-algorithm", "ES256"); |
|
|
|
|
|
|
|
|
|
verify(mockRunnerBuilder).webSocketConfiguration(wsRpcConfigArgumentCaptor.capture()); |
|
|
|
|
verify(mockRunnerBuilder).build(); |
|
|
|
|
|
|
|
|
|
assertThat(wsRpcConfigArgumentCaptor.getValue().getAuthenticationAlgorithm()) |
|
|
|
|
.isEqualTo(JwtAlgorithm.ES256); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void httpAuthenticationPublicKeyIsConfigured() throws IOException { |
|
|
|
|
final Path publicKey = Files.createTempFile("public_key", ""); |
|
|
|
|