mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 17:56:46 +00:00
docfix/tweaked email_to_space_mapping to email_domain_to_space_mappings
This commit is contained in:
parent
fe576925a4
commit
3223a97d4e
@ -965,9 +965,9 @@ default_auth_context_update_request_key=CUSTOMER_NUMBER
|
||||
# to the bank_ids (Spaces) the User has access to via their validated email domain. Entitlements are generated /refreshed
|
||||
# both following manual locin and Direct Login token generation (POST).
|
||||
# the default value is empty
|
||||
#email_to_space_mapping=
|
||||
#email_domain_to_space_mappings=
|
||||
# And here we provide an example to show how to prepare the mappings
|
||||
#email_to_space_mapping=[ \
|
||||
#email_domain_to_space_mappings=[ \
|
||||
# { \
|
||||
# "domain": "example.com", \
|
||||
# "bank_ids": [ \
|
||||
|
||||
@ -523,7 +523,7 @@ object APIUtil extends MdcLoggable with CustomJsonFormats{
|
||||
def getHeaders() = getHeadersCommonPart() ::: getGatewayResponseHeader()
|
||||
|
||||
case class CustomResponseHeaders(list: List[(String, String)])
|
||||
//This is used for get the value from props `email_to_space_mapping`
|
||||
//This is used for get the value from props `email_domain_to_space_mappings`
|
||||
case class EmailToSpaceMapping(
|
||||
domain: String,
|
||||
bank_ids: List[String]
|
||||
@ -3998,15 +3998,15 @@ object APIUtil extends MdcLoggable with CustomJsonFormats{
|
||||
val emailToSpaceMappings = json.parse(str).extract[List[EmailToSpaceMapping]]
|
||||
//The props value can be parse to JNothing.
|
||||
if(str.nonEmpty && emailToSpaceMappings == Nil)
|
||||
throw new RuntimeException("props [email_to_space_mapping] parse -> extract to Nil!")
|
||||
throw new RuntimeException("props [email_domain_to_space_mappings] parse -> extract to Nil!")
|
||||
else
|
||||
emailToSpaceMappings
|
||||
} catch {
|
||||
case e: Throwable => // error handling, found wrong props value as early as possible.
|
||||
this.logger.error(s"props [email_to_space_mapping] value is invalid, it should be the class($EmailToSpaceMapping) json format, current value is $str ." );
|
||||
this.logger.error(s"props [email_domain_to_space_mappings] value is invalid, it should be the class($EmailToSpaceMapping) json format, current value is $str ." );
|
||||
throw e;
|
||||
}
|
||||
|
||||
APIUtil.getPropsValue("email_to_space_mapping").map(extractor).getOrElse(Nil)
|
||||
APIUtil.getPropsValue("email_domain_to_space_mappings").map(extractor).getOrElse(Nil)
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
```
|
||||
Date Commit Action
|
||||
29/06/2021 98c5503c Existing Props authUser.skipEmailValidation now defaults to false (i.e. we now force email validation by default)
|
||||
29/06/2021 0b08199b Added props: email_to_space_mapping, default is empty
|
||||
29/06/2021 0b08199b Added props: email_domain_to_space_mappings, default is empty
|
||||
We can automatically grant the Entitlements required to use all the Dynamic Endpoint roles belonging to
|
||||
the bank_ids (Spaces) the User has access to via their validated email domain. Entitlements are
|
||||
sam generated /refreshed both following manual locin and Direct Login token generation (POST).
|
||||
|
||||
Loading…
Reference in New Issue
Block a user