Adding some docu.
authorTobias Markmann <tm@ayena.de>
Sun, 16 Aug 2009 21:20:02 +0000 (23:20 +0200)
committerTobias Markmann <tm@ayena.de>
Sun, 16 Aug 2009 21:20:02 +0000 (23:20 +0200)
util/sasl.lua

index d6ac5c1ef5ad1f58665b67003ab29056fc40b4b7..772e2dd5e9dbfa27b09b60b7b5c76530594e20e3 100644 (file)
@@ -37,6 +37,30 @@ local keys = keys
 local array = require "util.array"
 module "sasl"
 
+--[[
+Authentication Backend Prototypes:
+
+plain:
+       function(username, realm)
+               return password, state;
+       end
+
+plain-test:
+       function(username, realm, password)
+               return true or false, state;
+       end
+
+digest-md5:
+       function(username, realm, encoding)
+               return digesthash, state;
+       end
+
+digest-md5-test:
+       function(username, realm, encoding, digesthash)
+               return true or false, state;
+       end
+]]
+
 local method = {};
 method.__index = method;
 local mechanisms = {};
@@ -71,6 +95,7 @@ function method:mechanisms()
                                end
                end
        end
+       self["possible_mechanisms"] = mechanisms;
        return array.collect(keys(mechanisms));
 end