Skip to content

Commit 2ecbc2b

Browse files
waterkiptimlegge
authored andcommitted
Use default Moose types instead of MooseX::Types::Moose
We don't create own types, so I see no reason why we would depend on this module if Moose provides these types for free. Signed-off-by: Wesley Schwengle <[email protected]>
1 parent ecee8bf commit 2ecbc2b

File tree

10 files changed

+40
-47
lines changed

10 files changed

+40
-47
lines changed

Makefile.PL

-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ my %WriteMakefileArgs = (
3939
"Moose::Role" => 0,
4040
"MooseX::Types::Common::String" => 0,
4141
"MooseX::Types::DateTime" => 0,
42-
"MooseX::Types::Moose" => 0,
4342
"MooseX::Types::URI" => 0,
4443
"URI" => 0,
4544
"URI::QueryParam" => 0,
@@ -102,7 +101,6 @@ my %FallbackPrereqs = (
102101
"Moose::Role" => 0,
103102
"MooseX::Types::Common::String" => 0,
104103
"MooseX::Types::DateTime" => 0,
105-
"MooseX::Types::Moose" => 0,
106104
"MooseX::Types::URI" => 0,
107105
"Path::Tiny" => 0,
108106
"Sub::Override" => 0,

cpanfile

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ requires "Moose" => "0";
2323
requires "Moose::Role" => "0";
2424
requires "MooseX::Types::Common::String" => "0";
2525
requires "MooseX::Types::DateTime" => "0";
26-
requires "MooseX::Types::Moose" => "0";
2726
requires "MooseX::Types::URI" => "0";
2827
requires "URI" => "0";
2928
requires "URI::QueryParam" => "0";

lib/Net/SAML2/Binding/POST.pm

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use strict;
44
use warnings;
55

66
use Moose;
7-
use MooseX::Types::Moose qw/ Str /;
87
use Net::SAML2::XML::Util qw/ no_comments /;
98

109
=head1 NAME
@@ -44,8 +43,8 @@ path to the CA certificate for verification
4443
4544
=cut
4645

47-
has 'cert_text' => (isa => Str, is => 'ro', required => 0);
48-
has 'cacert' => (isa => 'Maybe[Str]', is => 'ro', required => 0);
46+
has 'cert_text' => (isa => 'Str', is => 'ro');
47+
has 'cacert' => (isa => 'Maybe[Str]', is => 'ro');
4948

5049
=head2 handle_response( $response )
5150

lib/Net/SAML2/Binding/Redirect.pm

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use strict;
44
use warnings;
55

66
use Moose;
7-
use MooseX::Types::Moose qw/ Str /;
87
use MooseX::Types::URI qw/ Uri /;
98

109
=head1 NAME
@@ -65,10 +64,10 @@ query param name to use (SAMLRequest, SAMLResponse)
6564
6665
=cut
6766

68-
has 'key' => (isa => Str, is => 'ro', required => 1);
69-
has 'cert' => (isa => Str, is => 'ro', required => 1);
67+
has 'key' => (isa => 'Str', is => 'ro', required => 1);
68+
has 'cert' => (isa => 'Str', is => 'ro', required => 1);
7069
has 'url' => (isa => Uri, is => 'ro', required => 1, coerce => 1);
71-
has 'param' => (isa => Str, is => 'ro', required => 1);
70+
has 'param' => (isa => 'Str', is => 'ro', required => 1);
7271

7372
=head2 sign( $request, $relaystate )
7473

lib/Net/SAML2/Binding/SOAP.pm

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package Net::SAML2::Binding::SOAP;
22
use Moose;
3-
use MooseX::Types::Moose qw/ Str Object /;
43
use MooseX::Types::URI qw/ Uri /;
54
use Net::SAML2::XML::Util qw/ no_comments /;
65

@@ -65,14 +64,18 @@ the CA for the SAML CoT
6564
6665
=cut
6766

68-
has 'ua' => (isa => Object, is => 'ro', required => 1,
69-
default => sub { LWP::UserAgent->new });
67+
has 'ua' => (
68+
isa => 'Object',
69+
is => 'ro',
70+
required => 1,
71+
default => sub { LWP::UserAgent->new }
72+
);
7073

7174
has 'url' => (isa => Uri, is => 'ro', required => 1, coerce => 1);
72-
has 'key' => (isa => Str, is => 'ro', required => 1);
73-
has 'cert' => (isa => Str, is => 'ro', required => 1);
74-
has 'idp_cert' => (isa => Str, is => 'ro', required => 1);
75-
has 'cacert' => (isa => Str, is => 'ro', required => 1);
75+
has 'key' => (isa => 'Str', is => 'ro', required => 1);
76+
has 'cert' => (isa => 'Str', is => 'ro', required => 1);
77+
has 'idp_cert' => (isa => 'Str', is => 'ro', required => 1);
78+
has 'cacert' => (isa => 'Str', is => 'ro', required => 1);
7679

7780
=head2 request( $message )
7881

lib/Net/SAML2/IdP.pm

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package Net::SAML2::IdP;
22
use Moose;
3-
use MooseX::Types::Moose qw/ Str Object HashRef ArrayRef /;
43
use MooseX::Types::URI qw/ Uri /;
54
use Net::SAML2::XML::Util qw/ no_comments /;
65

@@ -35,14 +34,14 @@ Constructor
3534
3635
=cut
3736

38-
has 'entityid' => (isa => Str, is => 'ro', required => 1);
39-
has 'cacert' => (isa => 'Maybe[Str]', is => 'ro', required => 1);
40-
has 'sso_urls' => (isa => HashRef[Str], is => 'ro', required => 1);
41-
has 'slo_urls' => (isa => 'Maybe[HashRef[Str]]', is => 'ro', required => 0);
42-
has 'art_urls' => (isa => 'Maybe[HashRef[Str]]', is => 'ro', required => 0);
43-
has 'certs' => (isa => HashRef[Str], is => 'ro', required => 1);
44-
has 'formats' => (isa => HashRef[Str], is => 'ro', required => 1);
45-
has 'default_format' => (isa => Str, is => 'ro', required => 1);
37+
has 'entityid' => (isa => 'Str', is => 'ro', required => 1);
38+
has 'cacert' => (isa => 'Maybe[Str]', is => 'ro', required => 1);
39+
has 'sso_urls' => (isa => 'HashRef[Str]', is => 'ro', required => 1);
40+
has 'slo_urls' => (isa => 'Maybe[HashRef[Str]]', is => 'ro');
41+
has 'art_urls' => (isa => 'Maybe[HashRef[Str]]', is => 'ro');
42+
has 'certs' => (isa => 'HashRef[Str]', is => 'ro', required => 1);
43+
has 'formats' => (isa => 'HashRef[Str]', is => 'ro', required => 1);
44+
has 'default_format' => (isa => 'Str', is => 'ro', required => 1);
4645

4746
=head2 new_from_url( url => $url, cacert => $cacert )
4847

lib/Net/SAML2/Protocol/ArtifactResolve.pm

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package Net::SAML2::Protocol::ArtifactResolve;
22
use Moose;
3-
use MooseX::Types::Moose qw/ Str /;
43
use MooseX::Types::URI qw/ Uri /;
54

65
with 'Net::SAML2::Role::ProtocolMessage';
@@ -46,9 +45,9 @@ IdP's identity URI
4645
4746
=cut
4847

49-
has 'issuer' => (isa => Str, is => 'ro', required => 1);
50-
has 'destination' => (isa => Str, is => 'ro', required => 1);
51-
has 'artifact' => (isa => Str, is => 'ro', required => 1);
48+
has 'issuer' => (isa => 'Str', is => 'ro', required => 1);
49+
has 'destination' => (isa => 'Str', is => 'ro', required => 1);
50+
has 'artifact' => (isa => 'Str', is => 'ro', required => 1);
5251

5352
=head2 as_xml( )
5453

lib/Net/SAML2/Protocol/Assertion.pm

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package Net::SAML2::Protocol::Assertion;
22
use Moose;
3-
use MooseX::Types::Moose qw/ Str HashRef ArrayRef /;
43
use MooseX::Types::DateTime qw/ DateTime /;
54
use MooseX::Types::Common::String qw/ NonEmptySimpleStr /;
65
use DateTime;
@@ -22,14 +21,14 @@ Net::SAML2::Protocol::Assertion - SAML2 assertion object
2221
2322
=cut
2423

25-
has 'attributes' => (isa => HashRef [ArrayRef], is => 'ro', required => 1);
26-
has 'session' => (isa => Str, is => 'ro', required => 1);
27-
has 'nameid' => (isa => Str, is => 'ro', required => 1);
24+
has 'attributes' => (isa => 'HashRef[ArrayRef]', is => 'ro', required => 1);
25+
has 'session' => (isa => 'Str', is => 'ro', required => 1);
26+
has 'nameid' => (isa => 'Str', is => 'ro', required => 1);
2827
has 'not_before' => (isa => DateTime, is => 'ro', required => 1);
2928
has 'not_after' => (isa => DateTime, is => 'ro', required => 1);
3029
has 'audience' => (isa => NonEmptySimpleStr, is => 'ro', required => 1);
3130
has 'xpath' => (isa => 'XML::XPath', is => 'ro', required => 1);
32-
has 'in_response_to' => (isa => Str, is => 'ro', required => 1);
31+
has 'in_response_to' => (isa => 'Str', is => 'ro', required => 1);
3332

3433
=head1 METHODS
3534

lib/Net/SAML2/Protocol/LogoutResponse.pm

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package Net::SAML2::Protocol::LogoutResponse;
22
use Moose;
3-
use MooseX::Types::Moose qw/ Str /;
43
use MooseX::Types::URI qw/ Uri /;
54
use Net::SAML2::XML::Util qw/ no_comments /;
65

@@ -49,9 +48,9 @@ request ID we're responding to
4948
5049
=cut
5150

52-
has 'status' => (isa => Str, is => 'ro', required => 1);
53-
has 'substatus' => (isa => Str, is => 'ro', required => 0);
54-
has 'response_to' => (isa => Str, is => 'ro', required => 1);
51+
has 'status' => (isa => 'Str', is => 'ro', required => 1);
52+
has 'substatus' => (isa => 'Str', is => 'ro', required => 0);
53+
has 'response_to' => (isa => 'Str', is => 'ro', required => 1);
5554

5655
=head2 new_from_xml( ... )
5756

lib/Net/SAML2/SP.pm

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package Net::SAML2::SP;
22
use Moose;
3-
use MooseX::Types::Moose qw/ Str /;
43
use MooseX::Types::URI qw/ Uri /;
54

65
=head1 NAME
@@ -74,16 +73,16 @@ SP contact email address
7473
=cut
7574

7675
has 'url' => (isa => Uri, is => 'ro', required => 1, coerce => 1);
77-
has 'id' => (isa => Str, is => 'ro', required => 1);
78-
has 'cert' => (isa => Str, is => 'ro', required => 1);
79-
has 'key' => (isa => Str, is => 'ro', required => 1);
76+
has 'id' => (isa => 'Str', is => 'ro', required => 1);
77+
has 'cert' => (isa => 'Str', is => 'ro', required => 1);
78+
has 'key' => (isa => 'Str', is => 'ro', required => 1);
8079
has 'cacert' => (isa => 'Maybe[Str]', is => 'ro', required => 1);
8180

82-
has 'org_name' => (isa => Str, is => 'ro', required => 1);
83-
has 'org_display_name' => (isa => Str, is => 'ro', required => 1);
84-
has 'org_contact' => (isa => Str, is => 'ro', required => 1);
81+
has 'org_name' => (isa => 'Str', is => 'ro', required => 1);
82+
has 'org_display_name' => (isa => 'Str', is => 'ro', required => 1);
83+
has 'org_contact' => (isa => 'Str', is => 'ro', required => 1);
8584

86-
has '_cert_text' => (isa => Str, is => 'rw', required => 0);
85+
has '_cert_text' => (isa => 'Str', is => 'rw', required => 0);
8786

8887
=head2 BUILD ( hashref of the parameters passed to the constructor )
8988

0 commit comments

Comments
 (0)