Commit 5877fa95 authored by Clément OUDOT's avatar Clément OUDOT
Browse files

CAS IssuerDB skeleton (#101)

parent dca8b923
......@@ -323,12 +323,17 @@ sub struct {
# IssuerDB branch
issuerDB => {
_nodes => [qw(issuerDBSAML)],
_nodes => [qw(issuerDBSAML issuerDBCAS)],
issuerDBSAML => {
_nodes => [qw(issuerDBSAMLPath issuerDBSAMLRule)],
issuerDBSAMLPath => 'text:/issuerDBSAMLPath',
issuerDBSAMLRule => 'text:/issuerDBSAMLRule',
},
issuerDBCAS => {
_nodes => [qw(issuerDBCASPath issuerDBCASRule)],
issuerDBCASPath => 'text:/issuerDBCASPath',
issuerDBCASRule => 'text:/issuerDBCASRule',
},
},
# LDAP
......@@ -1023,6 +1028,15 @@ sub testStruct {
1;
},
},
issuerDBCASPath => $testNotDefined,
issuerDBCASRule => {
test => $perlExpr,
warnTest => sub {
my $e = shift;
return ( 0, $assignMsg ) if ( $e =~ $assignTest );
1;
},
},
ldapBase => {
test => qr/^(?:\w+=.*|)$/,
msgFail => 'Bad LDAP base',
......@@ -1361,6 +1375,8 @@ sub defaultConf {
https => '0',
issuerDBSAMLPath => '^/saml/',
issuerDBSAMLRule => '0',
issuerDBCASPath => '^/cas/',
issuerDBCASRule => '0',
ldapBase => 'dc=example,dc=com',
ldapPort => '389',
ldapPwdEnc => 'utf-8',
......
......@@ -102,6 +102,9 @@ sub en {
issuerDBSAML => 'SAML',
issuerDBSAMLPath => 'Path',
issuerDBSAMLRule => 'Activation rule',
issuerDBCAS => 'CAS',
issuerDBCASPath => 'Path',
issuerDBCASRule => 'Activation rule',
ldapBase => 'Users search base',
ldapChangePasswordAsUser => 'Change as user',
ldapConnection => 'Connection',
......@@ -391,6 +394,9 @@ sub fr {
issuerDBSAML => 'SAML',
issuerDBSAMLPath => 'Chemin',
issuerDBSAMLRule => 'Règle d\'activation',
issuerDBCAS => 'CAS',
issuerDBCASPath => 'Chemin',
issuerDBCASRule => 'Règle d\'activation',
ldapBase => 'Base de recherche des utilisateurs',
ldapChangePasswordAsUser => 'Changement en tant qu\'utilisateur',
ldapConnection => 'Connexion',
......
## @file
# CAS Issuer file
## @class
# CAS Issuer class
package Lemonldap::NG::Portal::IssuerDBCAS;
use strict;
use Lemonldap::NG::Portal::Simple;
our $VERSION = '0.01';
## @method void issuerDBInit()
# TODO
# @return Lemonldap::NG::Portal error code
sub issuerDBInit {
my $self = shift;
PE_OK;
}
## @apmethod int issuerForUnAuthUser()
# TODO
# @return Lemonldap::NG::Portal error code
sub issuerForUnAuthUser {
my $self = shift;
PE_OK;
}
## @apmethod int issuerForAuthUser()
# TODO
# @return Lemonldap::NG::Portal error code
sub issuerForAuthUser {
my $self = shift;
PE_OK;
}
## @apmethod int issuerLogout()
# Do nothing
# @return Lemonldap::NG::Portal error code
sub issuerLogout {
PE_OK;
}
1;
__END__
=head1 NAME
=encoding utf8
Lemonldap::NG::Portal::IssuerDBCAS - CAS IssuerDB for LemonLDAP::NG
=head1 DESCRIPTION
CAS Issuer implementation in LemonLDAP::NG
=head1 SEE ALSO
L<Lemonldap::NG::Portal>
http://www.jasig.org/cas/protocol
=head1 AUTHOR
Clement OUDOT, E<lt>clement@oodo.,etE<gt>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2010 by Clement OUDOT
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.10.0 or,
at your option, any later version of Perl 5 you may have available.
=cut
......@@ -235,7 +235,7 @@ sub new {
}
# Check issuerDB path to load the correct issuerDB module
foreach my $issuerDBtype (qw(SAML OpenID)) {
foreach my $issuerDBtype (qw(SAML OpenID CAS)) {
my $module_name = 'Lemonldap::NG::Portal::IssuerDB' . $issuerDBtype;
$self->lmLog( "[IssuerDB activation] Try issuerDB module $issuerDBtype",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment