Code Monkey home page Code Monkey logo

authboss's People

Contributors

aarondl avatar abelkuruvilla avatar alireza-ahmadi avatar buu700 avatar ckeeney avatar cortesi avatar dependabot[bot] avatar frederikhors avatar golliher avatar gys avatar ibraheemdev avatar jakha avatar jmhodges avatar justin-wilxite avatar kaiomagalhaes avatar kris-runzer avatar maxhowald avatar mkp7 avatar nkonev avatar orian avatar rbren avatar stephenafamo avatar sunwukonga avatar testwill avatar tobias-kuendig avatar viovanov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

authboss's Issues

Did we forget a use case for editing users?

How do users reset their password in a normal flow? Do they really have to go through recover and getting e-mails etc? Or are we leaving all user editing up to the other person, who then now has to know about authboss semantics such as if you update a password it should invalidate all remember me tokens, and bcrypt the password with the correct configured strength.

Confirmer Module

Responsible for:

  • Interrupting the flow of User Creation to insert this validation step.
  • Sending an e-mail to the half-registered user.
  • Accepting a validation token, finding the associated user, and marking him as fully registered user.

Storage

A generic approach to storing and retrieving the information we need. Each one of these things must be separate but hopefully use the same standard interface.

User information (email, password, auth tokens, etc etc)
Cookie information (some people store these in DB, in files, etc)
Secrets

We could also provide some common storage implementations like Go's sql.DB for sqlite3, mysql and postgres and keep them in a subpackage like /storers. Mongo can be in there too ^_^

Tidy up Storer interfaces

TokenStorer, RecoverStorer, and ConfrmStorer should be moved from storer.go to their respective modules.

Locker Module

Locks out users who try to fail authentication. Should accept parameters for reset times, number of failures, duration of lockout etc.

Recovery Module

Allows users to reset their passwords, which will create a unique token for the password reset request, send it to the e-mail registered, and allow a user to reset their password with use of the token.

Storage Interface(s)

A generic approach to storing and retrieving the information we need. Each one of these things must be separate but hopefully use the same standard interface.

User information (email, password, auth tokens, etc etc)
Cookie information (some people store these in DB, in files, etc)
Secrets

We could also provide some common storage implementations like Go's sql.DB for sqlite3, mysql and postgres and keep them in a subpackage like /storers. Mongo can be in there too ^_^

Authentication Module

  • Authenticates using Username + Password
  • Stores some sort of persistence or has an interface to allow persistence of the session.

Rememberable Module

When requested, a user who is signing in will be remembered by a unique token that's given to the user.

Instead of Authenticating with email & password, the token is used, it is deleted and a new one is given.

Care must be given to flagging the logged in session as not half-authed. To disallow entry to sensitive areas without full-authentication.

Expire Module

Sets an expiry on the user's log in sessions beyond their session cookies.

Code cleanup helpers.

Session Vars and User Var lookups (should return err if nil|len=0)
str, err := User.StringErr()
if err != nil {
return err // err is authboss.AttributeErr
}

authboss.ClientDataErr // session & cookie store helpers should return this :D

Redirect (on success) -> Leave it
func FlashRedirect(w, "/", "", "")
func Redirect(w, "/")

Redirect (on failure) -> Get router to handle this as en error type
func RedirectErr(w, r, "/", "login successful", "") (flash messages, go to endpoint)

Render things that handle errors better.
data = data.Merge("username", username).FlashSuccess(ctx, "lol")
func views.Render(w, r, templName, data) err (authboss.RenderErr)

Tidy up callbacks & handler (both need to return error, callbacks need to stop execution with ok, not error)

clean up e-mailers in confirm & recover to use same code

Call Chain

RememberMe

  • GetUser
  • AfterSuccess

Expire

  • BeforeAuth
  • GetUser

Lock

  • BeforeAuth
  • GetUser

Register

Confirm

  • BeforeAuth
  • AfterRegister

Auth

  • GetUser
  • AfterSucess
  • AfterFailure

Validate

  • BeforeRegister

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.