1
0
mirror of https://github.com/volatiletech/authboss.git synced 2025-09-16 09:06:20 +02:00

Update import paths

This commit is contained in:
Aaron L
2025-06-25 21:52:09 -07:00
parent 0ab40e4843
commit 8d2e2f2d3d
63 changed files with 274 additions and 274 deletions

View File

@@ -452,5 +452,5 @@ the type in the attribute map matches what's in the struct before assignment.
### Changed
This breaking change allows multiple sites running off the same code base to each use different configurations of Authboss. To migrate
your code simply use authboss.New() to get an instance of Authboss and all the old things that used to be in the authboss package are
now there. See [this commit to the sample](https://github.com/volatiletech/authboss-sample/commit/eea55fc3b03855d4e9fb63577d72ce8ff0cd4079)
now there. See [this commit to the sample](https://github.com/aarondl/authboss-sample/commit/eea55fc3b03855d4e9fb63577d72ce8ff0cd4079)
to see precisely how to make these changes.

198
README.md
View File

@@ -2,11 +2,11 @@
# Authboss
[![GoDoc](https://img.shields.io/badge/godoc-reference-5272B4)](https://pkg.go.dev/mod/github.com/volatiletech/authboss/v3)
![ActionsCI](https://github.com/volatiletech/authboss/workflows/test/badge.svg)
[![GoDoc](https://img.shields.io/badge/godoc-reference-5272B4)](https://pkg.go.dev/mod/github.com/aarondl/authboss/v3)
![ActionsCI](https://github.com/aarondl/authboss/workflows/test/badge.svg)
[![Mail](https://img.shields.io/badge/mail%20list-authboss-lightgrey.svg)](https://groups.google.com/a/volatile.tech/forum/#!forum/authboss)
![Go Coverage](https://img.shields.io/badge/coverage-84.9%25-brightgreen.svg?longCache=true&style=flat)
[![Go Report Card](https://goreportcard.com/badge/github.com/volatiletech/authboss)](https://goreportcard.com/report/github.com/volatiletech/authboss)
[![Go Report Card](https://goreportcard.com/badge/github.com/aarondl/authboss)](https://goreportcard.com/report/github.com/aarondl/authboss)
Authboss is a modular authentication system for the web.
@@ -116,7 +116,7 @@ Of course the standard practice of fetching the library is just the beginning:
```bash
# Get the latest, you must be using Go modules as of v3 of Authboss.
go get -u github.com/volatiletech/authboss/v3
go get -u github.com/aarondl/authboss/v3
```
Here's a bit of starter code that was stolen from the sample.
@@ -131,7 +131,7 @@ ab.Config.Storage.CookieState = myCookieImplementation
ab.Config.Paths.Mount = "/authboss"
ab.Config.Paths.RootURL = "https://www.example.com/"
// This is using the renderer from: github.com/volatiletech/authboss
// This is using the renderer from: github.com/aarondl/authboss
ab.Config.Core.ViewRenderer = abrenderer.NewHTML("/auth", "ab_views")
// Probably want a MailRenderer here too.
@@ -154,7 +154,7 @@ mux.Mount("/authboss", http.StripPrefix("/authboss", ab.Config.Core.Router))
For a more in-depth look you **definitely should** look at the authboss sample to see what a full
implementation looks like. This will probably help you more than any of this documentation.
[https://github.com/volatiletech/authboss-sample](https://github.com/volatiletech/authboss-sample)
[https://github.com/aarondl/authboss-sample](https://github.com/aarondl/authboss-sample)
## App Requirements
@@ -196,7 +196,7 @@ to your app:
Everything under Config.Storage and Config.Core are required and you must provide them,
however you can optionally use default implementations from the
[defaults package](https://github.com/volatiletech/authboss/tree/master/defaults).
[defaults package](https://github.com/aarondl/authboss/tree/master/defaults).
This also provides an easy way to share implementations of certain stack pieces (like HTML Form Parsing).
As you saw in the example above these can be easily initialized with the `SetCore` method in that
package.
@@ -225,11 +225,11 @@ and the MailRenderer. For more information please see the use case [Rendering Vi
### ServerStorer implementation
The [ServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ServerStorer) is
The [ServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ServerStorer) is
meant to be upgraded to add capabilities depending on what modules you'd like to use.
It starts out by only knowing how to save and load users, but the `remember` module as an example
needs to be able to find users by remember me tokens, so it upgrades to a
[RememberingServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#RememberingServerStorer)
[RememberingServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#RememberingServerStorer)
which adds these abilities.
Your `ServerStorer` implementation does not need to implement all these additional interfaces
@@ -238,7 +238,7 @@ unless you're using a module that requires it. See the [Use Cases](#use-cases) d
### User implementation
Users in Authboss are represented by the
[User interface](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#User). The user
[User interface](https://pkg.go.dev/github.com/aarondl/authboss/v3/#User). The user
interface is a flexible notion, because it can be upgraded to suit the needs of the various modules.
Initially the User must only be able to Get/Set a `PID` or primary identifier. This allows the authboss
@@ -248,7 +248,7 @@ to save/load users.
As mentioned, it can be upgraded, for example suppose now we want to use the `confirm` module,
in that case the e-mail address now becomes a requirement. So the `confirm` module will attempt
to upgrade the user (and panic if it fails) to a
[ConfirmableUser](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ConfirmableUser)
[ConfirmableUser](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ConfirmableUser)
which supports retrieving and setting of confirm tokens, e-mail addresses, and a confirmed state.
Your `User` implementation does not need to implement all these additional user interfaces unless you're
@@ -257,9 +257,9 @@ requirements are.
### Values implementation
The [BodyReader](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#BodyReader)
The [BodyReader](https://pkg.go.dev/github.com/aarondl/authboss/v3/#BodyReader)
interface in the Config returns
[Validator](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Validator) implementations
[Validator](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Validator) implementations
which can be validated. But much like the storer and user it can be upgraded to add different
capabilities.
@@ -270,7 +270,7 @@ requested and switches on that to parse the body in whatever way
valuer required by the module.
An example of an upgraded `Valuer` is the
[UserValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#UserValuer)
[UserValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#UserValuer)
which stores and validates the PID and Password that a user has provided for the modules to use.
Your body reader implementation does not need to implement all valuer types unless you're
@@ -283,7 +283,7 @@ The config struct is an important part of Authboss. It's the key to making Authb
want with the implementations you want. Please look at it's code definition as you read the
documentation below, it will make much more sense.
[Config Struct Documentation](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Config)
[Config Struct Documentation](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Config)
### Paths
@@ -305,7 +305,7 @@ Mail sending related options.
### Storage
These are the implementations of how storage on the server and the client are done in your
app. There are no default implementations for these at this time. See the [Godoc](https://pkg.go.dev/mod/github.com/volatiletech/authboss/v3) for more information
app. There are no default implementations for these at this time. See the [Godoc](https://pkg.go.dev/mod/github.com/aarondl/authboss/v3) for more information
about what these are.
### Core
@@ -314,7 +314,7 @@ These are the implementations of the HTTP stack for your app. How do responses r
they redirected? How are errors handled?
For most of these there are default implementations from the
[defaults package](https://github.com/volatiletech/authboss/tree/master/defaults) available, but not for all.
[defaults package](https://github.com/aarondl/authboss/tree/master/defaults) available, but not for all.
See the package documentation for more information about what's available.
# Available Modules
@@ -328,20 +328,20 @@ for more information.
Name | Import Path | Description
----------|-------------------------------------------|------------
Auth | github.com/volatiletech/authboss/v3/auth | Database password authentication for users.
Confirm | github.com/volatiletech/authboss/v3/confirm | Prevents login before e-mail verification.
Expire | github.com/volatiletech/authboss/v3/expire | Expires a user's login
Lock | github.com/volatiletech/authboss/v3/lock | Locks user accounts after authentication failures.
Logout | github.com/volatiletech/authboss/v3/logout | Destroys user sessions for auth/oauth2.
Auth | github.com/aarondl/authboss/v3/auth | Database password authentication for users.
Confirm | github.com/aarondl/authboss/v3/confirm | Prevents login before e-mail verification.
Expire | github.com/aarondl/authboss/v3/expire | Expires a user's login
Lock | github.com/aarondl/authboss/v3/lock | Locks user accounts after authentication failures.
Logout | github.com/aarondl/authboss/v3/logout | Destroys user sessions for auth/oauth2.
OAuth1 | github.com/stephenafamo/authboss-oauth1 | Provides oauth1 authentication for users.
OAuth2 | github.com/volatiletech/authboss/v3/oauth2 | Provides oauth2 authentication for users.
Recover | github.com/volatiletech/authboss/v3/recover | Allows for password resets via e-mail.
Register | github.com/volatiletech/authboss/v3/register | User-initiated account creation.
Remember | github.com/volatiletech/authboss/v3/remember | Persisting login sessions past session cookie expiry.
OTP | github.com/volatiletech/authboss/v3/otp | One time passwords for use instead of passwords.
Twofactor | github.com/volatiletech/authboss/v3/otp/twofactor | Regenerate recovery codes for 2fa.
Totp2fa | github.com/volatiletech/authboss/v3/otp/twofactor/totp2fa | Use Google authenticator-like things for a second auth factor.
Sms2fa | github.com/volatiletech/authboss/v3/otp/twofactor/sms2fa | Use a phone for a second auth factor.
OAuth2 | github.com/aarondl/authboss/v3/oauth2 | Provides oauth2 authentication for users.
Recover | github.com/aarondl/authboss/v3/recover | Allows for password resets via e-mail.
Register | github.com/aarondl/authboss/v3/register | User-initiated account creation.
Remember | github.com/aarondl/authboss/v3/remember | Persisting login sessions past session cookie expiry.
OTP | github.com/aarondl/authboss/v3/otp | One time passwords for use instead of passwords.
Twofactor | github.com/aarondl/authboss/v3/otp/twofactor | Regenerate recovery codes for 2fa.
Totp2fa | github.com/aarondl/authboss/v3/otp/twofactor/totp2fa | Use Google authenticator-like things for a second auth factor.
Sms2fa | github.com/aarondl/authboss/v3/otp/twofactor/sms2fa | Use a phone for a second auth factor.
# Middlewares
@@ -358,13 +358,13 @@ use the middlewares if you use the module.
Name | Requirement | Description
---- | ----------- | -----------
[Middleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Middleware) | Recommended | Prevents unauthenticated users from accessing routes.
[LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware) | **Required** | Enables cookie and session handling
[ModuleListMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.ModuleListMiddleware) | Optional | Inserts a loaded module list into the view data
[confirm.Middleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/confirm/#Middleware) | Recommended with confirm | Ensures users are confirmed or rejects request
[expire.Middleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/expire/#Middleware) | **Required** with expire | Expires user sessions after an inactive period
[lock.Middleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/lock/#Middleware) | Recommended with lock | Rejects requests from locked users
[remember.Middleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/remember/#Middleware) | Recommended with remember | Logs a user in from a remember cookie
[Middleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Middleware) | Recommended | Prevents unauthenticated users from accessing routes.
[LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware) | **Required** | Enables cookie and session handling
[ModuleListMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.ModuleListMiddleware) | Optional | Inserts a loaded module list into the view data
[confirm.Middleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/confirm/#Middleware) | Recommended with confirm | Ensures users are confirmed or rejects request
[expire.Middleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/expire/#Middleware) | **Required** with expire | Expires user sessions after an inactive period
[lock.Middleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/lock/#Middleware) | Recommended with lock | Rejects requests from locked users
[remember.Middleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/remember/#Middleware) | Recommended with remember | Logs a user in from a remember cookie
# Use Cases
@@ -372,12 +372,12 @@ Name | Requirement | Description
## Get Current User
CurrentUser can be retrieved by calling
[Authboss.CurrentUser](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.CurrentUser)
[Authboss.CurrentUser](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.CurrentUser)
but a pre-requisite is that
[Authboss.LoadClientState](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientState)
[Authboss.LoadClientState](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientState)
has been called first to load the client state into the request context.
This is typically achieved by using the
[Authboss.LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware), but can
[Authboss.LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware), but can
be done manually as well.
## Reset Password
@@ -389,14 +389,14 @@ Updating a user's password is non-trivial for several reasons:
1. Optionally the user should be logged out (**not taken care of by UpdatePassword**)
In order to do this, we can use the
[Authboss.UpdatePassword](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.UpdatePassword)
[Authboss.UpdatePassword](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.UpdatePassword)
method. This ensures the above facets are taken care of which the exception of the logging out part.
If it's also desirable to have the user logged out, please use the following methods to erase
all known sessions and cookies from the user.
* [authboss.DelKnownSession](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#DelKnownSession)
* [authboss.DelKnownCookie](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#DelKnownCookie)
* [authboss.DelKnownSession](https://pkg.go.dev/github.com/aarondl/authboss/v3/#DelKnownSession)
* [authboss.DelKnownCookie](https://pkg.go.dev/github.com/aarondl/authboss/v3/#DelKnownCookie)
*Note: DelKnownSession has been deprecated for security reasons*
@@ -408,11 +408,11 @@ Module | auth
Pages | login
Routes | /login
Emails | _None_
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware)
ClientStorage | Session and Cookie
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ServerStorer)
User | [AuthableUser](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#AuthableUser)
Values | [UserValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#UserValuer)
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ServerStorer)
User | [AuthableUser](https://pkg.go.dev/github.com/aarondl/authboss/v3/#AuthableUser)
Values | [UserValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#UserValuer)
Mailer | _None_
To enable this side-effect import the auth module, and ensure that the requirements above are met.
@@ -428,7 +428,7 @@ Module | oauth1
Pages | _None_
Routes | /oauth1/{provider}, /oauth1/callback/{provider}
Emails | _None_
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/#Authboss.LoadClientStateMiddleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/#Authboss.LoadClientStateMiddleware)
ClientStorage | Session
ServerStorer | [OAuth1ServerStorer](https://pkg.go.dev/github.com/stephenafamo/authboss-oauth1?tab=doc#ServerStorer)
User | [OAuth1User](https://pkg.go.dev/github.com/stephenafamo/authboss-oauth1?tab=doc#User)
@@ -463,10 +463,10 @@ Module | oauth2
Pages | _None_
Routes | /oauth2/{provider}, /oauth2/callback/{provider}
Emails | _None_
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware)
ClientStorage | Session
ServerStorer | [OAuth2ServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#OAuth2ServerStorer)
User | [OAuth2User](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#OAuth2User)
ServerStorer | [OAuth2ServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#OAuth2ServerStorer)
User | [OAuth2User](https://pkg.go.dev/github.com/aarondl/authboss/v3/#OAuth2User)
Values | _None_
Mailer | _None_
@@ -480,9 +480,9 @@ These parameters are returned in `map[string]string` form and passed into the `O
Please see the following documentation for more details:
* [Package docs for oauth2](https://pkg.go.dev/github.com/volatiletech/authboss/v3/oauth2/)
* [authboss.OAuth2Provider](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#OAuth2Provider)
* [authboss.OAuth2ServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#OAuth2ServerStorer)
* [Package docs for oauth2](https://pkg.go.dev/github.com/aarondl/authboss/v3/oauth2/)
* [authboss.OAuth2Provider](https://pkg.go.dev/github.com/aarondl/authboss/v3/#OAuth2Provider)
* [authboss.OAuth2ServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#OAuth2ServerStorer)
## User Registration
@@ -492,11 +492,11 @@ Module | register
Pages | register
Routes | /register
Emails | _None_
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware)
ClientStorage | Session
ServerStorer | [CreatingServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#CreatingServerStorer)
User | [AuthableUser](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#AuthableUser), optionally [ArbitraryUser](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ArbitraryUser)
Values | [UserValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#UserValuer), optionally also [ArbitraryValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ArbitraryValuer)
ServerStorer | [CreatingServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#CreatingServerStorer)
User | [AuthableUser](https://pkg.go.dev/github.com/aarondl/authboss/v3/#AuthableUser), optionally [ArbitraryUser](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ArbitraryUser)
Values | [UserValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#UserValuer), optionally also [ArbitraryValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ArbitraryValuer)
Mailer | _None_
Users can self-register for a service using this module. You may optionally want them to confirm
@@ -515,7 +515,7 @@ This means the (whitelisted) values entered by the user previously will be acces
templates by using `.preserve.field_name`. Preserve may be empty or nil so use
`{{with ...}}` to make sure you don't have template errors.
There is additional [Godoc documentation](https://pkg.go.dev/mod/github.com/volatiletech/authboss/v3#Config) on the `RegisterPreserveFields` config option as well as
There is additional [Godoc documentation](https://pkg.go.dev/mod/github.com/aarondl/authboss/v3#Config) on the `RegisterPreserveFields` config option as well as
the `ArbitraryUser` and `ArbitraryValuer` interfaces themselves.
## Confirming Registrations
@@ -526,11 +526,11 @@ Module | confirm
Pages | confirm
Routes | /confirm
Emails | confirm_html, confirm_txt
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware), [confirm.Middleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/confirm/#Middleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware), [confirm.Middleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/confirm/#Middleware)
ClientStorage | Session
ServerStorer | [ConfirmingServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ConfirmingServerStorer)
User | [ConfirmableUser](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ConfirmableUser)
Values | [ConfirmValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ConfirmValuer)
ServerStorer | [ConfirmingServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ConfirmingServerStorer)
User | [ConfirmableUser](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ConfirmableUser)
Values | [ConfirmValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ConfirmValuer)
Mailer | Required
Confirming registrations via e-mail can be done with this module (whether or not done via the register
@@ -552,11 +552,11 @@ Module | recover
Pages | recover_start, recover_middle (not used for renders, only values), recover_end
Routes | /recover, /recover/end
Emails | recover_html, recover_txt
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware)
ClientStorage | Session
ServerStorer | [RecoveringServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#RecoveringServerStorer)
User | [RecoverableUser](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#RecoverableUser)
Values | [RecoverStartValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#RecoverStartValuer), [RecoverMiddleValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#RecoverMiddleValuer), [RecoverEndValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#RecoverEndValuer)
ServerStorer | [RecoveringServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#RecoveringServerStorer)
User | [RecoverableUser](https://pkg.go.dev/github.com/aarondl/authboss/v3/#RecoverableUser)
Values | [RecoverStartValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#RecoverStartValuer), [RecoverMiddleValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#RecoverMiddleValuer), [RecoverEndValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#RecoverEndValuer)
Mailer | Required
The flow for password recovery is that the user is initially shown a page that wants their `PID` to
@@ -582,11 +582,11 @@ Pages | _None_
Routes | _None_
Emails | _None_
Middlewares | LoadClientStateMiddleware,
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware), [remember.Middleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/remember/#Middleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware), [remember.Middleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/remember/#Middleware)
ClientStorage | Session, Cookies
ServerStorer | [RememberingServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#RememberingServerStorer)
ServerStorer | [RememberingServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#RememberingServerStorer)
User | User
Values | [RememberValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#RememberValuer) (not a Validator)
Values | [RememberValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#RememberValuer) (not a Validator)
Mailer | _None_
Remember uses cookie storage to log in users without a session via the `remember.Middleware`.
@@ -613,10 +613,10 @@ Module | lock
Pages | _None_
Routes | _None_
Emails | _None_
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware), [lock.Middleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/lock/#Middleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware), [lock.Middleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/lock/#Middleware)
ClientStorage | Session
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ServerStorer)
User | [LockableUser](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#LockableUser)
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ServerStorer)
User | [LockableUser](https://pkg.go.dev/github.com/aarondl/authboss/v3/#LockableUser)
Values | _None_
Mailer | _None_
@@ -634,10 +634,10 @@ Module | expire
Pages | _None_
Routes | _None_
Emails | _None_
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware), [expire.Middleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/expire/#Middleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware), [expire.Middleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/expire/#Middleware)
ClientStorage | Session
ServerStorer | _None_
User | [User](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#User)
User | [User](https://pkg.go.dev/github.com/aarondl/authboss/v3/#User)
Values | _None_
Mailer | _None_
@@ -659,11 +659,11 @@ Module | otp
Pages | otp, otpadd, otpclear
Routes | /otp/login, /otp/add, /otp/clear
Emails | _None_
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware)
ClientStorage | Session and Cookie
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ServerStorer)
User | [otp.User](https://pkg.go.dev/github.com/volatiletech/authboss/v3/otp/#User)
Values | [UserValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#UserValuer)
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ServerStorer)
User | [otp.User](https://pkg.go.dev/github.com/aarondl/authboss/v3/otp/#User)
Values | [UserValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#UserValuer)
Mailer | _None_
One time passwords can be useful if users require a backup password in case they lose theirs,
@@ -694,10 +694,10 @@ Module | twofactor
Pages | recovery2fa
Routes | /2fa/recovery/regen
Emails | _None_
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware)
ClientStorage | Session
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ServerStorer)
User | [twofactor.User](https://pkg.go.dev/github.com/volatiletech/authboss/v3/otp/twofactor/#User)
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ServerStorer)
User | [twofactor.User](https://pkg.go.dev/github.com/aarondl/authboss/v3/otp/twofactor/#User)
Values | _None_
Mailer | _None_
@@ -723,11 +723,11 @@ Module | twofactor
Pages | twofactor_verify
Routes | /2fa/recovery/regen
Emails | twofactor_verify_email_html, twofactor_verify_email_txt
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware)
ClientStorage | Session
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ServerStorer)
User | [twofactor.User](https://pkg.go.dev/github.com/volatiletech/authboss/v3/otp/twofactor/#User)
Values | [twofactor.EmailVerifyTokenValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/otp/twofactor/#EmailVerifyTokenValuer)
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ServerStorer)
User | [twofactor.User](https://pkg.go.dev/github.com/aarondl/authboss/v3/otp/twofactor/#User)
Values | [twofactor.EmailVerifyTokenValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/otp/twofactor/#EmailVerifyTokenValuer)
Mailer | Required
To enable this feature simply turn on
@@ -756,11 +756,11 @@ Module | totp2fa
Pages | totp2fa_{setup,confirm,remove,validate}, totp2fa_{confirm,remove}_success
Routes | /2fa/totp/{setup,confirm,qr,remove,validate}
Emails | _None_
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware)
ClientStorage | Session **(SECURE!)**
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ServerStorer)
User | [totp2fa.User](https://pkg.go.dev/github.com/volatiletech/authboss/v3/otp/twofactor/totp2fa/#User)
Values | [TOTPCodeValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/otp/twofactor/totp2fa/#TOTPCodeValuer)
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ServerStorer)
User | [totp2fa.User](https://pkg.go.dev/github.com/aarondl/authboss/v3/otp/twofactor/totp2fa/#User)
Values | [TOTPCodeValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/otp/twofactor/totp2fa/#TOTPCodeValuer)
Mailer | _None_
**Note:** Unlike most modules in Authboss you must construct a `totp2fa.TOTP` and call `.Setup()`
@@ -820,11 +820,11 @@ Module | sms2fa
Pages | sms2fa_{setup,confirm,remove,validate}, sms2fa_{confirm,remove}_success
Routes | /2fa/{setup,confirm,remove,validate}
Emails | _None_
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware)
ClientStorage | Session (**SECURE!**)
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ServerStorer)
User | [sms2fa.User](https://pkg.go.dev/github.com/volatiletech/authboss/v3/otp/twofactor/sms2fa/#User), [sms2fa.SMSNumberProvider](https://pkg.go.dev/github.com/volatiletech/authboss/v3/otp/twofactor/sms2fa/#SMSNumberProvider)
Values | [SMSValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/otp/twofactor/sms2fa/#SMSValuer), [SMSPhoneNumberValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/otp/twofactor/sms2fa/#SMSPhoneNumberValuer)
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ServerStorer)
User | [sms2fa.User](https://pkg.go.dev/github.com/aarondl/authboss/v3/otp/twofactor/sms2fa/#User), [sms2fa.SMSNumberProvider](https://pkg.go.dev/github.com/aarondl/authboss/v3/otp/twofactor/sms2fa/#SMSNumberProvider)
Values | [SMSValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/otp/twofactor/sms2fa/#SMSValuer), [SMSPhoneNumberValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/otp/twofactor/sms2fa/#SMSPhoneNumberValuer)
Mailer | _None_
**Note:** Unlike most modules in Authboss you must construct a `sms2fa.SMS` and call `.Setup()`
@@ -883,7 +883,7 @@ Same as totp2fa above.
## Rendering Views
The authboss rendering system is simple. It's defined by one interface: [Renderer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Renderer)
The authboss rendering system is simple. It's defined by one interface: [Renderer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Renderer)
The renderer knows how to load templates, and how to render them with some data and that's it.
So let's examine the most common view types that you might want to use.
@@ -897,7 +897,7 @@ setup. For example if you're using `html/template` then you could just use
`template.Execute()` in the `Render()` method.
There is also a very basic renderer: [Authboss
Renderer](https://github.com/volatiletech/authboss-renderer) which has some very
Renderer](https://github.com/aarondl/authboss-renderer) which has some very
ugly built in views and the ability to override them with your own if you don't
want to integrate your own rendering system into that interface.
@@ -905,7 +905,7 @@ want to integrate your own rendering system into that interface.
If you're building an API that's mostly backed by a javascript front-end, then you'll probably
want to use a renderer that converts the data to JSON. There is a simple json renderer available in
the [defaults package](https://github.com/volatiletech/authboss/tree/master/defaults) package if you wish to
the [defaults package](https://github.com/aarondl/authboss/tree/master/defaults) package if you wish to
use that.
### Data
@@ -913,10 +913,10 @@ use that.
The most important part about this interface is the data that you have to render.
There are several keys that are used throughout authboss that you'll want to render in your views.
They're in the file [html_data.go](https://github.com/volatiletech/authboss/blob/master/html_data.go)
They're in the file [html_data.go](https://github.com/aarondl/authboss/blob/master/html_data.go)
and are constants prefixed with `Data`. See the documentation in that file for more information on
which keys exist and what they contain.
The default [responder](https://pkg.go.dev/github.com/volatiletech/authboss/v3/defaults/#Responder)
The default [responder](https://pkg.go.dev/github.com/aarondl/authboss/v3/defaults/#Responder)
also happens to collect data from the Request context, and hence this is a great place to inject
data you'd like to render (for example data for your html layout, or csrf tokens).

View File

@@ -5,7 +5,7 @@ import (
"context"
"net/http"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
const (

View File

@@ -5,8 +5,8 @@ import (
"net/http/httptest"
"testing"
"github.com/volatiletech/authboss/v3"
"github.com/volatiletech/authboss/v3/mocks"
"github.com/aarondl/authboss/v3"
"github.com/aarondl/authboss/v3/mocks"
)
func TestAuthInit(t *testing.T) {

View File

@@ -14,7 +14,7 @@ import (
"path"
"github.com/friendsofgo/errors"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
const (

View File

@@ -10,8 +10,8 @@ import (
"net/http/httptest"
"testing"
"github.com/volatiletech/authboss/v3"
"github.com/volatiletech/authboss/v3/mocks"
"github.com/aarondl/authboss/v3"
"github.com/aarondl/authboss/v3/mocks"
)
func TestInit(t *testing.T) {

View File

@@ -10,7 +10,7 @@ package defaults
import (
"os"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
// SetCore creates instances of all the default pieces

View File

@@ -3,7 +3,7 @@ package defaults
import (
"testing"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
func TestSetCore(t *testing.T) {

View File

@@ -4,7 +4,7 @@ import (
"fmt"
"net/http"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
// ErrorHandler wraps http handlers with errors with itself

View File

@@ -5,7 +5,7 @@ import (
"context"
"io"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
// LogMailer logs e-mails instead of sending them.

View File

@@ -7,7 +7,7 @@ import (
"strings"
"testing"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
func TestMailer(t *testing.T) {

View File

@@ -4,7 +4,7 @@ import (
"context"
"encoding/json"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
var (

View File

@@ -4,7 +4,7 @@ import (
"context"
"testing"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
func TestJSONRenderer(t *testing.T) {

View File

@@ -4,7 +4,7 @@ import (
"net/http"
"strings"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
// Responder helps respond to http requests

View File

@@ -8,8 +8,8 @@ import (
"reflect"
"testing"
"github.com/volatiletech/authboss/v3"
"github.com/volatiletech/authboss/v3/mocks"
"github.com/aarondl/authboss/v3"
"github.com/aarondl/authboss/v3/mocks"
)
type testRenderer struct {

View File

@@ -6,7 +6,7 @@ import (
"unicode"
"github.com/friendsofgo/errors"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
var blankRegex = regexp.MustCompile(`^\s*$`)

View File

@@ -11,7 +11,7 @@ import (
"time"
"github.com/friendsofgo/errors"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
// NewSMTPMailer creates an SMTP Mailer to send emails with.

View File

@@ -9,7 +9,7 @@ import (
"os"
"testing"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
var (

View File

@@ -3,7 +3,7 @@ package defaults
import (
"fmt"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
// HTTPFormValidator validates HTTP post type inputs

View File

@@ -3,7 +3,7 @@ package defaults
import (
"testing"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
func TestValidate(t *testing.T) {

View File

@@ -8,7 +8,7 @@ import (
"regexp"
"github.com/friendsofgo/errors"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
// FormValue types

View File

@@ -5,8 +5,8 @@ import (
"strings"
"testing"
"github.com/volatiletech/authboss/v3"
"github.com/volatiletech/authboss/v3/mocks"
"github.com/aarondl/authboss/v3"
"github.com/aarondl/authboss/v3/mocks"
)
func TestHTTPBodyReaderLogin(t *testing.T) {

View File

@@ -2,11 +2,11 @@
# Authboss
[![GoDoc](https://img.shields.io/badge/godoc-reference-5272B4)](https://pkg.go.dev/mod/github.com/volatiletech/authboss/v3)
![ActionsCI](https://github.com/volatiletech/authboss/workflows/test/badge.svg)
[![GoDoc](https://img.shields.io/badge/godoc-reference-5272B4)](https://pkg.go.dev/mod/github.com/aarondl/authboss/v3)
![ActionsCI](https://github.com/aarondl/authboss/workflows/test/badge.svg)
[![Mail](https://img.shields.io/badge/mail%20list-authboss-lightgrey.svg)](https://groups.google.com/a/volatile.tech/forum/#!forum/authboss)
![Go Coverage](https://img.shields.io/badge/coverage-84.9%25-brightgreen.svg?longCache=true&style=flat)
[![Go Report Card](https://goreportcard.com/badge/github.com/volatiletech/authboss)](https://goreportcard.com/report/github.com/volatiletech/authboss)
[![Go Report Card](https://goreportcard.com/badge/github.com/aarondl/authboss)](https://goreportcard.com/report/github.com/aarondl/authboss)
Authboss is a modular authentication system for the web.

View File

@@ -4,7 +4,7 @@ The config struct is an important part of Authboss. It's the key to making Authb
want with the implementations you want. Please look at it's code definition as you read the
documentation below, it will make much more sense.
[Config Struct Documentation](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Config)
[Config Struct Documentation](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Config)
### Paths
@@ -26,7 +26,7 @@ Mail sending related options.
### Storage
These are the implementations of how storage on the server and the client are done in your
app. There are no default implementations for these at this time. See the [Godoc](https://pkg.go.dev/mod/github.com/volatiletech/authboss/v3) for more information
app. There are no default implementations for these at this time. See the [Godoc](https://pkg.go.dev/mod/github.com/aarondl/authboss/v3) for more information
about what these are.
### Core
@@ -35,5 +35,5 @@ These are the implementations of the HTTP stack for your app. How do responses r
they redirected? How are errors handled?
For most of these there are default implementations from the
[defaults package](https://github.com/volatiletech/authboss/tree/master/defaults) available, but not for all.
[defaults package](https://github.com/aarondl/authboss/tree/master/defaults) available, but not for all.
See the package documentation for more information about what's available.

View File

@@ -20,7 +20,7 @@
hideOtherSidebarContent: false,
},
name: 'Authboss Docs',
repo: 'https://github.com/volatiletech/authboss',
repo: 'https://github.com/aarondl/authboss',
loadSidebar: true,
subMaxLevel: 3
}

View File

@@ -19,7 +19,7 @@ to your app:
Everything under Config.Storage and Config.Core are required and you must provide them,
however you can optionally use default implementations from the
[defaults package](https://github.com/volatiletech/authboss/tree/master/defaults).
[defaults package](https://github.com/aarondl/authboss/tree/master/defaults).
This also provides an easy way to share implementations of certain stack pieces (like HTML Form Parsing).
As you saw in the example above these can be easily initialized with the `SetCore` method in that
package.
@@ -48,11 +48,11 @@ and the MailRenderer. For more information please see the use case [Rendering Vi
### ServerStorer implementation
The [ServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ServerStorer) is
The [ServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ServerStorer) is
meant to be upgraded to add capabilities depending on what modules you'd like to use.
It starts out by only knowing how to save and load users, but the `remember` module as an example
needs to be able to find users by remember me tokens, so it upgrades to a
[RememberingServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#RememberingServerStorer)
[RememberingServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#RememberingServerStorer)
which adds these abilities.
Your `ServerStorer` implementation does not need to implement all these additional interfaces
@@ -61,7 +61,7 @@ unless you're using a module that requires it. See the [Use Cases](#use-cases) d
### User implementation
Users in Authboss are represented by the
[User interface](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#User). The user
[User interface](https://pkg.go.dev/github.com/aarondl/authboss/v3/#User). The user
interface is a flexible notion, because it can be upgraded to suit the needs of the various modules.
Initially the User must only be able to Get/Set a `PID` or primary identifier. This allows the authboss
@@ -71,7 +71,7 @@ to save/load users.
As mentioned, it can be upgraded, for example suppose now we want to use the `confirm` module,
in that case the e-mail address now becomes a requirement. So the `confirm` module will attempt
to upgrade the user (and panic if it fails) to a
[ConfirmableUser](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ConfirmableUser)
[ConfirmableUser](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ConfirmableUser)
which supports retrieving and setting of confirm tokens, e-mail addresses, and a confirmed state.
Your `User` implementation does not need to implement all these additional user interfaces unless you're
@@ -80,9 +80,9 @@ requirements are.
### Values implementation
The [BodyReader](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#BodyReader)
The [BodyReader](https://pkg.go.dev/github.com/aarondl/authboss/v3/#BodyReader)
interface in the Config returns
[Validator](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Validator) implementations
[Validator](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Validator) implementations
which can be validated. But much like the storer and user it can be upgraded to add different
capabilities.
@@ -93,7 +93,7 @@ requested and switches on that to parse the body in whatever way
valuer required by the module.
An example of an upgraded `Valuer` is the
[UserValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#UserValuer)
[UserValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#UserValuer)
which stores and validates the PID and Password that a user has provided for the modules to use.
Your body reader implementation does not need to implement all valuer types unless you're

View File

@@ -13,10 +13,10 @@ use the middlewares if you use the module.
Name | Requirement | Description
---- | ----------- | -----------
[Middleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Middleware) | Recommended | Prevents unauthenticated users from accessing routes.
[LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware) | **Required** | Enables cookie and session handling
[ModuleListMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.ModuleListMiddleware) | Optional | Inserts a loaded module list into the view data
[confirm.Middleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/confirm/#Middleware) | Recommended with confirm | Ensures users are confirmed or rejects request
[expire.Middleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/expire/#Middleware) | **Required** with expire | Expires user sessions after an inactive period
[lock.Middleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/lock/#Middleware) | Recommended with lock | Rejects requests from locked users
[remember.Middleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/remember/#Middleware) | Recommended with remember | Logs a user in from a remember cookie
[Middleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Middleware) | Recommended | Prevents unauthenticated users from accessing routes.
[LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware) | **Required** | Enables cookie and session handling
[ModuleListMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.ModuleListMiddleware) | Optional | Inserts a loaded module list into the view data
[confirm.Middleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/confirm/#Middleware) | Recommended with confirm | Ensures users are confirmed or rejects request
[expire.Middleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/expire/#Middleware) | **Required** with expire | Expires user sessions after an inactive period
[lock.Middleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/lock/#Middleware) | Recommended with lock | Rejects requests from locked users
[remember.Middleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/remember/#Middleware) | Recommended with remember | Logs a user in from a remember cookie

View File

@@ -9,17 +9,17 @@ for more information.
Name | Import Path | Description
----------|-------------------------------------------|------------
Auth | github.com/volatiletech/authboss/v3/auth | Database password authentication for users.
Confirm | github.com/volatiletech/authboss/v3/confirm | Prevents login before e-mail verification.
Expire | github.com/volatiletech/authboss/v3/expire | Expires a user's login
Lock | github.com/volatiletech/authboss/v3/lock | Locks user accounts after authentication failures.
Logout | github.com/volatiletech/authboss/v3/logout | Destroys user sessions for auth/oauth2.
Auth | github.com/aarondl/authboss/v3/auth | Database password authentication for users.
Confirm | github.com/aarondl/authboss/v3/confirm | Prevents login before e-mail verification.
Expire | github.com/aarondl/authboss/v3/expire | Expires a user's login
Lock | github.com/aarondl/authboss/v3/lock | Locks user accounts after authentication failures.
Logout | github.com/aarondl/authboss/v3/logout | Destroys user sessions for auth/oauth2.
OAuth1 | github.com/stephenafamo/authboss-oauth1 | Provides oauth1 authentication for users.
OAuth2 | github.com/volatiletech/authboss/v3/oauth2 | Provides oauth2 authentication for users.
Recover | github.com/volatiletech/authboss/v3/recover | Allows for password resets via e-mail.
Register | github.com/volatiletech/authboss/v3/register | User-initiated account creation.
Remember | github.com/volatiletech/authboss/v3/remember | Persisting login sessions past session cookie expiry.
OTP | github.com/volatiletech/authboss/v3/otp | One time passwords for use instead of passwords.
Twofactor | github.com/volatiletech/authboss/v3/otp/twofactor | Regenerate recovery codes for 2fa.
Totp2fa | github.com/volatiletech/authboss/v3/otp/twofactor/totp2fa | Use Google authenticator-like things for a second auth factor.
Sms2fa | github.com/volatiletech/authboss/v3/otp/twofactor/sms2fa | Use a phone for a second auth factor.
OAuth2 | github.com/aarondl/authboss/v3/oauth2 | Provides oauth2 authentication for users.
Recover | github.com/aarondl/authboss/v3/recover | Allows for password resets via e-mail.
Register | github.com/aarondl/authboss/v3/register | User-initiated account creation.
Remember | github.com/aarondl/authboss/v3/remember | Persisting login sessions past session cookie expiry.
OTP | github.com/aarondl/authboss/v3/otp | One time passwords for use instead of passwords.
Twofactor | github.com/aarondl/authboss/v3/otp/twofactor | Regenerate recovery codes for 2fa.
Totp2fa | github.com/aarondl/authboss/v3/otp/twofactor/totp2fa | Use Google authenticator-like things for a second auth factor.
Sms2fa | github.com/aarondl/authboss/v3/otp/twofactor/sms2fa | Use a phone for a second auth factor.

View File

@@ -11,7 +11,7 @@ Of course the standard practice of fetching the library is just the beginning:
```bash
# Get the latest, you must be using Go modules as of v3 of Authboss.
go get -u github.com/volatiletech/authboss/v3
go get -u github.com/aarondl/authboss/v3
```
Here's a bit of starter code that was stolen from the sample.
@@ -26,7 +26,7 @@ ab.Config.Storage.CookieState = myCookieImplementation
ab.Config.Paths.Mount = "/authboss"
ab.Config.Paths.RootURL = "https://www.example.com/"
// This is using the renderer from: github.com/volatiletech/authboss
// This is using the renderer from: github.com/aarondl/authboss
ab.Config.Core.ViewRenderer = abrenderer.NewHTML("/auth", "ab_views")
// Probably want a MailRenderer here too.
@@ -49,4 +49,4 @@ mux.Mount("/authboss", http.StripPrefix("/authboss", ab.Config.Core.Router))
For a more in-depth look you **definitely should** look at the authboss sample to see what a full
implementation looks like. This will probably help you more than any of this documentation.
[https://github.com/volatiletech/authboss-sample](https://github.com/volatiletech/authboss-sample)
[https://github.com/aarondl/authboss-sample](https://github.com/aarondl/authboss-sample)

View File

@@ -1,6 +1,6 @@
# Rendering
The authboss rendering system is simple. It's defined by one interface: [Renderer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Renderer)
The authboss rendering system is simple. It's defined by one interface: [Renderer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Renderer)
The renderer knows how to load templates, and how to render them with some data and that's it.
So let's examine the most common view types that you might want to use.
@@ -14,7 +14,7 @@ setup. For example if you're using `html/template` then you could just use
`template.Execute()` in the `Render()` method.
There is also a very basic renderer: [Authboss
Renderer](https://github.com/volatiletech/authboss-renderer) which has some very
Renderer](https://github.com/aarondl/authboss-renderer) which has some very
ugly built in views and the ability to override them with your own if you don't
want to integrate your own rendering system into that interface.
@@ -22,7 +22,7 @@ want to integrate your own rendering system into that interface.
If you're building an API that's mostly backed by a javascript front-end, then you'll probably
want to use a renderer that converts the data to JSON. There is a simple json renderer available in
the [defaults package](https://github.com/volatiletech/authboss/tree/master/defaults) package if you wish to
the [defaults package](https://github.com/aarondl/authboss/tree/master/defaults) package if you wish to
use that.
### Data
@@ -30,10 +30,10 @@ use that.
The most important part about this interface is the data that you have to render.
There are several keys that are used throughout authboss that you'll want to render in your views.
They're in the file [html_data.go](https://github.com/volatiletech/authboss/blob/master/html_data.go)
They're in the file [html_data.go](https://github.com/aarondl/authboss/blob/master/html_data.go)
and are constants prefixed with `Data`. See the documentation in that file for more information on
which keys exist and what they contain.
The default [responder](https://pkg.go.dev/github.com/volatiletech/authboss/v3/defaults/#Responder)
The default [responder](https://pkg.go.dev/github.com/aarondl/authboss/v3/defaults/#Responder)
also happens to collect data from the Request context, and hence this is a great place to inject
data you'd like to render (for example data for your html layout, or csrf tokens).

View File

@@ -3,12 +3,12 @@
## Get Current User
CurrentUser can be retrieved by calling
[Authboss.CurrentUser](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.CurrentUser)
[Authboss.CurrentUser](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.CurrentUser)
but a pre-requisite is that
[Authboss.LoadClientState](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientState)
[Authboss.LoadClientState](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientState)
has been called first to load the client state into the request context.
This is typically achieved by using the
[Authboss.LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware), but can
[Authboss.LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware), but can
be done manually as well.
## Reset Password
@@ -20,14 +20,14 @@ Updating a user's password is non-trivial for several reasons:
1. Optionally the user should be logged out (**not taken care of by UpdatePassword**)
In order to do this, we can use the
[Authboss.UpdatePassword](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.UpdatePassword)
[Authboss.UpdatePassword](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.UpdatePassword)
method. This ensures the above facets are taken care of which the exception of the logging out part.
If it's also desirable to have the user logged out, please use the following methods to erase
all known sessions and cookies from the user.
* [authboss.DelKnownSession](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#DelKnownSession)
* [authboss.DelKnownCookie](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#DelKnownCookie)
* [authboss.DelKnownSession](https://pkg.go.dev/github.com/aarondl/authboss/v3/#DelKnownSession)
* [authboss.DelKnownCookie](https://pkg.go.dev/github.com/aarondl/authboss/v3/#DelKnownCookie)
*Note: DelKnownSession has been deprecated for security reasons*
@@ -39,11 +39,11 @@ Module | auth
Pages | login
Routes | /login
Emails | _None_
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware)
ClientStorage | Session and Cookie
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ServerStorer)
User | [AuthableUser](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#AuthableUser)
Values | [UserValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#UserValuer)
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ServerStorer)
User | [AuthableUser](https://pkg.go.dev/github.com/aarondl/authboss/v3/#AuthableUser)
Values | [UserValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#UserValuer)
Mailer | _None_
To enable this side-effect import the auth module, and ensure that the requirements above are met.
@@ -59,7 +59,7 @@ Module | oauth1
Pages | _None_
Routes | /oauth1/{provider}, /oauth1/callback/{provider}
Emails | _None_
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/#Authboss.LoadClientStateMiddleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/#Authboss.LoadClientStateMiddleware)
ClientStorage | Session
ServerStorer | [OAuth1ServerStorer](https://pkg.go.dev/github.com/stephenafamo/authboss-oauth1?tab=doc#ServerStorer)
User | [OAuth1User](https://pkg.go.dev/github.com/stephenafamo/authboss-oauth1?tab=doc#User)
@@ -94,10 +94,10 @@ Module | oauth2
Pages | _None_
Routes | /oauth2/{provider}, /oauth2/callback/{provider}
Emails | _None_
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware)
ClientStorage | Session
ServerStorer | [OAuth2ServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#OAuth2ServerStorer)
User | [OAuth2User](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#OAuth2User)
ServerStorer | [OAuth2ServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#OAuth2ServerStorer)
User | [OAuth2User](https://pkg.go.dev/github.com/aarondl/authboss/v3/#OAuth2User)
Values | _None_
Mailer | _None_
@@ -111,9 +111,9 @@ These parameters are returned in `map[string]string` form and passed into the `O
Please see the following documentation for more details:
* [Package docs for oauth2](https://pkg.go.dev/github.com/volatiletech/authboss/v3/oauth2/)
* [authboss.OAuth2Provider](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#OAuth2Provider)
* [authboss.OAuth2ServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#OAuth2ServerStorer)
* [Package docs for oauth2](https://pkg.go.dev/github.com/aarondl/authboss/v3/oauth2/)
* [authboss.OAuth2Provider](https://pkg.go.dev/github.com/aarondl/authboss/v3/#OAuth2Provider)
* [authboss.OAuth2ServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#OAuth2ServerStorer)
## User Registration
@@ -123,11 +123,11 @@ Module | register
Pages | register
Routes | /register
Emails | _None_
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware)
ClientStorage | Session
ServerStorer | [CreatingServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#CreatingServerStorer)
User | [AuthableUser](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#AuthableUser), optionally [ArbitraryUser](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ArbitraryUser)
Values | [UserValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#UserValuer), optionally also [ArbitraryValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ArbitraryValuer)
ServerStorer | [CreatingServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#CreatingServerStorer)
User | [AuthableUser](https://pkg.go.dev/github.com/aarondl/authboss/v3/#AuthableUser), optionally [ArbitraryUser](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ArbitraryUser)
Values | [UserValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#UserValuer), optionally also [ArbitraryValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ArbitraryValuer)
Mailer | _None_
Users can self-register for a service using this module. You may optionally want them to confirm
@@ -146,7 +146,7 @@ This means the (whitelisted) values entered by the user previously will be acces
templates by using `.preserve.field_name`. Preserve may be empty or nil so use
`{{with ...}}` to make sure you don't have template errors.
There is additional [Godoc documentation](https://pkg.go.dev/mod/github.com/volatiletech/authboss/v3#Config) on the `RegisterPreserveFields` config option as well as
There is additional [Godoc documentation](https://pkg.go.dev/mod/github.com/aarondl/authboss/v3#Config) on the `RegisterPreserveFields` config option as well as
the `ArbitraryUser` and `ArbitraryValuer` interfaces themselves.
## Confirming Registrations
@@ -157,11 +157,11 @@ Module | confirm
Pages | confirm
Routes | /confirm
Emails | confirm_html, confirm_txt
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware), [confirm.Middleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/confirm/#Middleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware), [confirm.Middleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/confirm/#Middleware)
ClientStorage | Session
ServerStorer | [ConfirmingServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ConfirmingServerStorer)
User | [ConfirmableUser](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ConfirmableUser)
Values | [ConfirmValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ConfirmValuer)
ServerStorer | [ConfirmingServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ConfirmingServerStorer)
User | [ConfirmableUser](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ConfirmableUser)
Values | [ConfirmValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ConfirmValuer)
Mailer | Required
Confirming registrations via e-mail can be done with this module (whether or not done via the register
@@ -183,11 +183,11 @@ Module | recover
Pages | recover_start, recover_middle (not used for renders, only values), recover_end
Routes | /recover, /recover/end
Emails | recover_html, recover_txt
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware)
ClientStorage | Session
ServerStorer | [RecoveringServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#RecoveringServerStorer)
User | [RecoverableUser](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#RecoverableUser)
Values | [RecoverStartValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#RecoverStartValuer), [RecoverMiddleValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#RecoverMiddleValuer), [RecoverEndValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#RecoverEndValuer)
ServerStorer | [RecoveringServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#RecoveringServerStorer)
User | [RecoverableUser](https://pkg.go.dev/github.com/aarondl/authboss/v3/#RecoverableUser)
Values | [RecoverStartValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#RecoverStartValuer), [RecoverMiddleValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#RecoverMiddleValuer), [RecoverEndValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#RecoverEndValuer)
Mailer | Required
The flow for password recovery is that the user is initially shown a page that wants their `PID` to
@@ -213,11 +213,11 @@ Pages | _None_
Routes | _None_
Emails | _None_
Middlewares | LoadClientStateMiddleware,
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware), [remember.Middleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/remember/#Middleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware), [remember.Middleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/remember/#Middleware)
ClientStorage | Session, Cookies
ServerStorer | [RememberingServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#RememberingServerStorer)
ServerStorer | [RememberingServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#RememberingServerStorer)
User | User
Values | [RememberValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#RememberValuer) (not a Validator)
Values | [RememberValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#RememberValuer) (not a Validator)
Mailer | _None_
Remember uses cookie storage to log in users without a session via the `remember.Middleware`.
@@ -244,10 +244,10 @@ Module | lock
Pages | _None_
Routes | _None_
Emails | _None_
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware), [lock.Middleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/lock/#Middleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware), [lock.Middleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/lock/#Middleware)
ClientStorage | Session
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ServerStorer)
User | [LockableUser](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#LockableUser)
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ServerStorer)
User | [LockableUser](https://pkg.go.dev/github.com/aarondl/authboss/v3/#LockableUser)
Values | _None_
Mailer | _None_
@@ -265,10 +265,10 @@ Module | expire
Pages | _None_
Routes | _None_
Emails | _None_
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware), [expire.Middleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/expire/#Middleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware), [expire.Middleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/expire/#Middleware)
ClientStorage | Session
ServerStorer | _None_
User | [User](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#User)
User | [User](https://pkg.go.dev/github.com/aarondl/authboss/v3/#User)
Values | _None_
Mailer | _None_
@@ -290,11 +290,11 @@ Module | otp
Pages | otp, otpadd, otpclear
Routes | /otp/login, /otp/add, /otp/clear
Emails | _None_
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware)
ClientStorage | Session and Cookie
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ServerStorer)
User | [otp.User](https://pkg.go.dev/github.com/volatiletech/authboss/v3/otp/#User)
Values | [UserValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#UserValuer)
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ServerStorer)
User | [otp.User](https://pkg.go.dev/github.com/aarondl/authboss/v3/otp/#User)
Values | [UserValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#UserValuer)
Mailer | _None_
One time passwords can be useful if users require a backup password in case they lose theirs,
@@ -325,10 +325,10 @@ Module | twofactor
Pages | recovery2fa
Routes | /2fa/recovery/regen
Emails | _None_
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware)
ClientStorage | Session
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ServerStorer)
User | [twofactor.User](https://pkg.go.dev/github.com/volatiletech/authboss/v3/otp/twofactor/#User)
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ServerStorer)
User | [twofactor.User](https://pkg.go.dev/github.com/aarondl/authboss/v3/otp/twofactor/#User)
Values | _None_
Mailer | _None_
@@ -354,11 +354,11 @@ Module | twofactor
Pages | twofactor_verify
Routes | /2fa/recovery/regen
Emails | twofactor_verify_email_html, twofactor_verify_email_txt
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware)
ClientStorage | Session
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ServerStorer)
User | [twofactor.User](https://pkg.go.dev/github.com/volatiletech/authboss/v3/otp/twofactor/#User)
Values | [twofactor.EmailVerifyTokenValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/otp/twofactor/#EmailVerifyTokenValuer)
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ServerStorer)
User | [twofactor.User](https://pkg.go.dev/github.com/aarondl/authboss/v3/otp/twofactor/#User)
Values | [twofactor.EmailVerifyTokenValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/otp/twofactor/#EmailVerifyTokenValuer)
Mailer | Required
To enable this feature simply turn on
@@ -387,11 +387,11 @@ Module | totp2fa
Pages | totp2fa_{setup,confirm,remove,validate}, totp2fa_{confirm,remove}_success
Routes | /2fa/totp/{setup,confirm,qr,remove,validate}
Emails | _None_
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware)
ClientStorage | Session **(SECURE!)**
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ServerStorer)
User | [totp2fa.User](https://pkg.go.dev/github.com/volatiletech/authboss/v3/otp/twofactor/totp2fa/#User)
Values | [TOTPCodeValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/otp/twofactor/totp2fa/#TOTPCodeValuer)
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ServerStorer)
User | [totp2fa.User](https://pkg.go.dev/github.com/aarondl/authboss/v3/otp/twofactor/totp2fa/#User)
Values | [TOTPCodeValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/otp/twofactor/totp2fa/#TOTPCodeValuer)
Mailer | _None_
**Note:** Unlike most modules in Authboss you must construct a `totp2fa.TOTP` and call `.Setup()`
@@ -451,11 +451,11 @@ Module | sms2fa
Pages | sms2fa_{setup,confirm,remove,validate}, sms2fa_{confirm,remove}_success
Routes | /2fa/{setup,confirm,remove,validate}
Emails | _None_
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#Authboss.LoadClientStateMiddleware)
Middlewares | [LoadClientStateMiddleware](https://pkg.go.dev/github.com/aarondl/authboss/v3/#Authboss.LoadClientStateMiddleware)
ClientStorage | Session (**SECURE!**)
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/#ServerStorer)
User | [sms2fa.User](https://pkg.go.dev/github.com/volatiletech/authboss/v3/otp/twofactor/sms2fa/#User), [sms2fa.SMSNumberProvider](https://pkg.go.dev/github.com/volatiletech/authboss/v3/otp/twofactor/sms2fa/#SMSNumberProvider)
Values | [SMSValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/otp/twofactor/sms2fa/#SMSValuer), [SMSPhoneNumberValuer](https://pkg.go.dev/github.com/volatiletech/authboss/v3/otp/twofactor/sms2fa/#SMSPhoneNumberValuer)
ServerStorer | [ServerStorer](https://pkg.go.dev/github.com/aarondl/authboss/v3/#ServerStorer)
User | [sms2fa.User](https://pkg.go.dev/github.com/aarondl/authboss/v3/otp/twofactor/sms2fa/#User), [sms2fa.SMSNumberProvider](https://pkg.go.dev/github.com/aarondl/authboss/v3/otp/twofactor/sms2fa/#SMSNumberProvider)
Values | [SMSValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/otp/twofactor/sms2fa/#SMSValuer), [SMSPhoneNumberValuer](https://pkg.go.dev/github.com/aarondl/authboss/v3/otp/twofactor/sms2fa/#SMSPhoneNumberValuer)
Mailer | _None_
**Note:** Unlike most modules in Authboss you must construct a `sms2fa.SMS` and call `.Setup()`

View File

@@ -6,7 +6,7 @@ import (
"net/http"
"time"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
var nowTime = time.Now

View File

@@ -7,8 +7,8 @@ import (
"testing"
"time"
"github.com/volatiletech/authboss/v3"
"github.com/volatiletech/authboss/v3/mocks"
"github.com/aarondl/authboss/v3"
"github.com/aarondl/authboss/v3/mocks"
)
func TestExpireSetup(t *testing.T) {

2
go.mod
View File

@@ -1,4 +1,4 @@
module github.com/volatiletech/authboss/v3
module github.com/aarondl/authboss/v3
go 1.20

View File

@@ -6,7 +6,7 @@ import (
"net/http"
"time"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
// Storage key constants

View File

@@ -7,8 +7,8 @@ import (
"testing"
"time"
"github.com/volatiletech/authboss/v3"
"github.com/volatiletech/authboss/v3/mocks"
"github.com/aarondl/authboss/v3"
"github.com/aarondl/authboss/v3/mocks"
)
func TestInit(t *testing.T) {

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"github.com/friendsofgo/errors"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
func init() {

View File

@@ -7,8 +7,8 @@ import (
"testing"
"time"
"github.com/volatiletech/authboss/v3"
"github.com/volatiletech/authboss/v3/mocks"
"github.com/aarondl/authboss/v3"
"github.com/aarondl/authboss/v3/mocks"
)
func TestLogout(t *testing.T) {

View File

@@ -11,7 +11,7 @@ import (
"time"
"github.com/friendsofgo/errors"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
// User represents all possible fields a authboss User may have

View File

@@ -3,7 +3,7 @@ package mocks
import (
"context"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
type UserWithSecondaryEmails struct {

View File

@@ -52,7 +52,7 @@ import (
"github.com/friendsofgo/errors"
"golang.org/x/oauth2"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
// FormValue constants

View File

@@ -9,8 +9,8 @@ import (
"testing"
"time"
"github.com/volatiletech/authboss/v3"
"github.com/volatiletech/authboss/v3/mocks"
"github.com/aarondl/authboss/v3"
"github.com/aarondl/authboss/v3/mocks"
"golang.org/x/oauth2"
"golang.org/x/oauth2/facebook"
"golang.org/x/oauth2/google"

View File

@@ -15,7 +15,7 @@ import (
"strings"
"github.com/friendsofgo/errors"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
const (

View File

@@ -7,8 +7,8 @@ import (
"net/http/httptest"
"testing"
"github.com/volatiletech/authboss/v3"
"github.com/volatiletech/authboss/v3/mocks"
"github.com/aarondl/authboss/v3"
"github.com/aarondl/authboss/v3/mocks"
)
type testUser struct {

View File

@@ -14,8 +14,8 @@ import (
"time"
"github.com/friendsofgo/errors"
"github.com/volatiletech/authboss/v3"
"github.com/volatiletech/authboss/v3/otp/twofactor"
"github.com/aarondl/authboss/v3"
"github.com/aarondl/authboss/v3/otp/twofactor"
)
// Session keys

View File

@@ -3,7 +3,7 @@ package sms2fa
import (
"fmt"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
// SMSValuer returns a code or a resend-code from the body

View File

@@ -6,11 +6,11 @@ import (
"net/http/httptest"
"testing"
"github.com/volatiletech/authboss/v3/otp/twofactor"
"github.com/aarondl/authboss/v3/otp/twofactor"
"golang.org/x/crypto/bcrypt"
"github.com/volatiletech/authboss/v3"
"github.com/volatiletech/authboss/v3/mocks"
"github.com/aarondl/authboss/v3"
"github.com/aarondl/authboss/v3/mocks"
)
type smsHolderSender string

View File

@@ -15,8 +15,8 @@ import (
"github.com/friendsofgo/errors"
"github.com/pquerna/otp"
"github.com/pquerna/otp/totp"
"github.com/volatiletech/authboss/v3"
"github.com/volatiletech/authboss/v3/otp/twofactor"
"github.com/aarondl/authboss/v3"
"github.com/aarondl/authboss/v3/otp/twofactor"
)
const (

View File

@@ -3,7 +3,7 @@ package totp2fa
import (
"fmt"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
// TOTPCodeValuer returns a code from the body

View File

@@ -9,11 +9,11 @@ import (
"golang.org/x/crypto/bcrypt"
"github.com/volatiletech/authboss/v3/otp/twofactor"
"github.com/aarondl/authboss/v3/otp/twofactor"
"github.com/pquerna/otp/totp"
"github.com/volatiletech/authboss/v3"
"github.com/volatiletech/authboss/v3/mocks"
"github.com/aarondl/authboss/v3"
"github.com/aarondl/authboss/v3/mocks"
)
func TestTOTPSetup(t *testing.T) {

View File

@@ -1,6 +1,6 @@
package twofactor
import "github.com/volatiletech/authboss/v3"
import "github.com/aarondl/authboss/v3"
// Page constants
const (

View File

@@ -7,7 +7,7 @@ import (
"net/http"
"strings"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
"golang.org/x/crypto/bcrypt"
)

View File

@@ -8,8 +8,8 @@ import (
"golang.org/x/crypto/bcrypt"
"github.com/volatiletech/authboss/v3"
"github.com/volatiletech/authboss/v3/mocks"
"github.com/aarondl/authboss/v3"
"github.com/aarondl/authboss/v3/mocks"
)
func TestSetup(t *testing.T) {

View File

@@ -12,7 +12,7 @@ import (
"net/url"
"path"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
// EmailVerify has a middleware function that prevents access to routes

View File

@@ -7,8 +7,8 @@ import (
"regexp"
"testing"
"github.com/volatiletech/authboss/v3"
"github.com/volatiletech/authboss/v3/mocks"
"github.com/aarondl/authboss/v3"
"github.com/aarondl/authboss/v3/mocks"
)
func TestSetupEmailVerify(t *testing.T) {

View File

@@ -15,7 +15,7 @@ import (
"path"
"time"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
// Constants for templates etc.

View File

@@ -6,8 +6,8 @@ import (
"strings"
"testing"
"github.com/volatiletech/authboss/v3"
"github.com/volatiletech/authboss/v3/mocks"
"github.com/aarondl/authboss/v3"
"github.com/aarondl/authboss/v3/mocks"
)
func testSetupWithSecondaryEmails() *testHarness {

View File

@@ -11,8 +11,8 @@ import (
"testing"
"time"
"github.com/volatiletech/authboss/v3"
"github.com/volatiletech/authboss/v3/mocks"
"github.com/aarondl/authboss/v3"
"github.com/aarondl/authboss/v3/mocks"
)
const (

View File

@@ -8,7 +8,7 @@ import (
"github.com/friendsofgo/errors"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
// Pages

View File

@@ -7,8 +7,8 @@ import (
"testing"
"github.com/friendsofgo/errors"
"github.com/volatiletech/authboss/v3"
"github.com/volatiletech/authboss/v3/mocks"
"github.com/aarondl/authboss/v3"
"github.com/aarondl/authboss/v3/mocks"
)
func TestRegisterInit(t *testing.T) {

View File

@@ -11,7 +11,7 @@ import (
"net/http"
"github.com/friendsofgo/errors"
"github.com/volatiletech/authboss/v3"
"github.com/aarondl/authboss/v3"
)
const (

View File

@@ -9,8 +9,8 @@ import (
"net/http/httptest"
"testing"
"github.com/volatiletech/authboss/v3"
"github.com/volatiletech/authboss/v3/mocks"
"github.com/aarondl/authboss/v3"
"github.com/aarondl/authboss/v3/mocks"
)
func TestInit(t *testing.T) {

View File

@@ -1,7 +1,7 @@
# Migrating to v2 from v1
As always, the best way to understand most of this is to look at the
[authboss-sample](https://github.com/volatiletech/authboss-sample). You could even look at
[authboss-sample](https://github.com/aarondl/authboss-sample). You could even look at
the commits that lead from v1 to v2 (though it is not divided nicely into small commits).
## Configuration
@@ -24,7 +24,7 @@ You probably will not want to override any of these and so I'd suggest a peek at
easily.
There is also an HTML renderer available at
[authboss-renderer](https://github.com/volatiletech/authboss-renderer).
[authboss-renderer](https://github.com/aarondl/authboss-renderer).
## Server storage