Changes for page Communication between models
Last modified by Erik Bakker on 2024/09/05 14:00
From version 15.1
edited by Erik Bakker
on 2022/07/28 10:48
on 2022/07/28 10:48
Change comment:
There is no comment for this version
To 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.
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - Communicationbetween models1 +expert-data-handling-groovy-script - Content
-
... ... @@ -1,5 +1,5 @@ 1 1 {{container}}{{container layoutStyle="columns"}}((( 2 - Whenyour integration landscapegrowsthroughtime,youmightdecide tosplitfunctionalusinessprocesses intomultipleeMagizmodels.In thosecases, thequestionofconnecting these modelssily, stable,andsecurelycouldarise.This microlearning willfocuson thatquestionandprovideananswerbasedon ourvisionandbestpracticeswhendealingwiththeplatform.2 +In the crash course on the API Gateway we discussed the various options available to [[secure>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.Crash Course API Gateway.crashcourse-api-gateway-security.WebHome||target="blank"]] your API Gateway properly. In this microlearning, we will expand our knowledge on that topic by looking at a special case of securing your API Gateway. That case is special as you use an external identity provider (IDP) to govern the roles and users that have rights on your API Gateway. 3 3 4 4 Should you have any questions, please get in touch with [[academy@emagiz.com>>mailto:academy@emagiz.com]]. 5 5 ... ... @@ -9,49 +9,50 @@ 9 9 10 10 == 2. Key concepts == 11 11 12 -This microlearning focuses on communicationbetween twoeMagiz models.Whencommunicatingtoanyexternalparty(fromthe viewofaertainmodel)youshouldalwaysconsiderhefollowing:12 +This microlearning focuses on using an external IDP to validate whether a user is authorized to execute a certain action on your API Gateway and what configuration is needed in eMagiz to make this work. 13 13 14 -* Security 15 -* Loose coupling 16 -* Maintainability 17 -* Clarity 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 18 18 19 -== 3. Communication betweenmodels==17 +== 3. External IDP == 20 20 21 -In a low-codeplatformlike eMagiz,youwant to preventusingcustomscripting asmuchas possible.However,sometimesinpractice,you encountersituationsthatcannot berealized withthe standard toolbox providedwithintheplatform.As aresult, weoffertheoptionto useGroovyptin thesesituationstoachievethedesired solution. In this microlearning, we willlook atwhereyoucanuse aGroovyscript anddiscussthekeyconsiderationswhenimplementingaGroovyscriptwithin yourmodel.19 +In the crash course on the API Gateway we discussed the various options available to [[secure>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.Crash Course API Gateway.crashcourse-api-gateway-security.WebHome||target="blank"]] your API Gateway properly. In this microlearning, we will expand our knowledge on that topic by looking at a special case of securing your API Gateway. That case is special as you use an external identity provider (IDP) to govern the roles and users that have rights on your API Gateway. 22 22 23 - Mostusers wouldthinkthatcommunicationvia queuestoconnecttwoseparate eMagizmodelsisasmart idea.However,thisis somethingthatwedonotencourage.Wediscouragethis forseveralpracticalandtechnicalreasonsalike.21 +When selecting the option OAuth2.0 (or OpenID Connect) you have the option to use the IDP provided by eMagiz which makes the configuration easy or you could use an external IDP which you have control over and want to use for this purposes. 24 24 25 - Whenlooking atthe practicalsideof things getting itconfigured correctly is time-consumingand an error-prone action(as isevidentby the question). Furthermore, it canleadto unexpected situations in whichyou make a typo tolisten to a queue on which no messages are provided. Thisqueuewillhowever be registeredon the JMS level (whenyouactivate the flow inquestion with thecustomconfiguration)which canlead to confusingqueue statistics and even moretroublesomefalse-positivealerting basedonmissingqueuemetricsor missingconsumers.23 +In this microlearning we will highlight what you need to configure in Design and Deploy to make this work within the tooling of eMagiz. 26 26 27 - Ontopof that because you basically allow one model to write and read from queues registered inanother model maintaining both models will become very confusing 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.25 +=== 3.1 Design === 28 28 29 - Anotherpracticalreasonfornotwantingthissthatweonotactively support this usecase fromeMagiz.Thismeanshatwhenwedo updatestoourtechnicalinfrastructurewe willnot take thisscenariointoaccount.This couldleadtoadditionalworkonyourpartinthefuture andreduced stabilityofyoursolution.27 +On the security level of the API Gateway in Design you need to select the desired option, for example OAuth2.0. Instead of not filling in the token and issuer URL, indicating that you want to use the eMagiz IDP, you need to fill these in to reference the IDP of your choice. Below you see an example of how this could be configured. 30 30 31 - Fromthetechnical point of view, the consequence of thisconstructions thatbothmodels needto knoweach othercertificatesand credentials whichare not consideredsecure. Ontop of that becauseyou, theoretically, can exchange data from any queue toany queue you couldeate a situation in which updates inone model trigger changes in the other model (i.e. when usingthe same data model) that are unexpected (and frankly unwanted).29 +[[image:Main.Images.Microlearning.WebHome@expert-securing-data-traffic-api-gw-security-external-idp-security-config-design.png]] 32 32 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 layer of communication 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. 31 +Note that the environmentID in this example should be replaced with an actual environmentID that references your environment. 36 36 37 - Bothalternatives have the benefit that the security can be tight and explicit (i.e.only model A can write/post data to modelB). Furthermore managing the solution becomes a lot easier as it makes use of the standard functionalitywithin the platform. We have no plans to support this approach in the product.33 +=== 3.2 Deploy === 38 38 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 + 39 39 == 4. Assignment == 40 40 41 -Consider what your criteria are when communicate 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. 45 +No assignment 43 43 44 44 == 5. Key takeaways == 45 45 46 -* Consider the following when communication between two models 47 -** Security 48 -** Loose coupling 49 -** Maintainability 50 -** Clarity 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. 51 51 52 52 == 6. Suggested Additional Readings == 53 53 54 -If you are interested in this topic and want more information, please consult us at [[productmanagement@emagiz.com>>mailto:productmanagement@emagiz.com]]55 +If you are interested in this topic and want more information, please read the help text provided by eMagiz. 55 55 56 56 == 7. Silent demonstration video == 57 57