mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 16:16:47 +00:00
Closes #109 - Need guard on internal (Kafka) getTransactions. should check the bankid/accountId is correct for all
This commit is contained in:
parent
aa8cde5ff4
commit
625c63212f
@ -109,6 +109,7 @@ object ErrorMessages {
|
||||
val InvalidGetBankAccountsConnectorResponse = "OBP-30201: Connector did not return the set of accounts we requested."
|
||||
val InvalidGetBankAccountConnectorResponse = "OBP-30202: Connector did not return the account we requested."
|
||||
val InvalidGetTransactionConnectorResponse = "OBP-30203: Connector did not return the transaction we requested."
|
||||
val InvalidGetTransactionsConnectorResponse = "OBP-30204: Connector did not return the set of transactions we requested."
|
||||
|
||||
|
||||
|
||||
|
||||
@ -252,6 +252,9 @@ object KafkaMappedConnector extends Connector with CreateViewImpls with Loggable
|
||||
"queryParams" -> queryParams.toString )
|
||||
implicit val formats = net.liftweb.json.DefaultFormats
|
||||
val rList = process(reqId, "getTransactions", argList).extract[List[KafkaInboundTransaction]]
|
||||
// Check does the response data match the requested data
|
||||
val isCorrect = rList.forall(x=>x.this_account.id == accountID.value && x.this_account.bank == bankId.value)
|
||||
if (!isCorrect) throw new Exception(ErrorMessages.InvalidGetTransactionsConnectorResponse)
|
||||
// Populate fields and generate result
|
||||
val res = for {
|
||||
r <- rList
|
||||
|
||||
Loading…
Reference in New Issue
Block a user