Mercurial > prosody-modules
changeset 831:0c3638673464
Merge upstream with my local LDAP work
author | Rob Hoelz <rob@hoelz.ro> |
---|---|
date | Tue, 18 Sep 2012 00:31:42 +0200 |
parents | f160166612c2 (diff) 87e847280aef (current diff) |
children | 9087431d35f6 |
files | |
diffstat | 5 files changed, 335 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_lib_ldap/dev/posix-users.ldif Mon Sep 17 20:15:27 2012 +0200 +++ b/mod_lib_ldap/dev/posix-users.ldif Tue Sep 18 00:31:42 2012 +0200 @@ -66,6 +66,7 @@ dn: uid=five,ou=Users,dc=example,dc=com objectclass: posixAccount objectclass: person +objectclass: inetOrgPerson uid: five uidNumber: 1004 gidNumber: 1004 @@ -73,6 +74,143 @@ cn: Jimmy Testerson userPassword: 51234 homeDirectory: /home/five +jpegPhoto:: /9j/4AAQSkZJRgABAQAAAQABAAD//gA+Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcg + SlBFRyB2NjIpLCBkZWZhdWx0IHF1YWxpdHkK/9sAQwAIBgYHBgUIBwcHCQkICgwUDQwLCwwZEhMP + FB0aHx4dGhwcICQuJyAiLCMcHCg3KSwwMTQ0NB8nOT04MjwuMzQy/9sAQwEJCQkMCwwYDQ0YMiEc + ITIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy/8AAEQgA + yADIAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMC + BAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYn + KCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeY + mZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5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PUikl + ZB5m3mni5KzLNIRleAPUUUVJQ5L6ZLhZYAEZSCGZQ3I9jxVx9S1C5cvLNvJ6kqP6Ciimop7hzNbE + sM9yCDtU/UV13hzxZPo91FMbNJQjAkbyOlFFP2cR+0l3PS7b4w2rqBNpMyt/sSg/0Fa0PxT0OTG+ + K7j+qA4/I0UUNElHxV4s0HW/D81vBcP54IeNWiYZP5ehNeM3NrP5rFImYZ6gUUVDirmsJNKxGsE6 + 9YZB/wABNTJkcEEfWiigpM6rwgyR6vDLJ/q4zvb6Dmiiioe5dj//2Q== dn: cn=Everyone,ou=Groups,dc=example,dc=com objectclass: posixGroup
--- a/mod_lib_ldap/dev/prosody-posix-ldap.cfg.lua Mon Sep 17 20:15:27 2012 +0200 +++ b/mod_lib_ldap/dev/prosody-posix-ldap.cfg.lua Tue Sep 18 00:31:42 2012 +0200 @@ -34,5 +34,9 @@ vcard_format = { displayname = 'cn', -- Consult the vCard configuration section in the README nickname = 'uid', + photo = { + type = 'image/jpeg', + binval = 'jpegPhoto', + } }, }
--- a/mod_lib_ldap/dev/slapd.conf Mon Sep 17 20:15:27 2012 +0200 +++ b/mod_lib_ldap/dev/slapd.conf Tue Sep 18 00:31:42 2012 +0200 @@ -3,6 +3,8 @@ # need it, don't include them include /etc/openldap/schema/cosine.schema include /etc/openldap/schema/nis.schema +# needed for inetOrgPerson so I can test jpegPhoto +include /etc/openldap/schema/inetorgperson.schema pidfile /var/run/openldap/slapd.pid argsfile /var/run/openldap/slapd.args
--- a/mod_lib_ldap/dev/t/02-vcard.t Mon Sep 17 20:15:27 2012 +0200 +++ b/mod_lib_ldap/dev/t/02-vcard.t Tue Sep 18 00:31:42 2012 +0200 @@ -4,6 +4,7 @@ use TestConnection; use AnyEvent::XMPP::Ext::VCard; +use MIME::Base64 qw(decode_base64); use Test::More; sub test_vcard { @@ -34,10 +35,14 @@ return; } + delete $vcard->{'_avatar_hash'}; # we don't check this + delete $vcard->{'PHOTO'}; # PHOTO data is treated specially + # by the vCard extension + foreach my $key (keys %$vcard) { my $value = $vcard->{$key}; - $value = $value->[0]; + $value = $value->[0] if ref($value) eq 'ARRAY'; if($value eq '') { delete $vcard->{$key}; @@ -46,7 +51,7 @@ } } - is_deeply $expected_fields, $vcard or diag(explain($vcard)); + is_deeply $vcard, $expected_fields or diag(explain($vcard)); $conn->cond->send; }); }); @@ -61,6 +66,14 @@ plan tests => 5; +my $photo_data = do { + local $/; + my $data = <DATA>; + chomp $data; + + decode_base64($data) +}; + test_vcard(one => { FN => 'John Testerson', NICKNAME => 'one', @@ -82,6 +95,147 @@ }); test_vcard(five => { - FN => 'Jimmy Testerson', - NICKNAME => 'five', + FN => 'Jimmy Testerson', + NICKNAME => 'five', + _avatar => $photo_data, + _avatar_type => 'image/jpeg', }); + +__DATA__ +/9j/4AAQSkZJRgABAQAAAQABAAD//gA+Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcg +SlBFRyB2NjIpLCBkZWZhdWx0IHF1YWxpdHkK/9sAQwAIBgYHBgUIBwcHCQkICgwUDQwLCwwZEhMP +FB0aHx4dGhwcICQuJyAiLCMcHCg3KSwwMTQ0NB8nOT04MjwuMzQy/9sAQwEJCQkMCwwYDQ0YMiEc +ITIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy/8AAEQgA +yADIAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMC +BAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYn +KCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeY +mZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5 ++v/EAB8BAAMBAQEBAQEBAQEAAAA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jxVx9S1C5cvLNvJ6kqP6Ciimop7hzNbE +sM9yCDtU/UV13hzxZPo91FMbNJQjAkbyOlFFP2cR+0l3PS7b4w2rqBNpMyt/sSg/0Fa0PxT0OTG+ +K7j+qA4/I0UUNElHxV4s0HW/D81vBcP54IeNWiYZP5ehNeM3NrP5rFImYZ6gUUVDirmsJNKxGsE6 +9YZB/wABNTJkcEEfWiigpM6rwgyR6vDLJ/q4zvb6Dmiiioe5dj//2Q==
--- a/mod_storage_ldap/ldap/vcard.lib.lua Mon Sep 17 20:15:27 2012 +0200 +++ b/mod_storage_ldap/ldap/vcard.lib.lua Tue Sep 18 00:31:42 2012 +0200 @@ -15,10 +15,41 @@ local builder_methods = {}; +local base64_encode = require('util.encodings').base64.encode; + function builder_methods:addvalue(key, value) self.vcard:tag(key):text(value):up(); end +function builder_methods:addphotofield(tagname, format_section) + local record = self.record; + local format = self.format; + local vcard = self.vcard; + local config = format[format_section]; + + if not config then + return; + end + + if config.extval then + if record[config.extval] then + local tag = vcard:tag(tagname); + tag:tag('EXTVAL'):text(record[config.extval]):up(); + end + elseif config.type and config.binval then + if record[config.binval] then + local tag = vcard:tag(tagname); + tag:tag('TYPE'):text(config.type):up(); + tag:tag('BINVAL'):text(base64_encode(record[config.binval])):up(); + end + else + module:log('error', 'You have an invalid %s config section', tagname); + return; + end + + vcard:up(); +end + function builder_methods:addregularfield(tagname, format_section) local record = self.record; local format = self.format; @@ -73,7 +104,7 @@ self:addvalue( 'FN', record[format.displayname]); self:addregularfield( 'N', 'name'); self:addvalue( 'NICKNAME', record[format.nickname]); - self:addregularfield( 'PHOTO', 'photo'); + self:addphotofield( 'PHOTO', 'photo'); self:addvalue( 'BDAY', record[format.birthday]); self:addmultisectionedfield('ADR', 'address'); self:addvalue( 'LABEL', nil); -- we don't support LABEL...yet. @@ -85,7 +116,7 @@ self:addregularfield( 'GEO', 'geo'); self:addvalue( 'TITLE', record[format.title]); self:addvalue( 'ROLE', record[format.role]); - self:addregularfield( 'LOGO', 'logo'); + self:addphotofield( 'LOGO', 'logo'); self:addvalue( 'AGENT', nil); -- we don't support AGENT...yet. self:addregularfield( 'ORG', 'org'); self:addvalue( 'CATEGORIES', nil); -- we don't support CATEGORIES...yet.