e DBI;
use DateTime;
use Scope::Guard;
use Carp qw/croak/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use Test2::Util::UUID qw/gen_uuid/;
our $VERSION = '2.000006'; # TRIAL
use Test
$subcount++;
my ($key) = keys(%$item);
my $line = encode_json($item);
print $wh $line, "\n";
}
}
$counter++;
;
my $last_run_uuid;
my $broken;
while (my $line = <$rh>) {
my $data = decode_json($line);
my ($type, @bad) = keys %$data;
die "Invalid data!" if @bad;
$s
TRIAL
use Carp qw/croak/;
use Time::HiRes qw/sleep time/;
use Test2::Harness::Util::JSON qw/encode_json encode_json/;
use parent 'Plack::Response';
use Importer Importer => 'import';
our %EXPORT_AN
}) {
$data = $go->$meth();
}
my $out = encode_json($data) . "\n";
return $out;
};
}
else {
$
$self->{errors} ||= []} => @_;
return;
}
sub as_json {
my $self = shift;
my (%inject) = @_;
$self->content_type('application/json');
my $data = {
%inject,
messag
est2::Harness::Util qw/clean_path file2mod open_file/;
use Test2::Harness::Util::JSON qw/encode_json encode_pretty_json/;
our $VERSION = '2.000006'; # TRIAL
BEGIN {
local $@;
my $inotify = e
return (0, reason => $err) unless $ok;
return (0, reason => "Got warnings: " . encode_pretty_json(\@warnings)) if @warnings;
return (1);
}
sub find_churn {
my $self = shift;
my ($fil
/parse_exit mod2file/;
use Test2::Util::UUID qw/gen_uuid/;
use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use Plack::Runner;
use DBIx::QuickDB;
use App::Yath::Server::Plack;
use App::Ya
ncode_json({
schema_config => $self->{+SCHEMA_CONFIG},
launcher_options => \@options,
}),
);
}
sub _do_server_post_exec {
my $class = shift;
my ($json) = @
_;
$0 = "yath-web-server";
my $data = decode_json($json);
my $r = Plack::Runner->new;
$r->parse_options(@{$data->{launcher_options}});
my $app = App::Yath::Server::Plack->new(
parent 'DBIx::Class::Core';
*get_all_fields = __PACKAGE__->can('get_inflated_columns');
sub TO_JSON {
my $self = shift;
my %cols = $self->get_all_fields;
return \%cols;
}
1;
__END__
>post('/reactive' => sub {
my $c = shift;
my $data = $c->req->json;
$c->render(
json => $reactive->process_request($data)
);
});
}
=head1 AUTHOR
Rob
>post('/reactive' => sub {
my $c = shift;
my $data = $c->req->json;
$c->render(
json => $reactive->process_request($data)
);
});
}
=head1 AUTHOR
Rob
undef
result <required>
rownr <required>
values undef
=over 2
=item answer => JSON
The JSON structure from the result which represents this row.
=item doc => L<Couch::DB::Document|Cou
ault to
the C<answer>.
=back
=back
=head2 Accessors
=over 4
=item $obj-E<gt>B<answer>()
The JSON fragment from the result answer which contains the information
about this row.
=item $obj-E<gt>B
f->_import_pem($data, $password);
}
elsif ($data =~ /^\s*(\{.*?\})\s*$/s) { # JSON
my $h = CryptX::_decode_json("$1") || {};
if ($h->{kty} && $h->{kty} eq "OKP" && $h->{crv} && $h->{crv} e
iv})) if $type && $type eq 'private' && $kh->{priv};
return $wanthash ? $hash : CryptX::_encode_json($hash);
}
sub CLONE_SKIP { 1 } # prevent cloning
1;
=pod
=head1 NAME
Crypt::PK::X25519 - Asy
9527721DABA3261C0BB1BEFDE7B4BBDAC631D454651",
});
# or a hash with items corresponding to JWK (JSON Web Key)
$pk->import_key({
kty => "OKP",
crv => "X25519",
d => "AC-T0Qulc
require XSLoader;
XSLoader::load('CryptX', $VERSION);
use Carp;
my $has_json;
BEGIN {
$has_json = 1 if eval { require JSON; 1 };
}
sub _croak {
die @_ if ref $_[0] || !$_[-1];
if ($_[-1] =~
de_json {
croak "FATAL: cannot find JSON module" if !$has_json;
return JSON->new->utf8->decode(shift);
}
sub _encode_json {
croak "FATAL: cannot find JSON module" if !$has_json;
return JSON->
f->_import_openssh($data, undef);
}
elsif ($data =~ /^\s*(\{.*?\})\s*$/s) { # JSON
my $h = CryptX::_decode_json("$1");
if ($h->{kty} && $h->{kty} eq "OKP" && $h->{crv} && $h->{crv} eq 'Ed2
iv})) if $type && $type eq 'private' && $kh->{priv};
return $wanthash ? $hash : CryptX::_encode_json($hash);
}
sub CLONE_SKIP { 1 } # prevent cloning
1;
=pod
=head1 NAME
Crypt::PK::Ed25519 - Di
EFB6B92D99CD457E2137172C0D749FE2B5A0C142DAD",
});
# or a hash with items corresponding to JWK (JSON Web Key)
$pk->import_key({
kty => "OKP",
crv => "Ed25519",
d => "RcEJum_S
JSON qw/decode_json encode_json/;
use List::Util qw/first/;
use Cwd qw/getcwd/;
use Carp qw/croak/;
use Time::HiRes qw/time/;
use Text::ParseWords qw/quotewords/;
use Test2::Harness::Util::File::JSON
my @args = (
name => 'durations',
is_json => 1,
http_args => [{headers => {'Content-Type' => 'application/json'}}],
);
if ($primary) {
local $@;
my $is_json = $params{is_json};
if (my $type = ref($in)) {
return $in if $is_json && ($type eq 'HASH' || $type eq 'ARRAY');
}
elsif (-f $in) {
if ($is_json) {
for encoders which want to be compilant with the new
L<Kelp/get_encoder> method. L<Kelp::Module::JSON> is one of such modules.
This allows to have all encoders in one easy to reach spot rather than
qi => encode_b64u(pack("H*", $kh->{qP})),
};
return $wanthash ? $hash : CryptX::_encode_json($hash);
}
elsif ($type eq 'public') {
return unless $kh->{N} && $kh->{e};
for (qw/N e
e => encode_b64u(pack("H*", $kh->{e})),
};
return $wanthash ? $hash : CryptX::_encode_json($hash);
}
}
sub export_key_jwk_thumbprint {
my ($self, $hash_name) = @_;
local $SIG{__DIE_
$self->export_key_jwk('public', 1);
my $json = CryptX::_encode_json({kty=>$h->{kty}, n=>$h->{n}, e=>$h->{e}});
return digest_data_b64u($hash_name, $json);
}
sub import_key {
my ($self, $key, $
d => encode_b64u(pack("H*", $kh->{k})),
};
return $wanthash ? $hash : CryptX::_encode_json($hash);
}
elsif ($type && $type eq 'public') {
return unless $kh->{pub_x} && $kh->{pub_y}
y => encode_b64u(pack("H*", $kh->{pub_y})),
};
return $wanthash ? $hash : CryptX::_encode_json($hash);
}
}
sub export_key_jwk_thumbprint {
my ($self, $hash_name) = @_;
local $SIG{__DIE_
export_key_jwk('public', 1);
my $json = CryptX::_encode_json({crv=>$h->{crv}, kty=>$h->{kty}, x=>$h->{x}, y=>$h->{y}});
return digest_data_b64u($hash_name, $json);
}
sub import_key {
my ($self,
ase qw/-config -worker_id/;
use Test2::Util::UUID qw/gen_uuid/;
use Test2::Harness::Util::JSON qw/decode_json/;
use IO::Uncompress::Bunzip2 qw($Bunzip2Error);
use IO::Uncompress::Gunzip qw($GunzipE
next if $line =~ m/^null$/ims;
my $ln = $.;
my $error = $self->process_event_json($processor, $ln => $line) or next;
push @errors => "error processing line number $ln: $er
return $status;
}
sub process_event_json {
my $self = shift;
my ($processor, $ln, $json) = @_;
my $ok = eval {
my $event = decode_json($json);
$processor->process_event(
qw{
-_schema
<dbi_dsn <dbi_user <dbi_pass
<ephemeral
<ephemeral_stack
};
sub TO_JSON {
my $self = shift;
my %data = %$self;
delete $data{+_SCHEMA};
delete $data{+EPH
qw/IS_WIN32/;
use Test2::Harness::Util qw/parse_exit mod2file/;
use Test2::Harness::Util::JSON qw/encode_json/;
use Test2::Harness::IPC::Util qw/pid_is_running/;
use Test2::Harness::Preload();
use T
warnings;
our $VERSION = '2.000006'; # TRIAL
use Term::Table;
use Test2::Harness::Util::JSON qw/decode_json/;
use App::Yath::Schema::Util qw/schema_config_from_settings/;
use parent 'App::Yath::Co
,
);
my $data = [];
while (my $run = $runs->next) {
push @$data => $run->TO_JSON;
}
return undef unless @$data;
return $data;
}
sub get_from_http {
my $self =
->{status}: $res->{reason}\n$res->{content}\n"
unless $res->{success};
return decode_json($res->{content});
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
App::Yath::Command::recent
item --ipc-dir-order ARG
=item --ipc-dir-order=ARG
=item --ipc-dir-order '["json","list"]'
=item --ipc-dir-order='["json","list"]'
=item --ipc-dir-order :{ ARG1 ARG2 ... }:
=item --ipc-dir-order=
lp information
=item -p key=val
=item -p=key=val
=item -pkey=value
=item -p '{"json":"hash"}'
=item -p='{"json":"hash"}'
=item -p:{ KEY1 VAL KEY2 :{ VAL1 VAL2 ... }: ... }:
=item -p :{ KEY1 VA
l
=item --plugins=key=val
=item --plugin '{"json":"hash"}'
=item --plugin='{"json":"hash"}'
=item --plugins '{"json":"hash"}'
=item --plugins='{"json":"hash"}'
=item --plugin :{ KEY1 VAL KEY2 :{