<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Pavit Kaur</title>
    <link>https://pavitkaur05.github.io/</link>
    <description>Recent content  by Pavit Kaur</description>
    
    <language>en</language>
    <copyright>2025 Pavit Kaur All rights reserved</copyright>
    <lastBuildDate>Mon, 23 Aug 2021 00:00:00 +0000</lastBuildDate>
    
	<atom:link href="https://pavitkaur05.github.io/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>About</title>
      <link>https://pavitkaur05.github.io/about/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <author>pavitk1@gmail.com (Pavit Kaur)</author>
      <guid>https://pavitkaur05.github.io/about/</guid>
      <description>&lt;p&gt;Hey there!&lt;/p&gt;
&lt;p&gt;I’m Pavit Kaur, part of the engineering team at &lt;a href=&#34;https://www.hackerrank.com/&#34;&gt;HackerRank&lt;/a&gt;. I was selected as a student developer for &lt;a href=&#34;https://summerofcode.withgoogle.com/archive/2021/projects/6267095049830400&#34;&gt;Google Summer of Code 2021&lt;/a&gt;, where I contributed to the &lt;a href=&#34;https://www.debian.org/&#34;&gt;Debian&lt;/a&gt; project. I graduated from &lt;a href=&#34;https://uiet.puchd.ac.in/&#34;&gt;University Institute of Engineering and Technology, Panjab University&lt;/a&gt; in 2022. This space captures the journey and learnings from my time with Google Summer of Code.&lt;/p&gt;
</description> 
    </item>
    
    <item>
      <title>GSoC 2021: Final Evaluation</title>
      <link>https://pavitkaur05.github.io/post/gsoc-final-evaluation/</link>
      <pubDate>Mon, 23 Aug 2021 00:00:00 +0000</pubDate>
      <author>pavitk1@gmail.com (Pavit Kaur)</author>
      <guid>https://pavitkaur05.github.io/post/gsoc-final-evaluation/</guid>
      <description>&lt;p&gt;Project: &lt;strong&gt;Incremental Improvements to Debian’s CI platform&lt;/strong&gt;&lt;br&gt;
Project Link: &lt;a href=&#34;https://summerofcode.withgoogle.com/projects/#6433686825730048&#34;&gt;https://summerofcode.withgoogle.com/projects/#6433686825730048&lt;/a&gt;&lt;br&gt;
Code Repository: &lt;a href=&#34;https://salsa.debian.org/ci-team/debci&#34;&gt;https://salsa.debian.org/ci-team/debci&lt;/a&gt;&lt;br&gt;
Mentors: &lt;a href=&#34;https://salsa.debian.org/terceiro&#34;&gt;Antonio Terceiro&lt;/a&gt; and &lt;a href=&#34;https://salsa.debian.org/elbrus&#34;&gt;Paul Gevers&lt;/a&gt;&lt;/p&gt;
&lt;h4 id=&#34;about-the-project&#34;&gt;&lt;strong&gt;About the Project&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Debian Continuous Integration&lt;/strong&gt; is Debian’s CI platform. It runs tests on the packages published in the Debian archive, and today is used to control migration of packages from unstable, Debian’s development area, to testing, the area of the archive where the next Debian release is being prepared. This makes it a crucial part of Debian’s infrastructure.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&#34;https://ci.debian.net&#34;&gt;web platform&lt;/a&gt; shows the results of all the tests executed. Debian CI provides developers both &lt;strong&gt;API&lt;/strong&gt; and a GUI &lt;strong&gt;Self-Service&lt;/strong&gt; section to request tests for the packages and get information on test history.&lt;/p&gt;
&lt;p&gt;This project involves implementing incremental improvements to the platform, making it easier to use and maintain.&lt;/p&gt;
&lt;h5 id=&#34;deliverables-of-the-project&#34;&gt;Deliverables of the project:&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;Migrating Logins to Salsa&lt;/li&gt;
&lt;li&gt;Adding support for testing security uploads and Debian LTS&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&#34;work-done&#34;&gt;&lt;strong&gt;Work done&lt;/strong&gt;&lt;/h4&gt;
&lt;h5 id=&#34;migrating-logins-to-salsa&#34;&gt;Migrating Logins to Salsa&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Originally, Debian CI used Debian SSO client certificates for logging in, but since that was deprecated logins are migrated to &lt;a href=&#34;https://salsa.debian.org/&#34;&gt;Salsa&lt;/a&gt;, Debian’s Gitlab instance and this is implemented with the help of &lt;a href=&#34;https://github.com/omniauth/omniauth&#34;&gt;OmniAuth&lt;/a&gt;, the ruby authentication framework.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Another thing fixed as part of this task was that there exists a limitation in the existing database structure, where usernames were directly stored as the test requestor field, so that relationship was normalized with a proper foreign key to the users table.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Merge Requests:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://salsa.debian.org/ci-team/debci/-/merge_requests/179&#34;&gt;Migrate to logins using Salsa&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://salsa.debian.org/ci-team/debci/-/merge_requests/181&#34;&gt;Update the jobs table to add real reference to users table&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h5 id=&#34;adding-support-for-testing-security-uploads-and-debian-lts&#34;&gt;Adding support for testing security uploads and Debian LTS&lt;/h5&gt;
&lt;p&gt;In this task, work was done to enable private tests in Debian CI for adding support for testing security uploads and Debian LTS. It includes tasks from adding the &lt;code&gt;private&lt;/code&gt; field in the &lt;strong&gt;API&lt;/strong&gt; and &lt;strong&gt;Self-Service&lt;/strong&gt; section in requesting tests to adding an option to &lt;code&gt;publish&lt;/code&gt; them when ready through both interfaces.&lt;/p&gt;
&lt;p&gt;Merge Requests:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://salsa.debian.org/ci-team/debci/-/merge_requests/182&#34;&gt;Add private jobs flag to jobs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://salsa.debian.org/ci-team/debci/-/merge_requests/183&#34;&gt;Submit private jobs via API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://salsa.debian.org/ci-team/debci/-/merge_requests/184&#34;&gt;Fix in migration file&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://salsa.debian.org/ci-team/debci/-/merge_requests/185&#34;&gt;Submit private jobs via Self Service&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://salsa.debian.org/ci-team/debci/-/merge_requests/186&#34;&gt;Add extra-apt-sources in API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://salsa.debian.org/ci-team/debci/-/merge_requests/187&#34;&gt;Add extra-apt-sources via Self Service&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://salsa.debian.org/ci-team/debci/-/merge_requests/189&#34;&gt;Validate extra apt sources&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://salsa.debian.org/ci-team/debci/-/merge_requests/190&#34;&gt;Publish private tests via API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://salsa.debian.org/ci-team/debci/-/merge_requests/191&#34;&gt;Update Self-Service Job History Page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://salsa.debian.org/ci-team/debci/-/merge_requests/193&#34;&gt;Add Publish and Retry in Self-Service&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h5 id=&#34;others&#34;&gt;Others&lt;/h5&gt;
&lt;p&gt;I worked on some issues to add usability improvements for the web interface:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://salsa.debian.org/ci-team/debci/-/merge_requests/180&#34;&gt;Change Retry link to point to the self-service interface&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://salsa.debian.org/ci-team/debci/-/merge_requests/195&#34;&gt;Add a user menu in the self-service interface&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&#34;learning-takeaways&#34;&gt;&lt;strong&gt;Learning Takeaways&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;I learned a lot throughout the entire journey. Some of the things to mention are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Writing tests:&lt;/strong&gt; I learned about using &lt;code&gt;Rspec&lt;/code&gt; for writing tests in ruby and understood how writing tests is an integral part of coding any project.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Using good coding practices:&lt;/strong&gt; By my merge requests reviews done by my mentor Antonio, I came to know about good coding practices which help in keeping the code both clean and concise.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&#34;acknowledgement&#34;&gt;&lt;strong&gt;Acknowledgement&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;I owe huge thanks to my mentors &lt;strong&gt;Antonio Terceiro&lt;/strong&gt; and &lt;strong&gt;Paul Gevers&lt;/strong&gt; for their constant support and guidance throughout the entire duration. It is for them that I was able to get started with the code-base of the project in the first place. And while working on the project, they were extremely responsive to all my queries. My merge requests were all thoroughly reviewed which enables me to learn more and work more efficiently. It was a complete pleasure interacting with them on weekly meet calls.&lt;/p&gt;
&lt;p&gt;To sum up, my GSoC journey was awesome 🎉 and I had a fun and productive summer with &lt;strong&gt;Debian&lt;/strong&gt; 😃&lt;/p&gt;
&lt;h4 id=&#34;whats-next&#34;&gt;&lt;strong&gt;What&amp;rsquo;s next?&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;As part of a continuation of my project task &lt;strong&gt;Adding support for testing security uploads and Debian LTS&lt;/strong&gt;, I would be working on Debian CI to facilitate the process of connecting the embargoed archive.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s the end of my GSoC journey but certainly not the end of my journey with &lt;strong&gt;Debian&lt;/strong&gt; or &lt;strong&gt;Open-Source&lt;/strong&gt;. I plan to stay an active contributor to &lt;strong&gt;Debian&lt;/strong&gt; and get involve with more Open Source projects as well 🌟&lt;/p&gt;
&lt;h4 id=&#34;extras&#34;&gt;&lt;strong&gt;Extras&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;The link to my Salsa Profile for all my work activities can be found &lt;a href=&#34;https://salsa.debian.org/PavitKaur05&#34;&gt;here&lt;/a&gt;.&lt;br&gt;
To know more about my journey, my other GSoC blog posts can be found below:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://pavitkaur05.github.io/post/journey-to-gsoc/&#34;&gt;Journey to GSoC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://pavitkaur05.github.io/post/gsoc-about-my-project-and-community-bonding-period/&#34;&gt;GSoC: About my Project and Community Bonding Period&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://pavitkaur05.github.io/post/gsoc-phase-1/&#34;&gt;GSoC: First Phase of Coding Period&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://pavitkaur05.github.io/post/gsoc-phase-2/&#34;&gt;GSoC: Second Phase of Coding Period&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description> 
    </item>
    
    <item>
      <title>GSoC: Second Phase of Coding Period</title>
      <link>https://pavitkaur05.github.io/post/gsoc-phase-2/</link>
      <pubDate>Sat, 21 Aug 2021 07:36:00 +0000</pubDate>
      <author>pavitk1@gmail.com (Pavit Kaur)</author>
      <guid>https://pavitkaur05.github.io/post/gsoc-phase-2/</guid>
      <description>&lt;p&gt;Hello there.&lt;/p&gt;
&lt;p&gt;So here we are near the end of &lt;strong&gt;GSoC 2021&lt;/strong&gt; and with that, I am sharing details of the work I completed in the second phase of the coding period.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://pavitkaur05.github.io/images/gsoc-coding-period-2.jpeg&#34; alt=&#34;coding-period-2&#34;&gt;&lt;/p&gt;
&lt;p&gt;Continuing with details of the task I left on&amp;hellip;&lt;/p&gt;
&lt;h4 id=&#34;task-adding-support-for-testing-security-uploads-and-debian-lts&#34;&gt;&lt;strong&gt;Task: Adding support for testing security uploads and Debian LTS&lt;/strong&gt;&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The &lt;code&gt;extra-apt-sources&lt;/code&gt; parameter is added to both &lt;strong&gt;API&lt;/strong&gt; and &lt;strong&gt;Self-Service&lt;/strong&gt; section for the &lt;code&gt;test request&lt;/code&gt; object and the part which took some time was deciding on its validation since if you ever deal with &lt;code&gt;apt sources&lt;/code&gt;, you would know that there exist a lot of combinations of a valid &lt;code&gt;apt source&lt;/code&gt; and in the end, the decision was taken to just add the minimal checks.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Since, we have enough setup to request &lt;code&gt;private&lt;/code&gt; tests, it made sense to have a way of looking them up in the &lt;strong&gt;Self-Service&lt;/strong&gt; section. So a new column is added to the test records in &lt;code&gt;Job-History&lt;/code&gt; marking the &lt;code&gt;visibility&lt;/code&gt; of a test (&lt;code&gt;private&lt;/code&gt; or &lt;code&gt;public&lt;/code&gt;) and a new filter to filter out records based on the &lt;code&gt;visibility&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The option to &lt;code&gt;retry&lt;/code&gt; tests is also added in &lt;strong&gt;Self-Service&lt;/strong&gt; in the &lt;code&gt;Job-History&lt;/code&gt; section so that &lt;code&gt;private&lt;/code&gt; tests can also be retried. As earlier, this option was only available in Package History pages but those pages do not show the &lt;code&gt;private&lt;/code&gt; tests.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The next thing in the list was to &lt;code&gt;publish&lt;/code&gt; these test results of &lt;code&gt;private&lt;/code&gt; tests at some point.
For the &lt;strong&gt;API&lt;/strong&gt; section, a new endpoint is added to accept a string of &lt;code&gt;run_ids&lt;/code&gt; which is ready to be published, and for the &lt;strong&gt;Self-Service&lt;/strong&gt; , in the Job-History page a &lt;code&gt;Publish&lt;/code&gt; button is added to be clicked after check boxing the required tests.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This ends the list of my planned work for the project. 🎉&lt;/p&gt;
&lt;h4 id=&#34;some-more-interesting-stuff&#34;&gt;&lt;strong&gt;Some more interesting stuff&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;As we got some more time for the coding period to end, my mentor Antonio Terceiro suggested that I could pick any issue from the opened issues list to work on so I picked up the one to add a user menu for the &lt;strong&gt;Self-Service&lt;/strong&gt; section and completed that.&lt;/p&gt;
&lt;p&gt;Antonio also gave me insights into &lt;strong&gt;Debian Packaging&lt;/strong&gt; and even let me try packaging a newer upstream version of the package &lt;a href=&#34;https://salsa.debian.org/ruby-team/itamae/-/commit/18a9d883cd83f8aab46f51a97ba20c1e52ff41fa&#34;&gt;itamae&lt;/a&gt; which is one of the packages maintained by him.&lt;/p&gt;
&lt;p&gt;I also worked on creating a video about my GSoC project for &lt;a href=&#34;https://debconf21.debconf.org/&#34;&gt;DebConf21&lt;/a&gt; and this was truly the hardest thing to do. From setting up everything to final editing, it took me about 2 days to create something sane to submit. Now, I am excited about DebConf21 😃&lt;/p&gt;
&lt;p&gt;That concludes my work in the second phase of the coding period and next, I will be sharing my &lt;strong&gt;Final Evaluation Submission&lt;/strong&gt; real soon.&lt;/p&gt;
&lt;p&gt;Stay tuned!&lt;/p&gt;
</description> 
    </item>
    
    <item>
      <title>GSoC: First Phase of Coding Period</title>
      <link>https://pavitkaur05.github.io/post/gsoc-phase-1/</link>
      <pubDate>Wed, 14 Jul 2021 03:52:00 +0000</pubDate>
      <author>pavitk1@gmail.com (Pavit Kaur)</author>
      <guid>https://pavitkaur05.github.io/post/gsoc-phase-1/</guid>
      <description>&lt;p&gt;Hello there.&lt;/p&gt;
&lt;p&gt;I still can&amp;rsquo;t believe that the first half of GSoC period is almost over. So it&amp;rsquo;s been about 5 weeks working on the project and that means I have a lot to share about it. So without further ado, let&amp;rsquo;s get started.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://pavitkaur05.github.io/images/gsoc-coding-period-1.jpeg&#34; alt=&#34;coding-period-1&#34;&gt;&lt;/p&gt;
&lt;p&gt;I will be listing up my work done in the respective tasks.&lt;/p&gt;
&lt;h4 id=&#34;task-migrating-logins-to-salsa&#34;&gt;&lt;strong&gt;Task: Migrating Logins to Salsa&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;The objective of this task was that the users could log in to their account on &lt;a href=&#34;https://ci.debian.net/&#34;&gt;debci&lt;/a&gt; using their &lt;a href=&#34;https://salsa.debian.org/&#34;&gt;Debian Salsa&lt;/a&gt; account (collaborative development server for Debian based on the GitLab software) and this is implemented with the help of &lt;a href=&#34;https://github.com/omniauth/omniauth&#34;&gt;OmniAuth&lt;/a&gt;, the ruby authentication framework.&lt;/p&gt;
&lt;p&gt;At the beginning of this, I had to discuss quite a few issues with my mentors that I was bumping into, and by the end of it with multiple revisions and discussions, the following was implemented:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The previous users&#39; table schema of debci comprises the username field which contained mostly the emails of the users with some exceptions and to accommodate the Salsa logins, a new uid field is added to the table to store the Salsa uid of the logged-in user with the username field storing Salsa usernames now and as the Salsa users have the liberty to change their usernames, the updation of username as well as in debci database is also taken care of.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For Salsa login, the &lt;code&gt;ruby-omniauth-gitlab&lt;/code&gt; strategy has been used and for login in development mode, the &lt;code&gt;developer&lt;/code&gt; strategy which comes with &lt;code&gt;ruby-omniauth&lt;/code&gt; has been set up.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Added a Login Page giving the option to log in using Salsa and an additional option to login in Developer Mode which is accessible only in Development Setup so that other contributors don&amp;rsquo;t have to set up dummy Salsa applications for working.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Added specs for the new login process. This was an interesting part, as I got the chance to understand RSpec and facilities provided by OmniAuth to mock the authentication for Integration Testing.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;One blocker that I dealt with was that the Debian release from where packages were pulled out for debci have the OmniAuth version 1.8, which was not working well with the developer strategy implementation for the application so to resolve that I did a minor change to the callback API for &lt;code&gt;developer&lt;/code&gt; strategy until the time that release have the newer version of OmniAuth.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Another thing we discussed in one of the meetings that in the existing database structure, the tests do not have a real reference to the users&#39; table and rather the username is stored directly as a string for the requestor field, so this thing was fixed as part of this task.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The migration of the existing users&#39; data for the new logins was handled by my mentor Antonio Terceiro and with this, our first task is concluded. All these changes are now part of &lt;a href=&#34;https://ci.debian.net/&#34;&gt;Debian Continuous Integration platform&lt;/a&gt; and you can find the blogpost for same by Antonio &lt;a href=&#34;https://terceiro.xyz/2021/06/27/debian-continuous-integration-now-using-salsa-logins/&#34;&gt;here.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This task also allowed me to write my first ever tutorial &lt;a href=&#34;https://pavitkaur05.github.io/post/omniauth-with-sinatra/&#34;&gt;Tutorial: Integrating OmniAuth with Sinatra Application&lt;/a&gt; to help people looking to integrate their ruby application with OmniAuth.&lt;/p&gt;
&lt;p&gt;Moving further to the next task in progress.&lt;/p&gt;
&lt;h4 id=&#34;task-adding-support-for-testing-security-uploads-and-debian-lts&#34;&gt;&lt;strong&gt;Task: Adding support for testing security uploads and Debian LTS&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;This is the next task I am working on enabling private tests in debci for adding support for testing security uploads and Debian LTS. Since it&amp;rsquo;s a bigger task, it is broken down into about 6-7 steps and till now, the following has been done:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The schema of jobs&#39; (tests) table is updated to have a boolean field to store whether the job is private or not.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The &lt;code&gt;is_private&lt;/code&gt; parameter is added to both &lt;strong&gt;API&lt;/strong&gt; and &lt;strong&gt;Self-Service&lt;/strong&gt; section so the private test can be submitted through the API  as well as through GUI form on the web platform.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Another thing which comes up through discussion in meetings that a parameter is required to add &lt;code&gt;extra-apt-sources&lt;/code&gt; for getting packages of security repository and this is the part in progress.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So that concludes my work till now. It has been an amazing journey with lots of learning and also the guidance from the wonderful mentors of my project and I am looking forward to more exciting parts ahead.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s all for now. See you next time!&lt;/p&gt;
</description> 
    </item>
    
    <item>
      <title>Tutorial: Integrating OmniAuth with Sinatra Application</title>
      <link>https://pavitkaur05.github.io/post/omniauth-with-sinatra/</link>
      <pubDate>Sun, 04 Jul 2021 00:00:00 +0000</pubDate>
      <author>pavitk1@gmail.com (Pavit Kaur)</author>
      <guid>https://pavitkaur05.github.io/post/omniauth-with-sinatra/</guid>
      <description>&lt;p&gt;As part of my GSoC project, my first task includes that user could login into their account on &lt;a href=&#34;https://ci.debian.net/&#34;&gt;debci&lt;/a&gt; using their &lt;a href=&#34;https://salsa.debian.org/&#34;&gt;Debian Salsa&lt;/a&gt; account (collaborative development server for Debian based on the GitLab software).&lt;/p&gt;
&lt;p&gt;The task is officially completed using &lt;a href=&#34;https://github.com/omniauth/omniauth&#34;&gt;OmniAuth&lt;/a&gt; library and while implementing it, I found that the documentation of OmniAuth is quite a mix-match and more focused on using it with Rails app and this gives me a idea to write a tutorial for people looking to integrate OmniAuth with Sinatra application. So here it is.&lt;/p&gt;
&lt;p&gt;Now, depending on the provider, Omniauth requires specific strategy which are generally released individually as RubyGems. For this tutorial, I would be using &lt;code&gt;omniauth-gitlab&lt;/code&gt; which I used for Debian Salsa in my project, &lt;code&gt;omniauth-twitter&lt;/code&gt; and a &lt;code&gt;developer&lt;/code&gt; strategy which could be used for project in development mode and comes with &lt;code&gt;omniauth&lt;/code&gt; gem itself.&lt;/p&gt;
&lt;p&gt;For simplicity purposes, I have included all routes and OmniAuth configurations in a single file &lt;code&gt;app.rb&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s start.&lt;/p&gt;
&lt;h3 id=&#34;register-your-application&#34;&gt;Register your application&lt;/h3&gt;
&lt;p&gt;This can be easily done – just head over to provider (Twitter, Salsa) website and find the option to &lt;strong&gt;create a new application&lt;/strong&gt; and fill in the form. In the callback URL field, you need to append &lt;code&gt;/auth/:provider/callback&lt;/code&gt; to whichever URL you used in the website field.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://pavitkaur05.github.io/images/tutorial-register-app.png&#34; alt=&#34;tutorial-register-app&#34;&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;client-id&lt;/code&gt; and &lt;code&gt;client-secret&lt;/code&gt; is obtained from the console which is used in further step to set up OmniAuth.&lt;/p&gt;
&lt;h3 id=&#34;gems&#34;&gt;Gems&lt;/h3&gt;
&lt;p&gt;At the top of the file, we require the necessary gems of for our project&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-ruby&#34; data-lang=&#34;ruby&#34;&gt;require &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;sinatra&amp;#39;&lt;/span&gt;
require &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;omniauth&amp;#39;&lt;/span&gt;
require &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;omniauth-gitlab&amp;#39;&lt;/span&gt;
require &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;omniauth-twitter&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;enable-sessions&#34;&gt;Enable sessions&lt;/h3&gt;
&lt;p&gt;In order for OmniAuth to work and to store the logged in user across requests, sessions need to be activated and if activated, you have one session hash per user session.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-ruby&#34; data-lang=&#34;ruby&#34;&gt;configure &lt;span style=&#34;color:#66d9ef&#34;&gt;do&lt;/span&gt;
    set &lt;span style=&#34;color:#e6db74&#34;&gt;:sessions&lt;/span&gt;, &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;
&lt;span style=&#34;color:#66d9ef&#34;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;set-up-omniauth-configurations&#34;&gt;Set up OmniAuth configurations&lt;/h3&gt;
&lt;p&gt;OmniAuth::Builder Rack middleware build up your list of OmniAuth strategies for use in your application:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-ruby&#34; data-lang=&#34;ruby&#34;&gt;use &lt;span style=&#34;color:#66d9ef&#34;&gt;OmniAuth&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;::&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;Builder&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;do&lt;/span&gt;
    &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; development?
      provider &lt;span style=&#34;color:#e6db74&#34;&gt;:developer&lt;/span&gt;,
               &lt;span style=&#34;color:#e6db74&#34;&gt;fields&lt;/span&gt;: &lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;:name&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;,
               &lt;span style=&#34;color:#e6db74&#34;&gt;uid_field&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;:name&lt;/span&gt;
    &lt;span style=&#34;color:#66d9ef&#34;&gt;end&lt;/span&gt;
    provider &lt;span style=&#34;color:#e6db74&#34;&gt;:gitlab&lt;/span&gt;, &lt;span style=&#34;color:#75715e&#34;&gt;#client-id , #client-secret,&lt;/span&gt;
             &lt;span style=&#34;color:#e6db74&#34;&gt;scope&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;read_user&amp;#34;&lt;/span&gt;,
             &lt;span style=&#34;color:#e6db74&#34;&gt;client_options&lt;/span&gt;: {
               &lt;span style=&#34;color:#e6db74&#34;&gt;site&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;https://salsa.debian.org/api/v4/&amp;#39;&lt;/span&gt;
             }
    provider &lt;span style=&#34;color:#e6db74&#34;&gt;:twitter&lt;/span&gt;, &lt;span style=&#34;color:#75715e&#34;&gt;#client-id , #client-secret,&lt;/span&gt;
&lt;span style=&#34;color:#66d9ef&#34;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here, few things to note could be the extra options used with providers, as&lt;br&gt;
In &lt;strong&gt;developer&lt;/strong&gt;:&lt;br&gt;
&lt;code&gt;fields&lt;/code&gt; : to specify the form fields for login in developer mode and by default it has name and email.&lt;br&gt;
&lt;code&gt;uid_field&lt;/code&gt;: to specify that which field&amp;rsquo;s value could be obtained as uid and by default it is email.&lt;br&gt;
In &lt;strong&gt;gitlab&lt;/strong&gt;:&lt;br&gt;
&lt;code&gt;scope&lt;/code&gt;: to limit the scope of application, by default, the api scope is requested and must be allowed in GitLab&amp;rsquo;s application configuration.&lt;br&gt;
&lt;code&gt;client_options&lt;/code&gt;: to specify the server being used as client based on Gitlab software.&lt;br&gt;
&lt;strong&gt;Note&lt;/strong&gt;: In case you want to have a different callback url other than the default &lt;code&gt;/auth/:provider/callback&lt;/code&gt;, it can be specified using &lt;code&gt;redirect_url&lt;/code&gt; option in case of &lt;code&gt;gitlab&lt;/code&gt; provider and accordingly update it in your Application Configuration at provider&amp;rsquo;s console.&lt;/p&gt;
&lt;h4 id=&#34;extra-configurations&#34;&gt;Extra configurations&lt;/h4&gt;
&lt;p&gt;To redirect to &lt;code&gt;auth/failure&lt;/code&gt; route in case of failure even in developer mode, following could be added:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-ruby&#34; data-lang=&#34;ruby&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;OmniAuth&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;config&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;on_failure &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; proc &lt;span style=&#34;color:#66d9ef&#34;&gt;do&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;|&lt;/span&gt;env&lt;span style=&#34;color:#f92672&#34;&gt;|&lt;/span&gt;
    &lt;span style=&#34;color:#66d9ef&#34;&gt;OmniAuth&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;::&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;FailureEndpoint&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;new(env)&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;redirect_to_failure
&lt;span style=&#34;color:#66d9ef&#34;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;By default, OmniAuth will log to STDOUT but you can configure this. If you don&amp;rsquo;t want OmniAuth to log to STDOUT, following could be used:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-ruby&#34; data-lang=&#34;ruby&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;OmniAuth&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;config&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;logger&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;level &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;Logger&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;::&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;UNKNOWN&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;setting-up-routes&#34;&gt;Setting up routes&lt;/h3&gt;
&lt;h5 id=&#34;login-route&#34;&gt;Login route&lt;/h5&gt;
&lt;p&gt;Starting with GET &lt;code&gt;/login&lt;/code&gt; route, where you can specify the options available to login:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-ruby&#34; data-lang=&#34;ruby&#34;&gt;get &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;/login&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;do&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&amp;lt;~&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;HTML&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;form method&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;post&amp;#39;&lt;/span&gt; action&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;/auth/gitlab&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;input type&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;hidden&amp;#34;&lt;/span&gt; name&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;authenticity_token&amp;#34;&lt;/span&gt; value&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;#{request.env[&amp;#34;rack.session&amp;#34;][&amp;#34;csrf&amp;#34;]}&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;button type&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;submit&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;Login&lt;/span&gt; with &lt;span style=&#34;color:#66d9ef&#34;&gt;Salsa&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/button&amp;gt;
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    &amp;lt;/&lt;/span&gt;form&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;form method&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;post&amp;#39;&lt;/span&gt; action&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;/auth/twitter&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;input type&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;hidden&amp;#34;&lt;/span&gt; name&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;authenticity_token&amp;#34;&lt;/span&gt; value&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;#{request.env[&amp;#34;rack.session&amp;#34;][&amp;#34;csrf&amp;#34;]}&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;button type&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;submit&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;Login&lt;/span&gt; with &lt;span style=&#34;color:#66d9ef&#34;&gt;Twitter&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/button&amp;gt;
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    &amp;lt;/&lt;/span&gt;form&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;form method&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;post&amp;#39;&lt;/span&gt; action&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;/auth/developer&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;input type&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;hidden&amp;#34;&lt;/span&gt; name&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;authenticity_token&amp;#34;&lt;/span&gt; value&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;#{request.env[&amp;#34;rack.session&amp;#34;][&amp;#34;csrf&amp;#34;]}&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;button type&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;submit&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;Login&lt;/span&gt; with &lt;span style=&#34;color:#66d9ef&#34;&gt;Developer&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/button&amp;gt;
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    &amp;lt;/&lt;/span&gt;form&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&#34;color:#66d9ef&#34;&gt;HTML&lt;/span&gt;
&lt;span style=&#34;color:#66d9ef&#34;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;auth/:provider&lt;/code&gt; path is created and configured automatically by OmniAuth, so you just need to send the request to that paths and auth process will start.&lt;br&gt;
&lt;em&gt;As per the OmniAuth version 2.0, OmniAuth now defaults to only POST as allowed request_phase methods and &lt;code&gt;authenticity_token&lt;/code&gt; is required to validate your requests so make sure to take care of this.&lt;/em&gt;&lt;/p&gt;
&lt;h5 id=&#34;callback-routes&#34;&gt;Callback routes:&lt;/h5&gt;
&lt;p&gt;On success from authentication, Omniauth will return the hash of information to the &lt;code&gt;auth/:provider/callback&lt;/code&gt; in the Rack environment under the key &lt;code&gt;omniauth.auth&lt;/code&gt; so this is what you can use in your desired way like creating a entry to your database and storing the current user in &lt;code&gt;session&lt;/code&gt; params.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-ruby&#34; data-lang=&#34;ruby&#34;&gt;get &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;/auth/:provider/callback&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;do&lt;/span&gt;
    erb &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    &amp;lt;h1&amp;gt;Hello &lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;#{&lt;/span&gt;request&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;env&lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;omniauth.auth&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;][&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;info&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;][&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;name&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;lt;/h1&amp;gt;&amp;#34;&lt;/span&gt;
&lt;span style=&#34;color:#66d9ef&#34;&gt;end&lt;/span&gt;

post &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;/auth/developer/callback&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;do&lt;/span&gt;
    erb &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    &amp;lt;h1&amp;gt;Hello &lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;#{&lt;/span&gt;request&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;env&lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;omniauth.auth&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;][&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;info&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;][&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;name&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;lt;/h1&amp;gt;&amp;#34;&lt;/span&gt;
&lt;span style=&#34;color:#66d9ef&#34;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here, POST request method is used for &lt;code&gt;developer&lt;/code&gt; strategy and GET request method for &lt;code&gt;twitter&lt;/code&gt; and &lt;code&gt;gitlab&lt;/code&gt; as that is how their working is defined in their respective strategies.&lt;/p&gt;
&lt;h5 id=&#34;failure-route&#34;&gt;Failure route:&lt;/h5&gt;
&lt;p&gt;If user authentication fails on the provider side, OmniAuth will catch the response and then redirect the request to the path &lt;code&gt;/auth/failure&lt;/code&gt;, passing a corresponding error message in a parameter named message.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-ruby&#34; data-lang=&#34;ruby&#34;&gt;get &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;/auth/failure&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;do&lt;/span&gt;
    halt(&lt;span style=&#34;color:#ae81ff&#34;&gt;403&lt;/span&gt;, erb(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&amp;lt;h2&amp;gt;Authentication Failed&amp;lt;/h2&amp;gt;&amp;lt;h4&amp;gt;Reason: &amp;lt;/h4&amp;gt;&amp;lt;pre&amp;gt;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;#{&lt;/span&gt;params&lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;:message&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;lt;/pre&amp;gt;&amp;#34;&lt;/span&gt;))
&lt;span style=&#34;color:#66d9ef&#34;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;final-result&#34;&gt;Final result&lt;/h3&gt;
&lt;p&gt;That&amp;rsquo;s it, our application is all set to be tested. And this is how it will be working.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://pavitkaur05.github.io/images/232441e2d8a740ff4d8f5bfb61c190763557a289.gif&#34; alt=&#34;Tutorial&#34;&gt;&lt;/p&gt;
&lt;p&gt;Here, I have already logged into my respective accounts so page for entring credentials does not show up but if the user has not logged into his account, he would be first asked to log in.&lt;/p&gt;
&lt;p&gt;For complete code, you can check out:
&lt;a href=&#34;https://github.com/PavitKaur05/OmniAuthWithSinatra&#34;&gt;OmniAuth with Sinatra Tutorial&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So this completes the tutorial. I hope it helps others who are looking to integrate their Ruby Applications with OmniAuth. If you have any feedback, feel free to let me know.&lt;/p&gt;
&lt;p&gt;See you next time!&lt;/p&gt;
</description> 
    </item>
    
    <item>
      <title>GSoC: About my Project and Community Bonding Period</title>
      <link>https://pavitkaur05.github.io/post/gsoc-about-my-project-and-community-bonding-period/</link>
      <pubDate>Tue, 08 Jun 2021 12:00:00 +0000</pubDate>
      <author>pavitk1@gmail.com (Pavit Kaur)</author>
      <guid>https://pavitkaur05.github.io/post/gsoc-about-my-project-and-community-bonding-period/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://pavitkaur05.github.io/images/debcixgsoc.jpeg&#34; alt=&#34;alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;To start writing about updates regarding my GSoC project, the first obvious thing I need to do is to explain what my project really is. So let’s get started.&lt;/p&gt;
&lt;h2 id=&#34;about-my-project&#34;&gt;About my project&lt;/h2&gt;
&lt;h4 id=&#34;what-is-debci&#34;&gt;What is debci?&lt;/h4&gt;
&lt;p&gt;Directly stating from the official docs:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The Debian continuous integration (debci) is an automated system that coordinates the execution of automated tests against packages in the Debian system.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h5 id=&#34;lets-try-decoding-it&#34;&gt;Let&amp;rsquo;s try decoding it:&lt;/h5&gt;
&lt;p&gt;Debian is a huge system with thousands of packages and within these packages exist inter-package dependencies. So if any package is updated, it is important to test if that package is working correctly but it is equally important to test that all the packages which are dependent on this updated package are working correctly too.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://ci.debian.net/&#34;&gt;Debci&lt;/a&gt; is a platform serving this purpose of automated testing for the entire Debian archive whenever a new version of the package, or of any package in its dependency chain is available. It comes with a UI that lets developers easily run tests and see their results if they pass or not.&lt;/p&gt;
&lt;p&gt;For my GSoC project, I am working to implement some incremental improvements to debci making it easier to use and maintain.&lt;/p&gt;
&lt;h2 id=&#34;community-bonding-period&#34;&gt;Community Bonding Period&lt;/h2&gt;
&lt;h4 id=&#34;the-debci-community&#34;&gt;The debci community&lt;/h4&gt;
&lt;p&gt;Everyone I have come across till now in the community is very nice. The debci community in itself is a small but active community. It really feels good to be a part of conversations here.&lt;/p&gt;
&lt;h4 id=&#34;weekly-call-set-up&#34;&gt;Weekly call set up&lt;/h4&gt;
&lt;p&gt;I have two mentors for this project Antonio Terceiro and Paul Gevers and they have set up a weekly sync call with me in which I will share my updates regarding the work done in the past week, any issues I am facing, and discuss the work for next week.  In addition to this, I can always contact them on IRC for any issue I am stuck in.&lt;/p&gt;
&lt;h4 id=&#34;work-till-now&#34;&gt;Work till now&lt;/h4&gt;
&lt;p&gt;The first thing I did in the community bonding period is setting up this blog. I wanted to have one for a long time and this seems to be a really nice opportunity to start. And the fact this has been added to &lt;a href=&#34;https://planet.debian.org/&#34;&gt;Planet Debian&lt;/a&gt; too makes me happier to write. I am still trying to get a hang of this and definitely need to learn how to spend less time writing it.&lt;/p&gt;
&lt;p&gt;I also worked on my already opened merge requests during this period and got them merged.&lt;/p&gt;
&lt;p&gt;Since I am already familiar with the codebase, so I started with my first deliverable a bit earlier before the official coding period begins which is &lt;strong&gt;migrating the logins to Salsa, Debian’s Gitlab Instance.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Currently, debci uses Debian SSO client certificates for logging in, but that is deprecated so it needs to be migrated to use &lt;a href=&#34;https://salsa.debian.org/&#34;&gt;Salsa&lt;/a&gt; as an identity provider.&lt;/p&gt;
&lt;p&gt;The OmniAuth library is being used to implement this with help of ruby-omniauth-gitlab strategy. I explored a great deal about integrating OmniAuth with our application and bumped into so many issues too when I began implementing that. Once I am done integrating the Salsa Authentication with debci, I am planning to write a separate tutorial on that which could be helpful to other people using OmniAuth with their application.&lt;/p&gt;
&lt;p&gt;With that, the community bonding period has ended on 7th June and the coding period officially begins and for now, I will be continuing working on my first deliverable.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s all for now. See you next time!&lt;/p&gt;
</description> 
    </item>
    
    <item>
      <title>Journey to GSoC</title>
      <link>https://pavitkaur05.github.io/post/journey-to-gsoc/</link>
      <pubDate>Tue, 25 May 2021 12:00:00 +0000</pubDate>
      <author>pavitk1@gmail.com (Pavit Kaur)</author>
      <guid>https://pavitkaur05.github.io/post/journey-to-gsoc/</guid>
      <description>&lt;p&gt;I am really excited that my Google Summer of Code proposal with Debian for the project &lt;strong&gt;“Debian Continuous Integration improvements”&lt;/strong&gt; has been accepted. Through this blog, I am here to share about my Pre-GSoC journey.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://pavitkaur05.github.io/images/gsoc.jpeg&#34; alt=&#34;alt text&#34;&gt;&lt;/p&gt;
&lt;p&gt;I knew about GSoC since my first year of college but had this misconception that only great coders get selected for GSoC which did not let me apply to the program until my 3rd year of engineering. I applied this year not because I thought I have turned into one but because I actually wanted to give a fair try to this before the time I become ineligible to participate.&lt;/p&gt;
&lt;h2 id=&#34;finding-project&#34;&gt;Finding Project&lt;/h2&gt;
&lt;p&gt;Scrolling through the list of GSoC 2021 organizations, I was checking out projects of organizations I am familiar with. Debian is one of the huge Open Source communities that has always inspired developers around the world to contribute to Open Source. So as I checked through Debian projects, I got excited to find the “Debian Continuous Integration improvements” project  (referred to as debci in this post) related to web development and more concerned with backend work which is something I am very much interested in.&lt;/p&gt;
&lt;p&gt;I joined the community, and as directed by the application tasks of the project I set up the debci on my machine and started with an issue labeled as a newcomer. Soon I was able to submit my first Merge Request and it was reviewed by Antonio Terceiro, the mentor of my GSoC Project. With his further guidance, I was able to turn MR into an acceptable patch, and voila it got merged! That really did boost my morale to contribute further to the project.&lt;/p&gt;
&lt;h2 id=&#34;student-application-period&#34;&gt;Student Application Period&lt;/h2&gt;
&lt;p&gt;At the suggestion of the mentor, during the Student Application Period, I worked on more open issues which were helping me understand the codebase better and in turn the deliverables of the project for my proposal. For my every doubt, I first tried to tackle it myself, and if still not able to find a solution I turn to mentors who did their best to answer my queries and this is how I completed my proposal and got it reviewed by Antonio before finally submitting it on 13th April. I still cannot express that feeling of satisfaction I achieved on submitting the proposal. I finally successfully applied for GSoC.&lt;/p&gt;
&lt;h2 id=&#34;after-proposal-submission&#34;&gt;After Proposal Submission&lt;/h2&gt;
&lt;p&gt;I did not stop my contribution after the Student Application period ended and kept on working on more issues which helped me stay in touch with the project and also because I was enjoying it a lot. I had already made up my mind to contribute more in Open Source as I learned and enjoyed plenty during this process.&lt;/p&gt;
&lt;h2 id=&#34;day-of-results&#34;&gt;Day of Results&lt;/h2&gt;
&lt;p&gt;On 17th May, I got my acceptance mail at around 11:30 pm at night and I remember screaming and waking everybody up in my home to announce the news to them. It was truly the happiest moment for me.&lt;/p&gt;
&lt;h2 id=&#34;moment-of-truth&#34;&gt;Moment of Truth&lt;/h2&gt;
&lt;p&gt;I would admit that I got involved with GSoC because of the reputation associated with it but things I learned during this pre GSoC period have made me realize the fun and learning opportunities associated with working opensource and I am here to stay for sure.&lt;/p&gt;
&lt;p&gt;I plan to write more blogs regarding my project and keep you guys updated about my work. Stay tuned!&lt;/p&gt;
</description> 
    </item>
    
    <item>
      <title></title>
      <link>https://pavitkaur05.github.io/home/subheader/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <author>pavitk1@gmail.com (Pavit Kaur)</author>
      <guid>https://pavitkaur05.github.io/home/subheader/</guid>
      <description>&lt;h2 id=&#34;nothing-is-as-permanent-as-a-temporary-solution-that-works&#34;&gt;&lt;em&gt;&amp;ldquo;Nothing is as permanent as a temporary solution that works&amp;rdquo;&lt;/em&gt;&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Anonymous&lt;/strong&gt;&lt;/p&gt;
</description> 
    </item>
    
  </channel>
</rss>

