auth

package
Version: v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2021 License: GPL-2.0, GPL-2.0-or-later Imports: 0 Imported by: 0

README

modules/auth

Basic user/auth module

This should be modeled after flask-security

Documentation

Overview

	A basic user authentication module for Revel

 list of concerns:

- Separating out the interface and driver - Removing DB/Storage dependency - UUID as default identifier? - how to deal with password/secret or generally, method of authorization - default {views,controllers,routes} for register/login/logut ? - reset password in most basic ? - activation (and other features) in a second / more sophisticated driver - filter for checking that user is authenticated

I think a driver is made up of 2 parts data prep and data storage register and password reset are part of data prep as is the auth hash method they don't care how the data is stored

then there is the data store

perhaps each auth user model should instantiate 2 drivers instead of 1? one for data prep components and one for storage so the security driver and the storage driver

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SecretDriver

type SecretDriver interface {
	Authenticate() (bool, error)
	HashSecret(args ...interface{}) (string, error)
}

type StorageDriver

type StorageDriver interface {
	Save(user interface{}) error
	// Load should take a partially filled struct
	// (with values needed to look up)
	// and fills in the rest
	Load(user interface{}) error
}
var (
	Store StorageDriver
)

type UserAuth

type UserAuth interface {
	// getters/setters implemented by the app-level model
	UserId() string
	Secret() string
	HashedSecret() string
	SetHashedSecret(string)

	SecretDriver
}

Directories

Path Synopsis
driver

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL