Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
== Outdated egg! This is an egg for CHICKEN 3, the unsupported old release. You're almost certainly looking for [[/eggref/4/stream-htpasswd|the CHICKEN 4 version of this egg]], if it exists. If it does not exist, there may be equivalent functionality provided by another egg; have a look at the [[https://wiki.call-cc.org/chicken-projects/egg-index-4.html|egg index]]. Otherwise, please consider porting this egg to the current version of CHICKEN. [[toc:]] [[tags:apache web htpasswd eggs parsing]] == Introduction The stream-htpasswd {{eggs|egg}} provides lazy generation and parsing of Apache htpasswd files. The htpasswd files are simple files that the Apache web server (and other related programs such as Subversion) use to keep a table of usernames and hashed passwords. == Examples === Consuming an htpasswd file The following code reads an htpasswd file from {{current-input-port}} and prints information from it. <enscript highlight=scheme>(use stream-ext stream-htpasswd format-modular) (stream-for-each (lambda (entry) (format #t "User: ~A~% Password hash: ~A~%" (stream->string (htpasswd-user entry)) (stream->string (htpasswd-hash entry)))) (stream->htpasswd (port->stream)))</enscript> === Producing an htpasswd file The following code produces an htpasswd file with a few hard-coded users. <enscript highlight=scheme>(use stream-htpasswd stream-ext) (define *users* (list->stream '(("pedro" "9qQnjR7L49qOk") ("juan" "9aoaXUqySXwKc") ("felix" "Q9i.QlCcFByfs")))) (write-stream (htpasswd->stream (stream-map (lambda (token) (make-htpasswd (string->stream (car token)) (string->stream (cadr token)))) *users*)))</enscript> == Authors This egg is made by [[http://azul.freaks-unidos.net/|Alejandro Forero Cuervo]] <azul@freaks-unidos.net>. == License The stream htpasswd egg for Chicken Scheme is in the public domain and may be reproduced or copied without permission from its author. Citation of the source is appreciated. == The htpasswd record ... == Reading an htpasswd file ... == Producing an htpasswd file ... == Version History ; 1.0 : First release.
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you subtract 1 from 4?