File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ Revision history for URI
2
2
3
3
{{$NEXT}}
4
4
- Add smb scheme (buralien)
5
+ - Add authority() to URI::otpauth (GH#152) (hightowe)
5
6
6
7
5.31 2024-11-06 03:38:29Z
7
8
- Re-releasing with corrected module permissions. No changes since 5.31
Original file line number Diff line number Diff line change @@ -128,6 +128,8 @@ sub type {
128
128
return $self -> _field(' type' , @parameters );
129
129
}
130
130
131
+ sub authority { return shift -> type(@_ ); }
132
+
131
133
sub label {
132
134
my ($self , @parameters ) = @_ ;
133
135
return $self -> _field(' label' , @parameters );
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ use strict;
4
4
use warnings;
5
5
6
6
use URI;
7
- use Test::More tests => 86 ;
7
+ use Test::More tests => 90 ;
8
8
9
9
{
10
10
my $uri = URI
-> new(
' otpauth://totp/Example:[email protected] ?secret=JBSWY3DPEHPK3PXP&issuer=Example' );
@@ -121,6 +121,7 @@ for my $case ( @case ) {
121
121
ok $uri , " created $uri " ;
122
122
is $uri -> scheme(), ' otpauth' , " $name : scheme" ;
123
123
is $uri -> type(), $type , " $name : type" ;
124
+ is $uri -> authority(), $type , " $name : authority" ;
124
125
is $uri -> secret(), $secret , " $name : secret" ;
125
126
is $uri -> issuer(), $issuer , " $name : issuer" ;
126
127
if (defined $issuer ) {
@@ -141,5 +142,7 @@ diag "doc1_uri is $doc1_uri";
141
142
diag " doc2_uri is $doc2_uri " ;
142
143
is " $doc1_uri " , " $doc2_uri " , " $doc1_uri : matches" ;
143
144
145
+ is $doc1_uri -> type(), $doc2_uri -> authority(), " type and authority match" ;
146
+
144
147
# vim:ts=2:sw=2:et:ft=perl
145
148
You can’t perform that action at this time.
0 commit comments