42links

Check-in [b072c35614]
Login

Check-in [b072c35614]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Major hismetic documentation improvements
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | trunk
Files: files | file ages | folders
SHA3-256: b072c356140481e31f49dd11a4f5f7e282a2f40b03bdea580ee925a0f7f886fe
User & Date: Cthulhux 2025-05-27 23:50:50
Context
2025-05-27
23:50
Major hismetic documentation improvements ... (Leaf check-in: b072c35614 user: Cthulhux tags: trunk)
2025-05-21
08:05
api docs updated ... (check-in: d536d7e058 user: Cthulhux tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to hismetic/README.md.

1
2
3
4
5
6
7
8




































9
10
11
12
13
14
15
# Huh?

This is a fork of [hermetic](https://github.com/eudoxia0/hermetic), a deprecated authentication framework for Clack-based Common Lisp web applications. The [demo](https://github.com/eudoxia0/hermetic/blob/master/demo/app.lisp) remains (mostly) compatible, except that `cl-pass` has been replaced by `bcrypt` hashing.

## bcrypt?

Yes. `hismetic` uses `bcrypt` and I don't care about other algorithms. Do not suggest them.





































## Demo?

The reference implementation is 42links. No support.

## "His"metic?

Well, it's not *her* metic anymore, is it?


|





>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


|




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Huh?

This is a fork of [hermetic](https://github.com/eudoxia0/hermetic), a deprecated authentication framework for [Clack](https://github.com/fukamachi/clack)-based Common Lisp web applications. The [demo](https://github.com/eudoxia0/hermetic/blob/master/demo/app.lisp) remains (mostly) compatible, except that `cl-pass` has been replaced by `bcrypt` hashing.

## bcrypt?

Yes. `hismetic` uses `bcrypt` and I don't care about other algorithms. Do not suggest them.

## Usage

Load `hismetic.lisp` from inside your project, then run `(hismetic:setup)`, providing functions that access users, passwords and roles:

```lisp
(defun user-exists-p (user)
  ;; Return t or nil here, depending on whether the
  ;; user name <user> exists.
)

(defun get-user-password (user)
  ;; Return the user password. Hashing recommended.
)

(defun get-user-roles (user)
  ;; Return a list of roles for the user here.
  ;; ex.: (list :users :staff)
)

;; Set up a session:
(hismetic:setup
 :user-p #'(lambda (user) (user-exists-p user))
 :user-pass #'(lambda (user) (get-hashed-user-password user))
 :user-roles #'(lambda (user) (get-user-roles user))
 :session *session*
 :denied #'(lambda (&optional params) "Access denied."))
```

Make sure your Clack application uses sessions:

```lisp
(clack:clackup (builder :session *app*))
```

Now, `(hismetic:login)` adds a user handle to your session, `(hismetic:logout)` removes it. `hismetic.lisp` contains a couple of helper methods and macros for your convenience as well, please consider the comments in the code and/or the example application below on how to use them.

## Demo?

The reference demo application for `hismetic` is [42links](https://code.rosaelefanten.org/42links).

## "His"metic?

Well, it's not *her* metic anymore, is it?