Changes for page SMB - Dynamically Manipulate Settings
Last modified by Erik Bakker on 2024/09/03 09:17
From version 2.1
edited by marijn
on 2022/05/05 16:37
on 2022/05/05 16:37
Change comment:
There is no comment for this version
To version 31.1
edited by Erik Bakker
on 2024/09/03 09:17
on 2024/09/03 09:17
Change comment:
There is no comment for this version
Summary
-
Page properties (5 modified, 0 added, 0 removed)
-
Attachments (0 modified, 0 added, 1 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,0 +1,1 @@ 1 +SMB - Dynamically Manipulate Settings - Parent
-
... ... @@ -1,0 +1,1 @@ 1 +Main.eMagiz Academy.Microlearnings.Advanced Level.File based connectivity.WebHome - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. marijn1 +XWiki.ebakker - Default language
-
... ... @@ -1,0 +1,1 @@ 1 +en - Content
-
... ... @@ -1,71 +1,90 @@ 1 -{{html wiki="true"}} 2 -<div class="ez-academy"> 3 - <div class="ez-academy_body"> 1 +{{container}}{{container layoutStyle="columns"}}((( 2 +In a previous [[microlearning>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.File based connectivity.intermediate-file-based-connectivity-smb-connectivity.WebHome||target="blank"]] on this subject, we discussed how to configure the various variants of SMB connectivity. We already mentioned that more dynamic options, such as automatically creating a "multi-level" directory (i.e.,/root/sub), are complex to configure and require a different approach. 3 + 4 +In this microlearning module, we’ll delve into dynamically manipulating settings on the SMB Session Factory. This approach is particularly useful when you need to create directories on-the-fly or manage file shares across multiple hosts. We’ll explore how to configure dynamic settings such as host, share, and directory using the Standard Service Activator, and discuss additional dynamic options to enhance flexibility in your SMB configurations. 4 4 5 - <divclass="doc">6 +If you have any questions, don't hesitate to contact [[academy@emagiz.com>>mailto:academy@emagiz.com]]. 6 6 8 +== 1. Prerequisites == 7 7 10 +* Advanced knowledge of the eMagiz platform 8 8 9 -= ErrorHandlingconcerningGDPR=12 +== 2. Key concepts == 10 10 11 - In eMagiz, all errors are raised when a process fails,and you want to have some formofloggingend up in the Manage phase of eMagiz. The Managephase of eMagiz is primarily accessible to support employees, employees working ontheproject, and insomecases, even more, people have at least view rights. Youcanimagine that whenmany people have access to potentiallysensitive data, you should consider countermeasures. This way, you canreduce the chancesof sensitive data endingup in the wrong hands.Some of the potentialcountermeasures are available within theplatform.Someof them are procedural in nature. In thismicrolearning,we will learn what youcan dotokeep yourdata safe within eMagiz.14 +This microlearning centers around dynamically manipulating settings on the SMB Session Factory. 12 12 13 - Shouldyouhaveany questions,don'thesitatetogetintouchwithacademy@emagiz.com.16 +* This option is the correct approach when you need to create a directory dynamically or have multiple hosts that host file shares. 14 14 15 -* Last update: November 15th, 2021 16 -* Required reading time: 5 minutes 18 +== 3. Dynamically manipulate SMB Session Settings == 17 17 18 - ==1.Prerequisites ==20 +In a previous [[microlearning>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.File based connectivity.intermediate-file-based-connectivity-smb-connectivity.WebHome||target="blank"]] we learned that we need an SMB Session Factory to set up the initial connection to the SMB drive. In this component, five main settings are relevant. 19 19 20 -* Advanced knowledge of the eMagiz platform 22 +* Host 23 +* Port 24 +* Username 25 +* Password 26 +* Share and directory 21 21 22 -== 2. Key concepts == 28 +In theory, each of these settings can be overwritten every time a message is consumed and processed by the flow. In practice, we see two main use cases that are relevant to mention in this microlearning as we see them currently being applied in our community. 29 + 30 +=== 3.1 Dynamic Host === 23 23 24 -This microlearning centers around error handling concerning GDPR 25 -With GDPR, we mean The law on General Data Protection Regulation. 32 +Suppose you have a multitude of SMB directories (i.e., shares) span across many different host servers. In that case, you need a solution to manipulate pre-existing information on the SMB session factory dynamically. In other words, you need to be able to override the default host configuration in the component with one that is determined based on information in the headers or message. 26 26 27 -* The GDPR is a European privacy regulation. It ensures the careful processing of personal data by businesses and organizations. 28 -* eMagiz has various security measures in place to keep your data safe 29 -* You also have a responsibility as a user how you use the data of the customer 34 +To do so, we need to add a component to the flow that will override the host setting. This component is called the "Standard service activator." 30 30 36 +[[image:Main.Images.Microlearning.WebHome@advanced-file-connectivity-dynamically-manipulate-smb-settings--standard-service-activator.png]] 31 31 38 +Here, we must define an expression to set the host based on a supplied value. Important in this expression is that we correctly reference the complete name of the SMB Session Factory support object in the flow and that once the host is set, the actual message is passed along. An example of such an expression is: 32 32 33 - == 3.ErrorHandlingregardingGDPR==40 +{{code}}@'smb.gtwydynm.exit.support.smb-session'.setHost(headers.server) ?: #root{{/code}} 34 34 35 - In eMagiz, all errorsareraised when aprocessfails, andyouwantto havesomeform of logging end up intheManage phaseof eMagiz. The Manage phaseof eMagiz isprimarily accessibletosupport employees, employees workingontheproject, and in some cases, even more, people have atleastview rights. You canimaginethat whenmany peoplehaveaccessto potentially sensitivedata,youshould considercountermeasures.This way,you canreducethe chancesof sensitivedata endingupin the wrong hands.Some ofthepotentialcountermeasuresareavailable within the platform.Some ofthemare procedural in nature. Inthismicrolearning, we will learn what you cando to keep your data safe withineMagiz.42 +This expression will set the host based on the value in the header called "server" and, once done, will pass the full message to the output channel. 36 36 37 - IneMagiz, we valuethesecurityof your data. A detailed overview of how your data is secured withintheplatformand when data is exchangedcanbefound inour [Security Guide](../howto/security-guide.md). One of theadditionalmeasures you could take onour data models is to indicatewhether the informationstored in those attributesis confidential. More informationon how that worksexactly canbe foundin this [microlearning](intermediate-defining-your-message-structures-data-model-attribute-confidentiality.md).44 +[[image:Main.Images.Microlearning.WebHome@advanced-file-connectivity-dynamically-manipulate-smb-settings--standard-service-activator-filled-in.png]] 38 38 39 - Buildingonthat, we have a store componentavailable in the store with whichyou can replace the values in these attributes(in case the original payload is XML) with \*\*\*. The error message is still shown for an RCA to be performed, but the sensitive data is not accessibletothe user.46 +=== 3.2 Dynamic Share and Directory === 40 40 41 -<p align="center">[[image:advanced-understanding-error-handling-in-emagiz--store-component-gdpr-error-handling.png||]]</p> 48 +If you have a "multi-level" path that eMagiz needs to create automatically, you must dynamically set the Share and Directory settings on the SMB Session Factory support object. 49 + 50 +To do so, we need to add a component to the flow that will override the host setting. This component is called the "Standard service activator." 42 42 43 - In terms of process, you should know which datais sensitive in terms of GDPRand **not**storethat informationinexternal tools such as Postmanand SOAP UI. Furthermore,it would bebest toconsider howyou want to shape the notifications topreventsensitive information frombeingwillinglydistributed to the eMail boxes ofrecipients.52 +[[image:Main.Images.Microlearning.WebHome@advanced-file-connectivity-dynamically-manipulate-smb-settings--standard-service-activator.png]] 44 44 45 - =====Practice=====54 +Here, we must define an expression to set the host based on a supplied value. Important in this expression is that we correctly reference the complete name of the SMB Session Factory support object in the flow and that once the host is set, the actual message is passed along. An example of such an expression is: 46 46 47 - == 4. Assignment==56 +{{code}}@'smb.gtwydynm.exit.support.smb-session'.setShareAndDir(headers.share) ?: #root{{/code}} 48 48 49 - Identify whichattributes,ifany,are sensitiveinnaturewithinyour(Academy)project.Thisassignmentcanbecompletedwithinthe(Academy) project youcreated/usedinthepreviousassignment.58 +This expression will set the host based on the value in the header called "server" and, once done, will pass the full message to the output channel. 50 50 51 - == 5.Keytakeaways==60 +[[image:Main.Images.Microlearning.WebHome@advanced-file-connectivity-dynamically-manipulate-smb-settings--standard-service-activator-filled-in-share-and-dir.png]] 52 52 53 -* The GDPR is a European privacy regulation. It ensures the careful processing of personal data by businesses and organizations. 54 -* eMagiz has various security measures in place to keep your data safe 55 -* You also have a responsibility as a user how you use the data of the customer 62 +{{warning}}Note that you can combine multiple dynamic settings into one expression to keep the number of components efficient. In that case the code will look something as follows {{code}}@'smb.gtwydynm.exit.support.smb-session'.setShareAndDir(headers.share) ?: @'smb.gtwydynm.exit.support.smb-session'.setHost(headers.server) ?: #root{{/code}}{{/warning}} 56 56 64 +=== 3.3 Additional Dynamic Options === 57 57 66 +Although we don't think these options will be used much we define them here for the sake of completeness and give you examples on how to make these additional values dynamically. 58 58 59 -== 6.SuggestedAdditional Readings==68 +==== 3.3.1 Port ==== 60 60 61 - There are nosuggestedadditionalreadingsonthistopic.70 +{{code}}@'smb.gtwydynm.exit.support.smb-session'.setPort(headers.port) ?: #root{{/code}} 62 62 63 -== 7.Silent demonstrationvideo==72 +==== 3.3.2 Username ==== 64 64 65 - Asthisis a moretheoreticalmicrolearning, wehavenovideoforthis.74 +{{code}}@'smb.gtwydynm.exit.support.smb-session'.setUsername(headers.username) ?: #root{{/code}} 66 66 67 -</div> 68 -</div> 69 -</div> 76 +==== 3.3.3 Password ==== 70 70 71 -{{/html}} 78 +{{code}}@'smb.gtwydynm.exit.support.smb-session'.setPassword(headers.password) ?: #root{{/code}} 79 + 80 +== 4. Key takeaways == 81 + 82 +* This option is the correct approach when you need to create a directory dynamically or have multiple hosts that host file shares. 83 + 84 +== 5. Suggested Additional Readings == 85 + 86 +* [[Intermediate (Menu)>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.WebHome||target="blank"]] 87 +** [[File based connectivity (Navigation)>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.File based connectivity.WebHome||target="blank"]] 88 +*** [[SMB Connectivity (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.File based connectivity.intermediate-file-based-connectivity-smb-connectivity.WebHome||target="blank"]] 89 +* [[SMB (Search Result)>>url:https://docs.emagiz.com/bin/view/Main/Search?sort=score&sortOrder=desc&highlight=true&facet=true&r=1&f_space_facet=1%2FMain.eMagiz+Academy.&f_type=DOCUMENT&f_locale=en&f_locale=&f_locale=en&text=%22smb%22||target="blank"]] 90 +)))((({{toc/}}))){{/container}}{{/container}}
- advanced-understanding-error-handling-in-emagiz--store-component-gdpr-error-handling.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.marijn - Size
-
... ... @@ -1,1 +1,0 @@ 1 -3.9 KB - Content