<?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 Semih Özden on Medium]]></title>
        <description><![CDATA[Stories by Semih Özden on Medium]]></description>
        <link>https://medium.com/@semihozden01?source=rss-a8cc9445beb9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*MuCJX99ZBPJTIMmHfZrdvg.jpeg</url>
            <title>Stories by Semih Özden on Medium</title>
            <link>https://medium.com/@semihozden01?source=rss-a8cc9445beb9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 19:07:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@semihozden01/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[What is the relationship between Closure and Redux under the hood?]]></title>
            <link>https://semihozden01.medium.com/what-is-the-relationship-between-closure-and-redux-under-the-hood-301d0bf4f1ff?source=rss-a8cc9445beb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/301d0bf4f1ff</guid>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[under-the-hood]]></category>
            <category><![CDATA[closure-in-javascript]]></category>
            <category><![CDATA[store-management]]></category>
            <category><![CDATA[redux]]></category>
            <dc:creator><![CDATA[Semih Özden]]></dc:creator>
            <pubDate>Mon, 13 Nov 2023 22:33:57 GMT</pubDate>
            <atom:updated>2023-11-13T22:52:54.589Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*_gk3Rb43sI6O6JxTNr9SOQ.jpeg" /></figure><p>While I was recalling my closure informations I recognize that I forget the key points. After a little bit research I understand and I come with the following real life scenario which we are facing in daily projects.</p><p>Closures are indeed used in Redux under the hood. Redux is a predictable state container for JavaScript applications, often used with libraries like React for building user interfaces. Closures play a crucial role in how Redux manages state and handles actions.</p><p>In Redux, the store holds the state of your application, and to update the state, you dispatch actions. Reducers are functions responsible for handling these actions and updating the state accordingly. Closures come into play because reducers are typically defined within the createStore function, which creates the Redux store.</p><p>When you define a reducer function inside createStore, it has access to the variables and parameters of its containing function, creating a closure. This allows the reducer to “close over” the initial state and handle actions with respect to that state.</p><p>Here’s a simplified example to illustrate the concept:</p><pre>function createStore(reducer, initialState) {<br>  let state = initialState;<br><br>  function dispatch(action) {<br>    state = reducer(state, action);<br>  }<br><br>  function getState() {<br>    return state;<br>  }<br><br>  return {<br>    dispatch,<br>    getState,<br>  };<br>}<br><br>function counterReducer(state = 0, action) {<br>  switch (action.type) {<br>    case &#39;INCREMENT&#39;:<br>      return state + 1;<br>    case &#39;DECREMENT&#39;:<br>      return state - 1;<br>    default:<br>      return state;<br>  }<br>}<br><br>const store = createStore(counterReducer, 0);<br></pre><p>Then run the following codes to see the results line by line.</p><pre>console.log(store.getState())<br>store.dispatch({type:&quot;INCREMENT&quot;})<br>console.log(store.getState())</pre><p>In this example, the counterReducer is defined within the createStore function, creating a closure over the state variable. This allows the reducer to access and modify the state based on the dispatched actions.</p><p>So, yes, closures are used in Redux to maintain and update the state in a predictable manner.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=301d0bf4f1ff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why does software supply chain security matter?]]></title>
            <link>https://semihozden01.medium.com/why-does-software-supply-chain-security-matter-3fabbdf6e8d3?source=rss-a8cc9445beb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fabbdf6e8d3</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[supply-chain-security]]></category>
            <category><![CDATA[supply-chain]]></category>
            <dc:creator><![CDATA[Semih Özden]]></dc:creator>
            <pubDate>Sun, 14 Mar 2021 21:15:38 GMT</pubDate>
            <atom:updated>2021-03-14T21:15:38.617Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kcsSGbFSYLQT98YdYEH16A.png" /><figcaption><a href="https://finitestate.io/">https://finitestate.io/</a></figcaption></figure><h3>What is a software supply chain?</h3><p>Simply, software supply chain is anything you need from development process to deployment into production. This includes all components you use to develop your product. It is not only contains software but also everything that composes your software and components such as repository, package manager etc. Some points which touches supply chain is that who wrote it, when it was contributed, how it’s been reviewed for security issues, knows vulnerabilities, supported versions, licence information. Furthermore, your packaging and build in scripts or your framework, which your application works on, can be count as parts of supply chain.</p><h3>Why does it matter for security?</h3><p>In these days, software dependencies are common almost for every project. While you are developing software, you do not write all functionality yourself that is when open source takes role with its dependencies. Synopsis (2020) report suggests that <a href="https://www.synopsys.com/content/dam/synopsys/sig-assets/reports/2020-ossra-report.pdf">99 percentage of codebases contains open sources in 2019</a>. This means that your application contains code that you did not write. Those codes can have high potential security risks according to Kaczorowski (2020). Synopsis (2020) states that 75% of codebases contained vulnerabilities as mentioned in 2020 open source security and risk analysis report. This vulnerabilities can create the worst cases for your production environment because thousands of open source developers have commit access to your repository. I think that this is enough to dream what can be happen in the future.</p><h3>Example of Supply Chain Attack</h3><p>If you have interest in secure code development, you may heard <em>event-stream </em>supply chain attack. Event stream is a Node.js library which is used commonly via npm. In the September of 2018, a volunteer wanted to help <em>event-stream</em> in github. An author also gave rights to newcomer to publish repository. The new user added <em>flatmap-stream</em> into event-stream and removed it a few weeks later from codebase but the user did not push the changes into npm. In October, malware is added to flatmap-stream by another user. After that flatmap-stream’s last version which has malware was downloaded with <em>event-stream</em>. Those people who have downloaded event-stream was affected this vulnerable dependency.</p><h3>How should we protect our components from supply chain attack?</h3><p>Kaczorowski (2020) states that unpatched software attack is not rare but direct supply chain attacks are limited. Therefore unpatched software creates the biggest risks for supply chain attacks.</p><p><strong>Protections tips for developers</strong></p><ul><li>As a developer, we should know what dependencies we use in our environment,</li><li>Regularly follow vulnerabilities exist for those dependencies and patch them,</li><li>Manage dependencies we have in our environment and remove unused ones,</li><li>Be careful before downloading new dependencies for example look at stars on github, weekly download number in npm (However, it does not mean it is a secure dependency 100% from now on).</li><li>Produce a Software Bill of Materials (SBOM) for software packages, updates, and connected device firmware.</li></ul><h3>What will be next article?</h3><p>My next article will be <strong>npm substitution attacks</strong> which is related with supply chain security.</p><h3>References</h3><p>Synopsis. (2020). 2020 Open Source Security and Risk Analysis. <a href="https://www.synopsys.com/software-integrity/resources/analyst-reports/2020-open-source-security-risk-analysis.html">synopsys.com/software-integrity/resources/a..</a></p><p>Kaczorowski, M. (2020, February 2). Secure at every step: What is software supply chain security and why does it matter? . <a href="https://github.blog/2020-09-02-secure-your-software-supply-chain-and-protect-against-supply-chain-threats-github-blog/">github.blog/2020–09–02-secure-your-software..</a></p><p>[Photograph with attacker and malicious code]. (2020, December 15). How we can prevent supply chain attacks like the one on SolarWinds [Photograph]. finitestate. <a href="https://finitestate.io/2020/12/15/how-we-can-prevent-supply-chain-attacks-like-the-one-on-solarwinds/">finitestate.io/2020/12/15/how-we-can-preven..</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fabbdf6e8d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>