Posts

A health wise peep into the life of a home based developer

First look at the lifestyle of a developer: Basically, a home-based developer though it applies to an office developer. It all begins with the lifestyle of the individual. Haven lived in this lifestyle and among other developers who equally lived a similar lifestyle, I can say the following.  Most developers take it as a lifestyle in that skipping breakfast is the order of the day and telling you that the last meal they take was maybe yesterday afternoon is a common wording that you can hear. This is not because they don’t have the means to get the food but most times because they neither felt hungry nor hadn’t any time to look for something and eat. This even goes further when they happened to get something and eat they eat what is termed junk food. Here I mean they go for what is readily available and takes less effort to acquire. They end up with things like bread, or just carbohydrate food. That is if we are to qualify it as food then they might spend their remaining time...

Using AWS inspector to monitor AWS EC2 instance for common vulnerabilities.

Image
AWS Inspector. This is an automated security assessment service on the AWS console which scans through your environment and provides you with a report of vulnerabilities in it. this service is useful in that It helps to improve the security and complains of applications deployed in the AWS environment It assesses the application for exposure (vulnerabilities and deviation from best security practices) Shows your changes which took place that exposes your infrastructure. It recommends possible ways of fixing the vulnerabilities. How to set up the inspector. To set up and AWS inspector, you need to make sure the service you want to monitor or access is running, in this case, the ec2 has to be running. So with the instance, you want to access running, on the AWS console search for the inspector service. With the inspector service on focus, click on get started. Next, you are presented with the page for configuring or choosing the type of assessment of which a...

Cross origin request explained

Image
If You are a developer getting started or have played with frontend as well as backend development for some time now then you must have faced issues with CORS a lot of the time. and I guess by now you must have known how to solve them. If you have not then follow along and you will know the reason why it is occuring and how to resolve it. If you already know how to solve it but don't understand the theory and reason behind what you do in order to solve it then you are in the right place. If you are a backend developer then you might have also heard a lot of your frontend guys ask you to enable CORS. For a frontend dev, the typical error you get is this. Access to fetch at 'http://localhost:3000/' from origin 'http://localhost:3001' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with C...

Algorithm Design A Call For Concern To Software Engineers

Image
Algorithms in its entirety are often misunderstood and misinterpreted by most of the software engineers or developers. Technically every software or program you develop does use an algorithm and in most cases brute-force that is the obvious solution and at times the easiest. In computer science and software engineering, the concern is in solving problems and any problem that needs to be solved requires a solution in a finite amount of time and using the smallest amount of resources as possible.  In this post is the discussion about the importance and need for a software engineer to be able and capable of designing a good algorithm in his or her software development lifetime. This post will also go further to demonstrate on the side effects that you as a developer have without basic knowledge of algorithms,  the software that you build and the community that uses the software you build. Importance of good algorithm design. Algorithm design is important because They make ...

Reset Password via Email Project

Image
Primary Mentor: Wyclif Luyima . Backup Mentor: Burke Mamlin . Student: Harisu fanyui Project Wiki:  https://wiki.openmrs.org/display/projects/Reset+Password+via+Email+Project Overview. This project aims at adding new feature into openmrs, ie that of which to allow users to perform self service resetting of password. This is going to do away with the bottle neck on the admins of having to carryout the password reset for other users by generating temporal password so when they log in they can reset. Or by allowing the users to provide some secret answers to secret questions that were previously provided. This new feature will allow users to request for password reset to be done via email and most importantly it should work and allow all these actions to be carried via reset webservice. Work still to be done. Create a page for the reference app for requesting a password reset Update the reference app pages that are used for resetting password and the controllers to d...

Week Twelve

Image
Week 12. This week commenced and i fully worked on making sure all the hanging pull request with respect to the core have been merged and closed. I accomplished these by hastening up my speed in fixing reviews, then i created new branches called general fix where all the light works related to renaming adding exception modifying exception messages and as well writing tests. Rest webservice. After sucessfully finishing with the core and everything merged, I went straight away to the  rest webservice module where i added 2 endpoint to handle the get with provided activation and a post with new credentials  password and activation key. this i did before consulting my mentor and  after consulting him. There was alot of other design changes such. i had to send and email message to my two mentors ie primary mentor and backup mentor. I also posted on talk here   from this talk post i received many criticism and all of them were positively to my benefits in finishing u...

Week Eleven

Gsoc Week 11, This week commenced and was interleaved with a lot of assorted activities which i under took some of which were not directly related to the my gsoc activities. This week i while still working on and fixing a the pending reviews on the pull request i made, i created off a branch from my supposed master reference which in this case is passwordreset then i added some code to receive the new password along side the activation key and creates an updates the user password if the activation key provided in the request is proven to belong to the user and is valid as the constraint provided in the method that will be invoke to get the user using the email. which are make sure that the user activation key exist and is not expired, make sure the activation key is linked to a user. After adding this method i had to also as usual write test to make sure that  the user password is updated if activation key is correct and one to make sure that the password is not updated if the ...

Week 10

Image
Gsoc Week 10. This week started off with a continuation of addressing the pending reviews still on the pull request which did not get merged the following week. I went further and continued writing some tests. I also during this week had to make a presentiation of the work i've done so fare till date. This i made following some reviews of past works that i saw in past gsoc students. I started by creating a youtube channel then i went further to create a power point presentation after i got the presentation working. I had as a next challenge in making a video explaining what my presentation is talking about. Below is a front page of my presentation of the work i did. and the complete power point presentation of th work can be found here  .Aslso the link to the you tube presentaion can be found here Password Reset Via email Project -gsoc midterm presentation . Also the link to the openmrs talk page can be found here  talk page By the end of this week i still c...

Week nine

Image
Mid Term Evaluation This week begin with me continuing to fix the reviews that my mentor made during the previous week. I continued the reviews until even by the end of the week the work was still hanging on the review as along the line i encountered a blocker which was about writing a test and the test was time sensitive as such creating a data set was difficult. This i had addressed in the previous week by moving these test into the userDAOTest and everything worked fine but as a result of the reviews, I had to as well migrate these test from the DAO to the service layer. This is where the algorithm which i used in the DAO for writing the test did not hold as the Logincredential which i am supposed to use was not available in the service layer. I did fixed all the other sections of the reviews but this was a blocker as it took more time debugging and actually letting me learn alot from the process. By the end of the week i had a call with my mentor and he left me with some hints a...

Week 8

Today i started by Migrating the User activation key to the login credential Object, this is as a result of the design discussion i had last week with my mentor and the reason is to abstract the activation key from being return in the User object and instead return it in the LoginCredential object. This process entails migrating the fields, methods and carrying out the mapping for the LoginCredential object. Which these i took care of. immediately i did this i noticed a failing test which is that of getUserByActivation Key this is a sure case and of course normal as the user object does not have the activation key any longer. I added the setActivationKey method to persist the created token and hashed to form the activation Key. This came up after the refactoring of the user object by sending the activation key to the LoginCredential Object. After successfully completing the above i made a pull request and from the feedback i got just the very same day i started updating...

Week Seven

Monday beginning of week 7.  I started this week freshly after having my pull request merged during the week that just passed, I Needed to move to new things and I went straing to the Openmrs webservice to consume the methods that i just added, During t he process of adding this method, I Tried accessing the methods which i added into core and non of them was available , i tried compiling and it failed then i realized it is not sync with the core during the build so i had to after some googling and seeking for help on the irc channel resulted to the option of me sending and email to my mentor for help in addressing the concern. I therefore got a reply with instructions on how i can do to get pass this blocker. I quickly implimented as i was told and there i went with build success. After having a sucessful build,   Now i went straight away to adding the functionality i was about to add. Immediately i started i noticed I was alsmost exposing the alot of logic to the r...

Week Six

Week 6 of google summer of code. This week began not different from the other ones but as it enfolds it showed to be one of a kind as the entire activities of the week turned around monotonous and with me perfecting the one and only single task. that of fixing and finalizing the pull request i made and making sure that all the content with respect to my gsoc project that relate to the openMRS-core have been fixed and merged to the set up repository located Passwordreset . Addressing the core issues meant the beginning of a new dawn for me as the next phase will completely depend on the functionality just added to the core to function. As the week commenced and went further i keep receiving reviews and fixing them day after day and it went further until i finally before the week went to and end addressed all the issues and got my pull request merged. In the process of fixing the reviews and writing test for the added code i had some hard times as some of the tests were failing and deb...

Week Five

 Week Five of gsoc This week  I continued work on Reviewing the not yet  addressed reviews that were left. Model change Then i went further to add to the user table another field by name user activation_key. This newly added field came up again as a series of discurssion which i had with my mentors and   we deemed necessary to instead of having another table to keep track of the token, expiry date, and relate it to   the user we should rather introduce another field to the already existing user model and this field   have as content, The user token which has been hashed (reversible) also going to use the salt which already already exist and is used for password hashing. and combined to this hashed token will be the timestamp of when the request for password reset was made(to be used for knowing if the token has expired or not). The hashed token  which will be of the format Hashed_token:timeStamp (xyt354m8912ghx:1233455612) is...

Week four

Image
Gsoc week four. Week four of the summer work as all other weeks that have passed had a similar experience and it began by me Bringing up a design with functional requirements as was told by my mentors. I brought up the requirements having in mind to use a library which I have been studying and understanding and as such I had to use one of the UML(Unified Modelling Language ) tool to do the design which in this case I chosed the usecase diagram and came up with the following . I made this use case having in mind to implement using JWT(JSON Web Token) but when I presented it to my mentors. I had a lot of positive feedbacks which I did not see at the instance when I did my design. Most of the discursion and criticism on this is found on talk here . After the deliberations and the feedback I got I had to change my way of thinking about the JWT. New methodology was proposed that of adding another field to the user table (activation_key) which will contain the token and als...

Gsoc Week three

Image
Implimentation continues. My week three has been some how challenging though i did not do much of coding during this week. It began with me Looking into resolving the blockers that i had the week which this one followed. One of the blocker which was a design issue and needed me to have it discussed with my mentor. This blocker came up as a result of some pull request reviews which i trying to fix led to a majority of test failing and i got worried, It Actually took a while for me to get it working reason being that the week was full of official public holidays, public and non working hours particularly for my mentor hence it delayed my resolving of the blocker. This did not just end here I after temporally resolving the issue while waiting for my mentor to discuss with them went further into  looking at the rest webservice module how to add my own new endpoint . This from the wiki seemed not to be a tedious work with the example they used. But while i started following the proce...

Gsoc Week Two

Image
Coding continues. Summarily, Week two of the summer cycle involved me structuring the the core to receive an email address and should be able to return the user using the email and as well to get a grasp of openmrs webservice module During this week I. Carried out the following activities. I Added an email field to the openmrs core module then i also added the necessary getters and setters methods, also went further to add all the methods in the interfaces, classes and some other methods and criteria query to retrieve a user by email supplied. Github pull request Link I also finished working on reviews from RESTWS-706 . with pull request I also Read up on json web token. I Had a look up on the openmrs-module-webservices.rest  figuring out how it works. I also Read on  Resp api design  and naming RESTful resources.  During this week i also had a meeting with my mentor and we discoursed on how and which json web token library i will use in composing toke...