Merge pull request #1636 from hongwei1/develop

tweaked the endpoints and documents
This commit is contained in:
Marko Milić 2020-07-14 11:04:20 +02:00 committed by GitHub
commit 5979f198bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 155 additions and 132 deletions

View File

@ -8,7 +8,7 @@
<groupId>com.tesobe</groupId>
<artifactId>obp-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.5.7</version>
<version>1.5.8</version>
</parent>
<artifactId>obp-api</artifactId>
<packaging>war</packaging>

View File

@ -441,6 +441,8 @@ webui_agree_terms_url =
# URL to load (alternative) get started content (this replaces the normal content in index.html
#webui_get_started_content_url = http://127.0.0.1:8080/plain.html
# URL to load (alternative) header content (this replaces the id ="table-header" content in default.html
#webui_header_content_url = http://127.0.0.1:8080/plain.html
# If we want to gather more information about an Application / Startup fill this url and text

View File

@ -41,7 +41,7 @@ object APIMethods_AccountInformationServiceAISApi extends RestHelper {
deleteConsent ::
getAccountList ::
getBalances ::
getCardAccount ::
getCardAccounts ::
getCardAccountBalances ::
getCardAccountTransactionList ::
getConsentAuthorisation ::
@ -324,9 +324,9 @@ The account-id is constant at least throughout the lifecycle of a given consent.
}
resourceDocs += ResourceDoc(
getCardAccount,
getCardAccounts,
apiVersion,
nameOf(getCardAccount),
nameOf(getCardAccounts),
"GET",
"/card-accounts",
"Reads a list of card accounts",
@ -338,97 +338,71 @@ respectively the OAuth2 access token.
""",
json.parse(""""""),
json.parse("""{
"cardAccounts" : [ {
"balances" : "",
"product" : "product",
"resourceId" : "resourceId",
"maskedPan" : "123456xxxxxx1234",
"_links" : {
"balances" : "/v1.3/payments/sepa-credit-transfers/1234-wertiq-983",
"transactions" : "/v1.3/payments/sepa-credit-transfers/1234-wertiq-983"
},
"usage" : "PRIV",
"name" : "name",
"creditLimit" : {
"amount" : "123",
"currency" : "EUR"
},
"currency" : "EUR",
"details" : "details",
"status" : { }
}, {
"balances" : "",
"product" : "product",
"resourceId" : "resourceId",
"maskedPan" : "123456xxxxxx1234",
"_links" : {
"balances" : "/v1.3/payments/sepa-credit-transfers/1234-wertiq-983",
"transactions" : "/v1.3/payments/sepa-credit-transfers/1234-wertiq-983"
},
"usage" : "PRIV",
"name" : "name",
"creditLimit" : {
"amount" : "123",
"currency" : "EUR"
},
"currency" : "EUR",
"details" : "details",
"status" : { }
} ]
"cardAccounts": [
{
"resourceId": "3d9a81b3-a47d-4130-8765-a9c0ff861b99",
"maskedPan": "525412******3241",
"currency": "EUR",
"name": "Main",
"product": "Basic Credit",
"status": "enabled",
"creditLimit": {
"currency": "EUR",
"amount": 15000
},
"balances": [
{
"balanceType": "interimBooked",
"balanceAmount": {
"currency": "EUR",
"amount": 14355.78
}
},
{
"balanceType": "nonBilled",
"balanceAmount": {
"currency": "EUR",
"amount": 4175.86
}
}
],
"_links": {
"transactions": {
"href": "/v1/card-accounts/3d9a81b3-a47d-4130-8765-a9c0ff861b99/transactions"
}
}
}
]
}"""),
List(UserNotLoggedIn, UnknownError),
Catalogs(notCore, notPSD2, notOBWG),
ApiTag("Account Information Service (AIS)") :: apiTagMockedData :: Nil
)
lazy val getCardAccount : OBPEndpoint = {
lazy val getCardAccounts : OBPEndpoint = {
case "card-accounts" :: Nil JsonGet _ => {
cc =>
for {
(Full(u), callContext) <- authenticatedAccess(cc)
} yield {
(json.parse("""{
"cardAccounts" : [ {
"balances" : "",
"product" : "product",
"resourceId" : "resourceId",
"maskedPan" : "123456xxxxxx1234",
"_links" : {
"balances" : "/v1.3/payments/sepa-credit-transfers/1234-wertiq-983",
"transactions" : "/v1.3/payments/sepa-credit-transfers/1234-wertiq-983"
},
"usage" : "PRIV",
"name" : "name",
"creditLimit" : {
"amount" : "123",
"currency" : "EUR"
},
"currency" : "EUR",
"details" : "details",
"status" : { }
}, {
"balances" : "",
"product" : "product",
"resourceId" : "resourceId",
"maskedPan" : "123456xxxxxx1234",
"_links" : {
"balances" : "/v1.3/payments/sepa-credit-transfers/1234-wertiq-983",
"transactions" : "/v1.3/payments/sepa-credit-transfers/1234-wertiq-983"
},
"usage" : "PRIV",
"name" : "name",
"creditLimit" : {
"amount" : "123",
"currency" : "EUR"
},
"currency" : "EUR",
"details" : "details",
"status" : { }
} ]
}"""), callContext)
_ <- passesPsd2Aisp(callContext)
_ <- Helper.booleanToFuture(failMsg = DefaultBankIdNotSet) {
defaultBankId != "DEFAULT_BANK_ID_NOT_SET"
}
bankId = BankId(defaultBankId)
(_, callContext) <- NewStyle.function.getBank(bankId, callContext)
availablePrivateAccounts <- Views.views.vend.getPrivateBankAccountsFuture(u, bankId)
(accounts, callContext) <- NewStyle.function.getBankAccounts(availablePrivateAccounts, callContext)
} yield {
(JSONFactory_BERLIN_GROUP_1_3.createCardAccountListJson(accounts, u), callContext)
}
}
}
}
resourceDocs += ResourceDoc(
getCardAccountBalances,

View File

@ -55,6 +55,7 @@ object JSONFactory_BERLIN_GROUP_1_3 extends CustomJsonFormats {
)
case class CoreAccountsJsonV13(accounts: List[CoreAccountJsonV13])
case class CoreCardAccountsJsonV13(cardAccounts: List[CoreAccountJsonV13])
case class AccountDetailsLinksJsonV13(
balances: LinkHrefJson,
@ -289,6 +290,35 @@ object JSONFactory_BERLIN_GROUP_1_3 extends CustomJsonFormats {
}
)
}
def createCardAccountListJson(bankAccounts: List[BankAccount], user: User): CoreCardAccountsJsonV13 = {
CoreCardAccountsJsonV13(bankAccounts.map {
x =>
val (iBan: String, bBan: String) = getIbanAndBban(x)
val balance =
CoreAccountBalancesJson(
balanceAmount = AmountOfMoneyV13(x.currency,x.balance.toString()),
balanceType = APIUtil.stringOrNull(x.accountType),
lastChangeDateTime=APIUtil.DateWithDayFormat.format(x.lastUpdate),
referenceDate =APIUtil.DateWithMsRollback.format(x.lastUpdate),
lastCommittedTransaction = "String"
)
CoreAccountJsonV13(
resourceId = x.accountId.value,
iban = iBan,
bban = bBan,
currency = x.currency,
name = x.name,
bic = getBicFromBankId(x.bankId.value),
cashAccountType = x.accountType,
product = x.accountType,
balances = balance,
_links = CoreAccountLinksJsonV13(LinkHrefJson(s"/${OBP_BERLIN_GROUP_1_3.version}/accounts/${x.accountId.value}/balances"))
)
}
)
}
def createCardAccountDetailsJson(bankAccount: BankAccount, user: User): CardAccountDetailsJsonV13 = {
val accountDetailsJsonV13 = createAccountDetailsJson(bankAccount: BankAccount, user: User)
@ -365,14 +395,14 @@ object JSONFactory_BERLIN_GROUP_1_3 extends CustomJsonFormats {
val address = transaction.otherBankAccount.map(_.accountRoutingAddress).getOrElse(None).getOrElse("")
val scheme: String = transaction.otherBankAccount.map(_.accountRoutingScheme).getOrElse(None).getOrElse("")
val (iban, bban, pan, maskedPan, currency) = extractAccountData(scheme, address)
// val (iban, bban, pan, maskedPan, currency) = extractAccountData(scheme, address)
CardTransactionJsonV13(
cardTransactionId = transaction.id.value,
transactionAmount = AmountOfMoneyV13(APIUtil.stringOptionOrNull(transaction.currency), transaction.amount.get.toString()),
transactionDate = transaction.finishDate.get,
bookingDate = transaction.startDate.get,
originalAmount = AmountOfMoneyV13(orignalCurrency, orignalBalnce),
maskedPan = maskedPan,
maskedPan = "",
proprietaryBankTransactionCode = "",
invoiced = true,
transactionDetails = APIUtil.stringOptionOrNull(transaction.description)

View File

@ -25,7 +25,7 @@ object ExampleValue {
lazy val bankIdExample = ConnectorField("gh.29.uk", s"A string that MUST uniquely identify the bank on this OBP instance. It COULD be a UUID but is generally a short string that easily identifies the bank / brand it represents.")
lazy val bank_idExample = bankIdExample
lazy val accountIdExample = ConnectorField("8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", s"A string that, in combination with the bankId MUST uniquely identify the account on this OBP instance. SHOULD be a UUID. MUST NOT be able to guess accountNumber from accountID. OBP-API or Adapter keeps a mapping between accountId and accountNumber. AccountId is a non reversible hash of the human readable account number.")
lazy val accountIdExample = ConnectorField("8ca8a7e4-6d02-40e3-a129-0b2bf89de9f0", s"A string that, in combination with the bankId MUST uniquely identify the account on this OBP instance. SHOULD be a UUID. MUST NOT be able to guess accountNumber from accountId. OBP-API or Adapter keeps a mapping between accountId and accountNumber. AccountId is a non reversible hash of the human readable account number.")
lazy val account_idExample = accountIdExample

View File

@ -251,8 +251,8 @@ object NewStyle {
callContext: Option[CallContext]): Future[ModeratedOtherBankAccount] =
Future(account.moderatedOtherBankAccount(counterpartyId, view, BankIdAccountId(account.bankId, account.accountId), user, callContext)) map { connectorEmptyResponse(_, callContext) }
def getTransactionsCore(bankId: BankId, accountID: AccountId, queryParams: List[OBPQueryParam], callContext: Option[CallContext]): OBPReturnType[List[TransactionCore]] =
Connector.connector.vend.getTransactionsCore(bankId: BankId, accountID: AccountId, queryParams: List[OBPQueryParam], callContext: Option[CallContext]) map { i =>
def getTransactionsCore(bankId: BankId, accountId: AccountId, queryParams: List[OBPQueryParam], callContext: Option[CallContext]): OBPReturnType[List[TransactionCore]] =
Connector.connector.vend.getTransactionsCore(bankId: BankId, accountId: AccountId, queryParams: List[OBPQueryParam], callContext: Option[CallContext]) map { i =>
(unboxFullOrFail(i._1, callContext,s"$InvalidConnectorResponseForGetTransactions", 400 ), i._2)
}
def checkOwnerViewAccessAndReturnOwnerView(user: User, bankAccountId: BankIdAccountId, callContext: Option[CallContext]) : Future[View] = {

View File

@ -892,7 +892,7 @@ trait APIMethods200 {
case "my" :: "banks" :: BankId(bankId) :: "accounts" :: AccountId(accountId) :: "account" :: Nil JsonGet req => {
cc =>
// TODO return specific error if bankId == "BANK_ID" or accountID == "ACCOUNT_ID"
// TODO return specific error if bankId == "BANK_ID" or accountId == "ACCOUNT_ID"
// Should be a generic guard we can use for all calls (also for userId etc.)
for {
u <- cc.user ?~ UserNotLoggedIn

View File

@ -511,16 +511,16 @@ trait Connector extends MdcLoggable {
//TODO, here is a problem for return value `List[Transaction]`, this is a normal class, not a trait. It is a big class,
// it contains thisAccount(BankAccount object) and otherAccount(Counterparty object)
def getTransactionsLegacy(bankId: BankId, accountID: AccountId, callContext: Option[CallContext], queryParams: List[OBPQueryParam] = Nil): Box[(List[Transaction], Option[CallContext])]= Failure(setUnimplementedError)
def getTransactionsLegacy(bankId: BankId, accountId: AccountId, callContext: Option[CallContext], queryParams: List[OBPQueryParam] = Nil): Box[(List[Transaction], Option[CallContext])]= Failure(setUnimplementedError)
def getTransactions(bankId: BankId, accountId: AccountId, callContext: Option[CallContext], queryParams: List[OBPQueryParam] = Nil): OBPReturnType[Box[List[Transaction]]] = {
val result: Box[(List[Transaction], Option[CallContext])] = getTransactionsLegacy(bankId, accountId, callContext, queryParams)
Future(result.map(_._1), result.map(_._2).getOrElse(callContext))
}
def getTransactionsCore(bankId: BankId, accountID: AccountId, queryParams: List[OBPQueryParam] = Nil, callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionCore]]] = Future{(Failure(setUnimplementedError), callContext)}
def getTransactionsCore(bankId: BankId, accountId: AccountId, queryParams: List[OBPQueryParam] = Nil, callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionCore]]] = Future{(Failure(setUnimplementedError), callContext)}
def getTransactionLegacy(bankId: BankId, accountID : AccountId, transactionId : TransactionId, callContext: Option[CallContext] = None): Box[(Transaction, Option[CallContext])] = Failure(setUnimplementedError)
def getTransaction(bankId: BankId, accountID : AccountId, transactionId : TransactionId, callContext: Option[CallContext] = None): OBPReturnType[Box[Transaction]] = {
val result: Box[(Transaction, Option[CallContext])] = getTransactionLegacy(bankId, accountID, transactionId, callContext)
def getTransactionLegacy(bankId: BankId, accountId : AccountId, transactionId : TransactionId, callContext: Option[CallContext] = None): Box[(Transaction, Option[CallContext])] = Failure(setUnimplementedError)
def getTransaction(bankId: BankId, accountId : AccountId, transactionId : TransactionId, callContext: Option[CallContext] = None): OBPReturnType[Box[Transaction]] = {
val result: Box[(Transaction, Option[CallContext])] = getTransactionLegacy(bankId, accountId, transactionId, callContext)
Future(result.map(_._1), result.map(_._2).getOrElse(callContext))
}

View File

@ -3265,8 +3265,8 @@ object LocalMappedConnector extends Connector with MdcLoggable {
}
override def getTransaction(bankId: BankId, accountID: AccountId, transactionId: TransactionId, callContext: Option[CallContext] = None): OBPReturnType[Box[Transaction]] = {
val result: Box[(Transaction, Option[CallContext])] = getTransactionLegacy(bankId, accountID, transactionId, callContext)
override def getTransaction(bankId: BankId, accountId: AccountId, transactionId: TransactionId, callContext: Option[CallContext] = None): OBPReturnType[Box[Transaction]] = {
val result: Box[(Transaction, Option[CallContext])] = getTransactionLegacy(bankId, accountId, transactionId, callContext)
Future(result.map(_._1), result.map(_._2).getOrElse(callContext))
}
@ -4182,5 +4182,8 @@ object LocalMappedConnector extends Connector with MdcLoggable {
CustomerAttributeX.customerAttributeProvider.vend.deleteCustomerAttribute(customerAttributeId) map { ( _, callContext) }
}
//NOTE: this method is not for mapped connector, we put it here for the star default implementation.
// : we call that method only when we set external authentication and provider is not OBP-API
override def checkExternalUserCredentials(username: String, password: String, callContext: Option[CallContext]): Box[InboundExternalUser] = Failure("")
}

View File

@ -946,7 +946,7 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit {
exampleOutboundMessage = (
OutBoundGetTransactionsCore(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext,
bankId=BankId(bankIdExample.value),
accountID=AccountId(accountIdExample.value),
accountId=AccountId(accountIdExample.value),
limit=limitExample.value.toInt,
offset=offsetExample.value.toInt,
fromDate="string",
@ -996,9 +996,9 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit {
adapterImplementation = Some(AdapterImplementation("- Core", 1))
)
override def getTransactionsCore(bankId: BankId, accountID: AccountId, queryParams: List[OBPQueryParam], callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionCore]]] = {
override def getTransactionsCore(bankId: BankId, accountId: AccountId, queryParams: List[OBPQueryParam], callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionCore]]] = {
import com.openbankproject.commons.dto.{OutBoundGetTransactionsCore => OutBound, InBoundGetTransactionsCore => InBound}
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountID, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams))
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams))
val response: Future[Box[InBound]] = (southSideActor ? req).mapTo[InBound].recoverWith(recoverFunction).map(Box !! _)
response.map(convertToTuple[List[TransactionCore]](callContext))
}

View File

@ -2202,7 +2202,7 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper with MdcLoggable
emailAddress=emailExample.value,
name=usernameExample.value))))))))),
bankId=BankId(bankIdExample.value),
accountID=AccountId(accountIdExample.value),
accountId=AccountId(accountIdExample.value),
limit=limitExample.value.toInt,
offset=offsetExample.value.toInt,
fromDate="string",
@ -2261,10 +2261,10 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper with MdcLoggable
adapterImplementation = Some(AdapterImplementation("- Core", 1))
)
// url example: /getTransactionsLegacy
override def getTransactionsLegacy(bankId: BankId, accountID: AccountId, callContext: Option[CallContext], queryParams: List[OBPQueryParam]): Box[(List[Transaction], Option[CallContext])] = {
override def getTransactionsLegacy(bankId: BankId, accountId: AccountId, callContext: Option[CallContext], queryParams: List[OBPQueryParam]): Box[(List[Transaction], Option[CallContext])] = {
import com.openbankproject.commons.dto.{OutBoundGetTransactionsLegacy => OutBound, InBoundGetTransactionsLegacy => InBound}
val url = getUrl(callContext, "getTransactionsLegacy")
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountID, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams))
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountId, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams))
val result: OBPReturnType[Box[List[Transaction]]] = sendRequest[InBound](url, HttpMethods.POST, req, callContext).map(convertToTuple(callContext))
result
}
@ -2406,7 +2406,7 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper with MdcLoggable
emailAddress=emailExample.value,
name=usernameExample.value))))))))),
bankId=BankId(bankIdExample.value),
accountID=AccountId(accountIdExample.value),
accountId=AccountId(accountIdExample.value),
limit=limitExample.value.toInt,
offset=offsetExample.value.toInt,
fromDate="string",
@ -2463,10 +2463,10 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper with MdcLoggable
adapterImplementation = Some(AdapterImplementation("- Core", 1))
)
// url example: /getTransactionsCore
override def getTransactionsCore(bankId: BankId, accountID: AccountId, queryParams: List[OBPQueryParam], callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionCore]]] = {
override def getTransactionsCore(bankId: BankId, accountId: AccountId, queryParams: List[OBPQueryParam], callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionCore]]] = {
import com.openbankproject.commons.dto.{OutBoundGetTransactionsCore => OutBound, InBoundGetTransactionsCore => InBound}
val url = getUrl(callContext, "getTransactionsCore")
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountID, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams))
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountId, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams))
val result: OBPReturnType[Box[List[TransactionCore]]] = sendRequest[InBound](url, HttpMethods.POST, req, callContext).map(convertToTuple(callContext))
result
}
@ -2506,7 +2506,7 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper with MdcLoggable
emailAddress=emailExample.value,
name=usernameExample.value))))))))),
bankId=BankId(bankIdExample.value),
accountID=AccountId(accountIdExample.value),
accountId=AccountId(accountIdExample.value),
transactionId=TransactionId(transactionIdExample.value))
),
exampleInboundMessage = (
@ -2562,10 +2562,10 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper with MdcLoggable
adapterImplementation = Some(AdapterImplementation("- Core", 1))
)
// url example: /getTransactionLegacy
override def getTransactionLegacy(bankId: BankId, accountID: AccountId, transactionId: TransactionId, callContext: Option[CallContext]): Box[(Transaction, Option[CallContext])] = {
override def getTransactionLegacy(bankId: BankId, accountId: AccountId, transactionId: TransactionId, callContext: Option[CallContext]): Box[(Transaction, Option[CallContext])] = {
import com.openbankproject.commons.dto.{OutBoundGetTransactionLegacy => OutBound, InBoundGetTransactionLegacy => InBound}
val url = getUrl(callContext, "getTransactionLegacy")
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountID, transactionId)
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountId, transactionId)
val result: OBPReturnType[Box[Transaction]] = sendRequest[InBound](url, HttpMethods.POST, req, callContext).map(convertToTuple(callContext))
result
}
@ -2661,10 +2661,10 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper with MdcLoggable
adapterImplementation = Some(AdapterImplementation("- Core", 1))
)
// url example: /getTransaction
override def getTransaction(bankId: BankId, accountID: AccountId, transactionId: TransactionId, callContext: Option[CallContext]): OBPReturnType[Box[Transaction]] = {
override def getTransaction(bankId: BankId, accountId: AccountId, transactionId: TransactionId, callContext: Option[CallContext]): OBPReturnType[Box[Transaction]] = {
import com.openbankproject.commons.dto.{OutBoundGetTransaction => OutBound, InBoundGetTransaction => InBound}
val url = getUrl(callContext, "getTransaction")
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountID, transactionId)
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull , bankId, accountId, transactionId)
val result: OBPReturnType[Box[Transaction]] = sendRequest[InBound](url, HttpMethods.POST, req, callContext).map(convertToTuple(callContext))
result
}

View File

@ -1050,7 +1050,7 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable {
exampleOutboundMessage = (
OutBoundGetTransactionsCore(outboundAdapterCallContext=MessageDocsSwaggerDefinitions.outboundAdapterCallContext,
bankId=BankId(bankIdExample.value),
accountID=AccountId(accountIdExample.value),
accountId=AccountId(accountIdExample.value),
limit=limitExample.value.toInt,
offset=offsetExample.value.toInt,
fromDate="string",
@ -1100,9 +1100,9 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable {
adapterImplementation = Some(AdapterImplementation("- Core", 1))
)
override def getTransactionsCore(bankId: BankId, accountID: AccountId, queryParams: List[OBPQueryParam], callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionCore]]] = {
override def getTransactionsCore(bankId: BankId, accountId: AccountId, queryParams: List[OBPQueryParam], callContext: Option[CallContext]): OBPReturnType[Box[List[TransactionCore]]] = {
import com.openbankproject.commons.dto.{OutBoundGetTransactionsCore => OutBound, InBoundGetTransactionsCore => InBound}
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountID, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams))
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, OBPQueryParam.getLimit(queryParams), OBPQueryParam.getOffset(queryParams), OBPQueryParam.getFromDate(queryParams), OBPQueryParam.getToDate(queryParams))
val response: Future[Box[InBound]] = sendRequest[InBound]("obp_get_transactions_core", req, callContext)
response.map(convertToTuple[List[TransactionCore]](callContext))
}
@ -1166,9 +1166,9 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable {
adapterImplementation = Some(AdapterImplementation("- Core", 1))
)
override def getTransaction(bankId: BankId, accountID: AccountId, transactionId: TransactionId, callContext: Option[CallContext]): OBPReturnType[Box[Transaction]] = {
override def getTransaction(bankId: BankId, accountId: AccountId, transactionId: TransactionId, callContext: Option[CallContext]): OBPReturnType[Box[Transaction]] = {
import com.openbankproject.commons.dto.{OutBoundGetTransaction => OutBound, InBoundGetTransaction => InBound}
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountID, transactionId)
val req = OutBound(callContext.map(_.toOutboundAdapterCallContext).orNull, bankId, accountId, transactionId)
val response: Future[Box[InBound]] = sendRequest[InBound]("obp_get_transaction", req, callContext)
response.map(convertToTuple[Transaction](callContext))
}

View File

@ -317,6 +317,7 @@ import net.liftweb.util.Helpers._
val usernameLockedStateCode = Long.MaxValue
val connector = APIUtil.getPropsValue("connector").openOrThrowException("no connector set")
val starConnectorSupportedTypes = APIUtil.getPropsValue("starConnector_supported_types","")
override def emailFrom = APIUtil.getPropsValue("mail.users.userinfo.sender.address", "sender-not-set")
@ -617,8 +618,11 @@ import net.liftweb.util.Helpers._
case Full(user) if (user.getProvider() != APIUtil.getPropsValue("hostname","")) =>
connector match {
case Helper.matchAnyKafka() if ( APIUtil.getPropsAsBoolValue("kafka.user.authentication", false) &&
! LoginAttempt.userIsLocked(username) ) =>
case Helper.matchAnyKafka() if (
(starConnectorSupportedTypes contains("kafka"))
&& APIUtil.getPropsAsBoolValue("kafka.user.authentication", false)
&& ! LoginAttempt.userIsLocked(username)
) =>
val userId = for { kafkaUser <- getUserFromConnector(username, password)
kafkaUserId <- tryo{kafkaUser.user} } yield {
LoginAttempt.resetBadLoginAttempts(username)
@ -630,8 +634,11 @@ import net.liftweb.util.Helpers._
LoginAttempt.incrementBadLoginAttempts(username)
Empty
}
case "obpjvm" if ( APIUtil.getPropsAsBoolValue("obpjvm.user.authentication", false) &&
! LoginAttempt.userIsLocked(username) ) =>
case "obpjvm" if (
(starConnectorSupportedTypes contains("obpjvm"))
&& APIUtil.getPropsAsBoolValue("obpjvm.user.authentication", false)
&& ! LoginAttempt.userIsLocked(username)
) =>
val userId = for { obpjvmUser <- getUserFromConnector(username, password)
obpjvmUserId <- tryo{obpjvmUser.user} } yield {
LoginAttempt.resetBadLoginAttempts(username)
@ -643,7 +650,11 @@ import net.liftweb.util.Helpers._
LoginAttempt.incrementBadLoginAttempts(username)
Empty
}
case Helper.matchAnyStoredProcedure() if !LoginAttempt.userIsLocked(username) =>
case Helper.matchAnyStoredProcedure() if (
(starConnectorSupportedTypes contains("stored_procedure"))
&& APIUtil.getPropsAsBoolValue("connector.user.authentication", false)
&& !LoginAttempt.userIsLocked(username)
) =>
val userId =
for {
authUser <- checkExternalUserViaConnector(username, password)

View File

@ -339,6 +339,9 @@ class WebUI extends MdcLoggable{
contentLoader("webui_about_vendor_content_url", "about-vendor")
}
def headerContentLoader: NodeSeq = {
contentLoader("webui_header_content_url", "table-header")
}
// This load content directly into the div that calls it.
def getStartedDirectContentLoader: NodeSeq = {

View File

@ -239,9 +239,8 @@ object Helper{
/**
* Used for version extraction from props string
*/
val matchKafkaVersion = "kafka_v([0-9a-zA-Z_]+)".r
val matchAnyKafka = "^kafka.*$".r
val matchAnyStoredProcedure = "^stored_procedure.*$".r
val matchAnyKafka = "kafka.*|star".r
val matchAnyStoredProcedure = "stored_procedure.*|star".r
/**
* change the TimeZone to the current TimeZOne

View File

@ -78,7 +78,7 @@ Berlin 13359, Germany
<td></td>
</tr>
</table>
<div id="table-header-script" data-lift="WebUI.headerContentLoader"></div>
<div id="messages-container" data-lift="Msgs"></div>
<script>
$(function() {

View File

@ -7,7 +7,7 @@
<groupId>com.tesobe</groupId>
<artifactId>obp-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.5.7</version>
<version>1.5.8</version>
</parent>
<artifactId>obp-commons</artifactId>
<packaging>jar</packaging>

View File

@ -482,7 +482,7 @@ case class OutBoundGetTransactionRequests210(outboundAdapterCallContext: Outboun
case class InBoundGetTransactionRequests210(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionRequest]) extends InBoundTrait[List[TransactionRequest]]
case class OutBoundGetTransactionsCore(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, accountID: AccountId, limit: Int, offset: Int, fromDate: String, toDate: String) extends TopicTrait
case class OutBoundGetTransactionsCore(outboundAdapterCallContext: OutboundAdapterCallContext, bankId: BankId, accountId: AccountId, limit: Int, offset: Int, fromDate: String, toDate: String) extends TopicTrait
case class InBoundGetTransactionsCore(inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: List[TransactionCore]) extends InBoundTrait[List[TransactionCore]]
//-------- return type are not Future--------------------------------------------------------------------------------------------------
@ -875,7 +875,7 @@ case class InBoundGetCounterpartiesLegacy (inboundAdapterCallContext: InboundAda
case class OutBoundGetTransactionsLegacy (outboundAdapterCallContext: OutboundAdapterCallContext,
bankId: BankId,
accountID: AccountId,
accountId: AccountId,
limit: Int,
offset: Int,
fromDate: String,
@ -885,7 +885,7 @@ case class InBoundGetTransactionsLegacy (inboundAdapterCallContext: InboundAdapt
case class OutBoundGetTransactionLegacy (outboundAdapterCallContext: OutboundAdapterCallContext,
bankId: BankId,
accountID: AccountId,
accountId: AccountId,
transactionId: TransactionId) extends TopicTrait
case class InBoundGetTransactionLegacy (inboundAdapterCallContext: InboundAdapterCallContext, status: Status, data: Transaction) extends InBoundTrait[Transaction]

View File

@ -244,7 +244,6 @@ case class Counterparty(
val kind: String, // Type of bank account.
// The following fields started from V210
@ignore
val counterpartyId: String,
val counterpartyName: String,
val thisBankId: BankId, // i.e. the Account that sends/receives money to/from this Counterparty

View File

@ -635,8 +635,8 @@ object ReflectUtils {
case it: Iterable[_] => it.map(toValueObject)
case array: Array[_] => array.map(toValueObject)
case v if getType(v).typeSymbol.asClass.isCaseClass => v
case other => {
val mirrorObj = mirror.reflect(other)
case obpObj if ReflectUtils.isObpObject(obpObj) => {
val mirrorObj = mirror.reflect(obpObj)
mirrorObj.symbol.info.decls
.filter(it => it.isMethod && it.isPublic && it.name.toString != "getSingleton")
.filterNot(_.isConstructor)
@ -654,6 +654,7 @@ object ReflectUtils {
})
.toMap
}
case x => x
}
}

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.tesobe</groupId>
<artifactId>obp-parent</artifactId>
<version>1.5.7</version>
<version>1.5.8</version>
<packaging>pom</packaging>
<name>Open Bank Project API Parent</name>
<inceptionYear>2011</inceptionYear>

View File

@ -3,6 +3,7 @@
### Most recent changes at top of file
```
Date Commit Action
13/07/2020 d42dda90 Added props: webui_header_content_url. If we set the props, it will override the id ="table-header" content in default.html
19/06/2020 ea819aab Added props: refresh_user.interval. default is 30 minutes.
This props will set the interval for the internal refresh user process.
29/04/2020 75925d8c Added props: allow_pre_filled_password. in Sign Up page the default password form filed is ****