From 66da2b58a466b00ad6b3fe53dc53ed42e898f60f Mon Sep 17 00:00:00 2001 From: Alexis Hernandez Date: Thu, 10 Jan 2019 22:56:16 -0700 Subject: [PATCH] infra: Restrict the available routes for LTC --- infra/deployment/config/ltc-routes | 23 +++++++++++++++++++++++ infra/deployment/ltc-backend.yml | 8 ++++++++ 2 files changed, 31 insertions(+) create mode 100644 infra/deployment/config/ltc-routes diff --git a/infra/deployment/config/ltc-routes b/infra/deployment/config/ltc-routes new file mode 100644 index 0000000..96ff2b1 --- /dev/null +++ b/infra/deployment/config/ltc-routes @@ -0,0 +1,23 @@ +# Routes +# This file defines all application routes (Higher priority routes first) +# https://www.playframework.com/documentation/latest/ScalaRouting +# ~~~~ + +GET /health controllers.HealthController.check() +# GET /maintenance controllers.MaintenanceController.run(query: String ?= "") + +GET /transactions/:txid controllers.TransactionsController.getTransaction(txid: String) +GET /transactions/:txid/raw controllers.TransactionsController.getRawTransaction(txid: String) +POST /transactions controllers.TransactionsController.sendRawTransaction() + +GET /addresses/:address controllers.AddressesController.getBy(address: String) +GET /v2/addresses/:address/transactions controllers.AddressesController.getLightWalletTransactions(address: String, limit: Int ?= 10, lastSeenTxid: Option[String], order: String ?= "desc") + +GET /blocks controllers.BlocksController.getLatestBlocks() +GET /blocks/:query controllers.BlocksController.getDetails(query: String) +GET /blocks/:query/raw controllers.BlocksController.getRawBlock(query: String) +GET /v2/blocks/:blockhash/transactions controllers.BlocksController.getTransactionsV2(blockhash: String, limit: Int ?= 10, lastSeenTxid: Option[String]) + +GET /stats controllers.StatisticsController.getStatus() + +GET /v2/balances controllers.BalancesController.getHighest(limit: Int ?= 10, lastSeenAddress: Option[String]) diff --git a/infra/deployment/ltc-backend.yml b/infra/deployment/ltc-backend.yml index 2c44d47..3fed3ea 100644 --- a/infra/deployment/ltc-backend.yml +++ b/infra/deployment/ltc-backend.yml @@ -54,6 +54,14 @@ owner: play group: play + - name: Set the application routes + become: yes + copy: + src: config/ltc-routes + dest: /home/play/app/xsn-block-explorer-0.1.0-SNAPSHOT/conf/routes + owner: play + group: play + - name: Set the application files permissions become: yes file: