mirror of
https://github.com/OpenBankProject/API-Explorer.git
synced 2026-02-06 10:47:23 +00:00
Merge remote-tracking branch 'Simon/develop' into develop
# Conflicts: # src/main/scala/code/lib/ObpAPI.scala
This commit is contained in:
commit
ae36addfd9
@ -1,23 +1,38 @@
|
||||
api_explorer = API Explorer
|
||||
api_management = Gestion API
|
||||
user_management = Gestion de Usuarios
|
||||
api_management = Gesti\u00f3n API
|
||||
user_management = Gesti\u00f3n de Usuarios
|
||||
api_manager = API Manager
|
||||
introduction = Introducción
|
||||
introduction = Introducci\u00f3n
|
||||
support = Soporte
|
||||
register = Registrarse
|
||||
logon = Ingresar
|
||||
terms_conditions = Terminos y condiciones
|
||||
privacy_policy = Política de privacidad
|
||||
api_documentation = Documentación API
|
||||
privacy_policy = Pol\u00edtica de privacidad
|
||||
api_documentation = Documentaci\u00f3n API
|
||||
api_host = Host del API
|
||||
api_tester = Evaluador API
|
||||
view_api_explorer = Ver API Explorer
|
||||
get_api_key = Obtener llave API
|
||||
dynamic = Din\u00e1micas
|
||||
another.action = Otra acci\u00f3n
|
||||
onboard = A cargo
|
||||
consent.flow = Flujo del contenido
|
||||
message.docs = Documentaci\u00f3n de mensajes
|
||||
glossary = Glosario
|
||||
space = Espacio
|
||||
bank = Banco
|
||||
choose_from = Selecciona desde ...
|
||||
accounts = Cuentas
|
||||
views = Vistas
|
||||
counterparties = Contrapartes
|
||||
transactions = Transacciones
|
||||
filter = Filtrar..
|
||||
|
||||
|
||||
and_distributed_under_the = y distribuido bajo la
|
||||
and_commercial_licenses = y licencias comerciales
|
||||
spaces = Espacios
|
||||
more = More
|
||||
more = M\u00e1s
|
||||
|
||||
|
||||
invalid.email.address = Invalid email address
|
||||
@ -400,4 +415,6 @@ invalid.username=Invalid Username: \
|
||||
your.username.is.not.unique = Your username is not unique. Please enter a different one.
|
||||
# Those 2 messages must have the same output in order to prevent leakage of information
|
||||
user.invitation.is.already.finished = Looks like the invitation link is invalid. Still need help? Please send us a message using API Playground Support.
|
||||
your.secret.link.is.not.valid = Looks like the invitation link is invalid. Still need help? Please send us a message using API Playground Support.
|
||||
your.secret.link.is.not.valid = Looks like the invitation link is invalid. Still need help? Please send us a message using API Playground Support.
|
||||
|
||||
api_host=Anfitri\u00f3n de la API: \
|
||||
@ -163,4 +163,10 @@ dev.port=8082
|
||||
|
||||
|
||||
# Sngle Sign On
|
||||
# sso.enabled=false
|
||||
# sso.enabled=false
|
||||
|
||||
# ------------------------------ Identity Provider OAuth2 Props ------------------------------
|
||||
## if integrate_with_hydra set to true, all other props must not be empty
|
||||
# integrate_with_identity_provider=false
|
||||
# identity_provider_token_endpoint=http://127.0.0.1:4444/oauth2/token
|
||||
# ------------------------------ Identity Provider OAuth2 Props end --------------------------
|
||||
@ -25,6 +25,7 @@ import net.liftweb.json._
|
||||
import net.liftweb.util.Helpers.{intToTimeSpanBuilder => _, _}
|
||||
import okhttp3.MediaType
|
||||
|
||||
import scala.collection.JavaConverters._
|
||||
import scala.collection.immutable.{List, Nil}
|
||||
import scala.concurrent.duration._
|
||||
import scala.language.postfixOps
|
||||
@ -103,7 +104,7 @@ object ObpAPI extends Loggable {
|
||||
}
|
||||
}
|
||||
|
||||
def currentUser : Box[CurrentUserJson]= ObpGet(s"$obpPrefix/v2.0.0/users/current").flatMap(_.extractOpt[CurrentUserJson])
|
||||
def currentUser : Box[CurrentUserJson]= ObpGet(s"$obpPrefix/v3.0.0/users/current").flatMap(_.extractOpt[CurrentUserJson])
|
||||
|
||||
def getRoot : Box[JValue]= ObpGet(s"$obpPrefix/v4.0.0/root")
|
||||
|
||||
@ -349,7 +350,7 @@ object ObpAPI extends Loggable {
|
||||
//Note: ?content=static&content=dynamic
|
||||
// if there are two content parameters there, only the first one is valid for the api call.
|
||||
// so requestParams have the high priority
|
||||
val requestParams = List("tags", "language", "functions", "content", CacheModifier)
|
||||
val requestParams = List("tags", "locale", "language", "functions", "content", CacheModifier)
|
||||
.map(paramName => (paramName, S.param(paramName)))
|
||||
.collect{
|
||||
case (paramName, Full(paramValue)) if(paramValue.trim.size > 0) => s"$paramName=$paramValue"
|
||||
@ -489,6 +490,7 @@ object ObpAPI extends Loggable {
|
||||
def getResourceDocsJValueResponse(apiVersion : String, requestParams: String, contentTag: String) = {
|
||||
logger.debug("getResourceDocsJValueResponse says Hello")
|
||||
val result = ObpGet(s"$obpPrefix/v4.0.0/resource-docs/$apiVersion/obp$requestParams&content=$contentTag")
|
||||
logger.debug("requestParams says result is: " + requestParams)
|
||||
logger.debug("getResourceDocsJValueResponse says result is: " + result)
|
||||
result
|
||||
}
|
||||
@ -569,12 +571,14 @@ object ObpAPI extends Loggable {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// The code below is introduced in order to support Application Access via API Explorer.
|
||||
// For instance using Hydra ORA as Identity Provider
|
||||
object IdentityProviderRequest extends MdcLoggable {
|
||||
|
||||
val clientId = Helper.getPropsValue("obp_consumer_key", "")
|
||||
val clientSecret = Helper.getPropsValue("obp_secret_key", "")
|
||||
val tokenEndpoint = Helper.getPropsValue("identity_provider_token_endpoint", "http://127.0.0.1:4444/oauth2/token")
|
||||
val integrateWithIdentityProvider = Helper.getPropsAsBoolValue("integrate_with_identity_provider", false)
|
||||
val jwsAlg = Helper.getPropsValue("oauth2.jws_alg", "ES256")
|
||||
val jwkPrivateKey = Helper.getPropsValue("oauth2.jwk_private_key")
|
||||
|
||||
@ -651,17 +655,22 @@ case class ObpError(error :String)
|
||||
object OBPRequest extends MdcLoggable {
|
||||
implicit val formats = DefaultFormats
|
||||
//returns a tuple of the status code, response body and list of headers
|
||||
def apply(apiPath : String, jsonBody : Option[JValue], method : String, headers : List[Header]) : Box[(Int, String, List[String])] = {
|
||||
def apply(apiPath : String, jsonBody : Option[JValue], method : String, headers : List[Header]) : Box[(Int, String, List[String], List[String])] = {
|
||||
logger.debug(s"before $apiPath call:")
|
||||
|
||||
def addAppAccess = {
|
||||
if (!headers.exists(_.key == "Authorization")) {
|
||||
Header("Authorization", s"Bearer $obtainAccessToken") :: headers
|
||||
def addAppAccessIfNecessary: List[Header] = {
|
||||
if(IdentityProviderRequest.integrateWithIdentityProvider) {
|
||||
if (!headers.exists(_.key == "Authorization") && !apiPath.contains("resource-docs/OBPv5.0.0/obp")) {
|
||||
val temp = Header("Authorization", s"Bearer $obtainAccessToken") :: headers
|
||||
temp
|
||||
} else {
|
||||
headers
|
||||
}
|
||||
} else {
|
||||
headers
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
lazy val statusAndBody = tryo {
|
||||
val credentials = OAuthClient.getAuthorizedCredential
|
||||
val apiUrl = OAuthClient.currentApiBaseUrl
|
||||
@ -686,14 +695,11 @@ object OBPRequest extends MdcLoggable {
|
||||
request.setRequestProperty("Content-Type", "application/json; charset=UTF-8")
|
||||
request.setRequestProperty("Accept", "application/json")
|
||||
request.setRequestProperty("Accept-Charset", "UTF-8")
|
||||
if(apiPath.contains("/obp/v4.0.0/my/consents/request") || apiPath.contains("/obp/v5.0.0/my/consents/request")) {
|
||||
request.setRequestProperty("Authorization", s"Bearer $obtainAccessToken")
|
||||
}
|
||||
|
||||
//sign the request if we have some credentials to sign it with
|
||||
credentials.foreach(c => c.consumer.sign(request))
|
||||
|
||||
headers.foreach(header => request.setRequestProperty(header.key, header.value))
|
||||
|
||||
addAppAccessIfNecessary.foreach(header => request.setRequestProperty(header.key, header.value))
|
||||
|
||||
//Set the request body
|
||||
if(jsonBody.isDefined) {
|
||||
@ -704,12 +710,20 @@ object OBPRequest extends MdcLoggable {
|
||||
writer.close()
|
||||
}
|
||||
|
||||
val requestHeaders = {
|
||||
addAppAccessIfNecessary.map(header => (header.key, Set(header.value))) :::
|
||||
request.getRequestProperties().asScala.mapValues(_.asScala.toSet).toList
|
||||
}
|
||||
val adjustedRequestHeaders = requestHeaders.to[Set].toList
|
||||
.map(x => x._1 + ": " + x._2.mkString(", "))
|
||||
.sortWith(_ < _).filter(_.startsWith("null") == false)
|
||||
|
||||
|
||||
request.connect()
|
||||
val status = request.getResponseCode()
|
||||
import scala.collection.JavaConverters._
|
||||
val responseHeaders: List[(String, Set[String])] = request.getHeaderFields().asScala.mapValues(_.asScala.toSet).toList
|
||||
val adjustedResponseHeaders = responseHeaders.map(x => x._1 + ": " + x._2.mkString(", ")).sortWith(_ < _).filter(_.startsWith("null") == false)
|
||||
|
||||
|
||||
//get reponse body
|
||||
val inputStream = if(status >= 400) request.getErrorStream() else request.getInputStream()
|
||||
val reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"))
|
||||
@ -724,7 +738,7 @@ object OBPRequest extends MdcLoggable {
|
||||
}
|
||||
readLines()
|
||||
reader.close();
|
||||
(status, builder.toString(), adjustedResponseHeaders)
|
||||
(status, builder.toString(), adjustedResponseHeaders, adjustedRequestHeaders)
|
||||
}
|
||||
|
||||
val urlParametersUrl = apiPath.split("\\?")
|
||||
@ -764,16 +778,16 @@ object OBPRequest extends MdcLoggable {
|
||||
object ObpPut {
|
||||
def apply(apiPath: String, json : JValue): Box[JValue] = {
|
||||
OBPRequest(apiPath, Some(json), "PUT", Nil) match {
|
||||
case Full((status, result, _)) => APIUtils.getAPIResponseBody(status, result)
|
||||
case Full((status, result, _, _)) => APIUtils.getAPIResponseBody(status, result)
|
||||
case Failure(msg, exception, chain) => Failure(msg)
|
||||
case _ =>Failure(UnknownErrorMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
object ObpPutWithHeader {
|
||||
def apply(apiPath: String, json : JValue, headers : List[Header] = Nil): (Box[JValue], List[String]) = {
|
||||
def apply(apiPath: String, json : JValue, headers : List[Header] = Nil): (Box[JValue], List[String], List[String]) = {
|
||||
OBPRequest(apiPath, Some(json), "PUT", headers) match {
|
||||
case Full(value) => (APIUtils.getAPIResponseBody(value._1, value._2), value._3)
|
||||
case Full(value) => (APIUtils.getAPIResponseBody(value._1, value._2), value._3, value._4)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -781,20 +795,20 @@ object ObpPutWithHeader {
|
||||
object ObpPost {
|
||||
def apply(apiPath: String, json : JValue): Box[JValue] = {
|
||||
OBPRequest(apiPath, Some(json), "POST", Nil) match {
|
||||
case Full((status, result, _)) => APIUtils.getAPIResponseBody(status, result)
|
||||
case Full((status, result, _, _)) => APIUtils.getAPIResponseBody(status, result)
|
||||
case Failure(msg, exception, chain) => Failure(msg)
|
||||
case _ => Failure(UnknownErrorMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
object ObpPostWithHeader {
|
||||
def apply(apiPath: String, json : JValue, headers : List[Header] = Nil): (Box[JValue], List[String]) = {
|
||||
def apply(apiPath: String, json : JValue, headers : List[Header] = Nil): (Box[JValue], List[String], List[String]) = {
|
||||
val requestBody = json match {
|
||||
case JNothing | JNull => None
|
||||
case v => Option(v)
|
||||
}
|
||||
OBPRequest(apiPath, requestBody, "POST", headers) match {
|
||||
case Full(value) => (APIUtils.getAPIResponseBody(value._1, value._2), value._3)
|
||||
case Full(value) => (APIUtils.getAPIResponseBody(value._1, value._2), value._3, value._4)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -805,7 +819,7 @@ object ObpDeleteBoolean {
|
||||
*/
|
||||
def apply(apiPath: String): Boolean = {
|
||||
val worked = OBPRequest(apiPath, None, "DELETE", Nil).map {
|
||||
case(status, result, _) => APIUtils.apiResponseWorked(status, result)
|
||||
case(status, result, _, _) => APIUtils.apiResponseWorked(status, result)
|
||||
}
|
||||
worked.getOrElse(false)
|
||||
}
|
||||
@ -818,16 +832,16 @@ object ObpDeleteBoolean {
|
||||
object ObpDelete {
|
||||
def apply(apiPath: String): Box[JValue] = {
|
||||
OBPRequest(apiPath, None, "DELETE", Nil) match {
|
||||
case Full((status, result, _)) => APIUtils.getAPIResponseBody(status, result)
|
||||
case Full((status, result, _, _)) => APIUtils.getAPIResponseBody(status, result)
|
||||
case Failure(msg, exception, chain) => Failure(msg)
|
||||
case _ => Failure(UnknownErrorMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
object ObpDeleteWithHeader {
|
||||
def apply(apiPath: String, headers : List[Header] = Nil): (Box[JValue], List[String]) = {
|
||||
def apply(apiPath: String, headers : List[Header] = Nil): (Box[JValue], List[String], List[String]) = {
|
||||
OBPRequest(apiPath, None, "DELETE", headers) match {
|
||||
case Full(value) => (APIUtils.getAPIResponseBody(value._1, value._2), value._3)
|
||||
case Full(value) => (APIUtils.getAPIResponseBody(value._1, value._2), value._3, value._4)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -841,7 +855,7 @@ object ObpGet {
|
||||
Empty
|
||||
} else {
|
||||
OBPRequest(apiPath, None, "GET", headers) match {
|
||||
case Full((status, result, _)) => APIUtils.getAPIResponseBody(status, result)
|
||||
case Full((status, result, _, _)) => APIUtils.getAPIResponseBody(status, result)
|
||||
case Failure(msg, exception, chain) => Failure(msg)
|
||||
case _ => Failure(UnknownErrorMessage)
|
||||
}
|
||||
@ -855,7 +869,7 @@ object ObpHead {
|
||||
Empty
|
||||
} else {
|
||||
OBPRequest(apiPath, None, "HEAD", headers) match {
|
||||
case Full((status, result, _)) => APIUtils.getAPIResponseBody(status, result)
|
||||
case Full((status, result, _, _)) => APIUtils.getAPIResponseBody(status, result)
|
||||
case Failure(msg, exception, chain) => Failure(msg)
|
||||
case _ => Failure(UnknownErrorMessage)
|
||||
}
|
||||
@ -864,17 +878,17 @@ object ObpHead {
|
||||
}
|
||||
|
||||
object ObpGetWithHeader {
|
||||
def apply(apiPath: String, headers : List[Header] = Nil): (Box[JValue], List[String]) = {
|
||||
def apply(apiPath: String, headers : List[Header] = Nil): (Box[JValue], List[String], List[String]) = {
|
||||
OBPRequest(apiPath, None, "GET", headers) match {
|
||||
case Full(value) => (APIUtils.getAPIResponseBody(value._1, value._2), value._3)
|
||||
case Full(value) => (APIUtils.getAPIResponseBody(value._1, value._2), value._3, value._4)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
object ObpHeadWithHeader {
|
||||
def apply(apiPath: String, headers : List[Header] = Nil): (Box[JValue], List[String]) = {
|
||||
def apply(apiPath: String, headers : List[Header] = Nil): (Box[JValue], List[String], List[String]) = {
|
||||
OBPRequest(apiPath, None, "HEAD", headers) match {
|
||||
case Full(value) => (APIUtils.getAPIResponseBody(value._1, value._2), value._3)
|
||||
case Full(value) => (APIUtils.getAPIResponseBody(value._1, value._2), value._3, value._4)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -459,7 +459,7 @@ WIP to add comments on resource docs. This code copied from Sofit.
|
||||
"#all-partial-functions" #> commaSeparatedListOfResources
|
||||
}
|
||||
|
||||
def getResponse (url : String, resourceVerb: String, json : JValue, customRequestHeader: String = "") : (String, String) = {
|
||||
def getResponse (url : String, resourceVerb: String, json : JValue, customRequestHeader: String = "") : (String, String, String) = {
|
||||
|
||||
// version is now included in the url
|
||||
val urlWithVersion = s"$url"
|
||||
@ -475,28 +475,34 @@ WIP to add comments on resource docs. This code copied from Sofit.
|
||||
}
|
||||
|
||||
var headersOfCurrentCall: List[String] = Nil
|
||||
var requestHeadersOfCurrentCall: List[String] = Nil
|
||||
|
||||
val responseBodyBox = {
|
||||
resourceVerb match {
|
||||
case "GET" =>
|
||||
val x = ObpGetWithHeader(urlWithVersion, requestHeader)
|
||||
headersOfCurrentCall = x._2
|
||||
requestHeadersOfCurrentCall = x._3
|
||||
x._1
|
||||
case "HEAD" =>
|
||||
val x = ObpHeadWithHeader(urlWithVersion, requestHeader)
|
||||
headersOfCurrentCall = x._2
|
||||
requestHeadersOfCurrentCall = x._3
|
||||
x._1
|
||||
case "DELETE" =>
|
||||
val x = ObpDeleteWithHeader(urlWithVersion, requestHeader)
|
||||
headersOfCurrentCall = x._2
|
||||
requestHeadersOfCurrentCall = x._3
|
||||
x._1
|
||||
case "POST" =>
|
||||
val x = ObpPostWithHeader(urlWithVersion, json, requestHeader)
|
||||
headersOfCurrentCall = x._2
|
||||
requestHeadersOfCurrentCall = x._3
|
||||
x._1
|
||||
case "PUT" =>
|
||||
val x = ObpPutWithHeader(urlWithVersion, json, requestHeader)
|
||||
headersOfCurrentCall = x._2
|
||||
requestHeadersOfCurrentCall = x._3
|
||||
x._1
|
||||
case _ => {
|
||||
val failMsg = s"API Explorer says: Unsupported resourceVerb: $resourceVerb. Url requested was: $url"
|
||||
@ -519,7 +525,7 @@ WIP to add comments on resource docs. This code copied from Sofit.
|
||||
}
|
||||
|
||||
logger.debug(s"responseBody is $responseBody")
|
||||
(responseBody, headersOfCurrentCall.mkString("\n"))
|
||||
(responseBody, headersOfCurrentCall.mkString("\n"), requestHeadersOfCurrentCall.mkString("\n"))
|
||||
}
|
||||
|
||||
|
||||
@ -938,10 +944,14 @@ WIP to add comments on resource docs. This code copied from Sofit.
|
||||
val fullPathTarget = "full_path_" + resourceId
|
||||
val fullHeadersBox= "full_headers_box_"+resourceId
|
||||
val fullHeadersTarget = "full_headers_" + resourceId
|
||||
val fullRequestHeadersBox= "full_request_headers_box_"+ resourceId
|
||||
val fullRequestHeadersTarget = "full_request_headers_" + resourceId
|
||||
// The javascript to show it
|
||||
val jsCommandShowFullPath : String = s"DOLLAR_SIGN('#$fullPathTarget').fadeIn();".replace("DOLLAR_SIGN","$")
|
||||
val jsCommandShowFullHeaders : String =
|
||||
s"DOLLAR_SIGN('#$fullHeadersBox').show();".replace("DOLLAR_SIGN","$") ++s"DOLLAR_SIGN('#$fullHeadersTarget').fadeIn();".replace("DOLLAR_SIGN","$")
|
||||
val jsCommandShowFullRequestHeaders : String =
|
||||
s"DOLLAR_SIGN('#$fullRequestHeadersBox').show();".replace("DOLLAR_SIGN","$") ++s"DOLLAR_SIGN('#$fullRequestHeadersTarget').fadeIn();".replace("DOLLAR_SIGN","$")
|
||||
|
||||
// alert('$fullPathTarget');
|
||||
//logger.info(s"jsCommand is $jsCommand")
|
||||
@ -987,7 +997,7 @@ WIP to add comments on resource docs. This code copied from Sofit.
|
||||
.replaceAll("(?<![Vv]validations/)OBPv", "")) //delete OBPv, but if the OBPv is part of operationId, not to do delete, e.g: /validations/OBPv4.0.0-dynamicEndpoint_POST__account_access_consents
|
||||
//////////////
|
||||
|
||||
val (body, headers) = getResponse(requestUrl, requestVerb, jsonObject, customRequestHeader = requestCustomHeader)
|
||||
val (body, headers, requestHeaders) = getResponse(requestUrl, requestVerb, jsonObject, customRequestHeader = requestCustomHeader)
|
||||
// Return the commands to call the url with optional body and put the response into the appropriate result div
|
||||
SetHtml(resultTarget, Text(body)) &
|
||||
// SetHtml(rolesTarget, Text(responseRoleString)) &
|
||||
@ -999,9 +1009,11 @@ WIP to add comments on resource docs. This code copied from Sofit.
|
||||
Run (jsCommandHideTypicalSuccessResponseBox) &
|
||||
Run (jsCommandShowFullPath) &
|
||||
Run (jsCommandShowFullHeaders) &
|
||||
Run (jsCommandShowFullRequestHeaders) &
|
||||
Run (jsEnabledSubmitBtn) &
|
||||
SetHtml(fullPathTarget, Text(fullPath.toString)) &
|
||||
SetHtml(fullHeadersTarget, Text(headers))
|
||||
SetHtml(fullHeadersTarget, Text(headers)) &
|
||||
SetHtml(fullRequestHeadersTarget, Text(requestHeaders))
|
||||
}
|
||||
|
||||
def processFavourites(name: String): JsCmd = {
|
||||
@ -1582,6 +1594,8 @@ WIP to add comments on resource docs. This code copied from Sofit.
|
||||
"@request_url_input" #> text(i.url, s => requestUrl = s, "aria-label"->s"${i.summary}","maxlength" -> "512", "size" -> "100", "id" -> s"request_url_input_${i.id}") &
|
||||
"@request_header_input" #> text("", s => requestCustomHeader = s, "maxlength" -> "2048", "size" -> "100", "id" -> s"request_header_input${i.id}") &
|
||||
"@full_path [id]" #> s"full_path_${i.id}" &
|
||||
"#full_request_headers_box [id]" #> s"full_request_headers_box_${i.id}" &
|
||||
"@full_request_headers [id]" #> s"full_request_headers_${i.id}" &
|
||||
"#full_headers_box [id]" #> s"full_headers_box_${i.id}" &
|
||||
"@full_headers [id]" #> s"full_headers_${i.id}" &
|
||||
// Extraction.decompose creates json representation of JObject.
|
||||
|
||||
@ -53,8 +53,10 @@ class Login {
|
||||
}
|
||||
}
|
||||
}
|
||||
val displayNameOfUser = getDisplayNameOfUser()
|
||||
".logged-out *" #> "" &
|
||||
".username *" #> getDisplayNameOfUser() &
|
||||
".username *" #> displayNameOfUser &
|
||||
".display-login-name-error *" #> displayNameOfUser.toString & // Hidden field
|
||||
"#logout [onclick+]" #> SHtml.onEvent(s => {
|
||||
OAuthClient.logoutAll()
|
||||
Noop
|
||||
|
||||
@ -27,11 +27,11 @@ Berlin 13359, Germany
|
||||
|
||||
package code.snippet
|
||||
|
||||
import code.util.Helper
|
||||
import code.util.Helper.MdcLoggable
|
||||
import net.liftweb.http.{S, SessionVar}
|
||||
import net.liftweb.util.Helpers._
|
||||
import net.liftweb.util.{CssSel, Props, _}
|
||||
|
||||
import code.util.Helper._
|
||||
|
||||
|
||||
@ -42,9 +42,9 @@ class WebUI extends MdcLoggable {
|
||||
|
||||
// language tag
|
||||
def homePage = {
|
||||
val host = Props.get("base_url").getOrElse("unknown")
|
||||
"#Es a [href]" #> scala.xml.Unparsed(s"$host/?locale=es_ES") &
|
||||
"#En a [href]" #> scala.xml.Unparsed(s"$host/?locale=en_EN")
|
||||
val host = Helper.getPropsValue("base_url", "unknown host")
|
||||
"#es a [href]" #> scala.xml.Unparsed(s"/?locale=es_ES") &
|
||||
"#en a [href]" #> scala.xml.Unparsed(s"/?locale=en_EN")
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -127,7 +127,7 @@
|
||||
|
||||
|
||||
<li class="breadcrumbs__list" id ="dynamic_link_div" >
|
||||
<a id ="dynamic_link" class="dynamic_button" href="/?tags=Dynamic&content=dynamic">Dynamic</a>
|
||||
<a id ="dynamic_link" class="dynamic_button" href="/?tags=Dynamic&content=dynamic"><lift:loc locid="dynamic">Dynamic</lift:loc></a>
|
||||
</li>
|
||||
<li class="breadcrumbs__list" id="api_manager_link_div" >
|
||||
<a id="api_manager_link" class="api_manager_button" href="http://127.0.0.1:8000/">API Manager</a>
|
||||
@ -146,20 +146,20 @@
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-info dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <lift:loc locid="more">More</lift:loc> <img src="./media/images/chevron_down_thick_write.svg" alt="Girl in a jacket" width="10" height="10"></button>
|
||||
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<li name="dropdown_versions"><a class="dropdown-item version" href="#">Another action</a> <hr></li>
|
||||
<li name="dropdown_versions"><a class="dropdown-item version" href="#"><lift:loc locid="another.action">Another action</lift:loc></a> <hr></li>
|
||||
|
||||
<li id="onboard_link_div">
|
||||
<a id="onboard_link" class="version" href="This href should be replaced">Onboard</a>
|
||||
<a id="onboard_link" class="version" href="This href should be replaced"><lift:loc locid="onboard">Onboard</lift:loc></a>
|
||||
</li>
|
||||
<li id="consent_flow_link_div">
|
||||
<a id="consent_flow_link" class="version" href="https://oauth2-flow.demo.openbankproject.com/">Consent Flow</a>
|
||||
<a id="consent_flow_link" class="version" href="https://oauth2-flow.demo.openbankproject.com/"><lift:loc locid="consent.flow">Consent Flow</lift:loc></a>
|
||||
</li><hr>
|
||||
<li id ="message_doc_link_div">
|
||||
<a id="message_doc_link" href="./message-docs?connector=kafka_vSept2018"
|
||||
class="breadcrumbs__link version">Message Docs</a>
|
||||
class="breadcrumbs__link version"><lift:loc locid="message.docs">Message Docs</lift:loc></a>
|
||||
</li><hr>
|
||||
<li id="Glossary">
|
||||
<a id="glossary_link" href="./glossary?" class="breadcrumbs__link version">Glossary</a>
|
||||
<a id="glossary_link" href="./glossary?" class="breadcrumbs__link version"><lift:loc locid="glossary">Glossary</lift:loc></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -169,7 +169,7 @@
|
||||
<div class="dropdown">
|
||||
<button aria-expanded="false" aria-haspopup="true" data-toggle="dropdown" id="dropdownMenuButton" type="button" class="btn btn-info dropdown-toggle"><lift:loc locid="spaces">Spaces</lift:loc> <img height="10" width="10" alt="Girl in a jacket" src="./media/images/chevron_down_thick_write.svg"></button>
|
||||
<ul aria-labelledby="dropdownMenuButton" class="dropdown-menu">
|
||||
<li name="dropdown_space"><a class="dropdown-item version" href="#">Space</a> <hr></li>
|
||||
<li name="dropdown_space"><a class="dropdown-item version" href="#"><lift:loc locid="space">Space</lift:loc></a> <hr></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
@ -251,7 +251,7 @@
|
||||
</div>
|
||||
|
||||
<div class="version_path">
|
||||
API Host: <a name="version_path" class="version" href="version path">version path</a>
|
||||
<lift:loc locid="api_host">API Host: </lift:loc><a name="version_path" class="version" href="version path">version path</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@ -260,20 +260,20 @@
|
||||
<section class="option-section">
|
||||
<div class="container">
|
||||
<div class="option-box">
|
||||
<div class="option-box__headline" id="Banks-Dropdown">Bank</div>
|
||||
<div class="option-box__headline" id="Banks-Dropdown"><lift:loc locid="bank">Bank</lift:loc></div>
|
||||
<!--
|
||||
<div class="count-box">
|
||||
<span class="count-box__number">0</span>
|
||||
</div>
|
||||
-->
|
||||
<select id="bank_selector" name="Bank" class="option-box__select js-example-basic-single">
|
||||
<option value="Choose from..." class="option-box__option">Choose from...</option>
|
||||
<option value="Choose from..." class="option-box__option"><lift:loc locid="choose_from">Choose from...</lift:loc></option>
|
||||
<option value="Choose from..." class="option-box__option">Placeholder</option>
|
||||
<option value="Choose from..." class="option-box__option">Placeholder</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="option-box">
|
||||
<div class="option-box__headline" id="Accounts-Dropdown">Accounts</div>
|
||||
<div class="option-box__headline" id="Accounts-Dropdown"><lift:loc locid="accounts">Accounts</lift:loc></div>
|
||||
<!--
|
||||
<div class="count-box">
|
||||
<span class="count-box__number">0</span>
|
||||
@ -287,20 +287,20 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="option-box" name="views_box">
|
||||
<div class="option-box__headline" id="Views-Dropdown">Views</div>
|
||||
<div class="option-box__headline" id="Views-Dropdown"><lift:loc locid="views">Views</lift:loc></div>
|
||||
<!--
|
||||
<div class="count-box">
|
||||
<span class="count-box__number">0</span>
|
||||
</div>
|
||||
-->
|
||||
<select id="view_selector" name="Views" class="option-box__select js-example-basic-single">
|
||||
<option value="Choose from..." class="option-box__option">Choose from...</option>
|
||||
<option value="Choose from..." class="option-box__option"><lift:loc locid="choose_from">Choose from...</lift:loc></option>
|
||||
<option value="Choose from..." class="option-box__option">Placeholder</option>
|
||||
<option value="Choose from..." class="option-box__option">Placeholder</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="option-box" id="counterparty_selector-option-box">
|
||||
<div class="option-box__headline" id="Counterparties-Dropdown">Counterparties</div>
|
||||
<div class="option-box__headline" id="Counterparties-Dropdown"><lift:loc locid="counterparties">Counterparties</lift:loc></div>
|
||||
<!--
|
||||
<div class="count-box">
|
||||
<span class="count-box__number">0</span>
|
||||
@ -308,13 +308,13 @@
|
||||
-->
|
||||
<select id="counterparty_selector" name="Counterparties"
|
||||
class="option-box__select js-example-basic-single">
|
||||
<option value="Choose from..." class="option-box__option">Choose from...</option>
|
||||
<option value="Choose from..." class="option-box__option"><lift:loc locid="choose_from">Choose from...</lift:loc></option>
|
||||
<option value="Choose from..." class="option-box__option">placeholder</option>
|
||||
<option value="Choose from..." class="option-box__option">placeholder</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="option-box" id="transaction_selector-option-box">
|
||||
<div class="option-box__headline" id="Transactions-Dropdown">Transactions</div>
|
||||
<div class="option-box__headline" id="Transactions-Dropdown"><lift:loc locid="transactions">Transactions</lift:loc></div>
|
||||
<!--
|
||||
<div class="count-box">
|
||||
<span class="count-box__number">0</span>
|
||||
@ -322,7 +322,7 @@
|
||||
-->
|
||||
<select id="transaction_selector" name="Transactions"
|
||||
class="option-box__select js-example-basic-single">
|
||||
<option value="Choose from..." class="option-box__option">Choose from...</option>
|
||||
<option value="Choose from..." class="option-box__option"><lift:loc locid="choose_from">Choose from...</lift:loc></option>
|
||||
<option value="Choose from..." class="option-box__option">Placeholder</option>
|
||||
<option value="Choose from..." class="option-box__option">Placeholder</option>
|
||||
</select>
|
||||
@ -376,7 +376,7 @@
|
||||
|
||||
<div name="example_request_header" id="example_request_header" style="display: block;">
|
||||
<!-- It is populated at render (but it can be edited manually) -->
|
||||
<input type="text" name="request_header_input" class="default-input" placeholder="Request Header">
|
||||
<input type="text" name="request_header_input" class="default-input" placeholder="Request Header (Header1:Value1::Header2:Value2)">
|
||||
</div>
|
||||
<div name="example_request_body" id="example_request_body" style="display: block;">
|
||||
<input name="example_request_body_input" class="default-input" placeholder="JSON body to POST or PUT">
|
||||
@ -411,14 +411,20 @@
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<!-- Request Headers -->
|
||||
<div id="full_request_headers_box" class="content-box__info-box" style="display: none;">
|
||||
<!-- Text in a <pre> element is displayed in a fixed-width font, and the text preserves both spaces and line breaks.
|
||||
The text will be displayed exactly as written in the HTML source code. -->
|
||||
<pre><code><details style="cursor:s-resize;"><summary style="display:list-item">Request Headers:</summary>
|
||||
<div name="full_request_headers"></div></details></code></pre>
|
||||
</div>
|
||||
|
||||
<!-- Response Headers -->
|
||||
<div id="full_headers_box" class="content-box__info-box" style="display: none;">
|
||||
<div>Headers:</div>
|
||||
<br/>
|
||||
<pre>
|
||||
<code>
|
||||
<div name="full_headers"></div>
|
||||
</code>
|
||||
</pre>
|
||||
<!-- Text in a <pre> element is displayed in a fixed-width font, and the text preserves both spaces and line breaks.
|
||||
The text will be displayed exactly as written in the HTML source code. -->
|
||||
<pre><code><details open style="cursor:s-resize;"><summary style="display:list-item">Response Headers:</summary>
|
||||
<div name="full_headers"></div></details></code></pre>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@ -78,7 +78,7 @@ along with this program. If not, see www.gnu.org/licenses/
|
||||
<div class="settings-box" data-lift="Login.login">
|
||||
<div class="sign-box">
|
||||
<div class="logged-out">
|
||||
<a id="start-login" class="sign-box__text signed" href="#">Log on</a>
|
||||
<a id="start-login" class="sign-box__text signed" href="#"><lift:loc locid="logon">Log on</lift:loc></a>
|
||||
</div>
|
||||
<div class="logged-in">
|
||||
<!--
|
||||
@ -92,15 +92,11 @@ along with this program. If not, see www.gnu.org/licenses/
|
||||
<div class="logged-in">
|
||||
<span class="username"></span>
|
||||
<a class="settings-imgs__link" id="logout" href="#">
|
||||
<span class="logout-link">Log off</span>
|
||||
<span class="logout-link"><lift:loc locid="logoff">Log off</lift:loc></span>
|
||||
</a>
|
||||
<!--
|
||||
<a href="#" class="settings-imgs__link">
|
||||
<img src="./media/images/settings-icon.png" alt="Settings icon" class="settings-imgs__icon">
|
||||
</a>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
<div hidden class="display-login-name-error"></div>
|
||||
</div>
|
||||
|
||||
<div style="clear: both"></div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user