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

earlier type filtering

parent 19926e00
No related branches found
No related tags found
No related merge requests found
......@@ -38,12 +38,12 @@ sub parse {
my ($self, %args) = @_;
my @array;
foreach my $EntityDescriptor (
ENTITY: foreach my $EntityDescriptor (
@{ $self->{doc}->getElementsByLocalName('EntityDescriptor') })
{
my $id = $EntityDescriptor->getAttribute('entityID');
next if $args{entity_id} && $args{entity_id} ne $id;
next ENTITY if $args{entity_id} && $args{entity_id} ne $id;
my $data = {
entityid => $id
......@@ -55,6 +55,8 @@ sub parse {
next unless $child->nodeType() == XML_ELEMENT_NODE;
if ($child->localname() eq 'IDPSSODescriptor') {
next ENTITY
if $args{entity_type} && $args{entity_type} ne 'idp';
$data->{type} = 'idp';
......@@ -80,6 +82,8 @@ sub parse {
}
} elsif ($child->localname() eq 'SPSSODescriptor') {
next ENTITY
if $args{entity_type} && $args{entity_type} ne 'sp';
$data->{type} = 'sp';
......@@ -165,9 +169,6 @@ sub parse {
}
}
## Filter entities based on type
next if $args{entity_type} && $args{entity_type} ne $data->{type};
## Merge domains in a single string
my $domains = join(',', @{ $data->{domain} })
if ($data->{domain});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment