Code Monkey home page Code Monkey logo

simple-auth's People

Contributors

dependabot[bot] avatar gjordao avatar microanibal avatar nneves avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

fmagno nneves bomany

simple-auth's Issues

JWT token support

I would like to request support for JWT token type auth.

This is a very common auth standard, and would greatly increase compatibility with other technologies.

What do you think?

Feature request: Support OAuth flows

It would be fantastic if simple-auth would support using OAuth compatible services in order to make it easy to plug into other auth systems that support it.

feature request: ability to select the hashing algorithm

The project is using bcrypt, and it already has a healthy selection of options for algorithms.

It would be great to let the user select the one they would like to use through an ENV variable or similar.

A secure default should be used like AES256 for example. It might also be necessary to allow the user to inject algorithm specific configuration.

PASSWORD_RESET_URL is required but it shouldn't

The environment variable PASSWORD_RESET_URL is set as required but by default we do not expect an SMPT server to be provided (we need email to send the password reset url). We need to either:

  • Remove the required restriction from this ENV
    OR
  • Set it to required only if the SMTP server is provided

Add max number of tries for logins

  • Should be controlled by an env variable
    • Should default to 3
  • Should lock that user account for X time
    • Time controlled by env variable
    • Default to 2 minutes

Expose additional Nodemailer configurations

Extend env var configuration to allow other SMPT connection configurations:

  1. secure
  2. not secure but force STARTTLS to be used
  3. not secure and don't use STARTTLS

New .env variables setup:

  1. secure
SMTP_SECURE=true
SMTP_REQUIRE_TLS=false
SMTP_IGNORE_TLS=false
  1. not secure but force STARTTLS to be used
SMTP_SECURE=false
SMTP_REQUIRE_TLS=true
SMTP_IGNORE_TLS=false
  1. not secure and don't use STARTTLS
SMTP_SECURE=false
SMTP_REQUIRE_TLS=false
SMTP_IGNORE_TLS=true

Feature Request: Structured Logging

Most projects these days will have their logs collected and analysed somewhere.

It would be great if we could get structured logging in json format in order to make analysis easier.

Feature request: add "middleware" to allow the developer to enrich the JWT payload

Scenario:
As a developer, I may wish to add more content to the JWT payload. This is a very common use case.

Suggestion:
If I as a developer could configure a web hook to be used before the JWT is returned, I could create a service to return the payload to be added to the JWT token (inside a payload property for example).

{
...
  payload: {
    // the returned object from my webhook
  }
}

Mitigate timing attack in authentication

When attempting to authenticate, if a user does not exist the it will throw invalidCredentialsError, while when a user exists it takes much longer as the attempted password gets hashed and compared with the stored password. This allows for an attacker to infer whether or not a given account exists based upon the response time of an authentication attempt.

A way to mitigate this is to run a hash of a dummy password that is guaranteed to fail.

Use node 14.x (LTS) in Dockerfile

Use node-slim instead of alpine to avoid some issues with binaries. We can iterate on this if performance is an issue at some point

Environment service returning 'true' if ENVVAR is set to false

When setting a "boolean" env var to false (.env file or shell export), the Environment service will always return true.

Example: set the local .env file to
SMTP_SECURE=false

This code will always evaluate it to true (parsedField will always be true, regardeless of the value you put)
https://github.com/GJordao/simple-auth/blob/master/src/services/Environment/Environment.ts#L82

There are some conditions in the cloud that you want to turn ON or OFF the functionality by changing the env var between true/false, at the moment you need to completly remove the env var from the setup to make it OFF!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.