Skip to content

Commit c4ec6e2

Browse files
authored
Merge pull request #38 from timlegge/dist-changes
A few more cleanup and fixes
2 parents 9c5585b + 54e612e commit c4ec6e2

18 files changed

+126
-11
lines changed

Changes

+33
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
11
Revision history for Perl extension Net::SAML2.
22

3+
{{$NEXT}}
4+
5+
[Significant Changes since 0.40]
6+
7+
- COMPATABILITY WARNING: version 0.44 will likely make sha256 the default
8+
- HTTP-Redirect now supports signing and verifying with more than rsa-sha1
9+
- include HTTP-Post for SingleLogoutService in generated metadata
10+
- Destination missing in LogoutRequest
11+
- Added PingIdentity to the tested IdPs
12+
- Most other changes related to the testapp Saml2Test (in git repo)
13+
14+
[Change Log]
15+
- f694501 testapp: prevent app error if the are no slo_urls
16+
- c2c9e4b testapp: revert previous change to sls-redirect-response
17+
- c9532b3 Fixes #30 - Modules withou version and cleanup missing Abstract
18+
- 9c5585b Merge pull request #37 from timlegge/testapp
19+
- c51ba51 Tested compatiblity against PingIdentity
20+
- b4d3fe9 Remove end of line spaces
21+
- 41ef582 testapp: provide documentation on how to use the Saml2Test application
22+
- 5a8ebb7 Fixes #36 testapp: metadata is rendered as text by the browser
23+
- f1e2eca testapp: add .gitignore file testapp
24+
- ca4b8bd Fixes #35: Metadata does not include HTTP-Post for SingleLogoutService
25+
- 64008da testapp: Better org_name
26+
- 22073bb Update certificates with 10 year expiration
27+
- f215c40 testapp: add lightttpd.conf to proxy https traffic to testapp on port 3000
28+
- f92ba77 testapp: provide lighttpd config to deliver a metatdata.xml file
29+
- 2d671a4 Fixes #32: HTTP-Redirect should support more than sha1
30+
- 5e2425a testapp: Make required settings configurable
31+
- f70b0a5 Fixes #34: testapp: Dancer request_uri is not decoded
32+
- 8c0d048 testapp: Fixes #33 Destination is not properly assigned
33+
- 6e0a685 Fixes #31 Destination missing in LogoutRequest
34+
- 652c763 testapp: support post for LogoutResponse
35+
336
0.40 - 2021-07-26
437

538
[Significant Changes since 0.38]

dist.ini

+19-6
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ contributor = Timothy Legge <[email protected]>
3232
[ConfirmRelease]
3333
[UploadToCPAN]
3434

35-
[GatherDir]
35+
[Git::GatherDir]
3636
exclude_filename = cpanfile
3737
exclude_filename = Makefile.PL
3838
exclude_filename = dev-bin/cpanm
@@ -46,10 +46,10 @@ match = ico
4646

4747
[CPANFile]
4848

49-
[CopyFilesFromBuild::Filtered]
50-
copy = cpanfile
51-
copy = Makefile.PL
52-
copy = README
49+
;[CopyFilesFromBuild::Filtered]
50+
;copy = cpanfile
51+
;copy = Makefile.PL
52+
;copy = README
5353

5454
[CopyFilesFromRelease]
5555
copy = cpanfile, Makefile.PL, README
@@ -75,5 +75,18 @@ web = https://github.com/perl-net-saml2/perl-Net-SAML2/issues
7575
[Test::NoTabs]
7676

7777
[PodWeaver]
78-
[VersionFromModule]
78+
[NextRelease]
79+
format = %v -- %{EEE MMM dd HH:mm:ss VVV yyyy}d
80+
filename = Changes
81+
82+
[Git::NextVersion]
83+
first_version = 0.001 ; this is the default
84+
version_by_branch = 0 ; this is the default
85+
version_regexp = ^(0.\d+)$ ; this is the default
86+
[WriteVersion]
87+
[Git::Tag]
88+
tag_format = %V ; this is the default
89+
tag_message = %V ; this is the default
90+
[Git::Commit]
91+
changelog = Changes ; this is the default
7992
[Signature]

lib/Net/SAML2.pm

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ use warnings;
44

55
require 5.008_001;
66

7+
# ABSTRACT: SAML2 bindings and protocol implementation
8+
79
our $VERSION = '0.40';
810
$VERSION = eval {$VERSION};
911

lib/Net/SAML2/Binding/POST.pm

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ use warnings;
55

66
use Moose;
77

8+
our $VERSION = '0.40';
9+
10+
# ABSTRACT: Net::SAML2::Binding::POST - HTTP POST binding for SAML
11+
812
=head1 NAME
913
1014
Net::SAML2::Binding::POST - HTTP POST binding for SAML2

lib/Net/SAML2/Binding/Redirect.pm

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ use warnings;
66
use Moose;
77
use MooseX::Types::URI qw/ Uri /;
88

9+
our $VERSION = '0.40';
10+
11+
# ABSTRACT: Net::SAML2::Binding::Redirect - HTTP Redirect binding for SAML
12+
913
=head1 NAME
1014
1115
Net::SAML2::Binding::Redirect

lib/Net/SAML2/Binding/SOAP.pm

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ use Moose;
33
use MooseX::Types::URI qw/ Uri /;
44
use Net::SAML2::XML::Util qw/ no_comments /;
55

6+
our $VERSION = '0.40';
7+
8+
# ABSTRACT: Net::SAML2::Binding::Artifact - SOAP binding for SAML
9+
610
=head1 NAME
711
812
Net::SAML2::Binding::Artifact - SOAP binding for SAML2

lib/Net/SAML2/IdP.pm

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ package Net::SAML2::IdP;
22
use Moose;
33
use MooseX::Types::URI qw/ Uri /;
44

5+
our $VERSION = '0.40';
6+
7+
# ABSTRACT: Net::SAML2::IdP - SAML Identity Provider object
8+
59
=head1 NAME
610
711
Net::SAML2::IdP - SAML Identity Provider object

lib/Net/SAML2/Protocol/ArtifactResolve.pm

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ use MooseX::Types::URI qw/ Uri /;
44

55
with 'Net::SAML2::Role::ProtocolMessage';
66

7+
our $VERSION = '0.40';
8+
9+
# ABSTRACT: Net::SAML2::Protocol::ArtifactResolve - ArtifactResolve protocol class
10+
711
=head1 NAME
812
913
Net::SAML2::Protocol::ArtifactResolve - ArtifactResolve protocol class.

lib/Net/SAML2/Protocol/Assertion.pm

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ use XML::LibXML;
1010

1111
with 'Net::SAML2::Role::ProtocolMessage';
1212

13+
our $VERSION = '0.40';
14+
15+
# ABSTRACT: Net::SAML2::Protocol::Assertion - SAML2 assertion object
16+
1317
=head1 NAME
1418
1519
Net::SAML2::Protocol::Assertion - SAML2 assertion object

lib/Net/SAML2/Protocol/AuthnRequest.pm

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ with 'Net::SAML2::Role::ProtocolMessage';
1010

1111
# ABSTRACT: SAML2 AuthnRequest object
1212

13+
our $VERSION = '0.40';
14+
15+
=head1 NAME
16+
17+
Net::SAML2::Protocol::AuthnRequest - SAML2 AuthnRequest object
18+
1319
=head1 SYNOPSIS
1420
1521
my $authnreq = Net::SAML2::Protocol::AuthnRequest->new(

lib/Net/SAML2/Protocol/LogoutRequest.pm

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ use Net::SAML2::XML::Util qw/ no_comments /;
66

77
with 'Net::SAML2::Role::ProtocolMessage';
88

9+
# ABSTRACT: SAML2 LogoutRequest Protocol object
10+
11+
our $VERSION = '0.40';
12+
913
=head1 NAME
1014
1115
Net::SAML2::Protocol::LogoutRequest - the SAML2 LogoutRequest object

lib/Net/SAML2/Protocol/LogoutResponse.pm

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ use Net::SAML2::XML::Util qw/ no_comments /;
55

66
with 'Net::SAML2::Role::ProtocolMessage';
77

8+
# ABSTRACT: SAML2 LogoutResponse Protocol object
9+
10+
our $VERSION = '0.40';
11+
812
=head1 NAME
913
1014
Net::SAML2::Protocol::LogoutResponse - the SAML2 LogoutResponse object

lib/Net/SAML2/Role/ProtocolMessage.pm

+7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ use DateTime;
1010
use MooseX::Types::URI qw/ Uri /;
1111
use Net::SAML2::Util qw(generate_id);
1212

13+
our $VERSION = '0.40';
14+
15+
=head1 NAME
16+
17+
Net::SAML2::Role::ProtocolMessage - the SAML2 ProtocolMessage Role object
18+
19+
1320
=head1 DESCRIPTION
1421
1522
Provides default ID and timestamp arguments for Protocol classes.

lib/Net/SAML2/SP.pm

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ package Net::SAML2::SP;
22
use Moose;
33
use MooseX::Types::URI qw/ Uri /;
44

5+
our $VERSION = '0.40';
6+
7+
# ABSTRACT: Net::SAML2::SP - SAML Service Provider object
8+
59
=head1 NAME
610
711
Net::SAML2::SP - SAML Service Provider object

lib/Net/SAML2/Util.pm

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package Net::SAML2::Util;
33
use strict;
44
use warnings;
55

6+
our $VERSION = '0.40';
7+
68
use Crypt::OpenSSL::Random qw(random_pseudo_bytes);
79

810
# ABSTRACT: Utility functions for Net:SAML2

lib/Net/SAML2/XML/Sig.pm

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package Net::SAML2::XML::Sig;
33
use strict;
44
use warnings;
55

6+
# ABSTRACT: Net::SAML2::XML::Sig - A toolkit to help sign and verify XML Digital Signatures
7+
68
=head1 NAME
79
810
Net::SAML2::XML::Sig - A toolkit to help sign and verify XML Digital Signatures.
@@ -36,7 +38,7 @@ use vars qw($VERSION @EXPORT_OK %EXPORT_TAGS $DEBUG);
3638

3739
$DEBUG = 0;
3840
# Based on XML::Sig VERSION = '0.47';
39-
$VERSION = '0.40';
41+
our $VERSION = '0.40';
4042

4143
use base qw(Class::Accessor);
4244
Net::SAML2::XML::Sig->mk_accessors(qw(key));

lib/Net/SAML2/XML/Util.pm

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ use XML::LibXML;
99
use vars qw($VERSION @EXPORT_OK %EXPORT_TAGS $DEBUG);
1010

1111
$DEBUG = 0;
12-
$VERSION = '0.40';
12+
our $VERSION = '0.40';
1313

1414
# We are exporting functions
1515
use base qw/Exporter/;
1616

1717
# Export list - to allow fine tuning of export table
1818
@EXPORT_OK = qw( no_comments );
1919

20+
# ABSTRACT: Net::SAML2::XML::Util - XML Util class
21+
2022
=head1 NAME
2123
2224
Net::SAML2::XML::Util - XML Util class.

xt/testapp/lib/Saml2Test.pm

+15-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Demo app to show use of Net::SAML2 as an SP.
1616
use Dancer ':syntax';
1717
use Net::SAML2;
1818
use MIME::Base64 qw/ decode_base64 /;
19-
use URI::Encode;
19+
use URI::Encode qw(uri_encode uri_decode);
2020

2121
our $VERSION = '0.1';
2222

@@ -47,6 +47,11 @@ get '/logout-redirect' => sub {
4747
my $idp = _idp();
4848
my $sp = _sp();
4949

50+
if ( ! defined $idp->slo_url('urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect') ) {
51+
redirect "/", 302;
52+
return; # "Redirected\n";
53+
}
54+
5055
my $logoutreq = $sp->logout_request(
5156
$idp->slo_url('urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'),
5257
params->{nameid},
@@ -64,6 +69,12 @@ get '/logout-redirect' => sub {
6469
get '/logout-soap' => sub {
6570
my $idp = _idp();
6671
my $slo_url = $idp->slo_url('urn:oasis:names:tc:SAML:2.0:bindings:SOAP');
72+
73+
if ( ! defined $slo_url ) {
74+
redirect "/", 302;
75+
return "Redirected\n";
76+
}
77+
6778
my $idp_cert = $idp->cert('signing');
6879

6980
my $sp = _sp();
@@ -142,8 +153,9 @@ get '/sls-redirect-response' => sub {
142153
my $sp = _sp();
143154
my $redirect = $sp->slo_redirect_binding($idp, 'SAMLResponse');
144155

145-
my $uri = URI::Encode->new( { encode_reserved => 0 } );
146-
my ($response, $relaystate) = $redirect->verify($uri->decode(request->request_uri));
156+
my $decoded = uri_decode(request->uri);
157+
158+
my ($response, $relaystate) = $redirect->verify($decoded);
147159

148160
redirect $relaystate || '/', 302;
149161
return "Redirected\n";

0 commit comments

Comments
 (0)