Comparison

util/sasl/anonymous.lua @ 2998:36c169ed1576

Merge Tobias's fancy SASL branch->trunk
author Matthew Wild <mwild1@gmail.com>
date Wed, 05 May 2010 11:29:10 +0100
parent 2996:b0515ed4d9d7
child 3116:90a98a6b52ac
comparison
equal deleted inserted replaced
2989:87c378c77be3 2998:36c169ed1576
1 -- sasl.lua v0.4 1 -- sasl.lua v0.4
2 -- Copyright (C) 2008-2009 Tobias Markmann 2 -- Copyright (C) 2008-2010 Tobias Markmann
3 -- 3 --
4 -- All rights reserved. 4 -- All rights reserved.
5 -- 5 --
6 -- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 -- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7 -- 7 --
18 18
19 module "anonymous" 19 module "anonymous"
20 20
21 --========================= 21 --=========================
22 --SASL ANONYMOUS according to RFC 4505 22 --SASL ANONYMOUS according to RFC 4505
23
24 --[[
25 Supported Authentication Backends
26
27 anonymous:
28 function(username, realm)
29 return true; --for normal usage just return true; if you don't like the supplied username you can return false.
30 end
31 ]]
32
23 local function anonymous(self, message) 33 local function anonymous(self, message)
24 local username; 34 local username;
25 repeat 35 repeat
26 username = generate_uuid(); 36 username = generate_uuid();
27 until self.profile.anonymous(username, self.realm); 37 until self.profile.anonymous(username, self.realm);