Skip to main content

Posts

Thought Work 17 Sept

https://www.sandimetz.com/blog/2017/9/13/breaking-up-the-behemoth Churn - new measure unit/way. Complex and frequently changed code (git commits). Complex but rarely change code may be OK. Not complex but changed frequently also be OK. OO vs complex (big) procedural code. OO is cost-effective.... https://www.kitchensoap.com/2017/08/12/multiple-perspectives-on-technical-problems-and-solutions/  Architecture Review Working Group, or “ARWG” was developed. The main idea was that such a group could keep the practice going without senior engineering leadership bringing an authoritarian flavor to the meetings, and continually model the behavior the practice needed to encourage the multiple perspectives that departures needed. You might be thinking: “but where and when does a decision   get made?” The ARWG’s role was  not  to make a decision. The ARWG’s role was to  create and sustain the conditions where a dialogue can take place , with as many perspec...

Epress authen, routing, middleware ...

https://stackoverflow.com/questions/11784233/using-passportjs-how-does-one-pass-additional-form-fields-to-the-local-authenti https://blog.risingstack.com/node-hero-node-js-authentication-passport-js/ https://www.owasp.org/index.php/Session_Management_Cheat_Sheet https://stackoverflow.com/questions/10306185/nodejs-best-way-to-pass-common-variables-into-separate-modules https://www.npmjs.com/package/express-passport-session-tracker https://stackoverflow.com/questions/16800418/how-to-properly-pass-mysql-connection-to-routes-with-express-js https://scotch.io/tutorials/easy-node-authentication-setup-and-local https://scotch.io/bar-talk/the-ins-and-outs-of-token-based-authentication https://scotch.io/tutorials/the-anatomy-of-a-json-web-token https://jonathanmh.com/express-passport-json-web-token-jwt-authentication-beginners/ https://github.com/jaredhanson/passport/blob/master/lib/strategies/session.js https://stackoverflow.com/questions/2015232/database-design-for-audit-...

Sample passport Express dùng strategy Github

Link tut:  https://gist.github.com/jokecamp/65604d50227b8ea8e0d3 Đầu tiên càn tạo Github apps: Vô Setting (profile j đó) > Github Apps (tab bên trái dưới) > new app. điền đúng thông tin redirect URL, callback (ai làm Facebook OAuth, Google 0Auth thì rõ). Code demo: package.json: { "name": "securehelloworld", "version": "1.0.0", "description": "", "main": "server.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "dependencies": { "express": "^4.13.3", "express-session": "^1.11.3", "passport": "^0.3.0", "passport-github": "^1.0.0" } } 1 var express = require('express'); 2 var app = express(); 3 var passpo...