Skeleton of a SOAP configuration access
This commit is contained in:
parent
0f1d5ce5cc
commit
0b6efc588d
|
@ -1,5 +1,8 @@
|
|||
Revision history for Perl extension Lemonldap::NG::Handler.
|
||||
|
||||
0.75 Sat Feb 24 16:36:56
|
||||
- Adding cross-domain-authentication support
|
||||
|
||||
0.74 Sun Feb 4 19:27:34 2007
|
||||
- unprotect system documentation
|
||||
- remove warning on Apache-1.3 ($ENV{MOD_PERL_API_VERSION} does not exist)
|
||||
|
|
|
@ -2,7 +2,7 @@ package Lemonldap::NG::Handler;
|
|||
|
||||
print STDERR
|
||||
"See Lemonldap::NG::Handler(3) to know which Lemonldap::NG::Handler::* module to use.";
|
||||
our $VERSION = "0.74";
|
||||
our $VERSION = "0.75";
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ use MIME::Base64;
|
|||
use Exporter 'import';
|
||||
use Safe;
|
||||
|
||||
our $VERSION = '0.74';
|
||||
our $VERSION = '0.75';
|
||||
|
||||
our %EXPORT_TAGS = (
|
||||
localStorage =>
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
Revision history for Perl extension Lemonldap::NG::Manager.
|
||||
0.44 Sat Feb 24 16:32:34 2007
|
||||
- Adding SOAP support to access to configuration
|
||||
|
||||
0.43 Sun Jan 28 19:10:24 2007
|
||||
- Little correction on patch 0.41->0.42
|
||||
|
|
|
@ -53,6 +53,7 @@ lib/Lemonldap/NG/Manager/Base.pm
|
|||
lib/Lemonldap/NG/Manager/Conf.pm
|
||||
lib/Lemonldap/NG/Manager/Conf/DBI.pm
|
||||
lib/Lemonldap/NG/Manager/Conf/File.pm
|
||||
lib/Lemonldap/NG/Manager/Conf/SOAP.pm
|
||||
lib/Lemonldap/NG/Manager/Help.pm
|
||||
Makefile.PL
|
||||
MANIFEST
|
||||
|
@ -60,3 +61,7 @@ META.yml Module meta-data (added by MakeMaker)
|
|||
README
|
||||
TODO
|
||||
t/Lemonldap-NG-Manager.t
|
||||
t/Lemonldap-NG-Manager-Conf.t
|
||||
t/Lemonldap-NG-Manager-Conf-DBI.t
|
||||
t/Lemonldap-NG-Manager-Conf-File.t
|
||||
t/Lemonldap-NG-Manager-Conf-SOAP.t
|
||||
|
|
|
@ -12,7 +12,7 @@ require Lemonldap::NG::Manager::Help;
|
|||
|
||||
our @ISA = qw(Lemonldap::NG::Manager::Base);
|
||||
|
||||
our $VERSION = '0.43';
|
||||
our $VERSION = '0.44';
|
||||
|
||||
sub new {
|
||||
my ( $class, $args ) = @_;
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
package Lemonldap::NG::Manager::Conf::SOAP;
|
||||
|
||||
use strict;
|
||||
use SOAP::Lite;
|
||||
|
||||
our $VERSION = 0.1;
|
||||
|
||||
sub prereq {
|
||||
my $self = shift;
|
||||
unless ( $self->{proxy} and $self->{uri} ) {
|
||||
print STDERR 'No SOAP parameters found (proxy and uri)';
|
||||
return 0;
|
||||
}
|
||||
1;
|
||||
}
|
||||
|
||||
sub _connect {
|
||||
my $self = shift;
|
||||
$self->{service} ||= SOAP::Lite -> uri($self->{uri})
|
||||
-> proxy($self->{proxy});
|
||||
}
|
||||
|
||||
sub _soapCall {
|
||||
my $self = shift;
|
||||
my $func = shift;
|
||||
$self->_connect;
|
||||
my $conf = $self->{service}->$func(@_)->result;
|
||||
return @$conf;
|
||||
|
||||
}
|
||||
|
||||
sub available {
|
||||
my $self = shift;
|
||||
return $self->_soapCall('available',@_);
|
||||
}
|
||||
|
||||
sub lastCfg {
|
||||
my $self = shift;
|
||||
return $self->_soapCall('lastCfg',@_);
|
||||
}
|
||||
|
||||
sub store {
|
||||
my $self = shift;
|
||||
return $self->_soapCall('store',@_);
|
||||
}
|
||||
|
||||
sub load {
|
||||
my $self = shift;
|
||||
return $self->_soapCall('load',@_);
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
|
@ -0,0 +1,48 @@
|
|||
package Lemonldap::NG::Manager::SOAPServer;
|
||||
|
||||
use strict;
|
||||
use SOAP::Transport::HTTP;
|
||||
use Lemonldap::NG::Manager::Conf;
|
||||
|
||||
our $VERSION = "0.1";
|
||||
|
||||
my $config;
|
||||
|
||||
sub start {
|
||||
my ( $args ) = @_;
|
||||
unless ($args) {
|
||||
print STDERR "parameters are required, I can't start so\n";
|
||||
return 0;
|
||||
}
|
||||
foreach (qw(configStorage)) {
|
||||
unless ( $args->{$_} ) {
|
||||
print STDERR qq/The "$_" parameter is required\n/;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Lemonldap::NG::Manager::SOAPServer::Proxy->new( $args );
|
||||
$config = Lemonldap::NG::Manager::Conf->new( $args->{configStorage} );
|
||||
die "Configuration not loaded" unless $config;
|
||||
SOAP::Transport::HTTP::CGI->dispatch_to(__PACKAGE__."::Proxy")->handle;
|
||||
}
|
||||
|
||||
package Lemonldap::NG::Manager::SOAPServer::Proxy;
|
||||
|
||||
sub available {
|
||||
return $config->available(@_)
|
||||
}
|
||||
|
||||
sub lastCfg {
|
||||
return $config->lastCfg(@_)
|
||||
}
|
||||
|
||||
sub store {
|
||||
return $config->store(@_)
|
||||
}
|
||||
|
||||
sub load {
|
||||
return $config->load(@_)
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
|
@ -0,0 +1,15 @@
|
|||
# Before `make install' is performed this script should be runnable with
|
||||
# `make test'. After `make install' it should work as `perl Lemonldap-NG-Manager.t'
|
||||
|
||||
#########################
|
||||
|
||||
# change 'tests => 1' to 'tests => last_test_to_print';
|
||||
|
||||
use Test::More tests => 1;
|
||||
BEGIN { use_ok('Lemonldap::NG::Manager::Conf::DBI') };
|
||||
|
||||
#########################
|
||||
|
||||
# Insert your test code below, the Test::More module is use()ed here so read
|
||||
# its man page ( perldoc Test::More ) for help writing this test script.
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
# Before `make install' is performed this script should be runnable with
|
||||
# `make test'. After `make install' it should work as `perl Lemonldap-NG-Manager.t'
|
||||
|
||||
#########################
|
||||
|
||||
# change 'tests => 1' to 'tests => last_test_to_print';
|
||||
|
||||
use Test::More tests => 1;
|
||||
BEGIN { use_ok('Lemonldap::NG::Manager::Conf::File') };
|
||||
|
||||
#########################
|
||||
|
||||
# Insert your test code below, the Test::More module is use()ed here so read
|
||||
# its man page ( perldoc Test::More ) for help writing this test script.
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
# Before `make install' is performed this script should be runnable with
|
||||
# `make test'. After `make install' it should work as `perl Lemonldap-NG-Manager.t'
|
||||
|
||||
#########################
|
||||
|
||||
# change 'tests => 1' to 'tests => last_test_to_print';
|
||||
|
||||
use Test::More tests => 1;
|
||||
# SOAP::Lite is not required, so Lemonldap::NG::Manager::Conf::SOAP may
|
||||
# not run.
|
||||
SKIP: {
|
||||
eval { require SOAP::Lite };
|
||||
skip "SOAP::Lite is not installed, so SOAP configuration access will not work", 1 if($@);
|
||||
use_ok('Lemonldap::NG::Manager::Conf::SOAP');
|
||||
}
|
||||
|
||||
#########################
|
||||
|
||||
# Insert your test code below, the Test::More module is use()ed here so read
|
||||
# its man page ( perldoc Test::More ) for help writing this test script.
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
# Before `make install' is performed this script should be runnable with
|
||||
# `make test'. After `make install' it should work as `perl Lemonldap-NG-Manager.t'
|
||||
|
||||
#########################
|
||||
|
||||
# change 'tests => 1' to 'tests => last_test_to_print';
|
||||
|
||||
use Test::More tests => 1;
|
||||
BEGIN { use_ok('Lemonldap::NG::Manager::Conf') };
|
||||
|
||||
#########################
|
||||
|
||||
# Insert your test code below, the Test::More module is use()ed here so read
|
||||
# its man page ( perldoc Test::More ) for help writing this test script.
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
Revision history for Perl extension Lemonldap::NG::Portal.
|
||||
|
||||
0.62 Sat Feb 24 16:34:45
|
||||
- Adding cross-domain-authentication mechanism
|
||||
|
||||
0.61 Sun Feb 11 9:10:12
|
||||
- Existing sessions are now checked
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
Changes
|
||||
example/index.pl
|
||||
example/slavePortal.pl
|
||||
lib/Lemonldap/NG/Portal.pm
|
||||
lib/Lemonldap/NG/Portal/AuthSSL.pm
|
||||
lib/Lemonldap/NG/Portal/CDA.pm
|
||||
|
|
Loading…
Reference in New Issue