Tree [027f93] master /
History



File Date Author Commit
autoconf 2011-05-15 Michael Poole Michael Poole [3d3c25] Add an empty directory marker to create autoconf/.
doc 2014-04-26 Michael Poole Michael Poole [98366d] iauthd-c.conf.example: Clarify the example libr...
modules 2014-05-02 Michael Poole Michael Poole [52053f] iauth_xquery: Try that again...
src 2014-08-15 Michael Poole Michael Poole [b8b74a] sar: Fix compilation with gcc 4.4's overactive ...
tests 2011-05-11 Michael Poole Michael Poole [ceb4b0] Initial commit.
.gitignore 2014-08-15 Michael Poole Michael Poole [027f93] .gitignore: Add patterns to support an in-tree ...
AUTHORS 2011-05-11 Michael Poole Michael Poole [ceb4b0] Initial commit.
COPYING 2011-05-15 Michael Poole Michael Poole [942b75] Initial commit of IAuth framework (with login-o...
ChangeLog 2011-05-11 Michael Poole Michael Poole [ceb4b0] Initial commit.
INSTALL 2014-08-01 Michael Poole Michael Poole [15ea2b] Properly check for, and document, the dependenc...
Makefile.am 2011-05-15 Michael Poole Michael Poole [942b75] Initial commit of IAuth framework (with login-o...
NEWS 2011-05-11 Michael Poole Michael Poole [ceb4b0] Initial commit.
README 2012-01-20 Michael Poole Michael Poole [96c78c] Add "soft done" support for login-on-connect.
configure.ac 2014-08-15 Michael Poole Michael Poole [81a2fa] Fix build for libevent1.

Read Me

About iauthd-c
==============

This program is a reference framework and set of modules that
implement (Undernet) ircu's IAuth client authorization (and sometimes
authentication) protocol.

An IRC server that uses IAuth communicates with this program over this
standard input and output using a standard protocol (defined in the
ircu source tree, doc/readme.iauth).  The server tells this program
about new client connections, and usually waits until iauthd-c accepts
or rejects the client before finishing the "registration" phase -- at
that point, the server tells the rest of the network about the client.

This means that this program can do a bunch of checks about a client
to see whether it should be allowed on the network, and potentially
what IRC account stamp to give the client, before anyone on the
network can see the client (or the client's IP address, and before the
client can bother anyone else).

Architecture
============

iauthd-c uses libevent (http://www.monkey.org/~provos/libevent/) for
I/O multiplexing.  Extension modules can use either libevent's
asynchronous DNS resolver (evdns_*) or a more full-featured one in
iauthd-c (sar_*).

At the moment, iauthd-c is single-threaded, because we do not
anticipate it being compute-bound or otherwise benefiting from
concurrent threads of execution.

The iauthd-c core application provides a framework for making
decisions but does not contain any actual decision-making code (or
even IAuth code).  It loads shared libraries from LIBEXECDIR/iauthd-c/
to do that; these libraries are called iauthd modules.

Module Interfaces
=================

Each module is described by an opaque structure (struct module) and
should export up to three standard entry points, with exactly these
names (do NOT replace "module_" with the name of the module!):

 - void module_constructor(const char module_name[])

   This is the first function to be called.  It should only assume
   that the iauthd-c core (including libevent and the C library) are
   loaded, unless the shared library directly links to some other
   library.  This function can call module_depends() to indicate
   other iauthd modules it depends upon.

 - void module_post_init(struct module *self)

   This optional entry point can perform second-pass initialization
   that requires other iauthd modules to be loaded.

 - void module_destructor(void)

   This optional entry point is called just before the module is
   unloaded, and should release any persistent resources owned by the
   module.

The module core exports two functions that modules might use to
express load (or unload) order:

 - void module_depends(const char name[], ...) (null-terminated list)

   This function declares that the currently loading module depends
   on one or more other modules, as named.

 - void module_antidepends(const char name[])

   This function declares that the currently loading module is a
   back-end provider for some other module, and must be unloaded after
   it.

IAuth Interfaces
================

The code in the src directory is utility code rather than relating to
IAuth.  The IAuth-specific code is in modules/iauth_core.c and
modules/iauth.h.  Typically, iauth modules should call
module_depends("iauth", NULL) to indicate that they provide services
to the iauth modules.

Compiling
=========

From a totally fresh source tree, you should run these commands to
generate the first build.  (Except for the mkdir, running them again
later should be harmless.)

  autoreconf -Wall -i
  mkdir +build
  cd +build
  ../configure --enable-silent-rules
  make