<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sajitha Liyanage on Medium]]></title>
        <description><![CDATA[Stories by Sajitha Liyanage on Medium]]></description>
        <link>https://medium.com/@sajithaliyanage?source=rss-3d07b7bad46f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fKoxeL7xA-rjndJyNzupKQ.jpeg</url>
            <title>Stories by Sajitha Liyanage on Medium</title>
            <link>https://medium.com/@sajithaliyanage?source=rss-3d07b7bad46f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 20:36:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sajithaliyanage/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Integrating HashiCorp Secure Vault with WSO2 Micro Integrator]]></title>
            <link>https://medium.com/think-integration/integrating-hashicorp-secure-vault-with-wso2-micro-integrator-4210d145a4d0?source=rss-3d07b7bad46f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4210d145a4d0</guid>
            <category><![CDATA[hashicorp]]></category>
            <category><![CDATA[wso2-micro-integrator]]></category>
            <category><![CDATA[hashicorp-vault]]></category>
            <category><![CDATA[wso2-integration-studio]]></category>
            <category><![CDATA[wso2-api-manager]]></category>
            <dc:creator><![CDATA[Sajitha Liyanage]]></dc:creator>
            <pubDate>Sat, 30 Oct 2021 17:57:27 GMT</pubDate>
            <atom:updated>2021-11-01T04:25:46.354Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pbk5zDOxWwHgtd05mz8pew.png" /></figure><p>Today’s digital enterprises need to pay special attention to security concerns because corporate data, internal applications, deployments, etc. are so important to their day-to-day operations. Therefore, secret management is one of the major security tasks that developers are concerned about. So what is a secret and why do we need it? Let’s sort it out first.</p><p>Simply non-human privilege credentials are often called <strong>secrets</strong> and we use these secrets to protect any kind of sensitive and important information in tools, applications, containers, cloud-native environments and DevOps. Secrets act as a key to lock and unlock the data whenever we need to access it. Managing these secrets we called it <strong>Secret Management</strong>. Nowadays HashiCorp Vault is the most popular open-source secret management tool among developers due to its features.</p><blockquote>A secret is anything that you want to tightly control access to, such as API keys, passwords, certificates, and more. — <strong>Vault Documentation</strong></blockquote><p>In this blog, I will be explaining how WSO2 Micro Integrator helps you to protect your secrets by integrating HashiCorp secure vault and how you can manage them in your integration solutions with different authentication methods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*fcwLWixk10G27dEqiHOM-Q.gif" /></figure><p>First of all, let’s see how to install and start the HashiCorp vault server in your environment. HashiCorp Vault runs as a client/server application. It is the only part of the Vault architecture that interacts with the data storage and backend. We can use their Vault CLI to do all its operations.</p><h3>Starting the Dev Server</h3><p>To set up the development server, perform the following steps:</p><ol><li><a href="https://www.vaultproject.io/downloads">Download</a> and Unzip the package for your system. To see more specific recommendations for your operating system, check out the <a href="https://learn.hashicorp.com/tutorials/vault/getting-started-install">official documentation</a>.</li><li>Set the environment variable <strong>VAULT_ADDR:</strong></li></ol><pre>$ export VAULT_ADDR=’http://127.0.0.1:8200’</pre><p>3. Start the vault dev server:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M0QkMo2S6AIOrKr06XZhPw.png" /><figcaption>Server startup logs</figcaption></figure><p>4. Verify the server is running:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KM4TlqS8Zb9kHbiaOkUujg.png" /><figcaption>Check server status</figcaption></figure><h4>Manage Secrets</h4><p>There are multiple ways to insert and retrieve secrets(manage) in the HashiCorp secure vault. It has an HTTP API to interact with the server programmatically, a command-line interface(CLI tool) also a web-based GUI. Here I’ll show you how to create and view secrets with help of CLI.</p><p>We can use <strong>vault kv put</strong> command to create a secret in a specific file path with a specific key. The below example will create a secret <em>name</em> with the value <em>sajithaliyanage</em>, and store it by the <em>secret/sajitha</em> path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p4Aw0mX3jwTg-0idGNXDKg.png" /><figcaption>Create a secret</figcaption></figure><p>We can use <strong>vault kv get</strong> command to fetch secrets from the specified location.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0w28fjdaNsjAOq-NnHD2RQ.png" /><figcaption>Fetch a secret</figcaption></figure><p><strong>Congratulations!</strong> 👏 You’ve started the HashiCorp Vault server and managed secrets successfully. Now we can configure the WSO2 Micro Integrator server to connect with the HashiCorp vault server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*FW4-mLueiLFXzkiqvHb1qw.gif" /></figure><h3>Authentication Methods</h3><p>HashiCorp secure vault supports multiple authentication methods that make the most sense for the business use cases. Among these, WSO2 Micro Integrator supports the following methods which are popular and widely used.</p><ul><li><a href="https://learn.hashicorp.com/tutorials/vault/tokens?in=vault/auth-methods">Static Token</a> Authentication</li><li><a href="https://www.vaultproject.io/docs/auth/approle">AppRole</a> Authentication</li><li><a href="https://www.vaultproject.io/docs/auth/ldap">LDAP</a> Authentication</li></ul><h4>Static Token Authentication</h4><p>In the HashiCorp vault, tokens are the core method for authentication. In the previous section, when you start the Vault server you probably notice that <strong>vault server -dev </strong>command outputs an initial token named <strong>“Root Token”</strong>. This is the basic authentication method for the vault and it is also the only auth method that cannot be disabled. These root tokens are tokens that have the root policy attached to them. Root tokens can do anything in Vault.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hwwf9XQ3a9vz_KXjAkwmtA.png" /><figcaption>Root Token in server startup logs</figcaption></figure><p>In order to static authentication, add the following configurations to the <strong>deployment.toml </strong>file located inside the <strong>&lt;MI_HOME&gt;/conf</strong> directory of the Micro Integrator.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7c78330ed0626d7c866cd114c83a4bfe/href">https://medium.com/media/7c78330ed0626d7c866cd114c83a4bfe/href</a></iframe><h4>AppRole Authentication</h4><p>This is the recommended authentication method as per the HashiCorp team. The AppRole authentication method allows applications to authenticate with Vault-defined roles. This approach uses <strong>SecretID</strong> and <strong>RoleID</strong> for login. The RoleID and SecretID are like a username and password that an application uses to authenticate. Once the login is successful it returns a client token which can be used to fetch secrets from the Vault. Further, this method provides the option of limiting the number of times the SecretID token can be used which extends security aspects further.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*-IltyAyqkZkcKgVnRq22Og.png" /><figcaption>AppRole Auth Overview</figcaption></figure><p>Please follow the below steps in order to enable AppRole authentication in the HashiCorp server and configure the Micro Integrator.</p><ol><li>Enable the AppRole auth method:</li></ol><pre><strong>$ vault auth enable approle</strong><br>Success! Enabled approle auth method at: approle/</pre><p>2. Create a policy named <strong>sample-policy</strong> with a definition:</p><pre><strong>$</strong> <strong>vault policy write sample-policy</strong> <strong>-&lt;&lt;EOF</strong><br>  <strong># Read-only permission on secrets stored at &#39;secret/data/*&#39;<br>  path &quot;secret/data/*&quot; {<br>       capabilities = [ &quot;read&quot; ]<br>  }<br>  EOF</strong><br>Success! Uploaded policy: sample-policy</pre><p>3. Creates a role named <strong>my-role</strong> with the <strong>sample-policy</strong> policy attached:</p><pre><strong>$ vault write auth/approle/role/my-role <br>    token_policies=&quot;sample-policy&quot;\<br>    secret_id_ttl=10m \<br>    token_num_uses=10 \<br>    token_ttl=20m \<br>    token_max_ttl=30m \<br>    secret_id_num_uses=40</strong><br>Success! Data written to: auth/approle/role/my-role</pre><blockquote><strong>Note:</strong> If the token issued by your approle needs the ability to create child tokens, you will need to set <strong>token_num_uses</strong> to 0. Otherwise, SecretId will be expired once it reached the secret_id_num_uses occurrences.</blockquote><p>4. Fetch the RoleID of the AppRole:</p><pre><strong>$ vault read auth/approle/role/my-role/role-id</strong></pre><pre>Key        Value<br>---        -----<br>role_id    675a50e7-cfe0-be76-e35f-49ec009731ea</pre><p>5. Get a SecretID issued against the AppRole:</p><pre><strong>$ vault write -force auth/approle/role/my-role/secret-id </strong></pre><pre>Key                 Value<br>---                 -----<br>secret_id           ed0a642f-2acf-c2da-232f-1b21300d5f29<br>secret_id_accessor  a240a31f-270a-4765-64bd-94ba1f65703c</pre><p>6. Add the following configurations to the <strong>deployment.toml</strong> of Micro Integrator</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/44ada1c95fcbe67ba8403abb0b89dd60/href">https://medium.com/media/44ada1c95fcbe67ba8403abb0b89dd60/href</a></iframe><h4>LDAP Authentication</h4><p>The LDAP auth method allows authentication using an existing LDAP server and username and password credentials. This allows Vault to be integrated into environments using LDAP without duplicating the username and password pieces of information in multiple places. Follow the below steps to configure.</p><ol><li>Enable the LDAP auth method:</li></ol><pre><strong>$ vault auth enable ldap</strong></pre><p>2. Connect LDAP server with HashiCorp vault:</p><pre><strong>$ vault write auth/ldap/config \<br>    url=&quot;ldap://ldap.example.com&quot; \<br>    userattr=sAMAccountName \<br>    userdn=&quot;ou=Users,dc=example,dc=com&quot; \<br>    groupdn=&quot;ou=Users,dc=example,dc=com&quot; \<br>    groupfilter=&quot;(&amp;(objectClass=person)(uid={{.Username}}))&quot; \<br>    groupattr=&quot;memberOf&quot; \<br>    binddn=&quot;cn=vault,ou=users,dc=example,dc=com&quot; \<br>    bindpass=&#39;My$ecrt3tP4ss&#39; \<br>    certificate=@ldap_ca_cert.pem \<br>    insecure_tls=false \<br>    starttls=true</strong></pre><p>3. Add the following configurations to the <strong>deployment.toml</strong> of Micro Integrator</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eaf813c0b4541cd8de0b56cd0ae5e13a/href">https://medium.com/media/eaf813c0b4541cd8de0b56cd0ae5e13a/href</a></iframe><h3>Accessing HashiCorp Secrets in Micro Integrator</h3><p>Once you configured the Micro Integrator to connect with the HashiCorp vault, you can use the following Synapse Xpath function to access HashiCorp secrets from your Synapse Configurations.</p><p>Given below is a sample synapse property that uses a HashiCorp secret:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7e6592511929d8b7af061b99f528d05b/href">https://medium.com/media/7e6592511929d8b7af061b99f528d05b/href</a></iframe><p>Awesome! Now you know how it works well with WSO2 Micro Integrator. I hope you really enjoyed this blog. Also, if you have any questions, please leave a comment below. Cheers! 🍻</p><ul><li><a href="https://wso2.com/api-manager/">The #1 open-source platform for building and managing APIs with ease</a></li><li><a href="https://www.vaultproject.io/docs/auth">Auth Methods | Vault by HashiCorp</a></li><li><a href="https://apim.docs.wso2.com/en/latest/install-and-setup/setup/mi-setup/security/using-hashicorp-secrets/#using-hashicorp-secrets">Using Hashicorp Secrets - WSO2 API Manager Documentation 4.0.0</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4210d145a4d0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/think-integration/integrating-hashicorp-secure-vault-with-wso2-micro-integrator-4210d145a4d0">Integrating HashiCorp Secure Vault with WSO2 Micro Integrator</a> was originally published in <a href="https://medium.com/think-integration">Think Integration</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The What, Why and Wow behind the WSO2 Micro Integrator Containers]]></title>
            <link>https://medium.com/think-integration/the-what-why-and-wow-behind-the-wso2-micro-integrator-containers-b89c842a3f?source=rss-3d07b7bad46f------2</link>
            <guid isPermaLink="false">https://medium.com/p/b89c842a3f</guid>
            <category><![CDATA[wso2-micro-integrator]]></category>
            <category><![CDATA[wso2-integration-studio]]></category>
            <category><![CDATA[wso2-ei]]></category>
            <category><![CDATA[docker-container]]></category>
            <category><![CDATA[wso2]]></category>
            <dc:creator><![CDATA[Sajitha Liyanage]]></dc:creator>
            <pubDate>Sun, 29 Nov 2020 17:13:40 GMT</pubDate>
            <atom:updated>2020-12-01T05:20:16.593Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gGQstpa9oxXbydaHbRFTjA.png" /></figure><p>Nowadays most of the enterprises are moving to the containerized solutions from the virtualization due to its popularity and tons of benefits. As we all know they start and stop much faster than virtual machines, they have higher portability, can be quickly added or removed in the environment, can run on any type of platforms, smaller than the VMs, etc. majorly can be considered as it’s plus points.</p><p>Although the concept of containerization has a long history, it has attracted attention with the release of Docker as an open-source project in 2013. Linux Containers can have multiple management interfaces like Docker, Kubernetes but in all cases, they are powered by two main building blocks: <a href="https://en.wikipedia.org/wiki/Linux_namespaces"><strong>Linux namespaces</strong></a><strong> </strong>and <a href="https://en.wikipedia.org/wiki/Cgroups"><strong>cgroups</strong></a>. With these two Linux technologies, containerization provides virtualization at the operating system level, unlike a VM that provides hardware virtualization. This is because containers (Docker) runs everywhere like on-prem (Windows, Linux, macOS) and even in the cloud platforms (AWS, GCP, Azure). Once the enterprise application is containerized, it can be easily built, deployed and moved in and across the environments as we desire. Also can run in a hybrid on-prem and cloud infrastructure.</p><h3>WSO2 Micro Integrator vs WSO2 EI 6.x Family</h3><p>Before moving towards the big picture of the WSO2 Micro Integrator Containers, let&#39;s discuss what and why about the WSO2 Micro Integrator(MI) first. As a reputed middleware company, <a href="https://wso2.com/"><strong>WSO2</strong></a> offers <a href="https://wso2.com/integration/?utm_source=medium&amp;utm_medium=blogs&amp;utm_campaign=think_integration">WSO2 Enterprise Integrator(EI)</a> which is a comprehensive integration solution for all kind of enterprise integration needs. Further, WSO2 EI consists of their own <strong>Synapse </strong>and<strong> Axis2</strong> engines as the integration runtime and the web service engine which are battle-tested over millions of integration use cases over the past decade. However, with the demand and the evolution of the microservices WSO2 decided to have two major product families based on the integration architectures.</p><ul><li><a href="https://docs.wso2.com/display/EI660"><strong>WSO2 EI 6.x Family</strong></a><strong> -</strong> offers the conventional, centralized integration solution of the WSO2 middleware stack. WSO2 EI 6.x includes the ESB profile and other supporting profiles packaged in a single distribution.</li><li><a href="https://ei.docs.wso2.com/en/latest/"><strong>WSO2 EI 7.x Family</strong></a><strong> - </strong>offers a hybrid platform that enables API-centric integration supporting various integration architecture styles: microservices architecture, cloud-native architecture, or a centralized ESB architecture.</li></ul><p>Given below is a comparison between the Micro Integrator of EI 7.x and the ESB profile of EI 6.x.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AoefYJfu0rr2lY3Qk3yh0g.png" /><figcaption>Comparison between EI 6.x and EI 7.x families</figcaption></figure><blockquote><strong>What is WSO2 Micro Integrator?</strong></blockquote><blockquote><a href="https://wso2.com/integration/micro-integrator/?utm_source=medium&amp;utm_medium=blogs&amp;utm_campaign=think_integration">WSO2 Micro Integrator</a> is an open-source, container friendly Integration runtime of Enterprise Integrator which is used for integrating APIs, services, data, and SaaS, proprietary, and legacy systems. Also, it supports both centralized (ESB style) and decentralized (microservices, cloud native) architectural styles.</blockquote><p>As described in above, WSO2 Micro Integrator is specifically designed for the cloud-native environment with the key attributes that are essential for a microservice-ready integration solution such as faster startup time, low memory footprint, lightweight, etc. when it compares with the EI 6.x series.</p><h3>Running WSO2 Micro Integrator on Containers</h3><p>To run the Micro Integrator based integration solutions on the container orchestration platforms like Docker Swarm or Kubernetes, first, we need to create an <strong>immutable</strong> Docker image with our integration solution by using WSO2 Micro Integrator base image. Here, WSO2 has been creating MI base images from <strong>Ubuntu</strong>, <strong>CentOS</strong> and <strong>Alpine Linux</strong> operating systems for each of their Micro Integrator releases. The community version of WSO2 Micro Integrator’s base Docker image is available on <a href="https://hub.docker.com/r/wso2/wso2mi">DockerHub</a>.</p><ul><li><strong>Base Docker Images and Tags (community version)</strong></li></ul><pre>docker pull wso2/wso2mi:latest<br>docker pull wso2/wso2mi:latest-ubuntu18.04<br>docker pull wso2/wso2mi:latest-centos7</pre><p>Also, WSO2 maintains its own Docker registry to deliver Docker images with the latest updates for WSO2 customers. Users need a valid WSO2 subscription to access the <a href="https://docker.wso2.com/">WSO2 Docker Registry</a>.</p><ul><li><strong>Base Docker Image and Tag (with updates)</strong></li></ul><pre>docker pull docker.wso2.com/wso2mi:latest</pre><h3>Build I<strong>mmutable</strong> Docker Images for Integrations</h3><p>If you have worked with WSO2 Micro Integrator, then you will have already heard of <strong>WSO2 Integration Studio</strong>. Because it is the drag-and-drop graphical development environment for the WSO2 Enterprise Integrator.</p><blockquote><strong>What is WSO2 Integration Studio?</strong></blockquote><blockquote>WSO2 Integration Studio is a low code development platform for the WSO2 Enterprise Integrator. It provides intiutive, efficient integration artifact development experience and accelerates all the stages of development lifecycle (design, develop, debug and test) with ease and a connected experience.</blockquote><p>So, let us see how we can build immutable Docker images for our integration solutions using the WSO2 Integration Studio. For this example, I am going to use a basic <strong>Hello World</strong> type of integration flow. You can find this template on the <em>Getting Started</em> page of the Integration Studio.</p><ol><li>Click on the Hello World sample in the Getting Started page and give a suitable name for the project.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*avetiTW0eIcxe1j7JQzajQ.gif" /><figcaption>Creating Hello World Integration Project</figcaption></figure><p>As you can see, Hello World project has been created as a Maven Multi-Module(MMM) project by default. Also, it is the recommended way of creating an <strong>Integration Solution</strong> for the WSO2 Enterprise Integrator 7.1.0 release onwards.</p><p>2. To export the Hello World sample as a Docker image, create a <strong>Docker Exporter</strong> module inside the created MMM project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QpjuM9EvgCvH5oqxnBsqlQ.gif" /><figcaption>Creating a Docker exporter module</figcaption></figure><p>Fill up the wizard form with suitable Docker image details.</p><ul><li><strong>Docker Exporter Name</strong> - Name for the module.</li><li><strong>Base Image Repository</strong> - Base image name of the WSO2 EI runtime.</li><li><strong>Base Image Tag</strong> - Base image tag of the WSO2 EI runtime.</li><li><strong>Target Image Repository</strong> - Name of the creating Docker image (should be in <em>{registry_url}/{username}/{repository}</em> or <em>{username}/{repository}</em> naming convention).</li><li><strong>Target Image Tag </strong>- Tag of the creating Docker image.</li><li><strong>Environment Variables</strong> - Section for adding env variables to the creating Docker image.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*Cyiuq8y9Yc5DCvyLtweGaQ.png" /><figcaption>Docker Image Details</figcaption></figure><p>3. Select the Hello World composite exporter module as a dependency (Here we can add multiple composite exporter modules to pack inside the creating Docker image).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jLnAMgeOwTtwzZkWuESXxw.png" /><figcaption>Select composite exporter module as a dependency</figcaption></figure><p>4. Fire up the <strong>Build Image</strong> button in the Docker exporter POM file to build the Docker image. Make sure you have installed <a href="https://docs.docker.com/install/">Docker</a> on your machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gp5s6RQcaVanY3kThGdxhA.gif" /><figcaption>Build a Docker image</figcaption></figure><p>Once, the docker build is successful, you will be notified with a pop-up message and you can see that the image is available in your Docker environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*gLfEYqABHdwOTUdfAArmpA.png" /><figcaption>Docker build successful message</figcaption></figure><p>5. Run the built Docker image and invoke the HelloWorld service.</p><pre>docker run -p 8290:8290 &lt;IMAGE_ID&gt;<br>curl http://localhost:8290/HelloWorld</pre><p>6. Fire up the <strong>Push Image</strong> button in the Docker exporter’s POM file to push the Docker image using the provided Docker registry credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p6hFRn-704KzYqL5IXaK-A.gif" /><figcaption>Push Docker image to the registry</figcaption></figure><p>Once, the docker push is successful, you will be notified with a pop-up message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*8dUXHuxIiAM48reCQdZJ0w.png" /><figcaption>Docker push successful message</figcaption></figure><p>See how smart it is. We can now build and ship Docker images with just two button clicks. 😎</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*6Wtq6U_WD08VMiRLOxhSXw.gif" /></figure><p>Additionally, since all the projects in Integration Studio are based on Maven, we can execute following maven commands on the Docker exporter’s POM file in order to build/push Docker images to the Docker registries. This is how WSO2 EI project structure fits with the CICD workflows.</p><ul><li><strong>Build a Docker image with the integration solution</strong></li></ul><pre>mvn clean install -Ddockerfile.push.skip</pre><ul><li><strong>Push built Docker image to a Docker registry</strong></li></ul><pre>mvn clean install -Ddockerfile.build.skip -Ddockerfile.username=&lt;USERNAME&gt; -Ddockerfile.password=&lt;PASSWORD&gt;</pre><ul><li><strong>Build and Push Docker image to a Docker registry</strong></li></ul><pre>mvn clean install -Ddockerfile.username=&lt;USERNAME&gt; -Ddockerfile.password=&lt;PASSWORD&gt;</pre><h3>Applying secure-vault to WSO2 Micro Integrator Containers</h3><p>WSO2 Enterprise Integrator uses <a href="https://ei.docs.wso2.com/en/latest/micro-integrator/setup/security/encrypting_plain_text/#in-server-configurations"><strong>Cipher-Tool</strong></a> (to mask sensitive information in server configurations) and <a href="https://ei.docs.wso2.com/en/latest/micro-integrator/setup/security/encrypting_plain_text/#in-synapse-configurations"><strong>Secure-Vault</strong></a> (to mask sensitive information in Synapse configurations) implementations for more secured integration solutions with sensitive data. However, in previous versions of the WSO2 Integration Studio, we had to follow multiple steps to enable these implementations in a Docker image with the Docker exporter module. But from the Integration Studio 7.1.0 release onwards, in order to encrypt sensitive information, we can follow the below easy steps to achieve the requirement.</p><ol><li>Define the secrets inside the <strong>deployment.toml</strong> file which is located in the Docker exporter module as follows.</li></ol><pre>....</pre><pre>[truststore]<br># refer secret as a server configuration value             <br>password = &quot;$secret{truststore_password}&quot;</pre><pre>[secrets] <br>truststore_password = &quot;[wso2carbon]&quot; <br>runtime_secret = &quot;[secret]&quot;</pre><pre>...</pre><p>You can refer the above <strong>runtime_secret</strong> alias inside the Synapse configuration by using the <strong>vault-lookup</strong> function ({wso2:vault-lookup(&#39;alias&#39;)) as shown below.</p><pre>&lt;<strong>log</strong> level=&quot;custom&quot;&gt;   <br>   &lt;<strong>property</strong> expression=&quot;wso2:vault-lookup(&#39;runtime_secret&#39;)&quot; name=&quot;secret&quot;/&gt; <br>&lt;/<strong>log</strong>&gt;</pre><p>2. Select the “<strong>Enable Cipher Tool</strong>” option in the Docker Exporter’s POM file (underneath, this option encrypts all the secrets defined in the TOML file and generates required files to enable security for the MI while the Docker build).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EsYhSWFfkdx5rJZ_tMtsyQ.png" /><figcaption>Enabling Cipher Tool option</figcaption></figure><p>3. Change the default secure vault configurations inside the Docker exporter’s POM file via the source view if needed.</p><pre>....<br>&lt;properties&gt;<br>   &lt;keystore.type&gt;JKS&lt;/keystore.type<br>   &lt;keystore.password&gt;wso2carbon&lt;/keystore.password&gt;<br>   &lt;ciphertool.enable&gt;true&lt;/ciphertool.enable<br>   &lt;keystore.alias&gt;wso2carbon&lt;/keystore.alias<br>   &lt;keystore.name&gt;wso2carbon.jks&lt;/keystore.name&gt;<br>&lt;/properties&gt;<br>....</pre><p>4. Build the Docker image.</p><p>As a summary, we discussed how and why WSO2 Micro Integrator suits to the containerized architectures and later discussed WOW facts of generating immutable Docker images with WSO2 Integration Studio. Hope everything in this article makes sense for your development with containerized WSO2 Micro Integrator. If you have any questions, comment below. Cheers! 🍻</p><h3><strong>Resources</strong></h3><ul><li><a href="https://wso2.com/integration/?utm_source=medium&amp;utm_medium=blogs&amp;utm_campaign=think_integration">WSO2 Enterprise Integrator</a></li><li><a href="https://wso2.com/integration/integration-studio/?utm_source=medium&amp;utm_medium=blogs&amp;utm_campaign=think_integration">WSO2 Integration Studio</a></li><li><a href="https://ei.docs.wso2.com/en/latest/micro-integrator/setup/installation/run_in_containers/">Page not found - WSO2 Enterprise Integrator Documentation</a></li><li><a href="https://wso2.com/integration/micro-integrator/?utm_source=medium&amp;utm_medium=blogs&amp;utm_campaign=think_integration">Micro Integrator</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b89c842a3f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/think-integration/the-what-why-and-wow-behind-the-wso2-micro-integrator-containers-b89c842a3f">The What, Why and Wow behind the WSO2 Micro Integrator Containers</a> was originally published in <a href="https://medium.com/think-integration">Think Integration</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Contribute | Write For Us]]></title>
            <link>https://medium.com/think-integration/contribute-write-for-us-c408f93dd060?source=rss-3d07b7bad46f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c408f93dd060</guid>
            <category><![CDATA[integration]]></category>
            <dc:creator><![CDATA[Sajitha Liyanage]]></dc:creator>
            <pubDate>Tue, 15 Sep 2020 09:46:40 GMT</pubDate>
            <atom:updated>2020-09-15T13:09:22.162Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*uwq4l_zP0UfYuZzpoX100g.jpeg" /></figure><p>If you are a passionate or professional Medium writer, You can apply to become a contributor and share your expertise with our wealthy and influential readers. We are always looking for great content to help integration developers who curious to learn new things every day.</p><h3>Ideas</h3><p><em>Here are a few ideas to get you started:</em></p><ul><li>Anything which you have learned, experienced or anything which you think can help for integration developers.</li><li>Tutorials on how to do something interesting with diagrams or source codes.</li><li>Trending topics, design patterns, or new technologies that are coupling with the integration domain.</li></ul><h3>Style Guide</h3><p><em>Instructions before you submit:</em></p><ul><li>Your Medium account should have your name, a bio, and a picture of you.</li><li>Your article should have a title, a subtitle, and a nice cover image.</li><li>Please remove all personal calls to action in your post such as “sign up for my newsletter” or “follow me on Twitter.”</li><li>At the bottom of your article, please include a <strong>Resources</strong> section with any links that you mentioned in your post for quick reference by the reader. GitHub repositories, JSFiddles, and gists are highly recommended.</li><li>Make sure the article read time is longer than two minutes.</li></ul><h3>Submission</h3><p><em>How to submit your story with us:</em></p><p>When your post is ready, reach out at eicontentteam@wso2.com with the<strong> following email template</strong>.</p><ul><li><strong><em>Email Subject</em></strong> - [Think_Integration] Title of the blog</li><li><strong><em>Email Body</em></strong> - <strong>Medium username</strong> (we need this in order to give you access), <strong>Link to a draft</strong> (Medium &amp; Google doc drafts are preferred. If submitting a Google doc, please allow access to anyone who has the link)</li></ul><p>We will review the content and provide any feedback if necessary. We will publish the draft as soon as it meets our publishing standards.</p><p><strong>Note: </strong>If you have already published a story with <strong>Think Integration</strong>, there’s no need to use the above criteria again. Just click the … menu in the top right of your Medium story, click “<strong>Add to Publication</strong>”, and we’ll get the notification and respond.</p><p><strong>We look forward to your submissions!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c408f93dd060" width="1" height="1" alt=""><hr><p><a href="https://medium.com/think-integration/contribute-write-for-us-c408f93dd060">Contribute | Write For Us</a> was originally published in <a href="https://medium.com/think-integration">Think Integration</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to write effective Unit Testing using WSO2 Integration Studio]]></title>
            <link>https://medium.com/think-integration/how-to-write-effective-unit-testing-using-wso2-integration-studio-5fa43ef0326c?source=rss-3d07b7bad46f------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fa43ef0326c</guid>
            <category><![CDATA[integration-studio]]></category>
            <category><![CDATA[unit-testing]]></category>
            <category><![CDATA[integration]]></category>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[wso2-ei]]></category>
            <dc:creator><![CDATA[Sajitha Liyanage]]></dc:creator>
            <pubDate>Mon, 06 Jan 2020 08:39:02 GMT</pubDate>
            <atom:updated>2020-09-18T10:11:01.839Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pCxV3_yoa2TJPZ02TSoNzQ.jpeg" /></figure><p>When the code executes smoothly, no one cares about testing it assuming their code is perfect and without any mistakes. So whenever the code breaks they have to put full effort to find out from where it breaks and why it breaks. It is not an easy task but very time-wasting and costly work.</p><p>Unit Testing is a great method that ensures the code is performing well as expected and it is an early bug-detection way which can be used for our development use cases in any kind of platforms.</p><p>With the latest 7.0.0 release of <a href="https://wso2.com/integration/integration-studio/">WSO2 Integration Studio</a>, we have introduced one of the brand new features; <strong>Unit Testing</strong> to the Integration Studio tooling to enhance the developer experience by letting them test the integration solutions within minutes. By this feature, users will be able to create new unit test suites for the following ESB artifacts,</p><ul><li><strong><em>REST APIs</em></strong></li><li><strong><em>Proxy Services</em></strong></li><li><strong><em>Sequences</em></strong></li></ul><p>This unit test suite includes multiple test cases that assert the actual payloads and properties with the expected values. Finally, a detailed summary of the unit test suites will be shown in the tooling console which can be useful when troubleshooting the integration flows.</p><p>This article is a step by step guide on how to write effective unit testing for your integration flows using the WSO2 Integration Studio in minutes. Here, I am going to use <strong>Content-Based Routing</strong> example to demonstrate the flow of the unit testing. You can find this template on the <em>Getting Started</em> welcome page in the Integration Studio.</p><h3>01. Create an Integration Solution</h3><p>When you start the WSO2 Integration Studio tooling, you will be first directed to the <em>Getting Started</em> welcome page. Then select the Content-Based Routing template from the set of templates in the welcome page and create a new project named “<strong><em>ContentBasedRoutingApplication</em></strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wW-i8qHv3hxKJdDMR06ryA.gif" /><figcaption>Create a new template project in WSO2 Integration Studio</figcaption></figure><p>Once the project is created, you can find the relevant proxy-service and endpoint artifacts inside the project <strong>src</strong> directory in the workspace of the Project Explorer. <strong>Wait! Wait!</strong> <strong>Did you see it?</strong> Now there is a new directory called <strong>test</strong> parallel to the <strong>src</strong> directory that holds the unit test suites of the project artifacts. 😎</p><h3>02. Create a new Unit Test Suite</h3><p>You can simply right-click on the <strong>test</strong> directory and navigate to the <strong>New</strong> and click on the <strong>Unit Test Suite</strong> option as shown below. It will fire up the unit test suite creation wizard for you. Alternatively, you can create a new unit test suite by <strong><em>Right click</em></strong> <strong><em>→ New</em></strong> on the relevant API, proxy-service, or sequence file which is located inside the <strong><em>&lt;Project&gt;→ src → main → synapse-config </em></strong>file path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qbUP9Us34BxFWSBdotLj9A.png" /><figcaption>Create a new Unit Test Suite</figcaption></figure><h4>Step 01: Select a creation method for Unit Test Suite</h4><p>In this page, you can select which way you want to create a unit test suite either by importing or creating a new one. In this example, I’m going to select the <strong>Create a New Unit Test Suite </strong>option to proceed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vH5iOmZdewfLQHMx9th_XA.png" /><figcaption>Creation method of Unit Test Suite</figcaption></figure><h4>Step 02: Select the Main Artifact file to test</h4><p>In this page, you can provide a name for the unit test suite and select the main configuration artifact file from the tree-based file list. This list will show you all the API, Proxy-service, and Sequence artifact file which are available in the tooling workspace. Once you are done, click <strong>Next.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E81EL-X0lcCF6OmleF9e3A.png" /><figcaption>Select Test Artifact which wants to test</figcaption></figure><h4>Step 03: Select Supportive Artifact files</h4><p>This page will let you select the supportive artifacts which are used in the main artifact file selected in the previous step. Here, you can select multiple artifacts/resources such as configuration files, registry resources, connectors, etc. from this view. In this example, I have selected two endpoints which are using inside the content-based routing proxy-service. Once you are done, click <strong>Next.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*as_rM6LXenB8BEG-OYo7JA.png" /><figcaption>Select supportive artifacts for the Test artifact</figcaption></figure><h4>Step 04: Select Mock Services</h4><p>In order to mock the actual endpoints, you can select multiple mock service files that can be created using the following method.</p><p><strong><em>Right-click on the Test folder</em></strong> <strong><em>→ New → Mock Service</em></strong></p><p>If you haven’t created any mock services yet, you can click the <strong>Create a New Mock Service</strong> link in this page and create a new mock service for you (For this example, I’m not using any mock services). After that click <strong><em>Finish</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7pKrArFqtin-QTmI-Zq3cQ.png" /><figcaption>Select Mock services or create a new Mock Service for an endpoint</figcaption></figure><p>You can find out the created unit test suite under the <strong>test</strong> directory of the selected project.</p><h3>03. Add Test Cases to the created Unit Test Suite</h3><p>The Unit Test Suite is designed with three main sections. <strong>Test Artifact, Test Cases and Assertion Details </strong>section, <strong>Supportive Artifacts</strong> section, and <strong>Mock Services</strong> section. Also, we can switch between the design and source views to view and modify the unit test suite. In the design view, press <strong>➕</strong> button under the <strong>Test Artifact, Test Cases and Assertion Details </strong>section to add a new test case to the unit test suite. It will fire up the <strong>Add Test Cases</strong> wizard page for you. First, a valid enter a name for the test case for the ease of identification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qxjm6bM3flogTrt-pXKtyQ.gif" /><figcaption>Add a new Test Case for the Unit Test Suite</figcaption></figure><h4>Step 01: Insert Input Payload and Properties</h4><p>In this section, you can insert the <em>Input Payload</em> and <em>Input Properties</em> (these two fields are optional) which will be used as inputs in the mediation flow. Here, Input Payload can be a type of <strong>JSON, XML</strong>, or <strong>plain text</strong>.</p><p>In this example, I have inserted the following XML payload as the input payload.</p><pre>&lt;ArithmaticOperation&gt;    <br>    &lt;Operation&gt;Add&lt;/Operation&gt;    <br>    &lt;Arg1&gt;10&lt;/Arg1&gt;    <br>    &lt;Arg2&gt;25&lt;/Arg2&gt;<br>&lt;/ArithmaticOperation&gt;</pre><p>Considering the Input Properties, there are three types of properties allowed in the Unit Test Suites to be tested. They are <strong>Synapse($ctx)</strong>, <strong>Axis2($axis2),</strong> and <strong>Transport($trp)</strong> properties. For the sequences, the test suite allows you to add all the above types of properties with the values. For the APIs and Proxy-services, it only allows you to add transport properties.</p><p>Press ➕ button to add a new input property to the test case. It will popup a new wizard page as shown below to collect the data about the Input Property. In this example, it needs an input transport property as follows.</p><ul><li>Property Scope <strong><em>→ Transport</em></strong></li><li>Property Name <strong><em>→ Content-Type</em></strong></li><li>Property Value <strong><em>→ application/xml</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LItN7ii4loiOhnrhzg1NbQ.gif" /><figcaption>Add input properties to the test case</figcaption></figure><blockquote><strong>Note:</strong> If you are creating a test case for the APIs, you can see extra two compulsory fields as <strong>Request Path </strong>and<strong> Request Method </strong>in the above section. Request Path indicates the URL-mapping of the API resource and Request Method indicates the REST method type of the resource.</blockquote><h4>Step 02: Add Assertion Details</h4><p>In this section, you can add multiple assertions to the test case. To the ease of differentiation, we have defined two assertion types for a test case; <strong>AssertEquals</strong> and <strong>AssertNotNull</strong>. <em>AssertEquals</em> checks whether the equality of the mediated result and the expected value whereas <em>AssertNotNull</em> checks whether the mediated result is not null. Press ➕ button to add a new assertion data to the test case. It will popup a new wizard page as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UBmNHHuhDYJj4luqysRPhg.png" /><figcaption>Add an assertion to the test case</figcaption></figure><p><strong>Note: </strong>Please find the assertion input label descriptions below.</p><ul><li><strong>Assertion Type</strong>: Type of the assertion.</li><li><strong>Actual Expression</strong>: Expression that you want to assert.</li></ul><p>▹ <strong>$body</strong>: assert the payload</p><p>▹ <strong>$ctx:</strong>: assert synapse property</p><p>▹ <strong>$axis2:</strong>: assert axis2 property</p><p>▹ <strong>$trp:</strong>: assert transport property</p><p>▹ <strong>$statusCode</strong>: assert status code of the service</p><p>▹ <strong>$httpVersion</strong>: assert http version of the service</p><ul><li><strong>Expected Value</strong>: Expected value for the actual expression. Type can be a <strong>JSON</strong>, <strong>XML</strong> or a <strong>plain text</strong>.</li><li><strong>Error Message</strong>: Error message to print when the assertion is failed.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4194be43bc8acfc82439632f077f17a3/href">https://medium.com/media/4194be43bc8acfc82439632f077f17a3/href</a></iframe><p>Click <strong><em>Add</em></strong><em>, o</em>nce you have added at least one assertion required details and then <strong>save</strong> the unit test suite. Additionally, you can refer the source view to get more idea about how the unit test suite syntaxes generated through the above steps.</p><h3>04. Run Unit Test Suites</h3><p>You can run the created Unit Test Suites using embedded Unit Testing Server in the Micro Integrator runtime packed inside the WSO2 Integration Studio. Simply, you can right-click on the <strong>test</strong> directory and click on <strong>Run Unit Test </strong>to run all the unit test suites at once. Or else, right-click on the particular unit test suite and click on <strong>Run Unit Test </strong>to run only that unit test suite alone.</p><p>Once you click the <strong>Run Unit Test</strong>, you will get a <strong>Run Configuration</strong> popup as follows. Here, you can decide whether to run the unit test suites in the <strong>Local Server</strong> mode or <strong>Remote Server</strong> mode. By default, Local Server mode is chosen here to run with the embedded server in WSO2 Integration Studio.</p><blockquote><strong>Note:</strong> If you select<strong> Remote Server </strong>option,<strong> before you begin</strong> be sure that your remote Micro Integrator is started along with its Unit Testing server. Note that you need to pass the -DsynapseTest property with your product startup script as shown below. This property is required for starting the Unit Testing server.</blockquote><blockquote><strong>On MacOS/Linux/CentOS</strong></blockquote><blockquote>sh micro-integrator.sh -DsynapseTest</blockquote><blockquote><strong>On Windows</strong></blockquote><blockquote>micro-integrator.bat -DsynapseTest</blockquote><blockquote>To change starting port of the unit testing server, you can use -DsynapseTestPort=&lt;PORT&gt; system property with above command. The default port is 9008.</blockquote><p>Then click <strong><em>Run, </em></strong>once you have filled the required field such as <strong>Unit Test Port, Server Execution Path </strong>etc<em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EGDp1WoWWJ2YHwwgsGp8dw.gif" /><figcaption>Running the created Unit Test Suite</figcaption></figure><p>After that, you will see the testing server starting logs in the tooling console and it will print the summary for the given unit test suite using the response from the testing server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*57lEzmwR077UxbUIDMXFLw.png" /><figcaption>Console output of the run Unit Test Suite (Successful)</figcaption></figure><p>See how easy to do the unit testing now in the Integration Studio. That’s it! Now you have successfully tested an integration solution in WSO2 Integration Studio. 😎</p><p>Now let’s try this unit test with false data that makes the assertion phase failed and see how the unit test server responds. In the previous test case, I have set 35 as the expected value for the addition of 15 and 25. Let’s update it as 40 and see.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GyOpTKvKuMi62n8St20B8w.png" /><figcaption>Console output of the run Unit Test Suite (Failure)</figcaption></figure><p>See how smart it is. Here the Unit Test Report shows in which phase it has failed and what is the reason for the failure. From EI 7.0.0 onwards, you can use this feature to test your integration solutions in a quicker and easier way using WSO2 Integration Studio. Hope everything in this article helps you to discover how the Unit Testing works in Integration Studio. If you have any questions, comment below. Cheers! 🍻</p><h3>Useful Links</h3><ul><li><a href="https://ei.docs.wso2.com/en/latest/micro-integrator/develop/creating-unit-test-suite/">Creating a Unit Test Suite - WSO2 Enterprise Integrator Documentation</a></li><li><a href="https://wso2.com/integration/?utm_source=medium&amp;utm_medium=blogs&amp;utm_campaign=think_integration">WSO2 Enterprise Integrator</a></li><li><a href="https://wso2.com/integration/integration-studio/?utm_source=medium&amp;utm_medium=blogs&amp;utm_campaign=think_integration">WSO2 Integration Studio</a></li><li><a href="https://ei.docs.wso2.com/en/latest/micro-integrator/develop/intro-integration-development/">Developing Integration Solutions - WSO2 Enterprise Integrator Documentation</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fa43ef0326c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/think-integration/how-to-write-effective-unit-testing-using-wso2-integration-studio-5fa43ef0326c">How to write effective Unit Testing using WSO2 Integration Studio</a> was originally published in <a href="https://medium.com/think-integration">Think Integration</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s start Integration with WSO2-EI]]></title>
            <link>https://sajithaliyanage.medium.com/lets-start-integration-with-wso2-ei-c767d4dd996a?source=rss-3d07b7bad46f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c767d4dd996a</guid>
            <category><![CDATA[enterprise-integration]]></category>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[wso2-ei]]></category>
            <category><![CDATA[integration]]></category>
            <dc:creator><![CDATA[Sajitha Liyanage]]></dc:creator>
            <pubDate>Sun, 24 Mar 2019 13:59:56 GMT</pubDate>
            <atom:updated>2019-03-24T14:04:09.084Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RWlij-jM97mrocB9sTJ-yQ.png" /></figure><h3>What is Software Integration and Why?</h3><p>Nowadays integration is very useful for enterprises to simplify a very complex functionality into a tiny one. When considering the definition of <strong>Software Integration,</strong> it is the process of connecting/integrating different sub-systems, modules, services or components into a single larger system that functions as one unit. The main benefit of using software integration is organisations can speed-up their applications in runtime and can reduce the operational costs and maintenance cost of the applications. More than this, Integration gives the ability to connect legacy systems with new age application and it is very useful for maintaining the code quality and multi-functionality within the applications.</p><h3>WSO2 Enterprise-Integrator</h3><p>WSO2 Enterprise-Integrator is a fully open source java based product for the cloud-native and container-native projects which is core to the WSO2 Integration Agile Platform. Currently, it is one of the most popular Integration product using in enterprises and it implemented by <a href="https://wso2.com/">WSO2</a>. Following are the benefits of using WSO2 Enterprise-Integrator for your enterprise applications.</p><ul><li>A unified platform with fully open source and container-native, cloud-native capabilities — Lowers technology implementation risk</li><li>Supports complex integration scenarios — implemented easily and rapidly, speeding large projects</li><li>Sophisticated tooling and small footprint — speeds development cycles and flexibility</li><li>Business processes modelling capabilities — help deploy and manage flows of activity within service-based architectures</li><li>Deploy anywhere; Have the flexibility to deploy on-premise, use the public cloud, or both. Easily migrate in between this environments.- saves money and time via better resource utilization.</li></ul><p>Source- <a href="https://wso2.com/integration/">WSO2 ENTERPRISE INTEGRATOR</a></p><p>WSO2 EI is a package of the following components. That is why you can use this product as a solution for your many businesses activities. The main components follow,</p><ol><li><strong>Enterprise Service Bus</strong></li></ol><p>This is a standards-based messaging engine that provides the value of messaging without writing code. It provides data integration capabilities, eliminating the need to use a separate data services server for your integration processes. Includes functionalities of WSO2 Data Services Server and WSO2 App Server. <a href="https://wso2.com/products/enterprise-service-bus/">Read More…</a></p><p>2.<strong> Business Processes</strong></p><p>This helps to increase productivity and enhance competitiveness by enabling developers to easily deploy business processes and models written using Web Services Business Process Execution Language (WS-BPEL) and Business Process Model and Notation (BPMN) standards respectively. <a href="https://wso2.com/products/business-process-server/">Read More…</a></p><p>3.<strong> Message Broker</strong></p><p>This is a lightweight, easy-to-use, distributed message-brokering server. It features high availability (HA) support with a complete hot-to-hot continuous availability mode, the ability to scale up to several servers in a cluster, and no single point of failure. <a href="https://wso2.com/products/message-broker/">Read More…</a></p><p>4. <strong>Analytics</strong></p><p>This will useful for tracking the runtime activities, performance and mediation flow and more of WSO2 Enterprise Integrator.</p><p>You can get more information about WSO2 Enterprise Integrator from these Reads. <a href="https://wso2.com/library/articles/2017/07/what-is-wso2-esb/">ReadOne</a> and <a href="https://wso2.com/blogs/thesource/2017/02/enterprise-integrator-release-note/">ReadTwo</a>.</p><h3>How to use WSO2 EI?</h3><p>Yeah. There are few easy steps to follow to get started with WSO2 Enterprise Integrator.</p><p><strong>Step One</strong> — Go to the WSO2 EI page and press the download button.</p><p><strong>Step Two</strong> — You can select the download method whatever you like from it.</p><p><strong>Step Three</strong> — Navigate to the product’s bin folder and execute the following code.</p><pre>bin/sh integrator.sh</pre><p>Else you can go to the source of <strong>product-ei </strong>located in Github WSO2 organisation and get it.</p><p><strong>Step One </strong>— Navigate to the WSO2 <a href="https://github.com/wso2/product-ei">product-ei</a> repo</p><p><strong>Step Two</strong> — Clone the repo using the git command</p><pre>git clone <a href="https://github.com/wso2/product-ei.git">https://github.com/wso2/product-ei.git</a></pre><p><strong>Step Three </strong>— Execute the following code to build the product. (Need maven build automation tool for this)</p><pre>mvn clean install</pre><p><strong>Step Four </strong>— Navigate to the distribution/target folder and find the product-ei package.</p><p>I think now you have some knowledge about what is meant by software integration, why it is important and why I suggest WSO2 EI for your integration works. I will explain how to use WSO2 EI for your application with some examples and features of WSO2 EI in further articles. Till then if you still not tried WSO2 EI for your applications, just visit the official site and try it. Because it is 100% open source and free.</p><p>See you on the next article.</p><p>Stay tuned :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c767d4dd996a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GSoC 2018 Journey with SCoRe Lab — EPI 4]]></title>
            <link>https://sajithaliyanage.medium.com/gsoc-2018-journey-with-score-lab-epi-4-ba85c6272c8e?source=rss-3d07b7bad46f------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba85c6272c8e</guid>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[gsoc-2018]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Sajitha Liyanage]]></dc:creator>
            <pubDate>Thu, 02 Aug 2018 15:15:33 GMT</pubDate>
            <atom:updated>2018-08-02T15:15:33.404Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi all, In previous EPI I have explained you how I created separate modules with routes to deal with different URLs.</p><p><a href="https://medium.com/@sajithaliyanage/gsoc-2018-journey-with-score-lab-epi-3-ce0e87f94793"><strong>Previous EPI</strong></a></p><p>To integrate firebase to application, I have created a user account in Firebase console. Then I have enabled <strong>Email/Password</strong> provider in SIGN-IN METHOD. There are more sign in method features provided by firebase and if you want to integrate those, such as Facebook, Gmail just click enable button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zSxKIB8b4dqL6YJyrJfmDw.jpeg" /><figcaption>choose Email/Password provider</figcaption></figure><p>Next, we can find our configuration in the project settings on our dashboard. There have access to all the necessary information: secrets, keys, ids and other properties. It needs to next step in ChainKeeper React application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mtP9d9_5ZqEa1qOWhy7dAw.jpeg" /></figure><p>Then I have created seperate folder to maintain the firebase codes. in that folder I have created 3 files index.js (simple entry point file to the Firebase module), firebase.js (all the configuration goes there)and auth.js ( Firebase authentication API will be defined to sign up, sign in, sign out etc.) files.</p><p>To setup the firebase configurations I have update the firebase.js file as follows,</p><pre><strong>import </strong>* <strong>as </strong>firebase  <strong>from </strong>&#39;firebase&#39;;<br><br><strong>const </strong>config = {<br>  apiKey: YOUR_API_KEY,<br>  authDomain: YOUR_AUTH_DOMAIN,<br>  databaseURL: YOUR_DATABASE_URL,<br>  projectId: YOUR_PROJECT_ID,<br>  storageBucket: &#39;&#39;,<br>  messagingSenderId: YOUR_MESSAGING_SENDER_ID,<br>};<br><br><strong>if </strong>(!firebase.<em>apps</em>.length) {<br>  firebase.initializeApp(config);<br>}<br><br><strong>const </strong>auth = firebase.auth();<br><strong>const </strong>googleProvider = <strong>new </strong>firebase.auth.GoogleAuthProvider();<br><br><strong>export default </strong>firebase;<br><strong>const </strong>database = firebase.database();<br><strong>export </strong>{<br>  auth,<br>  googleProvider,<br>  database,<br>};</pre><p>Then I have updated the index.js file as follows,</p><pre><strong>import </strong>* <strong>as </strong>auth <strong>from </strong>&#39;./auth&#39;;<br><strong>import </strong>* <strong>as </strong>firebase <strong>from </strong>&#39;./firebase&#39;;<br><strong>import </strong>* <strong>as </strong>db <strong>from </strong>&#39;./db&#39;;<br><br><strong>export </strong>{<br>  auth,<br>  db,<br>  firebase,<br>};</pre><p>Then I have implemented firebase APIs in auth.js file for different services.</p><pre><strong>import </strong>{ auth } <strong>from </strong>&#39;./firebase&#39;;<br><br>// Sign Up<br><strong>export const </strong>doCreateUserWithEmailAndPassword = (email, password) =&gt;<br>  auth.createUserWithEmailAndPassword(email, password);<br><br>// Sign In<br><strong>export const </strong>doSignInWithEmailAndPassword = (email, password) =&gt;<br>  auth.signInWithEmailAndPassword(email, password);<br><br>// Sign out<br><strong>export const </strong>doSignOut = () =&gt;<br>  auth.signOut();<br><br>// Password Reset<br><strong>export const </strong>doPasswordReset = (email) =&gt;<br>  auth.sendPasswordResetEmail(email);<br><br>// Password Change<br><strong>export const </strong>doPasswordUpdate = (password) =&gt;<br>  auth.currentUser.updatePassword(password);</pre><p>So now we have done the hard part in the application. Now we remain thing is the connect out front end with these firebase APIs. Now lets see it.</p><p><strong>Sign-Up Component</strong></p><p>In signup component, I used for main fields from user when sign up. Username,email, passwordOne, passwordTwo. Here is the updated code of the signup component.</p><pre><strong>import </strong>React, { Component } <strong>from </strong>&#39;react&#39;;<br><strong>import </strong>{ Link,withRouter, } <strong>from </strong>&#39;react-router-dom&#39;;<br><br><strong>import </strong>* <strong>as </strong>routes <strong>from </strong>&#39;../constants/routes&#39;;<br><strong>import </strong>{ auth, db } <strong>from </strong>&#39;../firebase&#39;;<br><strong>import </strong>LoginwithGoogle <strong>from </strong>&#39;./LoginwithGoogle&#39;;<br><br><strong>const </strong>INITIAL_STATE = {<br>  username:&#39;&#39;,<br>  email: &#39;&#39;,<br>  passwordOne: &#39;&#39;,<br>  passwordTwo: &#39;&#39;,<br>  error: <strong>null</strong>,<br>};<br><br><strong>const </strong>SignUpPage = ({ history }) =&gt;<br>  &lt;div&gt;<br>    &lt;SignUpForm history={history} /&gt;<br>  &lt;/div&gt;<br><br><strong>const </strong>byPropKey = (propertyName, value) =&gt; () =&gt; ({<br>  [propertyName]: value,<br>});<br><br><strong>class </strong>SignUpForm <strong>extends </strong>Component {<br>  constructor(props) {<br>    <strong>super</strong>(props);<br><br>    <strong>this</strong>.state = { ...INITIAL_STATE };<br>  }<br><br>  onSubmit = (event) =&gt; {<br>    <strong>const </strong>{<br>      username,<br>      email,<br>      passwordOne,<br>    } = <strong>this</strong>.state;<br><br>    <strong>const </strong>{<br>      history,<br>    } = <strong>this</strong>.props;<br><br>    auth.doCreateUserWithEmailAndPassword(email, passwordOne)<br>      .then(authUser =&gt; {<br>         // Create a user in your own accessible Firebase Database too<br>         db.doCreateUser(authUser.uid, username, email)<br>          .then(() =&gt; {<br>            <strong>this</strong>.setState(() =&gt; ({ ...INITIAL_STATE }));<br>            history.push(routes.LANDING);<br>          })<br>          .catch(error =&gt; {<br>            <strong>this</strong>.setState(byPropKey(&#39;error&#39;, error));<br>          });<br>      })<br>      .catch(error =&gt; {<br>        <strong>this</strong>.setState(byPropKey(&#39;error&#39;, error));<br>      });<br><br>    event.preventDefault();<br>  }<br><br><br>  render() {<br>    <strong>const </strong>{<br>      username,<br>      email,<br>      passwordOne,<br>      passwordTwo,<br>      error,<br>    } = <strong>this</strong>.state;<br><br>     <strong>const </strong>isInvalid =<br>      passwordOne !== passwordTwo ||<br>      passwordOne === &#39;&#39; ||<br>      email === &#39;&#39; ||<br>      username === &#39;&#39;;<br><br>    <strong>return </strong>(<br>           &lt;div className=&quot;limiter main-back&quot;&gt;<br>                &lt;div className=&quot;container-login100 back-login&quot;&gt;<br>                    &lt;div className=&quot;wrap-login100&quot;&gt;<br>                        &lt;form className=&quot;login100-form validate-form&quot; onSubmit={<strong>this</strong>.onSubmit}&gt;<br>                            &lt;span className=&quot;login100-form-title p-b-1&quot; style={{marginTop:&quot;-40px&quot;,color:&#39;#52595b&#39;, fontSize:&#39;16px&#39;,fontFamily: &#39;Poppins-Regular&#39;}}&gt;<br>                                Welcome to the<br>                            &lt;/span&gt;<br>                            &lt;span className=&quot;login100-form-title p-b-48&quot;&gt;<br>                                &lt;img src={require(&#39;../../public/images/l.jpeg&#39;)} style={{width:&#39;240px&#39;}} alt=&quot;true&quot; /&gt;<br>                            &lt;/span&gt;<br><br>                            &lt;div className=&quot;wrap-input100 validate-input&quot;&gt;<br>                                &lt;input<br>                                  value={username}<br>                                  onChange={event =&gt; <strong>this</strong>.setState(byPropKey(&#39;username&#39;, event.target.value))}<br>                                  type=&quot;text&quot;<br>                                  className=&quot;input100&quot;<br>                                  placeholder=&quot;Enter Name&quot;<br>                                /&gt;<br>                            &lt;/div&gt;<br><br>                            &lt;div className=&quot;wrap-input100 validate-input&quot;&gt;<br>                                &lt;input<br>                                  value={email}<br>                                  onChange={event =&gt; <strong>this</strong>.setState(byPropKey(&#39;email&#39;, event.target.value))}<br>                                  type=&quot;email&quot;<br>                                  className=&quot;input100&quot;<br>                                  placeholder=&quot;Email Address&quot;<br>                                /&gt;<br>                            &lt;/div&gt;<br><br>                            &lt;div className=&quot;wrap-input100 validate-input&quot;&gt;<br>                                &lt;span className=&quot;btn-show-pass&quot;&gt;<br>                                    &lt;i className=&quot;zmdi zmdi-eye&quot; /&gt;<br>                                &lt;/span&gt;<br>                                 &lt;input<br>                                  value={passwordOne}<br>                                  onChange={event =&gt; <strong>this</strong>.setState(byPropKey(&#39;passwordOne&#39;, event.target.value))}<br>                                  type=&quot;password&quot;<br>                                  className=&quot;input100&quot;<br>                                  placeholder=&quot;Password&quot;<br>                                /&gt;<br>                            &lt;/div&gt;<br><br>                            &lt;div className=&quot;wrap-input100 validate-input&quot;&gt;<br>                                &lt;span className=&quot;btn-show-pass&quot;&gt;<br>                                    &lt;i className=&quot;zmdi zmdi-eye&quot; /&gt;<br>                                &lt;/span&gt;<br>                                &lt;input<br>                                  value={passwordTwo}<br>                                  onChange={event =&gt; <strong>this</strong>.setState(byPropKey(&#39;passwordTwo&#39;, event.target.value))}<br>                                  type=&quot;password&quot;<br>                                  className=&quot;input100&quot;<br>                                  placeholder=&quot;Confirm Password&quot;<br>                                /&gt;<br>                            &lt;/div&gt;<br><br>                            &lt;div className=&quot;container-login100-form-btn&quot;&gt;<br>                                &lt;div className=&quot;wrap-login100-form-btn&quot;&gt;<br>                                    &lt;div className=&quot;login100-form-bgbtn&quot;/&gt;<br>                                    &lt;button className=&quot;login100-form-btn&quot; disabled={isInvalid} type=&quot;submit&quot;&gt;<br>                                      Sign Up<br>                                    &lt;/button&gt;<br>                                &lt;/div&gt;<br>                            &lt;/div&gt;<br><br>                             &lt;div className=&quot;text-center p-t-10&quot;&gt;<br>                                &lt;span className=&quot;txt1&quot;&gt;<br>                                     { error &amp;&amp; &lt;p style={{color:&#39;#aa1d1d&#39;}}&gt;{error.message}&lt;/p&gt; }<br>                                &lt;/span&gt;<br>                            &lt;/div&gt;<br><br>                            &lt;div className=&quot;text-center p-t-15&quot;&gt;<br>                                &lt;span className=&quot;txt1&quot;&gt;<br>                                    &lt;p&gt;<br>                                     Have an account?<br>                                     {&#39; &#39;}<br>                                     &lt;Link to={routes.SIGN_IN}&gt;&lt;b&gt;Sign In&lt;/b&gt;&lt;/Link&gt;<br>                                    &lt;/p&gt;<br>                                &lt;/span&gt;<br>                            &lt;/div&gt;<br><br>                            &lt;hr /&gt;<br>                            &lt;div className=&quot;text-center p-t-15&quot;&gt;<br>                                &lt;span className=&quot;txt1&quot;&gt;<br>                                    &lt;LoginwithGoogle /&gt;<br>                                &lt;/span&gt;<br>                            &lt;/div&gt;<br><br>                        &lt;/form&gt;<br>                    &lt;/div&gt;<br>                &lt;/div&gt;<br>            &lt;/div&gt;<br>    );<br>  }<br>}<br><br><strong>const </strong>SignUpLink = () =&gt;<br>  &lt;p&gt;<br>    Don&#39;t have an account?<br>    {&#39; &#39;}<br>      &lt;Link to={routes.SIGN_UP}&gt;&lt;b&gt;Sign Up&lt;/b&gt;&lt;/Link&gt;<br>  &lt;/p&gt;<br><br><strong>export default </strong>withRouter(SignUpPage);<br><br><strong>export </strong>{<br>  SignUpForm,<br>  SignUpLink,<br>};</pre><p>I will explain this in simple way. In render part I have included my user interface part. When user submit the records with the signup form application automatically trigger the <strong>onSubmit</strong> function and it gets user entered fields. Then it passes all the records to the firebase API <em>auth.doCreateUserWithEmailAndPassword(email, passwordOne)</em> to create a new user.</p><p><strong>Sign-In Component</strong></p><p>In signin component, User needs to enter two fields when sign up as normal logins. Email, password. Here is the updated code of the signin component.</p><pre><strong>import </strong>React, { Component } <strong>from </strong>&#39;react&#39;;<br><strong>import </strong>{ withRouter } <strong>from </strong>&#39;react-router-dom&#39;;<br><br><strong>import </strong>{ SignUpLink } <strong>from </strong>&#39;./SignUp&#39;;<br><strong>import </strong>{ PasswordForgetLink } <strong>from </strong>&#39;./PasswordForget&#39;;<br><strong>import </strong>LoginwithGoogle <strong>from </strong>&#39;./LoginwithGoogle&#39;;<br><strong>import </strong>{ auth } <strong>from </strong>&#39;../firebase&#39;;<br><strong>import </strong>* <strong>as </strong>routes <strong>from </strong>&#39;../constants/routes&#39;;<br><br><strong>const </strong>SignInPage = ({ history }) =&gt;<br>  &lt;div&gt;<br>    &lt;SignInForm history={history} /&gt;<br>  &lt;/div&gt;<br><br><strong>const </strong>byPropKey = (propertyName, value) =&gt; () =&gt; ({<br>  [propertyName]: value,<br>});<br><br><strong>const </strong>INITIAL_STATE = {<br>  email: &#39;&#39;,<br>  password: &#39;&#39;,<br>  error: <strong>null</strong>,<br>};<br><br><strong>class </strong>SignInForm <strong>extends </strong>Component {<br>  constructor(props) {<br>    <strong>super</strong>(props);<br>    <strong>this</strong>.state = { ...INITIAL_STATE };<br>  }<br><br>  onSubmit = (event) =&gt; {<br>    <strong>const </strong>{<br>      email,<br>      password,<br>    } = <strong>this</strong>.state;<br><br>    <strong>const </strong>{<br>      history,<br>    } = <strong>this</strong>.props;<br><br>    auth.doSignInWithEmailAndPassword(email, password)<br>      .then(() =&gt; {<br>        <strong>this</strong>.setState(() =&gt; ({ ...INITIAL_STATE }));<br>        history.push(routes.LANDING);<br>      })<br>      .catch(error =&gt; {<br>        <strong>this</strong>.setState(byPropKey(&#39;error&#39;, error));<br>      });<br><br>    event.preventDefault();<br>  };<br><br>  render() {<br>    <strong>const </strong>{<br>      email,<br>      password,<br>      error,<br>    } = <strong>this</strong>.state;<br><br>    <strong>const </strong>isInvalid =<br>      password === &#39;&#39; ||<br>      email === &#39;&#39;;<br><br>    <strong>return </strong>(<br>            &lt;div className=&quot;limiter main-back&quot;&gt;<br>                &lt;div className=&quot;container-login100 back-login&quot;&gt;<br>                    &lt;div className=&quot;wrap-login100&quot;&gt;<br>                        &lt;form className=&quot;login100-form validate-form&quot; onSubmit={<strong>this</strong>.onSubmit}&gt;<br>                            &lt;span className=&quot;login100-form-title p-b-1&quot; style={{marginTop:&quot;-40px&quot;, color:&#39;#52595b&#39;, fontSize:&#39;16px&#39;,fontFamily: &#39;Poppins-Regular&#39;}}&gt;<br>                                Welcome to the<br>                            &lt;/span&gt;<br>                            &lt;span className=&quot;login100-form-title p-b-48&quot;&gt;<br>                                &lt;img src={require(&#39;../../public/images/l.jpeg&#39;)} style={{width:&#39;240px&#39;}} alt=&quot;true&quot; /&gt;<br>                            &lt;/span&gt;<br><br>                            &lt;div className=&quot;wrap-input100 validate-input&quot; data-validate=&quot;Valid email is: a@b.c&quot;&gt;<br>                                &lt;input<br>                                  value={email}<br>                                  onChange={event =&gt; <strong>this</strong>.setState(byPropKey(&#39;email&#39;, event.target.value))}<br>                                  type=&quot;text&quot;<br>                                  className=&quot;input100&quot;<br>                                  placeholder=&quot;Email&quot;<br>                                /&gt;<br>                            &lt;/div&gt;<br><br>                            &lt;div className=&quot;wrap-input100 validate-input&quot; data-validate=&quot;Enter password&quot;&gt;<br>                                &lt;span className=&quot;btn-show-pass&quot;&gt;<br>                                    &lt;i className=&quot;zmdi zmdi-eye&quot; /&gt;<br>                                &lt;/span&gt;<br>                                 &lt;input<br>                                  value={password}<br>                                  onChange={event =&gt; <strong>this</strong>.setState(byPropKey(&#39;password&#39;, event.target.value))}<br>                                  type=&quot;password&quot;<br>                                  className=&quot;input100&quot;<br>                                  placeholder=&quot;Password&quot;<br>                                /&gt;<br>                            &lt;/div&gt;<br><br>                            &lt;div className=&quot;container-login100-form-btn&quot;&gt;<br>                                &lt;div className=&quot;wrap-login100-form-btn&quot;&gt;<br>                                    &lt;div className=&quot;login100-form-bgbtn&quot;/&gt;<br>                                    &lt;button className=&quot;login100-form-btn&quot; disabled={isInvalid} type=&quot;submit&quot;&gt;<br>                                      Sign In<br>                                    &lt;/button&gt;<br>                                &lt;/div&gt;<br>                            &lt;/div&gt;<br><br><br>                             &lt;div className=&quot;text-center p-t-10&quot;&gt;<br>                                &lt;span className=&quot;txt1&quot;&gt;<br>                                     { error &amp;&amp; &lt;p style={{color:&#39;#aa1d1d&#39;}}&gt;{error.message}&lt;/p&gt; }<br>                                &lt;/span&gt;<br>                            &lt;/div&gt;<br><br>                            &lt;div className=&quot;text-center p-t-10&quot;&gt;<br>                                &lt;span className=&quot;txt1&quot;&gt;<br>                                     &lt;PasswordForgetLink /&gt;<br>                                &lt;/span&gt;<br>                            &lt;/div&gt;<br><br>                            &lt;div className=&quot;text-center p-t-15&quot;&gt;<br>                                &lt;span className=&quot;txt1&quot;&gt;<br>                                    &lt;SignUpLink /&gt;<br>                                &lt;/span&gt;<br>                            &lt;/div&gt;<br><br>                            &lt;hr /&gt;<br>                            &lt;div className=&quot;text-center p-t-15&quot;&gt;<br>                                &lt;span className=&quot;txt1&quot;&gt;<br>                                    &lt;LoginwithGoogle /&gt;<br>                                &lt;/span&gt;<br>                            &lt;/div&gt;<br><br>                        &lt;/form&gt;<br>                    &lt;/div&gt;<br>                &lt;/div&gt;<br>            &lt;/div&gt;<br>    );<br>  }<br>}<br><br><strong>export default </strong>withRouter(SignInPage);<br><br><strong>export </strong>{<br>  SignInForm,<br>};</pre><p>I will explain this in simple way. In render part I have included my user interface part. When user submit the records with the signin form application automatically trigger the <strong>onSubmit</strong> function and it gets user entered fields. Then it passes all the records to the firebase API auth.doSignInWithEmailAndPassword(email, password) to verify the user.</p><p><strong>Sign-Out Component</strong></p><p>Here is the sign out component.</p><pre><strong>import </strong>React <strong>from </strong>&#39;react&#39;;<br><br><strong>import </strong>{ auth } <strong>from </strong>&#39;../firebase&#39;;<br><br><strong>const </strong>SignOutButton = () =&gt;<br>  &lt;button<br>    type=&quot;button&quot;<br>    onClick={auth.doSignOut}<br>    style={{backgroundColor:&#39;transparent&#39;}}<br>  &gt;<br>    Sign Out<br>  &lt;/button&gt;<br><br><strong>export default </strong>SignOutButton;</pre><p>Here are the simple steps of creating Firebase + React authentication application, In this way I have achieved my authentication process. So that’s it.</p><p>So in ChainKeeper now we have strong authentication mechanism with firebase. In next article I will explain you a another feature of ChainKeeper <strong>Blockchain_REST_API</strong> with BlockSci. How it implemented and how it works.</p><p>Stay tuned! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba85c6272c8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GSoC 2018 Journey with SCoRe Lab — EPI 3]]></title>
            <link>https://sajithaliyanage.medium.com/gsoc-2018-journey-with-score-lab-epi-3-ce0e87f94793?source=rss-3d07b7bad46f------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce0e87f94793</guid>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[gsoc-2018]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Sajitha Liyanage]]></dc:creator>
            <pubDate>Thu, 02 Aug 2018 14:16:50 GMT</pubDate>
            <atom:updated>2018-08-02T14:16:50.115Z</atom:updated>
            <content:encoded><![CDATA[<p>As mentioned in previous article, here I’m going to explain how I achieved authentication mechanism in ChainKeeper using Firebase Real Time Database and React JS. Before that if you want to refer my previous blog you can check it with following link. :)</p><p><a href="https://medium.com/@sajithaliyanage/gsoc-2018-journey-with-score-lab-epi-2-d6cbd5371526"><strong>Previous EPI</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BE5Mbb8duCJv66Zu9Bun7Q.png" /></figure><p>Before going to implementation with firebase I have created several pages to maintain the modularity in the application. Therefore, let’s see the React Router first before diving into Firebase and the authentication afterward.</p><p>I have created separate “<em>src/constants/routes.js”</em> file to save constant paths.</p><pre>export const SIGN_UP = &#39;/signup&#39;;<br>export const SIGN_IN = &#39;/signin&#39;;<br>export const LANDING = &#39;/&#39;;<br>export const HOME = &#39;/home&#39;;<br>export const ACCOUNT = &#39;/account&#39;;<br>export const PASSWORD_FORGET = &#39;/pw-forget&#39;;</pre><p>Then I have created user interface for above routed functionalities. In this article I’m not going to explain how I created those using React JS. Because you can find tons of articles in Google how to do that ;) Then I have created common Navigation bar for the whole application using above create routes. Lets see how it did. For the Navigation bar I created a file called “ <em>src/components/Navigation.js</em>” file.</p><pre>import React from &#39;react&#39;;<br>import { Link } from &#39;react-router-dom&#39;;<br><br>import * as routes from &#39;../constants/routes&#39;;<br><br>const Navigation = () =&gt;<br>  &lt;div&gt;<br>    &lt;ul&gt;<br>      &lt;li&gt;&lt;Link to={routes.SIGN_IN}&gt;Sign In&lt;/Link&gt;&lt;/li&gt;<br>      &lt;li&gt;&lt;Link to={routes.LANDING}&gt;Landing&lt;/Link&gt;&lt;/li&gt;<br>      &lt;li&gt;&lt;Link to={routes.HOME}&gt;Home&lt;/Link&gt;&lt;/li&gt;<br>      &lt;li&gt;&lt;Link to={routes.ACCOUNT}&gt;Account&lt;/Link&gt;&lt;/li&gt;<br>    &lt;/ul&gt;<br>  &lt;/div&gt;<br><br>export default Navigation;</pre><p>Then I can specify which components should show up according to corresponding routes with the help of the Route component from React Router in our App component.</p><pre>import React from &#39;react&#39;;<br>import {<br>  BrowserRouter as Router,<br>  Route,<br>} from &#39;react-router-dom&#39;;<br><br>import Navigation from &#39;./Navigation&#39;;<br>import LandingPage from &#39;./Landing&#39;;<br>import SignUpPage from &#39;./SignUp&#39;;<br>import SignInPage from &#39;./SignIn&#39;;<br>import PasswordForgetPage from &#39;./PasswordForget&#39;;<br>import HomePage from &#39;./Home&#39;;<br>import AccountPage from &#39;./Account&#39;;<br><br>import * as routes from &#39;../constants/routes&#39;;<br><br>const App = () =&gt;<br>  &lt;Router&gt;<br>    &lt;div&gt;<br>      &lt;Navigation /&gt;<br><br>      &lt;hr/&gt;<br><br>      &lt;Route<br>        exact path={routes.LANDING}<br>        component={() =&gt; &lt;LandingPage /&gt;}<br>      /&gt;<br>      &lt;Route<br>        exact path={routes.SIGN_UP}<br>        component={() =&gt; &lt;SignUpPage /&gt;}<br>      /&gt;<br>      &lt;Route<br>        exact path={routes.SIGN_IN}<br>        component={() =&gt; &lt;SignInPage /&gt;}<br>      /&gt;<br>      &lt;Route<br>        exact path={routes.PASSWORD_FORGET}<br>        component={() =&gt; &lt;PasswordForgetPage /&gt;}<br>      /&gt;<br>      &lt;Route<br>        exact path={routes.HOME}<br>        component={() =&gt; &lt;HomePage /&gt;}<br>      /&gt;<br>      &lt;Route<br>        exact path={routes.ACCOUNT}<br>        component={() =&gt; &lt;AccountPage /&gt;}<br>      /&gt;<br>    &lt;/div&gt;<br>  &lt;/Router&gt;<br><br>export default App;</pre><p>So far I have created 2 main files called Routes.js (to declare constant routes) and Navigation.js file (to create a navigation bar with routes). Then I have updated my App.js component with specifying how the app need to react with different URLs.</p><p>Then I have created Landing page to ChainKeeper application as follows which is the page to redirect if the signup or sign in process complete.</p><pre>import React from &#39;react&#39;;<br><br>const LandingPage = () =&gt;<br>  &lt;div&gt;<br>    &lt;h1&gt;Landing Page&lt;/h1&gt;<br>  &lt;/div&gt;<br><br>export default LandingPage;</pre><p>As summary, I have created basic application with react ui and react routes. For next EPI I will explain how to get involve Firebase in React Setup.</p><p>Stay tuned :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce0e87f94793" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GSoC 2018 Journey with SCoRe Lab — EPI 2]]></title>
            <link>https://sajithaliyanage.medium.com/gsoc-2018-journey-with-score-lab-epi-2-d6cbd5371526?source=rss-3d07b7bad46f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6cbd5371526</guid>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[chainkeeper]]></category>
            <category><![CDATA[gsoc-2018]]></category>
            <category><![CDATA[scorelab]]></category>
            <dc:creator><![CDATA[Sajitha Liyanage]]></dc:creator>
            <pubDate>Mon, 28 May 2018 04:46:19 GMT</pubDate>
            <atom:updated>2018-05-28T04:46:19.448Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ci0YcdpKa5AoefHyFpae2w.jpeg" /></figure><p>In the previous article I have told you how much I excited to selected as a participant in GSoC 2018.</p><p><a href="https://medium.com/@sajithaliyanage/gsoc-2018-journey-with-score-lab-part-1-b6a71c046dd7"><strong>Previous EPI</strong></a></p><p>Here is the second article of my GSoC experiences with SCoRe Lab. This article is based on the project that I’m going to contribute in GSoC 2018. According to the GSoC calendar we are now in <strong>“Students Work on their Projects” </strong>stage. In Community Bonding period we need to be friendly with our organisation, with our mentors etc. As well as we need to get more information about our project during that period. So that I discussed about the project with my mentors and I gained lot of details within that period.</p><p>As discussed with mentors, my first project task is to get familiar with <strong>ReactJS</strong>. Because my whole project is based on ReactJS. <strong>ChainKeeper</strong> is the front-end of the BlockSci code base. I need to connect my project with BlockSci server to gives more user friendly experience for the BlockSci end-users. So I have started the development with ReactJS. I referred the ReactJS documentation to learn more technical stuffs in React. I have done some projects with AngularJS earlier. So React also similar to the Angular. Therefor I think now me have some confidence to code with ReactJS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ytMIcp6uu6UIZpApG1LFYg.png" /></figure><p>In ChainKeeper it needs the user authentication part. As discussed with mentors, I have added <strong>firebase</strong> user authentication model to ChainKeepr with user registration part and additionally social media authentications. Like Google Auth. In next article I will explain about the how I achieved connect authentications in Firebase for the ReactJS. Yes, It is very easy stuff. See you on next article.</p><p>Stay tuned :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6cbd5371526" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GSoC 2018 Journey with SCoRe Lab — EPI 1]]></title>
            <link>https://sajithaliyanage.medium.com/gsoc-2018-journey-with-score-lab-part-1-b6a71c046dd7?source=rss-3d07b7bad46f------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6a71c046dd7</guid>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[scorelab]]></category>
            <category><![CDATA[chainkeeper]]></category>
            <dc:creator><![CDATA[Sajitha Liyanage]]></dc:creator>
            <pubDate>Tue, 15 May 2018 13:47:41 GMT</pubDate>
            <atom:updated>2018-05-15T17:07:21.577Z</atom:updated>
            <content:encoded><![CDATA[<p>I had a big dream of my programming life to participate for GSoC. I have heard about GSoC with my first year from my seniors. Finally, my dream became true this time thanks to <a href="http://www.scorelab.org/">SCoRe Lab</a>. In last week of the April (23rd) 2018, I have got an email mentioned that I have selected for Google Summer of Code (GSoC) 2018 student for SCoRe Lab organization. I’m very excited to select as a participant in GSoC 2018.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*5Kon9U5xy5TSSEAierzeLw.png" /></figure><p>I applied for ChainKeeper project in SCoRe Lab. I’m the first member who going to contribute for this project. ChainKeeper is a web application to explore and analyze blockchain data for any users. Actually this is the front end of BlockSci which developed by Harry Kalodner et al. at Princeton University. We can discuss about the project and what are my approaches in development phase in next blog posts :)</p><p>I’m a very interesting person for the blockchain domain. I’m still a 4th year undergraduate at UCSC. Due to interesting to this domain I selected my final year research also in this field. I have some sort of knowledge about how the blockchain works, how the transactions, inputs and outputs related with blocks in Bitcoin etc.</p><p>After getting selected for the project, I had a discussion with the organization mentors regarding the project and further development tasks of the project. Developing is still waiting and I’m still getting familiar with <strong>React JS, C++ </strong>and<strong> Python Flask</strong> for do the project in quick (I hope so :P). I hope this might be a great opportunity for me to learn many new things such as techs, methodologies, people and hoping to give my full commitment towards the success of this project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6a71c046dd7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy WSO2 DS or DAS on Custom Docker in WSO2 Integration Cloud — Part 2]]></title>
            <link>https://sajithaliyanage.medium.com/deploy-wso2-ds-or-das-on-custom-docker-in-wso2-integration-cloud-part-2-ca280b3f4c24?source=rss-3d07b7bad46f------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca280b3f4c24</guid>
            <category><![CDATA[dashboard-server]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[data-analytics-server]]></category>
            <dc:creator><![CDATA[Sajitha Liyanage]]></dc:creator>
            <pubDate>Fri, 08 Dec 2017 07:38:09 GMT</pubDate>
            <atom:updated>2017-12-08T07:41:16.720Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-ME6z85CGpQWXv2brHHzIg.png" /></figure><p>From the previous tutorial we have discussed how to configure the WSO2 DAS or DS before deploy to the integration cloud.</p><p><a href="https://medium.com/@sajithaliyanage/deploy-wso2-ds-or-das-on-custom-docker-in-wso2-integration-cloud-part-1-6437792e9451"><strong>Tutorial 1</strong></a></p><p>In this tutorial lets see how to push WSO2 DAS or DS as docker image and pull it on the WSO2 Integration Cloud custom docker instance.</p><p>Lets us first start with the overall flow of docker, which goes like this,</p><ol><li>You need to create a Dockerfile with step by step instructions</li><li>Then you need to use docker build command to create a docker image based on the Dockerfile that you have created in point 1.</li><li>Then you need to use docker login command to log relevant docker repository</li><li>Then you need to use docker push command to push your image to that global docker repository</li></ol><p>with this information, lets start the work!</p><p><strong>Step 1 :-</strong></p><p>Open your terminal (Ctrl + Alt + t) and create a folder named docker-images as shown below. This will be our root folder where we will create our Dockerfile.</p><pre>sajitha@sajitha-ThinkPad:~$ mkdir docker-images</pre><p>Then navigate to docker-images folder using<strong> </strong>cd command. Next open your vim, nano or any relevant editor and past the below commands to it and save it named as Dockerfile. A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image.</p><pre>FROM java<br>MAINTAINER &lt;your-name&gt; (sajithal@domain.com)</pre><pre># Update packages and install dependencies.<br>ENV hostname &lt;hosting-domain&gt;<br>RUN  mkdir -p /wso2<br>COPY wso2das-3.1.0.zip /wso2<br>RUN cd /wso2 &amp;&amp; \<br>    unzip wso2das-3.1.0.zip &amp;&amp; \<br>    rm wso2das-3.1.0.zip<br>COPY bootstrap.sh /wso2/wso2das-3.1.0/bin</pre><pre>RUN useradd -ms /bin/bash wso2user \<br>    &amp;&amp; chown -R wso2user /wso2 \<br>    &amp;&amp; chmod -R 0774 /wso2<br>USER wso2user</pre><pre>ENTRYPOINT [&quot;/wso2/wso2das-3.1.0/bin/bootstrap.sh&quot;]</pre><pre>EXPOSE 9763 9443 8280 8243</pre><p>Docker image is nothing but a series of layers built on top of each other, we start with a base image. Let I describe the above commands one by one. The <a href="https://docs.docker.com/engine/reference/builder/#from"><strong>FROM</strong></a> instruction initializes a new build stage and sets the <a href="https://docs.docker.com/engine/reference/glossary/#base-image"><em>Base Image</em></a> for subsequent instructions. As such, a valid Dockerfile must start with a FROM instruction.<strong> </strong><a href="https://docs.docker.com/engine/reference/builder/#maintainer-deprecated"><strong>MAINTAINER</strong></a> instruction sets the <em>Author</em> field of the generated images. This is a good practice. <a href="https://docs.docker.com/engine/reference/builder/#env"><strong>ENV</strong></a><strong> </strong>instruction sets the environment variable &lt;key&gt;to the value &lt;value&gt;. Here I’m set my hosting domain as env key of hostname. <a href="https://docs.docker.com/engine/reference/builder/#run"><strong>RUN</strong></a> instruction will execute any commands in a new layer on top of the current image and commit the results. Here I create a folder called wso2 first. <a href="https://docs.docker.com/engine/reference/builder/#copy"><strong>COPY</strong></a><strong> </strong>instruction copies new files or directories from &lt;src&gt; and adds them to the file system of the container at the path &lt;dest&gt;. It’s already same as bash command. Here I copy my wso2das-3.1.0.zip folder to wso2 folder. Then using RUN instruction I do navigate to wso2 folder, unzip the wso2das-3.1.0.zip file and remove the zip file. Then I copy the boostrap.sh file to wso2 folder using COPY instruction. Then with RUN instruction I create a user and grant relevant privileges to that user. <a href="https://docs.docker.com/engine/reference/builder/#user"><strong>USER</strong></a><strong> </strong>instruction sets the user name (or UID) and optionally the user group (or GID) to use when running the image and for any RUN, CMD and ENTRYPOINT instructions that follow it in the Dockerfile. <a href="https://docs.docker.com/engine/reference/builder/#entrypoint"><strong>ENTRYPOINT</strong></a><strong> </strong>allows you to configure a container that will run as an executable. Here I set the ENTRYPOINT to “/wso2/wso2das-3.1.0/bin/bootstrap.sh”. <a href="https://docs.docker.com/engine/reference/builder/#expose"><strong>EXPOSE</strong></a><strong> </strong>instruction informs Docker that the container listens on the specified network ports at runtime. You can specify whether the port listens on TCP or UDP, and the default is TCP if the protocol is not specified.</p><p>Now we need to create boostratp.sh file. Again open your terminal editor and past below code to it and save it as boostrap.sh.</p><pre>#!/bin/bash</pre><pre>grep -rl &#39;your-domain&#39; /wso2/wso2das-3.1.0 | xargs sed -i &#39;s/your-domain/&#39;&quot;$hostname&quot;&#39;/g&#39;</pre><pre>echo &quot;Setting environment parameters completed.&quot;</pre><pre>sh /wso2/wso2das-3.1.0/bin/wso2server.sh -dashboardNode</pre><p>boostrap.sh file is need to set the environment variable in the docker container and run the wso2server.sh bash shell file.</p><p>Now we need to copy pre-configured (as in tutorial 1) wso2das-3.1.0.zip file to the docker-images folder. After all the works if we run the ls command in docker-images folder i should be like this.</p><pre>sajitha@sajitha-ThinkPad:~/docker-images$ ls<br>wso2das-3.1.0.zip  bootstrap.sh  Dockerfile</pre><p>So now all done, remain is run docker commands. lets do that. First build the docker image using build command. Here we use <strong>squash</strong> command (Squash newly built layers into a single new layer).</p><pre>sudo docker build -t &lt;username&gt;/&lt;repo-name&gt; --squash .</pre><p>You can see it’s running like this.</p><pre>sajitha@sajitha-ThinkPad:~/Desktop/docker-images$ sudo docker build -t myimages/dbserver --squash .<br><br>Sending build context to Docker daemon  463.6MB<br>Step 1/12 : FROM java<br> ---&gt; d23bdf5b1b1b<br>Step 2/12 : MAINTAINER Sajitha Liyanage &lt;<a href="/service/mailto:sajithal@wso2.com">sajithal@domain.com</a><br> ---&gt; Using cache<br> ---&gt; ac29c91e852e<br>Step 3/12 : ENV hostname domain.com<br> ---&gt; Using cache<br> ---&gt; c0a0dbe245d1<br>Step 4/12 : RUN mkdir -p /wso2<br> ---&gt; Using cache<br> ---&gt; 69044c919338<br>Step 5/12 : COPY wso2das-3.1.0.zip /wso2<br>...............</pre><p>After finish this command login to the docker account.</p><pre>sudo docker login -u &lt;username&gt; -p &lt;password&gt;</pre><p>Then after seeing “<strong>Login Successfully</strong>” message we can push the docker image to the global repo. This command will take some time but depends with network connection.</p><pre>sudo docker push &lt;username&gt;/&lt;repo-name&gt;</pre><p><strong>Step 2 :-</strong></p><p>After finish the push command we need to log into WSO2 Integration cloud. Then navigate to “CREATE APPLICATION -&gt; CUSTOM DOCKER -&gt; MANAGE IMAGES”. There is a button called <strong>Update </strong>that can update our previous created docker instance. So press Update button now. It will pull the docker image from docker-hub relavent repo based on what we gave the details in docker instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uih1ctqTbUBdY2_TVsBgag.png" /></figure><h3><strong>Congratulations!!</strong></h3><p>Now we have successfully pushed the docker image into the WSO2 Integration Cloud. Now only remain thing is start the docker. For that go to the docker instance that you created and press <strong>Start</strong> button.</p><p>Yeppy! It’s seems like up and running now. You can navigate to <strong>Log</strong> and see logs while server starts. (Don’t forget to Enable Tailing).</p><p>Stay tuned :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca280b3f4c24" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>