Skip to content
Snippets Groups Projects
Commit b652c633 authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

get rid of junk comments and debug code

parent 2ebb1907
Branches
Tags
No related merge requests found
...@@ -28,7 +28,6 @@ sub new { ...@@ -28,7 +28,6 @@ sub new {
my $self = {}; my $self = {};
## Bless AuthenticationToken object
bless $self, $pkg; bless $self, $pkg;
## Object may be created either with a hashref as argument or an IdPAccountManager::Data::Authenticationtoken object ## Object may be created either with a hashref as argument or an IdPAccountManager::Data::Authenticationtoken object
...@@ -136,7 +135,7 @@ sub _generate_token { ...@@ -136,7 +135,7 @@ sub _generate_token {
return substr(Digest::MD5::md5_hex(time . $$ . $salt), -1 * $size); return substr(Digest::MD5::md5_hex(time . $$ . $salt), -1 * $size);
} }
1; # Magic true value required at end of module 1;
__END__ __END__
=head1 NAME =head1 NAME
......
...@@ -21,7 +21,6 @@ sub new { ...@@ -21,7 +21,6 @@ sub new {
my $self = { logger => $args{logger} }; my $self = { logger => $args{logger} };
## Bless SAMLMetadata object
bless $self, $pkg; bless $self, $pkg;
return $self; return $self;
...@@ -115,7 +114,6 @@ sub print { ...@@ -115,7 +114,6 @@ sub print {
return 1.; return 1.;
} }
## Internal function
## returns a Lib::XML représenting an XML file ## returns a Lib::XML représenting an XML file
sub _get_xml_object { sub _get_xml_object {
my $self = shift; my $self = shift;
...@@ -176,13 +174,6 @@ sub _parse_saml_metadata { ...@@ -176,13 +174,6 @@ sub _parse_saml_metadata {
my $self = shift; my $self = shift;
my %options = @_; my %options = @_;
#$self->{logger}->log(level => LOG_TRACE, message => join(',',%options));
#unless ($options{'filter_entity_type'}) {
#$self->{logger}->log(level => LOG_ERROR, message => "paramètre entity_type manquant");
#return undef;
#}
my $root = $options{'metadata_as_xml'}; my $root = $options{'metadata_as_xml'};
my @extracted_array; my @extracted_array;
...@@ -202,14 +193,9 @@ sub _parse_saml_metadata { ...@@ -202,14 +193,9 @@ sub _parse_saml_metadata {
if ($options{'filter_entity_id'} if ($options{'filter_entity_id'}
&& ($options{'filter_entity_id'} ne $extracted_data->{'entityid'})); && ($options{'filter_entity_id'} ne $extracted_data->{'entityid'}));
#$self->{logger}->log(level => LOG_TRACE, message => "EntityId: %s - Cherche %s", $extracted_data->{'entityid'}, $options{'filter_entity_id'});
$extracted_data->{'xml_md'} = $extracted_data->{'xml_md'} =
IdPAccountManager::Tools::escape_xml($EntityDescriptor->toString()); IdPAccountManager::Tools::escape_xml($EntityDescriptor->toString());
#$self->{logger}->log(level => LOG_TRACE, message => "EntityId: %s", $extracted_data->{'entityid'});
#$self->{logger}->log(level => LOG_TRACE, message => "Entity dump: %s", $EntityDescriptor->toString());
foreach my $child ($EntityDescriptor->childNodes()) { foreach my $child ($EntityDescriptor->childNodes()) {
## Ignoringnodes of type XML::LibXML::Text or XML::LibXML::Comment ## Ignoringnodes of type XML::LibXML::Text or XML::LibXML::Comment
...@@ -224,7 +210,7 @@ sub _parse_saml_metadata { ...@@ -224,7 +210,7 @@ sub _parse_saml_metadata {
{ {
## On ne prend en compte que les endpoints prévus ## On ne prend en compte que les endpoints prévus
#next unless ($sso->getAttribute('Binding') && defined $supported_saml_bindings{$sso->getAttribute('Binding')}); #next unless ($sso->getAttribute('Binding') && defined $supported_saml_bindings{$sso->getAttribute('Binding')});
## On extrait les infos sur les endpoints ## On extrait les infos sur les endpoints
push @{ $extracted_data->{'idp_endpoints'} }, push @{ $extracted_data->{'idp_endpoints'} },
...@@ -301,7 +287,6 @@ sub _parse_saml_metadata { ...@@ -301,7 +287,6 @@ sub _parse_saml_metadata {
} elsif ($child->nodeName =~ /Extensions$/) { } elsif ($child->nodeName =~ /Extensions$/) {
#$self->{logger}->log(level => LOG_TRACE, message => "Extensions for %s", $extracted_data->{'entityid'});
foreach my $registrationinfo ( foreach my $registrationinfo (
$child->getElementsByLocalName('RegistrationInfo')) $child->getElementsByLocalName('RegistrationInfo'))
{ {
...@@ -408,7 +393,6 @@ sub _parse_saml_metadata { ...@@ -408,7 +393,6 @@ sub _parse_saml_metadata {
} }
## Filter entities based on type ## Filter entities based on type
#$self->{logger}->log(level => LOG_TRACE, message => "Entity type : %s", $extracted_data->{'type'});
next next
if (defined $options{'filter_entity_type'} if (defined $options{'filter_entity_type'}
&& ($options{'filter_entity_type'} ne $extracted_data->{'type'})); && ($options{'filter_entity_type'} ne $extracted_data->{'type'}));
...@@ -426,7 +410,7 @@ sub _parse_saml_metadata { ...@@ -426,7 +410,7 @@ sub _parse_saml_metadata {
return \@extracted_array; return \@extracted_array;
} }
1; # Magic true value required at end of module 1;
__END__ __END__
=head1 NAME =head1 NAME
......
...@@ -83,7 +83,7 @@ sub list_service_providers { ...@@ -83,7 +83,7 @@ sub list_service_providers {
return $service_providers; return $service_providers;
} }
1; # Magic true value required at end of module 1;
__END__ __END__
=head1 NAME =head1 NAME
......
...@@ -27,7 +27,6 @@ sub new { ...@@ -27,7 +27,6 @@ sub new {
my $self = {}; my $self = {};
## Bless Provider object
bless $self, $pkg; bless $self, $pkg;
## Object may be created either with a hashref as argument or an IdPAccountManager::Data::Testaccount object ## Object may be created either with a hashref as argument or an IdPAccountManager::Data::Testaccount object
...@@ -142,9 +141,7 @@ sub create_test_accounts_for_sp { ...@@ -142,9 +141,7 @@ sub create_test_accounts_for_sp {
return @test_accounts; return @test_accounts;
} }
#before 'new' => sub { print "about to call new\n"; }; 1;
1; # Magic true value required at end of module
__END__ __END__
=head1 NAME =head1 NAME
......
...@@ -265,7 +265,7 @@ sub boolean2integer { ...@@ -265,7 +265,7 @@ sub boolean2integer {
return undef; return undef;
} }
1; # Magic true value required at end of module 1;
__END__ __END__
=head1 NAME =head1 NAME
......
...@@ -43,23 +43,14 @@ sub new { ...@@ -43,23 +43,14 @@ sub new {
$self->{'param_out'}{'actions'} = $args{actions}; $self->{'param_out'}{'actions'} = $args{actions};
$self->{'param_out'}{'conf'} = \%Conf::global; $self->{'param_out'}{'conf'} = \%Conf::global;
## Dumping input data
#open TMP, ">/tmp/account_manager.in"; IdPAccountManager::Tools::dump_var($self->{'param_in'}, 0, \*TMP); close TMP;
## Clean input vars ## Clean input vars
foreach my $key (keys %{ $self->{'param_in'} }) { foreach my $key (keys %{ $self->{'param_in'} }) {
#$self->{logger}->log(level => LOG_TRACE, message => "PARAM_ENTREE: %s=%s", $key, $self->{'param_in'}{$key});
## Removing all ^M (0D) ## Removing all ^M (0D)
$self->{'param_in'}{$key} =~ s/\r//g; $self->{'param_in'}{$key} =~ s/\r//g;
$self->{'param_in'}{$key} =~ s/\s+$//; ## Remove trailing spaces $self->{'param_in'}{$key} =~ s/\s+$//; ## Remove trailing spaces
$self->{'param_in'}{$key} =~ s/^\s+//; ## Remove leading spaces $self->{'param_in'}{$key} =~ s/^\s+//; ## Remove leading spaces
#if ($self->{'param_in'}{$key} =~ /\0/) {
# my @valeurs = split /\0/, $self->{'param_in'}{$key};
# $self->{'param_in'}{$key} = $valeurs[0]; ## Only keep first value of multi-valued parameters
#}
## If action_xx param is set, then action=xx ## If action_xx param is set, then action=xx
## Usefull to have sementicless values in submit forms ## Usefull to have sementicless values in submit forms
...@@ -131,8 +122,6 @@ sub execute { ...@@ -131,8 +122,6 @@ sub execute {
} while ($self->{'next_action'}); } while ($self->{'next_action'});
#return undef if (!defined $status);
return 1; return 1;
} }
...@@ -141,16 +130,9 @@ sub respond { ...@@ -141,16 +130,9 @@ sub respond {
my $self = shift; my $self = shift;
$self->{logger}->log(level => LOG_DEBUG, message => ""); $self->{logger}->log(level => LOG_DEBUG, message => "");
## Dump output data
#open TMP, ">/tmp/account_registry.out"; IdPAccountManager::Tools::dump_var($self->{'param_out'}, 0, \*TMP); close TMP;
## Enable dumping off all variables in web pages
#$self->{'param_out'}{'dump'} = $self->{'param_out'};
## Automatic pass object entries to the output hash ## Automatic pass object entries to the output hash
foreach my $key (keys %{$self}) { foreach my $key (keys %{$self}) {
#$self->{logger}->log(level => LOG_TRACE, message => "Passing $key");
$self->{'param_out'}{$key} ||= $self->{$key} $self->{'param_out'}{$key} ||= $self->{$key}
unless ($key eq 'param_out'); unless ($key eq 'param_out');
} }
...@@ -158,13 +140,10 @@ sub respond { ...@@ -158,13 +140,10 @@ sub respond {
## An action may redirect to an external URL ## An action may redirect to an external URL
if ($self->{'url_redirection'}) { if ($self->{'url_redirection'}) {
#$self->{logger}->log(level => LOG_TRACE, message => "URL Redirect : $self->{'url_redirection'}");
printf "Location: %s\n\n", $self->{'url_redirection'}; printf "Location: %s\n\n", $self->{'url_redirection'};
} else { } else {
#$self->{'param_out'}{'cookie'} = CGI::Cookie->new(-name=>'as_user',-value=>$self->{'as_user'},-expires=>'-1M');
## Parse template ## Parse template
my $tt2 = Template->new( my $tt2 = Template->new(
{ {
...@@ -312,7 +291,6 @@ sub req_select_sp { ...@@ -312,7 +291,6 @@ sub req_select_sp {
entityid => $self->{'param_in'}{'sp_entityid'}); entityid => $self->{'param_in'}{'sp_entityid'});
## Prepare data ## Prepare data
#open TMP, ">/tmp/account_manager_metadata.dump"; IdPAccountManager::Tools::dump_var($federation_metadata->{'federation_metadata_as_hashref'}[0], 0, \*TMP); close TMP;
my $sp_metadata_as_hashref = my $sp_metadata_as_hashref =
$federation_metadata->{'federation_metadata_as_hashref'}[0]; $federation_metadata->{'federation_metadata_as_hashref'}[0];
my @contacts; my @contacts;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment