The mito-auth Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The mito-auth Reference Manual

This is the mito-auth Reference Manual, version 0.1, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 04:19:27 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

mito-auth

Mito-auth provides a Mito mixin class for user authorization.

Usage

(use-package :mito-auth)

;; Inherit mito-auth:has-secure-password.
;; It adds password_hash and password_salt.
(defclass user (has-secure-password)
  ((name :col-type (:varchar 60)
         :initarg :name
         :accessor user-name)
   (email :col-type (:varchar 255)
          :initarg :email
          :accessor user-email))
  (:metaclass mito:dao-table-class))

;; Connect to the DB
(mito:connect-toplevel :sqlite3 :database-name #P"/tmp/mito-auth.db")

;; Enable logging
(setf mito:*mito-logger-stream* t)

;; Ensure the table "user" exists
(mito:ensure-table-exists 'user)
;-> ;; CREATE TABLE IF NOT EXISTS "user" (
;       "id" INTEGER PRIMARY KEY AUTOINCREMENT,
;       "name" VARCHAR(60) NOT NULL,
;       "email" VARCHAR(255) NOT NULL,
;       "password_hash" CHAR(64) NOT NULL,
;       "password_salt" BYTEA NOT NULL,
;       "created_at" TIMESTAMP,
;       "updated_at" TIMESTAMP
;   ) () [0 rows] | MITO.DAO:ENSURE-TABLE-EXISTS

(mito:create-dao 'user
                 :name "Eitaro Fukamachi"
                 :email "e.arrows@gmail.com"
                 :password "c0mmon-l1sp")
;-> ;; INSERT INTO "user" ("name", "email", "password_hash", "password_salt", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) ("Eitaro Fukamachi", "e.arrows@gmail.com", "63ab35de18dffd24e51a98d5f9c4cd82e665053a73efbe7e006dc37e922d7949", "Lº€ÅLm&[FÂÍüîn24‹¾", "2016-02-19 17:47:10", "2016-02-19 17:47:10") [0 rows] | MITO.DAO:INSERT-DAO
;=> #<USER {100461A363}>

(defvar *user* (mito:find-dao 'user :email "e.arrows@gmail.com"))

(auth *user* "c0mmon-l1sp")
;=> T

(auth *user* "wrong-password")
;=> NIL

Installation

(ql:quickload :mito-auth)

See Also

Author

Copyright

Copyright (c) 2016 Eitaro Fukamachi (e.arrows@gmail.com)

License

Licensed under the LLGPL


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 mito-auth

Author

Eitaro Fukamachi

License

LLGPL

Description

User authorization for Mito classes

Version

0.1

Dependencies
Source

mito-auth.asd (file)

Component

src (module)


Next: , Previous: , Up: Top   [Contents][Index]

3 Modules

Modules are listed depth-first from the system components tree.


Previous: , Up: Modules   [Contents][Index]

3.1 mito-auth/src

Parent

mito-auth (system)

Location

src/

Component

mito-auth.lisp (file)


Next: , Previous: , Up: Top   [Contents][Index]

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

4.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.1 mito-auth.asd

Location

mito-auth.asd

Systems

mito-auth (system)


Previous: , Up: Lisp files   [Contents][Index]

4.1.2 mito-auth/src/mito-auth.lisp

Parent

src (module)

Location

src/mito-auth.lisp

Packages

mito-auth

Exported Definitions
Internal Definitions

make-password-hash (function)


Next: , Previous: , Up: Top   [Contents][Index]

5 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

5.1 mito-auth

Source

mito-auth.lisp (file)

Nickname

mito.auth

Use List

common-lisp

Exported Definitions
Internal Definitions

make-password-hash (function)


Next: , Previous: , Up: Top   [Contents][Index]

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

6.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.1 Functions

Function: auth OBJECT PASSWORD
Package

mito-auth

Source

mito-auth.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.2 Generic functions

Generic Function: (setf password) PASSWORD AUTH
Package

mito-auth

Source

mito-auth.lisp (file)

Methods
Method: (setf password) PASSWORD (OBJECT has-secure-password)
Generic Function: password-hash OBJECT
Package

mito-auth

Methods
Method: password-hash (HAS-SECURE-PASSWORD has-secure-password)

automatically generated reader method

Source

mito-auth.lisp (file)

Generic Function: password-salt OBJECT
Package

mito-auth

Methods
Method: password-salt (HAS-SECURE-PASSWORD has-secure-password)

automatically generated reader method

Source

mito-auth.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

6.1.3 Classes

Class: has-secure-password ()
Package

mito-auth

Source

mito-auth.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: password-hash
Initargs

:password-hash

Readers

password-hash (generic function)

Slot: password-salt
Initargs

:password-salt

Initform

(let ((ironclad:*prng* (ironclad:make-prng :fortuna :seed :urandom))) (ironclad:make-random-salt 20))

Readers

password-salt (generic function)


Previous: , Up: Definitions   [Contents][Index]

6.2 Internal definitions


Previous: , Up: Internal definitions   [Contents][Index]

6.2.1 Functions

Function: make-password-hash PASSWORD SALT
Package

mito-auth

Source

mito-auth.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   M  
Index Entry  Section

F
File, Lisp, mito-auth.asd: The mito-auth<dot>asd file
File, Lisp, mito-auth/src/mito-auth.lisp: The mito-auth/src/mito-auth<dot>lisp file

L
Lisp File, mito-auth.asd: The mito-auth<dot>asd file
Lisp File, mito-auth/src/mito-auth.lisp: The mito-auth/src/mito-auth<dot>lisp file

M
mito-auth.asd: The mito-auth<dot>asd file
mito-auth/src: The mito-auth/src module
mito-auth/src/mito-auth.lisp: The mito-auth/src/mito-auth<dot>lisp file
Module, mito-auth/src: The mito-auth/src module

Jump to:   F   L   M  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
A   F   G   M   P  
Index Entry  Section

(
(setf password): Exported generic functions
(setf password): Exported generic functions

A
auth: Exported functions

F
Function, auth: Exported functions
Function, make-password-hash: Internal functions

G
Generic Function, (setf password): Exported generic functions
Generic Function, password-hash: Exported generic functions
Generic Function, password-salt: Exported generic functions

M
make-password-hash: Internal functions
Method, (setf password): Exported generic functions
Method, password-hash: Exported generic functions
Method, password-salt: Exported generic functions

P
password-hash: Exported generic functions
password-hash: Exported generic functions
password-salt: Exported generic functions
password-salt: Exported generic functions

Jump to:   (  
A   F   G   M   P  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   P   S  
Index Entry  Section

P
password-hash: Exported classes
password-salt: Exported classes

S
Slot, password-hash: Exported classes
Slot, password-salt: Exported classes

Jump to:   P   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   H   M   P   S  
Index Entry  Section

C
Class, has-secure-password: Exported classes

H
has-secure-password: Exported classes

M
mito-auth: The mito-auth system
mito-auth: The mito-auth package

P
Package, mito-auth: The mito-auth package

S
System, mito-auth: The mito-auth system

Jump to:   C   H   M   P   S