OBJECT IDENTIFIER,
ecParameters ECParameters
}
>;
use constant _JWK_THUMBPRINT_JSON_ORDER => qw( crv kty x y );
use constant JWA_DIGEST_prime256v1 => 'sha256';
use constant JWA_DIG
a hash (e.g., SHA-256) of your original message.
my $sig = $prkey->sign($payload);
#For JSON Web Algorithms (JWT et al.), cf. RFC 7518 page 8
#This will also apply the appropriate SHA al
meDir 0.93;
use File::Spec::Functions 'catfile';
use HTTP::Date qw(time2str);
use HTTP::Tiny;
use JSON::MaybeXS;
use PAUSE::Packages::Module;
use PAUSE::Packages::Release;
use Safe::Isa;
use Types::UR
hile (<$fh>) {
last if /^$/;
}
while (<$fh>) {
chomp;
my ($path, $json) = split(/\s+/, $_, 2);
my $di = CPAN::DistnameInfo->new($path);
next RELEASE if
i->dist eq $distname) {
my $modules = [];
foreach my $entry (@{ decode_json($json) }) {
my $module = PAUSE::Packages::Module->new(
# hide from PAUSE
# ABSTRACT: base class for remote Actions
use v5.10;
use Moo;
use JSON::MaybeXS qw(encode_json);
use Pinto::Remote::SelfContained::Request;
use Pinto::Remote::SelfContained::Result
e,
quiet => $self->chrome->quiet,
};
return { name => 'chrome', data => encode_json($chrome_args) };
}
sub _pinto_args {
my ($self) = @_;
my $pinto_args = {
userna
'pinto', data => encode_json($pinto_args) };
}
sub _action_args {
my ($self) = @_;
my $action_args = $self->args;
return { name => 'action', data => encode_json($action_args) };
}
sub
fication
=item * Encryption & decryption
=item * Import (L<Crypt::Perl::PK>) from & export to L<JSON Web Key|https://tools.ietf.org/html/rfc7517> format
=item * L<JWK thumbprints|https://tools.ietf
load too long!";
}
$pbkey->verify($payload, $sig) or die "Invalid signature!";
#For JSON Web Algorithms (JWT et al.), cf. RFC 7518 page 8
#This verifies against the appropriate SHA d
ge Net::GitHub::V3::Query;
our $VERSION = '1.05';
our $AUTHORITY = 'cpan:FAYLAND';
use URI;
use JSON::MaybeXS;
use MIME::Base64;
use LWP::UserAgent;
use HTTP::Request;
use Carp qw/croak/;
use URI::E
ess_token' => ( is => 'rw', isa => Str, predicate => 'has_access_token' );
# return raw unparsed JSON
has 'raw_string' => (is => 'rw', isa => Bool, default => 0);
has 'raw_response' => (is => 'rw', i
=> 60,
);
},
);
has 'json' => (
is => 'ro',
isa => Object, # InstanceOf['JSON::MaybeXS'],
lazy => 1,
default => sub {
return JSON::MaybeXS->new( utf8 => 1 );
}
') =~ 'application/json') {
my $json = $res->decoded_content;
$data = eval { $self->json->decode($json) };
unless ($data) {
# We tolerate bad JSON for errors,
# otherwise we just rethrow the JSON parsing problem.
die unless $res->is_error;
$data = { message => $res->message };
}
} else {
$data = { message =
configming to spec: $@"
=item B<application/json>
If the B<body> is valid JSONRPC (ie. is has a I<'jsonrpc': '2.0'> field/value),
the response is a JSONRPC-error:
code => -32601
message =>
"Method '%s' not found"
If the B<body> is I<not> valid JSONRPC, the response is a generic json struct:
'error': {
'code': -32601,
'message': "Method '$request->path' not found"
elsif ( $content_type eq 'application/json' ) {
content_type('application/json');
my $request = request->body
? from_json(request->body, {allow_nonref => 1})
g Callback-results.
=head1 SYNOPSIS
use Dancer2::Plugin::RPC::JSON;
use Dancer2::RPCPlugin::CallbackResultFactory;
jsonrpc '/admin' => {
publish => 'config',
callback =>
r use with the NHC forecast advisory text
=head1 SYNOPSIS
Below is a full example of fetching a JSON file from NHC and iterating over
each storm using C<Weather::NHC::TropicalCyclone>. The NHC forec
############################
package Bing::ContentAPI;
use strict;
use warnings;
use Carp;
use JSON;
use REST::Client;
use HTML::Entities;
our $VERSION = '1.02';
sub new {
my ($class, $param)
% 2;
my $opt = {@_};
my $method = $self->prepare_method($opt);
$opt->{body} = encode_json $opt->{body} if $opt->{body};
return $self->request('POST', $method, $opt->{body});
}
sub de
eader('DeveloperToken', $self->{developer_token});
$r->addHeader('Content-type', 'application/json');
$r->addHeader('charset', 'UTF-8');
return $r;
}
my $refresh_token_info = qq|#########
resource => 'custom',
method => 'merchantId/orders/orderId'
);
=head1 PREREQUISITES
JSON
REST::Client
HTML::Entities
=head1 AUTHOR
Original Author
Bill Gerrard <bill@gerrard.or
x_redirects => 3) };
has country => 'eng';
has 'region';
has url => 'http://kayaposoft.com/enrico/json/v1.0/index.php';
sub load {
my ($self, %param) = @_;
$self->holidays({}) if $param{reset};
// '0', $err->{message} // 'coded error');
return undef;
}
my $loaded = $tx->res->json;
if (ref $loaded eq 'HASH' and my $err = $loaded->{error}) {
$self->error(sprintf "Fail
a convenient interface to individual storm sections
delivered inside of the NHC Tropical Cyclone JSON file.
=head1 SYNOPSIS
use strict;
use warnings;
use Weather::NHC::TropicalCyclone ();
file, qq{$advNum.$local_file};
}
=head1 DESCRIPTION
Given JSON returned by the NHC via C<https://www.nhc.noaa.gov/CurrentStorms.json>,
this module creates a covenient object for encapsulating eac
as.
Attempts to fetch the best track C<.dat> file that. This URL is not provided directly
by the JSON file, but can be easily derived by using using C<$DEFAULT_BTK_ROOT> and
composing the filename us
irects => 3) };
has division => 'england-and-wales';
has url => 'https://www.gov.uk/bank-holidays.json';
sub load {
my ($self, %param) = @_;
require IO::Socket::SSL;
my $tx = $self->agent->get
dvice} // '0', $err->{message} // 'coded error');
return undef;
}
my $loaded = $tx->res->json(sprintf '/%s/events', $self->division);
return 0 unless @$loaded;
$self->holidays({}) if $pa
d qw(getcwd abs_path);
use Encode qw(decode encode);
use File::Spec;
use HTML::Entities;
use JSON;
use JSON::Feed;
use Mojo::DOM;
use XML::Atom::SimpleFeed;
use App::WRT::Date qw(iso_date rfc_3339_da
uration is read from a F<wrt.json> in the directory where the C<wrt>
utility is invoked, or can (usually) be specified with the C<--config> option.
See F<example/wrt.json> for a sample configuration.
hood, configuration is done by combining a hash called C<%default>
with values pulled out of the JSON file. Most defaults can be overwritten
from the config file, but changing some would require wri
Net::GitHub::V4;
use Moo;
our $VERSION = '1.05';
our $AUTHORITY = 'cpan:FAYLAND';
use URI;
use JSON::MaybeXS;
use LWP::UserAgent;
use HTTP::Request;
use Carp qw/croak/;
use URI::Escape;
use Types::
ntication
has 'access_token' => ( is => 'rw', isa => Str, required => 1 );
# return raw unparsed JSON
has 'raw_string' => (is => 'rw', isa => Bool, default => 0);
has 'raw_response' => (is => 'rw', i
=> 60,
);
},
);
has 'json' => (
is => 'ro',
isa => Object, # InstanceOf['JSON::MaybeXS'],
lazy => 1,
default => sub {
return JSON::MaybeXS->new( utf8 => 1 );
}
d_alias};
my $xml_feed_content = $self->{wrt}->feed_print_recent();
my $json_feed_content = $self->{wrt}->feed_print_json_recent();
$self->write("${publish_dir}/${feed_alias}", $xml_feed_content
ish_dir}/${feed_alias}.xml", $xml_feed_content);
$self->write("${publish_dir}/${feed_alias}.json", $json_feed_content);
# Handle any other paths that aren't derived directly from files:
my @met
package Dancer2::Plugin::RPC::JSONRPC;
use Dancer2::Plugin;
use Moo;
with 'Dancer2::RPCPlugin';
our $VERSION = '2.00';
use constant PLUGIN_NAME => 'jsonrpc';
use Dancer2::RPCPlugin::CallbackResultF
Response;
use Dancer2::RPCPlugin::FlattenData;
use JSON;
use Scalar::Util 'blessed';
use Time::HiRes 'time';
plugin_keywords PLUGIN_NAME;
sub jsonrpc {
my ($plugin, $endpoint, $config) = @_;
$callback = $config->{callback};
$plugin->app->log(debug => "Starting jsonrpc-handler build: ", $lister);
my $jsonrpc_handler = sub {
my ($dsl) = @_;
my $http_request = $dsl