I have been recently working on incorporation of Fedora Accounts System’s username search functionality in the project “Fedora Happiness Packets”. After weeks of working, it’s so overwhelming to see its on the verge of completion and being incorporated in the project.
About the project
The search functionality is used to find the name and email address of Fedora Accounts System’s users from their username, making it a lot easier for any sender to send happiness packets to a particular user with the knowledge of just their username.
Getting started with python-fedora
API
For incorporating the search, python-fedora
API is used to retrieve the data. After authenticating as a genuine fas-user
by passing credentials to AccountSystem
, we can retrieve the data using the method person_by_username
of a fas2
object.
Problems encountered
The solution to the problem statement was simple. What made the process challenging was lack of proper documentation of the Python-Fedora module. Since credentials like FAS username and FAS password were required for authenticating the user, the main goal was to use the data while the user logs into Fedora Happiness Packets.
I was aiming to use OpenID Connect, the client id, client secret which is used while registering the application to the OpenID provider (Ipsilon in this case). But the fas-client we have in python-fedora does not support OpenID Connect Authentication. This was the major problem which created a major stuck in the proceeding.
Another setback was Django’s crispy forms. Since we are using Crispy forms to create models and render the layout in the front end, it was difficult for me to access individual form elements since the whole concept was very new to me.
Quick fix
After getting solution recommendation from other admins of Fedora, I finally got a solution to pass through. Since the search functionality requires only an authenticated user, which necessarily may not be the user who logs in, we can use a testing Username and testing Password in the case of development environment. For testing, we can make a json file from where the original credentials and the values are read into the project.
What I learnt?
I worked in Django for the very first time and it was such an overwhelming experience. I got to learn most of the concepts of Django. How it works, how the data flows, how data gets rendered in the front end, etc. The concept of Django’s Crispy forms was something really new to me and I learnt how to deal with the it. Every time, I rely on documentation to get into details, but for the first time I was successfully able to get what is actually happening by going through the code manually.
My experience
I had really enjoyed working with such an welcoming community. Almost all of my doubts are cleared during this application process. What actually I learnt that I am gonna keep with myself forever is, “There is always an alternative solution to any problem! We just need to minimize the gap between its actual existence and our knowledge of its being”.
Vote of Thanks!
Thanks to Justin (@jflory7) for helping me with my piles of doubts and queries. Jona (@jonatoni) was very kind to find explicit time to frame my ideas, thanks to her. A special thanks to Clement (@cverna) for helping me proceed with a viable solution, during one of the major hurdle I faced.
Thank you 🙂
Start the discussion by commenting on the auto-created topic at discussion.fedoraproject.org