<?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 Archit Kapoor on Medium]]></title>
        <description><![CDATA[Stories by Archit Kapoor on Medium]]></description>
        <link>https://medium.com/@architkpr?source=rss-311e81255368------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Df7A6jiQ8Y2m1yY_puIyeQ.jpeg</url>
            <title>Stories by Archit Kapoor on Medium</title>
            <link>https://medium.com/@architkpr?source=rss-311e81255368------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 18:46:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@architkpr/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[Simply Explained: OAuth 2.0]]></title>
            <link>https://medium.com/@architkpr/simply-explained-oauth-2-0-a6393729dc8a?source=rss-311e81255368------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6393729dc8a</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[oauth]]></category>
            <category><![CDATA[identity]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Archit Kapoor]]></dc:creator>
            <pubDate>Mon, 24 Feb 2025 18:49:15 GMT</pubDate>
            <atom:updated>2025-02-24T19:05:08.682Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re like me, you probably wonder how secure it really is when you allow non-Google apps — like Adobe — to access your Google Drive or let a third-party fitness app sync your Fitbit data. The answer lies in OAuth 2.0, the system that enables apps to access your data — without them needing your password!</p><p>Apps don’t really use OAuth 1 anymore, so in this article, I’ll break down OAuth 2.0 using a simple real-world analogy. My goal is to make it easy to understand — <strong>no technical background required.</strong></p><h3>Our Analogy: Going to the Arcade</h3><p>Imagine you’re at an arcade with your kids, and they’re excited to play as many games as they can. The arcade offers two payment options: <br>1. <strong>Pay per game </strong>— Each time they want to play, they need to pay separately.<br>2. <strong>Pay by the hour </strong>— You pay upfront for unlimited access during a set time.</p><p>If you want to leave your kids unsupervised, paying per game would mean giving them your credit card, which could be risky if it gets misused. Instead, you choose to pay upfront for 2 hours. In return, the arcade gives your kids an <em>access card</em> that’s valid for exactly 2 hours. The card may have restrictions that prevent them from accessing the bowling lanes or pool tables, but allow them to play any video game for 2 hours. Once the time runs out, the card stops working — <strong>but you can choose to add more time later, if needed</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*P8ZwozuS793tWLI4" /><figcaption>Photo by <a href="https://unsplash.com/@vantaymedia?utm_source=medium&amp;utm_medium=referral">Van Tay Media</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>OAuth 2.0 on the Internet</h3><p>Similarly, imagine you have downloaded an app that analyzes your Spotify playlists to give you insights about your listening habits. The app needs to see your playlists, but <strong>handing over your Spotify username and password would be risky</strong>. To use our analogy, Spotify is the arcade and the app you downloaded represents the kids who want to play video games. Your password is your credit card — you don’t want to give it to the app directly!</p><p>Instead, the app redirects you to Spotify, where you log in and explicitly grant the app permission to access your playlists — <strong>and nothing more</strong>. In return, Spotify issues the app an <em>access token</em> that works for a limited time. Just like the arcade card only grants access to video games and not bowling or pool tables, this token <strong>only</strong> allows the app to read your playlists — not your listening history, followers, or anything else.</p><h3>Do I Log In Every Time the Access Token Expires?</h3><p>When you requested Spotify to grant an <em>access token</em> to the app, Spotify silently added a <em>refresh token</em> as well. Once the <em>access token</em> expires, the app can request a new one automatically, <strong>without requiring you to log in again</strong>. While the app <em>could</em> ask you to log in again, silently refreshing its access ensures a smoother user experience.</p><p>However, if you <strong>log out of the app</strong>, its tokens are deleted, meaning it will have to <strong>request you to log in </strong>to Spotify again the next time you want to use its services.</p><h3>Why Does This Matter?</h3><p>Security and convenience don’t always go hand in hand, and striking the right balance is not easy. OAuth 2.0 does a pretty solid job — it lets apps access just what they need while keeping your passwords safe. Next time you connect a new app to your Google, Spotify, or Fitbit account, you’ll know exactly what’s happening behind the scenes.</p><p>Hopefully, this breakdown not only clarifies OAuth 2.0 but also highlights how real-world analogies can make complex tech concepts much easier to grasp!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6393729dc8a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Good Cybersecurity Habits: Password Managers]]></title>
            <link>https://medium.com/@architkpr/good-cybersecurity-habits-password-managers-cd1b206df7d1?source=rss-311e81255368------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd1b206df7d1</guid>
            <category><![CDATA[passwords]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Archit Kapoor]]></dc:creator>
            <pubDate>Sat, 25 Sep 2021 17:55:40 GMT</pubDate>
            <atom:updated>2021-09-29T15:48:22.510Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Note: This is </em><strong><em>not </em></strong><em>a technical, in-depth analysis of Password Managers. This is my attempt to make the average Internet user aware of their options when it comes to securing their digital life.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2LiVYRAy_-xGlphP" /><figcaption>Photo by <a href="https://unsplash.com/@mr_fresh?utm_source=medium&amp;utm_medium=referral">Yura Fresh</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you’ve been using the Internet for some time, you already know and hopefully appreciate the importance of passwords. You also need to be careful when working with them — existing on the Internet comes with a lot of responsibility.</p><p>When creating a new password, you would be told to <strong>not repeat</strong> one that you’ve used with another account, as well as come up with one that <strong>fulfils some criteria</strong> regarding the characters that it can contain. If this isn’t enough trouble, some Internet services require you to <strong>change your password every few months </strong>(especially certain banking websites). Then, of course, you are also told to <strong>never share your passwords</strong> with anyone. Fun.</p><h4>“How do these security folks expect us to remember unique passwords to all our accounts!?”</h4><p>Honestly, they don’t. If you were to remember all your passwords, you’ll probably not remember much else. So, how about writing them down in one place, maybe on a piece of paper, or better, in a file on your computer? That’s <strong>NOT</strong> a bad idea. If you can create a text file on your laptop, such that <strong>only you can access it</strong>, there’s little reason as to why that’s an insecure way of storing your passwords.</p><p>However, if you need to access that file, every time you log in to an account on your phone, tablet, work laptop, etc., you’ll probably give up all social media (finally!). Can we secure our digital life, without ruining the user experience?</p><p>Introducing, <a href="https://passwords.google.com/intro">password managers</a> — coming soon to a device near you! These applications allow you to store your passwords in one place, within the application, <strong>locked by the master password </strong>that you set. This can be a strong, unique password or a Touch/Face ID depending on the password manager you have. You may have come across them already — when Safari or Google Chrome ask you if you’d like them to “remember your password”, they are acting like a password manager. To access the passwords stored by them, you’d need to login with your Apple ID or Google account respectively. This gives you the assurance that only you can view those passwords, as well as giving you the flexibility to use them across your Apple/Android devices.</p><h4>“Can I trust these applications? What if they get breached?”</h4><p>Most of the popular password managers can be trusted. Unlike the local password file from earlier, these applications encrypt your passwords using the <a href="https://www.lastpass.com/security/zero-knowledge-security">best encryption algorithms</a>. If they do get breached, one can only obtain the encrypted list of passwords and they will not be able to view/use them without decryption. Of course, if your master password itself is weak, one can easily login as you and access your data. So all you need to do is <strong>set a strong master password</strong> that you can remember and <strong>not share it with anyone</strong>. Some applications also support multi-factor authentication in addition to your master password, for increased security.</p><h4>“Okay, I can store all my passwords here, but how do I create unique ones in the first place, that match the gazillion requirements!?”</h4><p>This may sound repetitive, but.. <strong>Use a password manager</strong>. This is why password managers that aren’t made by Google/Apple are more popular. Despite being cross-platform, they are more <a href="https://nordpass.com/features/">feature-rich</a>. One of the common features is allowing the user to set parameters as required — length of password, characters allowed, etc. — and generate a random, unique password. You can shuffle through various generated values and save the one you like.</p><p>In case an Internet service requires you to change your password — whether it is a routine update or due to some data breach — you can simply login to your password manager, <strong>generate a completely random, new value</strong>, and update your password in the password manager along with the Internet service.</p><h4>“Awesome! So, which password manager should I use?”</h4><p>There are several password managers that can be categorized based on whether they are paid or free, where they store your data (on your device or in the cloud), what features they offer, etc. Some users prefer a paid password manager, whereas some may want one that does not store their data in the cloud. Various websites compare the different applications in-depth, but I find <a href="https://www.cmu.edu/iso/governance/guidance/password-managers.html">this comparison</a> of popular password managers brief and easy to follow.</p><p>My goal with this post is not to point you towards a specific set of password managers, but to make you aware of their benefits and hopefully appreciate their importance. Just like having a bank account is a good habit, but the bank you choose to open one at depends completely at you, look into password managers and see what works for you.</p><h4>TL;DR</h4><p>Password Managers are software applications that allow you to store your passwords in one place, be it locally on your device or in the cloud, and allow you to generate strong, unique passwords to use for your various accounts on the Internet. They take the worry and responsibility that comes with handling passwords away from the user and can be trusted to manage your passwords in a secure and user-friendly manner.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd1b206df7d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Celery: Naming Your Workers]]></title>
            <link>https://medium.com/@architkpr/python-celery-naming-your-workers-9ac4e82e9bda?source=rss-311e81255368------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ac4e82e9bda</guid>
            <category><![CDATA[web-applications]]></category>
            <category><![CDATA[celery]]></category>
            <category><![CDATA[distributed-computing]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Archit Kapoor]]></dc:creator>
            <pubDate>Tue, 17 Aug 2021 17:24:03 GMT</pubDate>
            <atom:updated>2024-09-23T01:23:05.778Z</atom:updated>
            <content:encoded><![CDATA[<p>In my experience working with python and celery, I came across multiple challenges that helped me better understand a distributed messaging framework. One of the challenges was effectively handling multiple celery workers.</p><h3>Celery — A Brief Introduction</h3><p>In simple words, <a href="https://docs.celeryproject.org/en/stable/getting-started/introduction.html">celery</a> allows you to perform tasks asynchronously, by launching workers (and worker processes) in the background that accept tasks from a queue, compute the result and store it in the backend, without interrupting the foreground task. It can be an extremely useful tool in building web applications. Users can launch tasks and continue interacting with other elements of the web app, or even leave the app and return later to find the task completed without any issues. <a href="https://www.youtube.com/watch?v=BbPswIqn2VI">Here</a> is a great example of an application that uses celery.</p><p>When you launch a celery worker node, it launches X worker processes by default — X being the number of cores on your machine. However, this may not be enough and you may want to launch multiple workers, each launching multiple worker processes.</p><p>Here is the syntax to launch multiple workers (2 in this case) in celery —</p><pre>$ celery -A proj worker<br>$ celery -A proj worker</pre><h3>Duplicate Workers — Not A Good Idea</h3><p>Using the above example, you would successfully generate 2 <em>duplicate </em>workers, each launching their own set of worker processes. Any tasks in the queue would be picked up without any issues and executed successfully. Note that the <a href="https://docs.celeryproject.org/en/latest/userguide/workers.html#starting-the-worker">celery documentation</a> suggests providing unique identifiers (or “names”) to workers when launching multiple instances. Not doing so displays a warning —</p><pre>DuplicateNodenameWarning:<br>Received multiple replies from node name: celery@machinename.<br>Please make sure you give each node a unique nodename using the celery worker `-n` option.<br>pluralize(len(dupes), &#39;name&#39;), &#39;, &#39;.join(sorted(dupes)),</pre><p>The issue with duplicate workers can be seen clearly when you try to <a href="https://docs.celeryproject.org/en/stable/userguide/monitoring.html">monitor the celery workers</a>. When doing it from the command line, this is what monitoring active workers looks like —</p><pre>### Example - without name (celery -A proj worker)</pre><pre>$ celery -A proj inspect active<br>-&gt; celery@machinename: OK<br>- empty -<br>-&gt; celery@machinename: OK<br>{&#39;id&#39;: ... }<br></pre><pre>### Example - with name (celery -A proj worker -n worker1@hostname)</pre><pre>$ celery -A proj inspect active<br>-&gt; celery@worker1@hostname: OK<br>- empty -<br>-&gt; celery@worker2@hostname: OK<br>{&#39;id&#39;: ... }</pre><p>When doing it from python you see the real problem —</p><pre>### Example - without name</pre><pre>&gt; app.control.inspect().active()<br>{&#39;celery@machinename&#39;:[]}</pre><pre><br>### Example - with name</pre><pre>&gt; app.control.inspect().active()<br>{&#39;celery@worker2@hostname&#39;: [{&#39;id&#39;: ...}], &#39;celery@worker1@hostname&#39;:[], }</pre><p>As you can see, the active() method <strong>returns a dictionary with the worker names as keys</strong>. Since dictionaries can only have unique keys, there will be only one item in the returned dictionary if the celery workers don’t have unique names. Moreover, the order in which celery populates this dictionary is not consistent. This means that every time your code is run, the item in the dictionary (where workers haven’t been given a unique identifier) will change — at times giving you the worker you want!</p><h3>Conclusion</h3><p>It is interesting to see how a trivial issue can sometimes break your application. When working with multiple celery workers I initially launched duplicate nodes without any issues. Problems started to occur when I began monitoring the nodes and using that information in my application. I learnt that it is important to uniquely identify nodes, tasks, processes, etc., and also to look twice at compiler warnings!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ac4e82e9bda" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>