Merge pull request #943 from constantine2nd/develop

Added new props documented_root_url
This commit is contained in:
Simon Redfern 2018-03-02 09:22:14 +01:00 committed by GitHub
commit fdfaad1bb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 1 deletions

View File

@ -430,4 +430,8 @@ display_internal_errors=false
# oauth2.jwt.use.ssl=false
# URL of Public server JWK set used for validating bearer JWT access tokens
# oauth2.jwk_set.url=http://localhost:8080/openid-connect-server-webapp/jwk.json
# ----------------------------------------------------------- OAuth 2 -----------
# ----------------------------------------------------------- OAuth 2 -----------
## This property is used for documenting at Resource Doc
## (this needs to be a URL)
documented_root_url=https://openbankproject.com

View File

@ -104,6 +104,7 @@ val dateformat = new java.text.SimpleDateFormat("yyyy-MM-dd")
val ApiVersionNotSupported = "OBP-00008: The API version you called is not enabled on this server. Please contact your API administrator or use another version."
val FirehoseViewsNotAllowedOnThisInstance = "OBP-00009: Firehose views not allowed on this instance. Please set allow_firehose_views = true in props files. "
val MissingPropsValueAtThisInstance = "OBP-00010: Missing props value at this API instance - "
// General messages (OBP-10XXX)
val InvalidJsonFormat = "OBP-10001: Incorrect json format."
@ -1809,6 +1810,14 @@ Returns a string showed to the developer
* @return - the source port of the client or last seen proxy.
*/
def getRemotePort(): Int = S.containerRequest.map(_.remotePort).openOr(0)
/**
* @return - the server port
*/
def getServerPort(): Int = S.containerRequest.map(_.serverPort).openOr(0)
/**
* @return - the host name of the server
*/
def getServerName(): String = S.containerRequest.map(_.serverName).openOr("Unknown")
/**
@ -2487,6 +2496,12 @@ Versions are groups of endpoints in a file
if(view.isFirehose && canUseFirehose(user)) true
else false
}
/**
* This function is used to get property which is used for documenting at Resource Doc
* @return Value of property documented_root_url
*/
def getDocumentedRootUrl: String = getPropsValue("documented_root_url").openOr(MissingPropsValueAtThisInstance + "documented_root_url")
}