Changes for page Data Exchange
Last modified by Waria on 2026/07/23 10:11
From version 21.1
edited by Waria
on 2026/07/23 10:11
on 2026/07/23 10:11
Change comment:
There is no comment for this version
To version 3.1
edited by Erik Bakker
on 2022/06/13 09:26
on 2022/06/13 09:26
Change comment:
There is no comment for this version
Summary
-
Page properties (4 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - Data Exchange1 + XPath Advanced - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. waria1 +XWiki.ebakker - Default language
-
... ... @@ -1,1 +1,0 @@ 1 -en - Content
-
... ... @@ -1,87 +1,99 @@ 1 -{{container}} 2 -{{container layoutStyle="columns"}} 3 -((( 4 -In this section, we’ll examine how eMagiz manages data exchange between applications and integrations, focusing on security considerations for each method. eMagiz supports three main integration patterns: Messaging, API Gateway, and Event Streaming. We'll explore the security measures associated with each pattern, including options like OpenID Connect, OAuth2.0, and access control lists. By understanding these patterns and their specific security configurations, you'll be better equipped to protect data and ensure secure interactions across your integrations. 1 +{{container}}{{container layoutStyle="columns"}}((( 2 +Within the crash course, we already explained XPath conceptually. In that same microlearning, we also looked at some more uncomplicated cases of using XPath within your transformation. If you need to brush up on that knowledge, please check out this [microlearning](crashcourse-platform-create-transformation-xpath-basic.md). In the intermediate microlearning on this subject, we built upon that knowledge. Please check out this [microlearning](intermediate-create-your-transformations-xpath-intermediate.md) if you need a refresher on that. In this microlearning, we will build upon that knowledge and look at some concrete, practical examples that could be useful in your project. 5 5 6 6 Should you have any questions, please get in touch with [[academy@emagiz.com>>mailto:academy@emagiz.com]]. 7 7 6 +* Last update: October 25th, 2021 7 +* Required reading time: 6 minutes 8 + 8 8 == 1. Prerequisites == 9 9 10 -* Expert knowledge of the eMagiz platform 11 +* Advanced knowledge of the eMagiz platform 12 +* [XPath Basic](crashcourse-platform-create-transformation-xpath-basic.md) 13 +* [XPath Intermediate](intermediate-create-your-transformations-xpath-intermediate.md) 11 11 15 +crashcourse-platform-create-transformation-xpath-basic 16 +crashcourse-platform-create-transformation-XPath-basic 17 + 12 12 == 2. Key concepts == 13 13 14 -This microlearning focuses on securityconsiderations when exchangingdata via theplatform.20 +This microlearning focuses on more complex XPath operations. 15 15 16 - *Eachpatterncomeswithgeneric andspecific checksandbalancestoensuresecurityistakencare ofwhen exchangingdata.22 +With XPath Advanced, we mean learning that XPath options are complex but could benefit you in your daily work. 17 17 18 - ==3.DataExchange==24 +Some of the more complex XPath options are: 19 19 20 -Because eMagiz provides the integration between two or more applications via the eMagiz platform, the point at which the data is interchanged between application and integration is a critical part of the integration in terms of security. 21 -Within eMagiz, there are three main integration patterns a user can configure to support their business case most optimally. First, this section will look at all three integration types and specify the security measures. 26 +* dateTime calculation 27 +* Filter list 28 +* XPath on JSON 29 +* SpEL notation for XPath 22 22 23 -=== 3.1 Messaging === 24 24 25 -Messaging is the most flexible option of the three; therefore, a wide range of options is available within eMagiz to secure the connections. 26 -eMagiz offers users the tools to set up integrations and end-points securely. eMagiz supports well-known market standards, including: 27 27 28 -* OpenID Connect 29 -* WS-Security 30 -* API Keys in combination with HTTPS/SSL 31 -* SOAP Authentication 32 -* OAuth2.0 33 -* Basic Authentication 33 +== 3. XPath Advanced == 34 34 35 - This way,each connectionbetweentheapplication and theintegration(end-point)canbeadequatelysecuredandgivestheflexibilitytoconferwith theexternal applicationwhichmethod bestsuitstheirneeds.35 +Within the crash course, we already explained XPath conceptually. In that same microlearning, we also looked at some more uncomplicated cases of using XPath within your transformation. If you need to brush up on that knowledge, please check out this [microlearning](crashcourse-platform-create-transformation-xpath-basic.md). In the intermediate microlearning on this subject, we built upon that knowledge. Please check out this [microlearning](intermediate-create-your-transformations-xpath-intermediate.md) if you need a refresher on that. In this microlearning, we will build upon that knowledge and look at some concrete, practical examples that could be useful in your project. 36 36 37 - ===3.2API Gateway===37 +Some of the more complex XPath options are: 38 38 39 -The front-end of your API Gateway can be secured using a structure with users and permissions. The security of the backend of the API Gateway can be customized just as for messaging. Confer with your external party how the backend needs to be secured. 39 +* dateTime calculation 40 +* Filter list 41 +* XPath on JSON 42 +* SpEL notation for XPath 40 40 41 -eMagiz offers multiple authentication methods for API Gateway users: OAuth 2.0, Basic Auth and API Key. These can be configured per user. This means that you can choose the strongest authentication method supported by the consuming application. 42 - 43 -For OAuth 2.0 eMagiz hosts an authorization server per customer environment which functions as the IDP (identity provider). By communicating with this IDP via the OAuth2.0 protocol, a check is done every time a client calls a specific operation to see whether that client can access the API Gateway and has sufficient rights to access the operation. 44 - 45 -Although users can authenticate using OAuth 2.0, Basic Auth, or an API Key, eMagiz validates all requests through the same authorization infrastructure. Basic Auth and API Key credentials are translated internally to OAuth-based authorization, ensuring that user permissions are evaluated consistently regardless of the chosen authentication method. This centralizes authorization logic and reduces the risk of differences in security behavior between authentication mechanisms. 46 - 47 -To learn more about configuring API security and user permissions check out the [[API Gateway Crash Course>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.Crash Course API Gateway.WebHome||target="blank"]]. 44 +=== 3.1 dateTime calculation === 48 48 49 - ===3.3EventStreaming===46 +Sometimes we see that a dateTime calculation is needed within a transformation to determine a specific action. As these calculations are not natively supported within the eMagiz platform, you need to use XPath's functionality to calculate the new valid date (or dateTime). 50 50 51 -Within the Event Streaming solution, eMagiz provides Event Streaming users, and topics can be created. 52 -Access to a topic within a cluster is governed by an Access Control List (ACL). This ACL links users to a topic and defines what the user can do on a topic (consume, produce, both). 48 +The XPath standard offers several functions to calculate with dateTime values. The two most used options are dayTimeDuration and yearMonthDuration. With the help of the dayTimeDuration, you can add, subtract, multiple, or divide seconds, minutes, hours, and days regarding the original value. The yearMonthDuration works similarly but then for months and years. An example of such an XPath is: <xsl:value-of xmlns:xs="http://www.w3.org/2001/XMLSchema" select="CDM:StartDate + xs:dayTimeDuration('P1D') * xs:yearMonthDuration('P1M')"/>. In this example, XPath adds one day and subtracts one month from the input date. Note that making this work requires the additional namespace to be defined. Therefore you need a custom snippet within your transformation or a custom transformation to make this work. Furthermore, note that the P1D and P1M could also be filled with the help of parameters to make them dynamic in nature. 53 53 54 - Onlyuserswithsufficientrights in theDeploy phase of eMagizcan addusers, and topics and changetheACLentries specific to the Event Streaming cluster.50 +Some examples that we saw during the years: 55 55 56 -Apart from producing or consuming data on specific topics based on the ACL, users also need a valid Keystore (containing the key and cert generated automatically) and a valid truststore (containing the CA certificate of the event streaming cluster) to produce or consume data. 52 +* https://my.emagiz.com/p/question/172825635700358186 53 +* https://my.emagiz.com/p/question/172825635700352588 57 57 58 - Theseareall security measuresto prevent third partiesfrom unauthorizedaccess to the data stored on the topics.55 +=== 3.2 Filter list === 59 59 60 - For more information on howthispreciselycan beconfigured via the eMagizplatform,pleasecheckthefollowing[[microlearning>>doc:Main.eMagizAcademy.Microlearnings.CrashCourse.CrashCourseEventStreaming.crashcourse-eventstreaming-user-management||target="blank"]].57 +Sometimes you have a large message which contains a certain list within it. However, logic dictates that you can only send the message if at least one entry in the list for which attribute A is filled and attribute B equals type C. To make that happen in XPath, we first need to navigate to the list within the message. As we previously learned, there are two options to do so. One is to use // to navigate to the entity somewhere in the tree directly. The other is to start at the root and walk the tree from there. In this example, we use the latter. That results in the following XPath example: /root/list[attributeB = 'type C']/attributeA !=''. With this XPath, you filter the list on the specified check and subsequently check whether one of those entries that remains has an attributeA which is filled in. 61 61 62 -=== 3. 4General===59 +=== 3.3 XPath on JSON === 63 63 64 - Regardlessoftheselected patternforyour solution, it would bebestif you alwaysconsideredthat you onlyexchange relevantinformationwiththeexternalparty.This meansyoushouldconsiderbothheadersasthe payloadyouneed to exchangewiththeexternalparty. Thisisparticularly interestingfor anycommunication via HTTPgatewaysastheyholdfunctionality tosendallmessageheaders as HTTP headers andviceversa.61 +With the release of build number .50, we expanded our offering on JSON messages to resemble much of the functionality we previously offered for XML messages. As a result, you can use XPath expressions on JSON messages within the following components (related to XPath): 65 65 66 -== 4. Key takeaways == 63 +* XPath header enricher 64 +* XPath transformer 65 +* XPath router 67 67 68 -* Each pattern comes with generic and specific checks and balances to ensure security is taken care of when exchanging data. 69 -* When you are not careful, you might share too much information with external parties. 67 +To activate the functionality, simply link the JSON source factory support object to one of these components to achieve the desired result. For more information, check out: https://emagiz.github.io/docs/release-notes/build50. 70 70 71 -== 5. SuggestedAdditionalReadings==69 +=== 3.4 SpEL notation for XPath === 72 72 73 -* [[Fundamentals (Navigation)>>doc:Main.eMagiz Academy.Fundamentals.WebHome||target="blank"]] 74 -** [[eMagiz Security Guide (Explanation)>>doc:Main.eMagiz Academy.Fundamentals.fundamental-emagiz-security-guide||target="blank"]] 75 -* [[Crash Course (Menu)>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.WebHome||target="blank"]] 76 -** [[Crash Course API Gateway (Navigation)>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.Crash Course API Gateway.WebHome||target="blank"]] 77 -*** [[API User Management (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.Crash Course API Gateway.crashcourse-api-gateway-user-management||target="blank"]] 78 -** [[Crash Course Event Streaming (Navigation)>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.Crash Course Event Streaming.WebHome||target="blank"]] 79 -*** [[User Management - Event Streaming (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.Crash Course Event Streaming.crashcourse-eventstreaming-user-management||target="blank"]] 80 -* [[Data exchange (Search Result)>>url:https://docs.emagiz.com/bin/view/Main/Search?sort=score&sortOrder=desc&highlight=true&facet=true&r=1&f_space_facet=0%2FMain.&f_type=DOCUMENT&f_locale=en&f_locale=&f_locale=en&text=data+exchange||target="blank"]] 81 -))) 71 +Sometimes you want to perform an XPath operation but store the header via a standard message header enricher component. As a result, you need a valid SpEL expression to help you in this cause. To do so, you need to know the correct notation for an XPath expression when using the SpEL language. An example of the correct notation is: #xpath(payload,'/root/entity/attribute') 82 82 83 -((( 84 -{{toc/}} 85 -))) 86 -{{/container}} 87 -{{/container}} 73 + 74 + 75 +== 4. Assignment == 76 + 77 +Check out which of the XPaths we have discussed today can be found within your project. 78 +This assignment can be completed within the (Academy) project you created/used in the previous assignment. 79 + 80 +== 5. Key takeaways == 81 + 82 +Some of the more complex XPath options are: 83 + 84 +* dateTime calculation 85 +* Filter list 86 +* XPath on JSON 87 +* SpEL notation for XPath 88 + 89 + 90 + 91 +== 6. Suggested Additional Readings == 92 + 93 +If you are interested in this topic and want more information on it, please read the help text provided by eMagiz and read more information on the following link: 94 + 95 +* https://www.w3schools.com/xml/xpath_intro.asp 96 + 97 +== 7. Silent demonstration video == 98 + 99 +As this is more of theoretical microlearning, there is no video accompanying the microlearning.)))((({{toc/}}))){{/container}}{{/container}}