Skip to content

Commit

Permalink
Move authentication json-rpc HTTP handler first in the execution pipe…
Browse files Browse the repository at this point in the history
…line [hyperledger#535]

Signed-off-by: Diego López León <[email protected]>
Signed-off-by: Diego López León <[email protected]>
  • Loading branch information
diega committed Apr 26, 2022
1 parent 236abe4 commit 9038a64
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,19 +344,16 @@ private Router buildRouter() {
.route(HealthService.READINESS_PATH)
.method(HttpMethod.GET)
.handler(readinessService::handleRequest);
Route mainRoute =
router
.route("/")
.method(HttpMethod.POST)
.produces(APPLICATION_JSON)
.handler(
HandlerFactory.timeout(
new TimeoutOptions(config.getHttpTimeoutSec()), rpcMethods, true));
Route mainRoute = router.route("/").method(HttpMethod.POST).produces(APPLICATION_JSON);
if (authenticationService.isPresent()) {
mainRoute.handler(
HandlerFactory.authentication(authenticationService.get(), config.getNoAuthRpcApis()));
}
mainRoute.handler(this::handleJsonRPCRequest);
mainRoute
.handler(
HandlerFactory.timeout(
new TimeoutOptions(config.getHttpTimeoutSec()), rpcMethods, true))
.handler(this::handleJsonRPCRequest);

if (authenticationService.isPresent()) {
router
Expand Down

0 comments on commit 9038a64

Please sign in to comment.