����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
#!perl
use strict;
use warnings;
use URI;
use Test::More tests => 90;
{
my $uri = URI->new( 'otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example' );
ok $uri, "created $uri";
isa_ok $uri, 'URI::otpauth';
is $uri->type(), 'totp', 'type';
is $uri->label(), 'Example:alice@google.com', 'label';
is $uri->issuer(), 'Example', 'issuer';
is $uri->secret(), 'Hello!' . (chr 0xDE) . (chr 0xAD) . (chr 0xBE) . (chr 0xEF), 'secret';
is $uri->counter(), undef, 'counter';
is $uri->algorithm(), 'SHA1', 'algorithm';
is $uri->digits(), 6, 'digits';
is $uri->period(), 30, 'period';
is $uri->fragment(), undef, 'fragment';
my $new_secret = 'this_is_really secret!';
$uri->secret($new_secret);
my $new_uri = URI->new( "$uri" );
ok $new_uri, "created $new_uri";
isa_ok $new_uri, 'URI::otpauth';
unlike $new_uri, qr/secret=$new_secret/, 'no clear text secret';
is $new_uri->type(), 'totp', 'type';
is $new_uri->label(), 'Example:alice@google.com', 'label';
is $new_uri->account_name(), 'alice@google.com', 'account_name';
is $new_uri->issuer(), 'Example', 'issuer';
is $new_uri->secret(), $new_secret, 'secret';
is $new_uri->counter(), undef, 'counter';
is $new_uri->algorithm(), 'SHA1', 'algorithm';
is $new_uri->digits(), 6, 'digits';
is $new_uri->period(), 30, 'period';
is $new_uri->fragment(), undef, 'fragment';
my $next_uri = URI->new( 'otpauth://totp/alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example&digits=8&algorithm=SHA256' );
ok $next_uri, "created $next_uri";
isa_ok $next_uri, 'URI::otpauth';
is $next_uri->type(), 'totp', 'type';
is $next_uri->label(), 'Example:alice@google.com', 'label';
is $next_uri->account_name(), 'alice@google.com', 'account_name';
is $next_uri->issuer(), 'Example', 'issuer';
is $next_uri->secret(), 'Hello!' . (chr 0xDE) . (chr 0xAD) . (chr 0xBE) . (chr 0xEF), 'secret';
is $next_uri->counter(), undef, 'counter';
is $next_uri->algorithm(), 'SHA256', 'algorithm';
is $next_uri->digits(), 8, 'digits';
is $next_uri->period(), 30, 'period';
is $next_uri->fragment(), undef, 'fragment';
my $issuer_uri = URI->new( 'otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP' );
ok $issuer_uri, "created $issuer_uri";
isa_ok $issuer_uri, 'URI::otpauth';
is $issuer_uri->type(), 'totp', 'type';
is $issuer_uri->label(), 'Example:alice@google.com', 'label';
is $issuer_uri->account_name(), 'alice@google.com', 'account_name';
is $issuer_uri->issuer(), 'Example', 'issuer';
is $issuer_uri->secret(), 'Hello!' . (chr 0xDE) . (chr 0xAD) . (chr 0xBE) . (chr 0xEF), 'secret';
is $issuer_uri->counter(), undef, 'counter';
is $issuer_uri->algorithm(), 'SHA1', 'algorithm';
is $issuer_uri->digits(), 6, 'digits';
is $issuer_uri->period(), 30, 'period';
is $issuer_uri->fragment(), undef, 'fragment';
my $issuer2_uri = URI->new( 'otpauth://hotp/Example2:alice@google.com?&issuer=Example2&counter=23&period=15' );
ok $issuer2_uri, "created $issuer2_uri";
isa_ok $issuer2_uri, 'URI::otpauth';
is $issuer2_uri->type(), 'hotp', 'type';
is $issuer2_uri->label(), 'Example2:alice@google.com', 'label';
is $issuer2_uri->issuer(), 'Example2', 'issuer';
is $issuer2_uri->secret(), undef, 'secret';
is $issuer2_uri->counter(), 23, 'counter';
is $issuer2_uri->algorithm(), 'SHA1', 'algorithm';
is $issuer2_uri->digits(), 6, 'digits';
is $issuer2_uri->period(), 15, 'period';
is $issuer2_uri->fragment(), undef, 'fragment';
}
# vim:ts=2:sw=2:et:ft=perl
my @case = (
{
name => 'Hotp',
args => { secret => "topsecret", type => 'hotp', issuer => 'Foo', counter => 6, account_name => 'bob@example.com' },
secret => "topsecret",
type => 'hotp',
issuer => 'Foo',
account_name => 'bob@example.com',
counter => 6,
algorithm => 'SHA1',
period => 30,
},
{
name => 'Only Account Name',
args => { secret => "justabunchofstuff", account_name => 'alice@example.org', algorithm => 'SHA512', period => 7 },
secret => "justabunchofstuff",
type => 'totp',
issuer => undef,
account_name => 'alice@example.org',
counter => undef,
algorithm => 'SHA512',
period => 7,
},
{
name => 'Only mandatory',
args => { secret => "justabunchofstuff" },
secret => "justabunchofstuff",
type => 'totp',
issuer => undef,
account_name => undef,
counter => undef,
algorithm => 'SHA1',
period => 30,
},
);
for my $case ( @case ) {
my ( $name, $args, $secret, $type, $issuer, $account_name, $counter, $algorithm, $period, $frag )
= @{$case}{ qw(name args secret type issuer account_name counter algorithm period frag) };
my $uri = URI::otpauth->new( %$args );
ok $uri, "created $uri";
is $uri->scheme(), 'otpauth', "$name: scheme";
is $uri->type(), $type, "$name: type";
is $uri->authority(), $type, "$name: authority";
is $uri->secret(), $secret, "$name: secret";
is $uri->issuer(), $issuer, "$name: issuer";
if (defined $issuer) {
is $uri->label(), (join q[:], $issuer, $account_name), "$name: label";
}
is $uri->algorithm(), $algorithm, "$name: algorithm";
is $uri->counter(), $counter, "$name: counter";
is $uri->period(), $period, "$name: period";
}
eval {
URI::otpauth->new( type => 'totp' );
};
like $@, qr/^secret is a mandatory parameter for URI::otpauth/, "missing secret";
my $doc1_uri = URI->new( 'otpauth://totp/Example:alice@google.com?secret=NFZS25DINFZV643VOAZXELLTGNRXEM3UH4&issuer=Example' );
my $doc2_uri = URI::otpauth->new( type => 'totp', issuer => 'Example', account_name => 'alice@google.com', secret => 'is-this_sup3r-s3cr3t?' );
is "$doc1_uri", "$doc2_uri", "$doc1_uri: matches";
is $doc1_uri->type(), $doc2_uri->authority(), "type and authority match";
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| 00-report-prereqs.dd | File | 3.7 KB | 0644 |
|
| 00-report-prereqs.t | File | 5.88 KB | 0644 |
|
| abs.t | File | 5.44 KB | 0644 |
|
| clone.t | File | 331 B | 0644 |
|
| cwd.t | File | 176 B | 0644 |
|
| data.t | File | 2.28 KB | 0644 |
|
| escape-char.t | File | 613 B | 0644 |
|
| escape.t | File | 2.88 KB | 0644 |
|
| file.t | File | 3.61 KB | 0644 |
|
| ftp.t | File | 803 B | 0644 |
|
| ftpes.t | File | 231 B | 0644 |
|
| ftps.t | File | 230 B | 0644 |
|
| generic.t | File | 3.71 KB | 0644 |
|
| geo_basic.t | File | 1.72 KB | 0644 |
|
| geo_construct.t | File | 2.1 KB | 0644 |
|
| geo_point.t | File | 429 B | 0644 |
|
| gopher.t | File | 1020 B | 0644 |
|
| heuristic.t | File | 3.35 KB | 0644 |
|
| http.t | File | 1.08 KB | 0644 |
|
| icap.t | File | 1.08 KB | 0644 |
|
| idna.t | File | 503 B | 0644 |
|
| ipv6.t | File | 220 B | 0644 |
|
| irc.t | File | 890 B | 0644 |
|
| ircs.t | File | 239 B | 0644 |
|
| iri.t | File | 2.71 KB | 0644 |
|
| ldap.t | File | 2.38 KB | 0644 |
|
| mailto.t | File | 2.34 KB | 0644 |
|
| mix.t | File | 1.44 KB | 0644 |
|
| mms.t | File | 555 B | 0644 |
|
| news.t | File | 1.01 KB | 0644 |
|
| num_eq.t | File | 389 B | 0644 |
|
| old-absconf.t | File | 730 B | 0644 |
|
| old-base.t | File | 34.04 KB | 0644 |
|
| old-file.t | File | 2.71 KB | 0644 |
|
| old-relbase.t | File | 748 B | 0644 |
|
| otpauth.t | File | 8.33 KB | 0644 |
|
| path-segments.t | File | 1000 B | 0644 |
|
| pop.t | File | 828 B | 0644 |
|
| punycode.t | File | 2.22 KB | 0644 |
|
| query-param.t | File | 1.96 KB | 0644 |
|
| query.t | File | 3.29 KB | 0644 |
|
| rel.t | File | 541 B | 0644 |
|
| rfc2732.t | File | 1.86 KB | 0644 |
|
| roy-test.t | File | 936 B | 0644 |
|
| roytest1.html | File | 7.32 KB | 0644 |
|
| roytest2.html | File | 3.56 KB | 0644 |
|
| roytest3.html | File | 3.01 KB | 0644 |
|
| roytest4.html | File | 3.63 KB | 0644 |
|
| roytest5.html | File | 3.28 KB | 0644 |
|
| rsync.t | File | 263 B | 0644 |
|
| rtsp.t | File | 651 B | 0644 |
|
| scheme-exceptions.t | File | 480 B | 0644 |
|
| scp.t | File | 283 B | 0644 |
|
| sftp.t | File | 285 B | 0644 |
|
| sip.t | File | 2.23 KB | 0644 |
|
| smb.t | File | 838 B | 0644 |
|
| smtp.t | File | 954 B | 0644 |
|
| sort-hash-query-form.t | File | 354 B | 0644 |
|
| split.t | File | 994 B | 0644 |
|
| sq-brackets-legacy.t | File | 1.08 KB | 0644 |
|
| sq-brackets.t | File | 8.01 KB | 0644 |
|
| ssh.t | File | 283 B | 0644 |
|
| storable-test.pl | File | 577 B | 0644 |
|
| storable.t | File | 234 B | 0644 |
|
| urn-isbn.t | File | 746 B | 0644 |
|
| urn-oid.t | File | 278 B | 0644 |
|
| urn-scheme-exceptions.t | File | 525 B | 0644 |
|
| userpass.t | File | 429 B | 0644 |
|
| utf8.t | File | 543 B | 0644 |
|
| ws.t | File | 1.06 KB | 0644 |
|