npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@hilma/auth-server

v1.0.41

Published

Hilma Auth Server side is build over loopback 3, Providing you usefull extentions to the basic loopback auth. (Previously named auth, tools, supermodel)

Downloads

12

Readme

Hilma Auth (Server)

Hilma Auth Server side is build over loopback 3, Providing you usefull extentions to the basic loopback auth. (Previously named auth, tools, supermodel)

Installation

Go into your project, make sure you are inside the server folder (root folder, mostly):

via NPM

  npm install @hilma/auth-server

via Submodule

  git submodule add https://github.com/hilma-tech/hilma-auth-server.git auth

Important: Make sure you add to model-config.json the path to the module.

Introduction

Hilma Auth Server is divided to 3 main things:

  • Mixins -- > [ delete-relations.js, extended-user.js ]
  • Models -- > [ access-logger.json, stop.json. stop.js ]
  • Tools -- > [ discover-models, time-calcs, validate-tools]

roleAccessConfig

In order to use custom components and dhp for each role, you'll need to add to your server/config.json something like this:

"roleAccessConfig": {
  "ADMIN": {
    "comps": [
      "AdminMain"
    ],
    "defaultHomePage": "AdminMain"
  },
  "TRAINER": {
    "comps": [
      "TrainerMain"
    ],
    "defaultHomePage": "TrainerMain"
  },
  "COACH": {
    "comps": [
      "CoachHome"
    ],
    "defaultHomePage": "CoachHome"
  }
}

Mixins

Extended User

You can add the Extended User mixin to your user model, like that:

{
  "name": "Customer",
  "base": "User",
  "mixins": {
    "ExtendedUser": true,
   }
 }
What this mixins adds to your model (basic addons)?

When you activate the mixins, it gives you the following addons: | Addone | Explenation | | ------ | ------ | | Created, Modified | Create a 'Created' and 'Modified' properties on your model. | | RoleMapping | HasOne Relation to role-mapping model. | | After login | Gives you kl, klos, access-token cookies after login. | | Authenticate (func) | checks if the requested user has a valid AccessToken. | | deleteUserItems (func) | Delete the user Items after logout |

More Addones

If you want, you can allow more options to this mixin.

  • Disable Email

    If true, disable all Email related requirements - you won't need to provide an email while login or register, etc. Accepts a boolean (default false) Example:

         "ExtendedUser": {
             "DisableEmail": true,
          }
  • Default Max Age

    Define for how long the cookies are going to last (milliseconds). Accepts a number. Example:

         "ExtendedUser": {
             "DefaultMaxAge": 31556952000,
          }

    ( 31556952000 = one year in ms )

  • ManagedPasswords
  • Optional functions to manage user's password for security reasons. | property | Explenation | Default | type | ------ | ------ | ------ | ------ | | PreviousPasswords | Saves each user's 5 last passwords (encrypted) on a table name "Stop". Won't let user change their password to one of the previous ones. | false | boolean | ForceResetPassword | Force the user to change password after time specified. if "true" - uses the default value. Otherwise, use the number provided. | 6 months in ms (15552000000) | boolean\ number (ms)

    Example:

         "ExtendedUser": {
            "ManagedPasswords": {
             "PreviousPasswords": true,
             "ForceResetPassword": 93434223344
            }
          }
  • AccessLogger

    Won't let user log in if they fail to log in X times. | property | Explenation | Default | ------ | ------ | ------ | | BlockCount | The number of tries a user have before they been block. | 5 | BlockTime | The time the user has to wait before trying to log in again (milliseconds) | 600000 Example:

         "ExtendedUser": {
             "AccessLogger": {
                "BlockCount": 3,
                "BlockTime": 50000
             },
          }
  • ResetPassword

    Reset Password option will let the user reset his password through an email. | property | Explenation | Default | ------ | ------ | ------ | | Subject | The subject of the mail sent to the user. | Password Reset | TextStart | The text to begin the mail with. | Click | Click | The href text | here | TextEnd | The text to ends the mail with. | to reset your password

    Example:

         "ExtendedUser": {
           "ResetPassword": {
             "Subject": "איפוס ססמה בתן כתף",
             "TextStart": "שלום, על מנת לאפס ססמה לחץ",
             "Click": "ממש פה!!!",
             "TextEnd": "יום מקסים שיהיה לכם"
            },
          }
  • EmailVarification

    Reset Password option will let the user reset his password through an email. | property | Explenation | Default | ------ | ------ | ------ | | Subject | The subject of the mail sent to the user. | Verify Registration | TextStart | The text to begin the mail with. | Click | Click | The href text | here | TextEnd | The text to ends the mail with. | to verify your email

    Example:

         "ExtendedUser": {
              "EmailVarification": {
                "Subject": "תן כתף - אימות אימייל",
                "TextStart": "שלום, על מנת לאמת את אימיילך לחץ",
                "Click": "כאן!!!!!",
                "TextEnd": "יום מבורך"
              }
          }
Example of all ExtendedUser mixins' options:
{
 "mixins": {
    "ExtendedUser": {
      "DefaultMaxAge": 3545344424, 
      "DisableEmail": true,
      "ManagedPasswords": {
         "PreviousPasswords": true,
         "ForceResetPassword": 93434223344
       },
      "AccessLogger": {
        "BlockCount": 3,
        "BlockTime": 50000
      },
      "ResetPassword": {
        "Subject": "איפוס ססמה בתן כתף",
        "TextStart": "שלום, על מנת לאפס ססמה לחץ",
        "Click": "ממש פה!!!",
        "TextEnd": "יום מקסים שיהיה לכם"
      },
      "EmailVarification": {
        "Subject": "תן כתף - אימות אימייל",
        "TextStart": "שלום, על מנת לאמת את אימיילך לחץ",
        "Click": "כאן!!!!!",
        "TextEnd": "יום מבורך"
      }
    }
  }
}

Delete Relations

This mixin deletes somtehing and everything related to it. It create a function to the model (Model.deleteRelationalById), which accept an Id of the user.

Tools

Discover Models

Time Calcs

Validate Tools

License

MIT