Day 56: Another Day – More Code to Read

Continued my web security studies. Reading through the codebase for the PassportJS package. Still trying to breakdown the PassportJS software design. I am continuing to make slow steady progress.

I have been following all the operations that take place when the PassportJS package is imported into another JavaScript module. That journey starts with the construction of the Authenticator class instance and everything that comes with it. I have been following that construction process through the code by then looking at all the branch operations taking place as a result of that construction.

I now have to get through the construction of a SessionManager class instance outline because it is constructed and attached to the Passport instance when it is initially constructed.

TLDR;

Okay, so here are the highlights of what I did:

  • Backend -> Continued studying the concepts mentioned in the web security section. I continued reading through the package’s code base to fill in some of the gaps that are not fully covered in the documentation. The goal is to finish compiling all the information in this docs page as well as all the other examples and sources to construct my own notes that ensure this framework is clear and easy for me to use in the future. Continued working through the codebase while writing notes on the design of the package.

Passport Package Breakdown Notes – Update

Differences in Notes

diff --git a/packages/express/packages_related/passport/topics/advanced/package_breakdown/README.md b/packages/express/packages_related/passport/topics/advanced/package_breakdown/README.md
index cffc6bc..5a6bd88 100644
--- a/packages/express/packages_related/passport/topics/advanced/package_breakdown/README.md
+++ b/packages/express/packages_related/passport/topics/advanced/package_breakdown/README.md
@@ -150,7 +150,7 @@ When import passport package:
     }
 
   - When it get's constructed it automatically calls it's init method, which:
-
+s
     1. Calls the Passport `Instance.framework()` inherited method which sets the Passport Instance._framework property to 
        an object with an `initialize` and `authenticate` property derived from the 
        middleware/{initialize,authenticate}.js modules respectively.
@@ -166,12 +166,17 @@ When import passport package:
            name: 'session'
            _key: options.key || 'passport'
            _deserializeUser: (fn, req, done) => this._deserializers.push(fn) || done(error) || null
-	   error:            () => *FILL IN*                     // Set on all Passport Instance Strategies when 
-	                                                         // the `middleware/authenticate.js` module function is run.
-	   pass:             () => *FILL IN*                     // Set on all Passport Instance Strategies when 
-	                                                         // the `middleware/authenticate.js` module function is run.
-	   success:          () => *FILL IN*                     // Set on all Passport Instance Strategies when 
-	                                                         // the `middleware/authenticate.js` module function is run.
+
+	   /*
+	   *  The following properties are set on all strategy instances that have been
+	   *  added to the Passport `Instance._strategies` property. These methods are
+	   *  added later to each strategy by the `middleware/authenticate.js` module function when it is run.
+	   */
+	   error:            (e) => callback(err)
+	   pass:             () => undefined
+	   success:          (user, info) => callback(null, user, info) || next(err) || undefined || etc
+	   fail:             (challenge, status) => undefined
+	   redirect:         (url, status) => undefined
          }
          Class Methods: {
            authenticate:     (req, options) => new Error || self.error(err) //?? Not sure when it got an error method?


Goal For Round 8 of the #100DaysofCode Challenge

This is my eighth round of the “#100daysofcode” challenge. I will be continuing my work from round five, six, and seven into round eight. I was working through the book “Cracking the Coding Interview” by Gayle Laakmann McDowell. My goal was to become more familiar with algorithms and data structures. This goal was derived from my goal to better understand operating systems and key programs that I use in the terminal regularly e.g. Git. This goal was in turn derived from my desire to better understand the fundamental tools used for coding outside of popular GUIs. This in turn was derived from my desire to be a better back-end developer.

I am currently putting a pause on the algorithm work to build some backend/full stack projects. I primarily want to improve my skills with the back-end from an implementation perspective. I have improved tremendously in terminal and CLI skills but I lost focus due to how abstract the algorithm concepts got. I wanted to work on things that were more tangible until I can get to a position where I could directly benefit from improving my algorithm skills and theoretical knowledge. So that’s the focus right now. Build my backend skills and prove my full stack capabilities by building some dope projects.

Again, I still have no idea if my path is correct but I am walking down this road anyways. Worst case scenario I learn a whole bunch of stuff that will help me out on my own personal projects. Best case scenario I actually become one of those unicorn developers that go on to start a billion dollar company… You never know LOL.