{"id":23430694,"url":"https://github.com/sanketmaru/node-security","last_synced_at":"2025-10-30T12:32:10.489Z","repository":{"id":20909602,"uuid":"24197386","full_name":"sanketmaru/node-security","owner":"sanketmaru","description":"Node Security Application which will bootstrap a node js application in seconds and ready with a login features.","archived":false,"fork":false,"pushed_at":"2014-09-27T03:37:46.000Z","size":260,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-24T05:22:14.505Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sanketmaru.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-18T17:11:54.000Z","updated_at":"2018-06-18T15:56:19.000Z","dependencies_parsed_at":"2022-08-26T18:50:57.513Z","dependency_job_id":null,"html_url":"https://github.com/sanketmaru/node-security","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanketmaru%2Fnode-security","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanketmaru%2Fnode-security/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanketmaru%2Fnode-security/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanketmaru%2Fnode-security/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sanketmaru","download_url":"https://codeload.github.com/sanketmaru/node-security/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238968635,"owners_count":19560594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-23T09:46:25.234Z","updated_at":"2025-10-30T12:32:10.189Z","avatar_url":"https://github.com/sanketmaru.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"node-security\n=============\n\nNode Security Application which will authorize as well as authenticate users.\n\nCurrently the configurations are done with mysql db , next version will include configurations with NoSql database as well and a ready login module which will provide authorization for users. The code is also tightly coupled with the configs used. In the next versions users should not be concern with app.js changes and just need to place the configurations.\n\nBelow steps needs to be done to use this module :-\n\n1. Create a config directory inside your application folder.\n2. Copy sampledb.js and sampleconfig.js and rename it with db.js and config.js and place your configurations in this file. This include db configurations only.\n3. In your app.js place the below code to use the SignIn and SignUp features.\n\n\nMain app.js sample format\n\nvar express = require('express');\nvar DBConfig = require('./config/db');\nvar rolesConfig = require('./config/roles');\nGLOBAL.DBConfig = DBConfig;\nGLOBAL.rolesConfig = rolesConfig;\nnewMod = require('./lib');\nvar app = express();\n\napp.use(express.cookieParser());\napp.use(express.session({secret: 'xyz'}));\n\napp.get('/login', newMod.signIn, function(req, res){\n\tres.jsonp({\n\t\tsuccess:true,\n\t\t\"message\" : \"Login Success\"\n\t})\n});\n\napp.get('/signUp', newMod.signUp, function(req, res){\n\tres.jsonp({\n\t\tsuccess:true,\n\t\t\"message\" : \"signUp Success\"\n\t})\n});\n\napp.get('/addUserRole', newMod.addUserRole, function(req, res){\n\tres.jsonp({\n\t\tsuccess:true,\n\t\t\"message\" : \"addUserRole Success\"\n\t})\n});\n\napp.get('/admin', newMod.checkUserRole, newMod.checkUrlPattern, function(req, res){\n\tres.jsonp({\n\t\tsuccess:true,\n\t\t\"message\" : \"admin role Success\"\n\t})\n});\n\napp.get('/user', newMod.checkUserRole, newMod.checkUrlPattern, function(req, res){\n\tres.jsonp({\n\t\tsuccess:true,\n\t\t\"message\" : \"admin role Success\"\n\t})\n});\n\napp.listen(process.env.PORT || 9001);\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanketmaru%2Fnode-security","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanketmaru%2Fnode-security","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanketmaru%2Fnode-security/lists"}