Changes for page Communication between models
Last modified by Erik Bakker on 2024/09/05 14:00
From version 11.2
edited by Erik Bakker
on 2022/07/28 08:47
on 2022/07/28 08:47
Change comment:
Update document after refactoring.
To version 16.1
edited by Erik Bakker
on 2022/07/28 10:53
on 2022/07/28 10:53
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - expert-data-handling-groovy-script1 +Communication between models - Content
-
... ... @@ -1,5 +1,5 @@ 1 1 {{container}}{{container layoutStyle="columns"}}((( 2 - In thecrash courseonheAPI Gatewaywediscussedthe variousoptionsavailable to[[secure>>doc:Main.eMagizAcademy.Microlearnings.CrashCourse.CrashCourseAPIGateway.crashcourse-api-gateway-security.WebHome||target="blank"]]yourAPI Gatewayproperly.In this microlearning,we willexpandourknowledge on that topicbylookingatapecialcase of securingyourAPIGateway.That caseisspecial asyou usean externaldentityprovider (IDP)togoverntherolesand usersthat have rightson yourAPI Gateway.2 +When your integration landscape grows through time, you might decide to split functional business processes into multiple eMagiz models. In those cases, the question of connecting these models easily, stable, and securely could arise. This microlearning will focus on that question and provide an answer based on our vision and best practices when dealing with the platform. 3 3 4 4 Should you have any questions, please get in touch with [[academy@emagiz.com>>mailto:academy@emagiz.com]]. 5 5 ... ... @@ -9,50 +9,49 @@ 9 9 10 10 == 2. Key concepts == 11 11 12 -This microlearning focuses on u singan externalIDPtovalidatewhetherauserisauthorizedto execute acertainactiononyourAPIGatewayand whatconfiguration isneededin eMagizto makethis work.12 +This microlearning focuses on communication between two eMagiz models. When communicating to any external party (from the view of a specific model), you should always consider the following: 13 13 14 -* The Token and Issuer URL of the external IDP need to be known 15 -* Users and Roles under User Management need to be manually configured and maintained to keep them in sync with the external IDP 14 +* Security 15 +* Loose coupling 16 +* Maintainability 17 +* Clarity 16 16 17 -== 3. ExternalIDP==19 +== 3. Communication between models == 18 18 19 -In the crashcourse ontheAPI Gateway wediscussedthevarious options availableto[[secure>>doc:Main.eMagiz Academy.Microlearnings.CrashCourse.CrashCourseAPIGateway.crashcourse-api-gateway-security.WebHome||target="blank"]]yourAPI Gatewayproperly. In this microlearning, we willexpandour knowledgeon thattopicbylookingataspecialcaseofsecuring your API Gateway.Thatcaseisspecial as youusean externalidentityprovider(IDP)togoverntheroles and usersthathaverightson yourAPI Gateway.21 +In a low-code platform like eMagiz, you want to prevent using custom scripting as much as possible. However, sometimes in practice, you encounter situations that cannot be realized with the standard toolbox provided within the platform. As a result, we offer the option to use a Groovy script in these situations to achieve the desired solution. In this microlearning, we will look at where you can use a Groovy script and discuss the key considerations when implementing a Groovy script within your model. 20 20 21 - WhenselectingtheoptionOAuth2.0(orOpenID Connect)youhaveheoptiontousetheIDP provided by eMagizwhichmakes the configurationeasyoryoucould useanexternalIDP which youhavecontrolover andwantto usefor thispurposes.23 +Most users would think that communication via queues to connect two separate eMagiz models is a bright idea. However, this is something that we do not encourage. We discourage this for several practical and technical reasons alike. 22 22 23 - In thismicrolearningwewill highlight whatyou needto configureinDesign andDeploytoke thisworkwithinthe tooling ofeMagiz.25 +When looking at the practical side of things getting it configured correctly is time-consuming and an error-prone action (as is evident by the question). Furthermore, it can lead to unexpected situations where you make a typo to listen to a queue on which no messages are provided. This queue will, however, be registered on the JMS level (when you activate the flow in question with the custom configuration), which can lead to confusing queue statistics and even more troublesome false-positive alerting based on missing queue metrics or missing consumers. 24 24 25 - ===3.1Design===27 +On top of that, when you allow one model to write and read from queues registered in another model, maintaining both models will become very complex. This holds for the ones working on the project at the moment but also for those working on it at a later stage and does that need to provide (incidental) support on the environments. 26 26 27 - Onsecuritylevelof theAPI Gateway inDesignyou needtoselectthe desiredoption,for exampleOAuth2.0.Insteadofnotfilling in thetokenandissuerURL, indicating thatyou wanttouse theeMagizIDP,youneed tofilltheseintoeferencetheIDP ofyourchoice.Belowyouseean exampleofhowthiscould be configured.29 +Another practical reason for not wanting this is that we do not actively support this use case from eMagiz. This means that when we update our technical infrastructure, we will not consider this scenario. This could lead to additional work in the future and reduced stability of your solution. 28 28 29 - [[image:Main.Images.Microlearning.WebHome@expert-securing-data-traffic-api-gw-security-external-idp-security-config-design.png]]31 +From the technical point of view, the consequence of this construction is that both models need to know each other certificates and credentials, which are not considered secure. On top of that, because you, theoretically, can exchange data from any queue to any queue, you could create a situation in which updates in one model trigger changes in the other model (i.e., when using the same data model) that are unexpected (and frankly unwanted). 30 30 31 -Note that the environmentID in this example should be replaced with an actual environmentID that references your environment. 33 +We advise using functionality that makes it explicit that both models function independently of each other. From eMagiz, we consider two valid alternatives for this: 34 +- Using a web service as a communication layer between the two models. This web service can be REST or SOAP and has been implemented before 35 +- Using the Event Streaming functionality of eMagiz to write and read from topics. 32 32 33 - ===3.2Deploy===37 +Both alternatives have the benefit that the security can be tight and explicit (i.e., only model A can write/post data to model B). Furthermore, managing the solution becomes much easier as it uses the standard functionality within the platform. Therefore, we have no plans to support this approach in the product. 34 34 35 -Normally, eMagiz will automatically update the User Management information based on the configuration in Design. However, because the identity check is not done by eMagiz but by an external party you need to manually enter the roles and users and configure the scope correctly on role level. 36 - 37 -To do so navigate to User Management in Deploy and add the users you want manually by pressing the New button and providing them with a name. Do subsequently the same for the roles. On role level do not forget to correctly enter the scope to make the call work. Note that the help text on the scope level gently reminds you what you need to do to make this work. 38 - 39 -[[image:Main.Images.Microlearning.WebHome@expert-securing-data-traffic-api-gw-security-external-idp-scope-configuration.png]] 40 - 41 -{{warning}}When implementing this you would be the first to do so with this setup. This means there might be some unexpected behavior when configuring this.{{/warning}} 42 - 43 43 == 4. Assignment == 44 44 45 -No assignment 41 +Consider what your criteria are when communicating between models and compare them to our criteria. 42 +This assignment can be completed with the help of the (Academy) project you created/used in the previous assignment. 46 46 47 47 == 5. Key takeaways == 48 48 49 -* The Token and Issuer URL of the external IDP need to be known 50 -* Users and Roles under User Management need to be manually configured and maintained to keep them in sync with the external IDP 51 -* When implementing this you would be the first to do so with this setup. 46 +* Consider the following when communication between two models 47 +** security 48 +** Loose coupling 49 +** Maintainability 50 +** Clarity 52 52 53 53 == 6. Suggested Additional Readings == 54 54 55 -If you are interested in this topic and want more information, please readthehelptextvided byeMagiz.54 +If you are interested in this topic and want more information, please consult us at [[productmanagement@emagiz.com>>mailto:productmanagement@emagiz.com]] 56 56 57 57 == 7. Silent demonstration video == 58 58