Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LandonPattison/21839d41101923fe1564f653d90ffa6f to your computer and use it in GitHub Desktop.
Save LandonPattison/21839d41101923fe1564f653d90ffa6f to your computer and use it in GitHub Desktop.

Google Summer of Code 2022 - OpenFoodFacts - Project Submission

Description

Goals of the Project

  • Implement an external authentication microservice
  • Migrate users from current database to microservice authentication database
  • Integrate the given microservice UI into OpenFoodFacts

The main goal of the project was to integrate a authentication microservice into OpenFoodFacts, to have OpenFoodFacts user management code less complex and provide more features for users and app developers. When deciding on which microservice to use I had to take several things into consideration. I had to chose a microservice that could be hosted on OpenFoodFacts infastructure, allowed for importing of user credentials, but also a organization with good documentation of their service and also a community that was active. For these reasons I chose the open source organization Ory.

Overview of my work

  • Integrated Ory authentication and UI to the existing Perl codebase
  • Added the ability to import SCrypt passwords into Ory
  • Wrote Perl scripts to migrate users
  • Started adding i18n to the Ory UI

PRs during Google Summer of Code

  • Integrating Ory authentication and UI into OpenFoodFacts (these two PRs will be merged together, we kept the work in a separate PR and will be able to merge them with a feature flag) #7071 This was the main portion of connecting ory and openfoodfacts #6868
  • Adding the ability of importing Scrypt passwords into Ory (merged) #2689 This pr added the ability of importing SCrypt hashing passwords which are used in OpenFoodFacts into Ory Authentication
  • Adding i18n to a fork of the kratos UI (in progress)#1 This is a fork of the kratos UI for adding i18n for users around the world

Future Work

To finish the integration of external authentication into Openfoodfacts

  • HTMl and CSS needs to be changed in Ory UI to have the look and feel of OpenFoodFacts
  • Change UI to not let users change UserID or implement feature of allowing users to change UserID by changing MongoDB products

Further ideas that could be done

  • Add OAuth from Ory Hydra, this will be a simple integration after this PR
  • Take users completely out of STO perl database and rely solely on Ory

The project is nearly finished and I would love to continue working on it. I loved contributing to OpenFoodFacts, it is an amazing community and I will continue to contribute.

Some Obstacles I faced / What I learned

I got to learn many new technologies I've never used during my summer of code including, Docker, Perl, Go (Golang), NodeJS, and ExpressJS. I also improved upon my knowledge of technologies I have used before such as REST APIs and Git.

I faced many obstacles during my summer of code especially at the start. I had much trouble wrapping my head around docker but as I continued working and with the help of my mentors I gained a better understanding of its workings. Perl was a language that I have never used before. At the beginning it was hard to get used to but I eventually got used to it(it was a very interesting language to use :) ). I also faced the obstacle of not being able to impot users passwords using the hashing algorithm done in OpenFoodFacts. Because of this I gained experience in Go which I really enjoyed working with and plan on using in future personal projects. Another obstacle I faced was the nonexistent feature of i18n in the Ory UI. I am still working on this and plan to get it done soon, but because of this I have gained experience in NodeJS and ExpressJS.

I could not thank my mentors enough for helping me through obstacles I faced and guiding me through this experience. I enjoyed doing a project for OpenFoodFacts and what I've learned and the experience I've had will carry on with me the rest of my life.

All Open Source software I used/contributed to

I have got to work with many open source communities throughout this experience and have contributed to several besides OpenFoodFacts. I did contributions to Ory and I also got help from the i18next maintainers in adding i18n to the UI of this project.
OpenFoodFacts - #7071, #6868, #1
Perl
Go
Docker
Ory - merged PR
i18next

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment