view release on metacpan or search on metacpan
examples/slow-redis/app.pl view on Meta::CPAN
curl http://localhost:5001/
# Test 5 concurrent requests (should still take ~1 second total!)
time (for i in 1 2 3 4 5; do curl -s http://localhost:5001/ & done; wait)
# Compare with fast endpoint (no delay)
curl http://localhost:5001/fast
=head1 DESCRIPTION
This example demonstrates non-blocking I/O by intentionally sleeping for
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Async/Template.pm view on Meta::CPAN
tt $vars, << 'END',
USE timeout = Second;
AWAIT timeout.start(10)
r = AWAIT api.call('endpoint', {param = 'val'});
error = ERROR(r);
result = RESULT(r);
RETURN IF ERROR(r);
p2 = ASYNC some_async_fn('param');
p1 = ASYNC api.call('endpoint', {});
AWAIT p1;
AWAIT p2;
RETURN IF RESULT(r);
END
sub{
view all matches for this distribution
view release on metacpan or search on metacpan
$dpop_key->generate_key('secp256r1');
}
return $dpop_key;
}
# Build a DPoP header for an OAuth token endpoint request. Evaluates the
# proof in scalar context so a missing key yields no header (and no warning).
method _dpop_headers ( $url, $method, $skip_ath = 0 ) {
return {} unless $http->token_type eq 'DPoP';
my $proof = $http->_generate_dpop_proof( $url, $method, $skip_ath );
return defined $proof ? { DPoP => $proof } : {};
scope => $scope
};
# Prepare UA for DPoP
$http->set_tokens( undef, undef, 'DPoP', $self->_get_dpop_key() );
my $par_endpoint = $discovery->{metadata}{pushed_authorization_request_endpoint};
my $par_content = {
client_id => $client_id,
response_type => 'code',
code_challenge => $code_challenge,
code_challenge_method => 'S256',
scope => $scope,
aud => $discovery->{pds},
};
say '[DEBUG] [At] PAR request: ' . JSON::PP->new->ascii->encode($par_content) if $ENV{DEBUG};
my ($par_res)
= $http->post( $par_endpoint =>
{ headers => $self->_dpop_headers( $par_endpoint, 'POST', 1 ), encoding => 'form', content => $par_content, skip_ath => 1 } );
die 'PAR failed: ' . ( $par_res . '' ) if builtin::blessed $par_res;
say '[DEBUG] [At] PAR response: ' . JSON::PP->new->ascii->encode($par_res) if $ENV{DEBUG};
my $auth_uri = URI->new( $discovery->{metadata}{authorization_endpoint} );
$auth_uri->query_form( client_id => $client_id, request_uri => $par_res->{request_uri} );
return $auth_uri->as_string;
}
method oauth_callback ( $code, $state ) {
die 'OAuth state mismatch' unless $oauth_state && $state eq $oauth_state->{state};
my $token_endpoint = $oauth_state->{discovery}{metadata}{token_endpoint};
my $key = $self->_get_dpop_key();
my ($token_res) = $http->post(
$token_endpoint => {
headers => $self->_dpop_headers( $token_endpoint, 'POST', 1 ),
encoding => 'form',
content => {
grant_type => 'authorization_code',
code => $code,
client_id => $oauth_state->{client_id},
method oauth_refresh() {
return unless $session && $session->refreshJwt && $session->token_type eq 'DPoP';
my $discovery = $self->oauth_discover( $session->handle );
return unless $discovery;
my $token_endpoint = $discovery->{metadata}{token_endpoint};
my $key = $self->_get_dpop_key();
# Bind the DPoP key to the agent so the proof below is actually signed.
$http->set_tokens( undef, undef, 'DPoP', $key );
my $refresh_content = {
client_id => $session->client_id // '',
aud => $discovery->{pds},
};
say '[DEBUG] [At] Refresh request: ' . JSON::PP->new->ascii->encode($refresh_content) if $ENV{DEBUG};
my ($token_res)
= $http->post( $token_endpoint =>
{ headers => $self->_dpop_headers( $token_endpoint, 'POST', 1 ), encoding => 'form', content => $refresh_content, skip_ath => 1 } );
die 'Refresh failed: ' . ( $token_res . '' ) if builtin::blessed $token_res;
$session = At::Protocol::Session->new(
did => $token_res->{sub},
accessJwt => $token_res->{access_token},
refreshJwt => $token_res->{refresh_token},
return $self->_get_block_http( $cid_str, $did );
}
method _get_block_http ( $cid_str, $did ) {
# If no DID provided, we can't fallback to sync endpoints
return Future->done(undef) unless $did;
#~ say "[HTTP] Fetching block $cid_str for $did via com.atproto.sync.getBlocks...";
# com.atproto.sync.getBlocks returns a CAR file
return Future->call(
Once authenticated, you should store your session data securely so you can resume it later without requiring the user
to log in again.
=head3 Resuming an OAuth Session
You need to store the tokens, the DPoP key, and the PDS endpoint. The C<_raw> method on the session object provides a
simple hash for this purpose:
# After login, save the session
my $data = $at->session->_raw;
# ... store $data securely ...
# ... setup firehose ...
Mojo::IOLoop->start unless Mojo::IOLoop->is_running;
=head1 Lexicon Caching
The AT Protocol defines its API endpoints using "Lexicons" (JSON schemas). This library uses these schemas to
automatically coerce API responses into Perl objects.
=head2 How it works
When you call a method like C<app.bsky.actor.getProfile>, the library:
Resolves an AT Protocol DID to a libp2p PeerID. This is used to discover the user's data on the P2P network.
=head2 C<get_repo_head( $did )>
Retrieves the current MST (Merkle Search Tree) root CID for a user's repository via the C<com.atproto.sync.getHead>
endpoint.
=head2 C<get_block( $cid_str, [ $target_peer_id ] )>
Retrieves a raw block by its CID. If an C<ipfs_node> was provided to the constructor, this method will:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Attean/Algebra.pm view on Meta::CPAN
use Types::Standard qw(ConsumerOf Bool);
use namespace::clean;
with 'Attean::API::Algebra', 'Attean::API::UnaryQueryTree', 'Attean::API::UnionScopeVariables';
has 'endpoint' => (is => 'ro', isa => ConsumerOf['Attean::API::TermOrVariable'], required => 1);
has 'silent' => (is => 'ro', isa => Bool, default => 0);
sub algebra_as_string {
my $self = shift;
my $endpoint = $self->endpoint->as_sparql;
chomp($endpoint);
return sprintf('Service %s', $endpoint);
}
sub tree_attributes { return qw(endpoint) };
sub sparql_tokens {
my $self = shift;
my $service = AtteanX::SPARQL::Token->keyword('SERVICE');
my $l = AtteanX::SPARQL::Token->lbrace;
lib/Attean/Algebra.pm view on Meta::CPAN
my @tokens;
push(@tokens, $service);
if ($self->silent) {
push(@tokens, AtteanX::SPARQL::Token->keyword('SILENT'));
}
push(@tokens, $self->endpoint->sparql_tokens->elements);
push(@tokens, $l);
push(@tokens, $child->sparql_subtokens->elements);
push(@tokens, $r);
return Attean::ListIterator->new( values => \@tokens, item_type => 'AtteanX::SPARQL::Token' );
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AtteanX/Endpoint.pm view on Meta::CPAN
}
sub prepare_app {
my $self = shift;
my $config = $self->{config};
$self->{endpoint} = eval { AtteanX::Endpoint->new( $config ) };
if ($@) {
warn $@;
}
}
lib/AtteanX/Endpoint.pm view on Meta::CPAN
my $req = Plack::Request->new($env);
unless ($req->method =~ /^(GET|HEAD|POST)$/) {
return [ 405, [ 'Content-type', 'text/plain' ], [ 'Method not allowed' ] ];
}
my $ep = $self->{endpoint};
my $resp = $ep->run( $req );
return $resp->finalize;
}
}
lib/AtteanX/Endpoint.pm view on Meta::CPAN
This document describes AtteanX::Endpoint version 0.003
=head1 SYNOPSIS
plackup -p 9091 scripts/endpoint.psgi
=head1 DESCRIPTION
The AtteanX::Endpoint class implements a PSGI SPARQL Protocol endpoint.
=head1 ATTRIBUTES
=over 4
lib/AtteanX/Endpoint.pm view on Meta::CPAN
=item C<< model >>
=item C<< conf >>
A hash reference containing configuration data for the endpoint. For example:
{
endpoint => {
service_description => {
named_graphs => 1,
default => 1,
},
load_data => 0,
lib/AtteanX/Endpoint.pm view on Meta::CPAN
sub _run {
my $self = shift;
my $req = shift;
my $config = $self->{conf};
my $endpoint_path = $config->{endpoint}{endpoint_path} || '/sparql';
my $gsp_path = $config->{endpoint}{gsp_path} || '/gsp';
my $response = Plack::Response->new;
our $VERSION;
my $server = "AtteanX::Endpoint/$VERSION";
$server .= " " . $response->headers->header('Server') if defined($response->headers->header('Server'));
$response->headers->header('Server' => $server);
if ($req->path eq $endpoint_path or $req->path eq $gsp_path) {
# no-op
} else {
my $content;
my $path = $req->path_info;
$path =~ s#^/##;
my $dir = $ENV{ATTEAN_ENDPOINT_SHAREDIR} || File::Spec->catdir((eval { dist_dir('AtteanX-Endpoint') } || 'share'), 'endpoint');
my $abs = File::Spec->rel2abs($dir);
my $file = File::Spec->catfile($abs, 'www', $path);
if (-r $file) {
open( my $fh, '<', $file ) or croak $!;
$response->status(200);
lib/AtteanX/Endpoint.pm view on Meta::CPAN
}
$response->body($content);
return $response;
}
if ($req->path eq $endpoint_path) {
$self->_run_protocol($req, $response);
} else {
$self->_run_gsp($req, $response);
}
}
lib/AtteanX/Endpoint.pm view on Meta::CPAN
my $ae = $req->headers->header('Accept-Encoding') || '';
my $graph = $self->get_gsp_graph($req); # TODO
unless ($graph) {
die AtteanX::Endpoint::ClientError->new(
code => 400,
message => 'No graph specified', uri => 'http://id.kasei.us/rdf-endpoint/error/gsp_no_graph'
);
}
my $base = $req->base;
my $parser = Attean->get_parser('SPARQL')->new(base => $base);
my $algebra;
lib/AtteanX/Endpoint.pm view on Meta::CPAN
$self->log_gsp_request( $req );
if ($@ or not($algebra)) {
my $error = $@ || 'Internal error';
$self->log_error( $req, $error );
my $eclass = ($error =~ /Syntax/) ? 'AtteanX::Endpoint::ClientError' : 'AtteanX::Endpoint::ServerError';
die $eclass->new(message => 'SPARQL GSP parse error', uri => 'http://id.kasei.us/rdf-endpoint/error/parse_error', details => { error => $error });
}
} else {
unless ($config->{endpoint}{update}) {
die AtteanX::Endpoint::ClientError->new(code => 405, message => 'Method not allowed', uri => 'http://id.kasei.us/rdf-endpoint/error/bad_http_method');
}
if ($req->method eq 'PUT' or $req->method eq 'POST') {
my $ct = $req->headers->header('Content-Type');
unless ($ct) {
die AtteanX::Endpoint::ClientError->new(
code => 400,
message => 'No Content-Type specified for PUT request', uri => 'http://id.kasei.us/rdf-endpoint/error/gsp_no_media_type'
);
}
my $pclass = Attean->get_parser(media_type => $ct);
unless ($pclass) {
die AtteanX::Endpoint::ClientError->new(
code => 400,
message => "No parser available for media type $ct", uri => 'http://id.kasei.us/rdf-endpoint/error/gsp_unrecognized_media_type'
);
}
my $parser = $pclass->new();
my $iter = $parser->parse_iter_from_io($req->body);
lib/AtteanX/Endpoint.pm view on Meta::CPAN
} elsif ($req->method eq 'DELETE') {
$algebra = Attean::Algebra::Clear->new(drop => 1, silent => 1, target => 'GRAPH', graph => $graph);
} else {
die AtteanX::Endpoint::ClientError->new(
code => 400,
message => "Unsupported HTTP method: " . $req->method, uri => 'http://id.kasei.us/rdf-endpoint/error/gsp_unrecognized_http_method'
);
}
}
if ($self->log->is_trace) {
lib/AtteanX/Endpoint.pm view on Meta::CPAN
}
};
if ($@) {
my $error = $@;
$self->log->fatal($error);
die AtteanX::Endpoint::ServerError->new(code => 500, message => 'SPARQL GSP execution error', uri => 'http://id.kasei.us/rdf-endpoint/error/execution_error', details => { error => $@ });
}
$self->wrap_response_with_encoding($req, $response, $ae, $content);
return $response;
}
lib/AtteanX/Endpoint.pm view on Meta::CPAN
if ($req->method !~ /^(GET|POST)$/i) {
my $method = uc($req->method);
$content = "Unexpected method $method (expecting GET or POST)";
$self->log_error( $req, $content );
$response->header('Allow' => 'GET, POST');
die AtteanX::Endpoint::ClientError->new(code => 405, message => 'Method not allowed', uri => 'http://id.kasei.us/rdf-endpoint/error/bad_http_method');
} elsif (defined($ct) and $ct eq 'application/sparql-query') {
$sparql = $req->content;
} elsif (defined($ct) and $ct eq 'application/sparql-update') {
if ($config->{endpoint}{update} and $req->method eq 'POST') {
$sparql = $req->content;
}
} elsif ($req->param('query')) {
my @sparql = $req->param('query');
if (scalar(@sparql) > 1) {
$content = "More than one query string submitted";
$self->log_error( $req, $content );
die AtteanX::Endpoint::ClientError->new(code => 400, message => 'Multiple query strings not allowed', uri => 'http://id.kasei.us/rdf-endpoint/error/multiple_queries');
} else {
$sparql = $sparql[0];
}
} elsif ($req->param('update')) {
my @sparql = $req->param('update');
if (scalar(@sparql) > 1) {
$content = "More than one update string submitted";
$self->log_error( $req, $content );
die AtteanX::Endpoint::ClientError->new(code => 400, message => 'Multiple update strings not allowed', uri => 'http://id.kasei.us/rdf-endpoint/error/multiple_updates');
}
if ($config->{endpoint}{update} and $req->method eq 'POST') {
$sparql = $sparql[0];
} elsif ($req->method ne 'POST') {
my $method = $req->method;
$content = "Update operations must use POST";
$self->log_error( $req, $content );
$response->header('Allow' => 'POST');
die AtteanX::Endpoint::ClientError->new(code => 405, message => "$method Not Allowed for Update Operation", uri => 'http://id.kasei.us/rdf-endpoint/error/bad_http_method_update');
}
}
if ($sparql) {
my %args;
$args{ update } = 1 if ($config->{endpoint}{update} and $req->method eq 'POST');
$args{ load_data } = 1 if ($config->{endpoint}{load_data});
my $protocol_specifies_update_dataset = 0;
{
my @default = $req->param('default-graph-uri');
my @named = $req->param('named-graph-uri');
lib/AtteanX/Endpoint.pm view on Meta::CPAN
my $error = $@ || 'Internal error';
$self->log_error( $req, $error );
my $eclass = ($error =~ /Syntax/) ? 'AtteanX::Endpoint::ClientError' : 'AtteanX::Endpoint::ServerError';
if ($req->method ne 'POST' and $error =~ /read-only queries/sm) {
$error = 'Updates must use a HTTP POST request.';
die $eclass->new(message => 'Updates must use a HTTP POST request', uri => 'http://id.kasei.us/rdf-endpoint/error/bad_http_method_update');
} else {
die $eclass->new(message => 'SPARQL query/update parse error', uri => 'http://id.kasei.us/rdf-endpoint/error/parse_error', details => { error => $error, sparql => $sparql });
}
} else {
$self->log_query( $req, $sparql );
# TODO: handle case where query specifies update dataset
# if ($protocol_specifies_update_dataset and $query->specifies_update_dataset) {
# my $method = $req->method;
# $content = "Update operations cannot specify a dataset in both the query and with protocol parameters";
# $self->log_error( $req, $content );
# die AtteanX::Endpoint::ClientError->new(code => 400, message => 'Multiple datasets specified for update', uri => 'http://id.kasei.us/rdf-endpoint/error/update_specifies_multiple_datasets');
# }
if ($self->log->is_trace) {
$self->log->trace("Algebra:\n" . $algebra->as_string);
}
my $graph = $self->graph;
lib/AtteanX/Endpoint.pm view on Meta::CPAN
$response->headers->content_type($stype);
};
if ($@) {
my $error = $@;
$self->log->fatal($error);
die AtteanX::Endpoint::ServerError->new(code => 500, message => 'SPARQL query/update execution error', uri => 'http://id.kasei.us/rdf-endpoint/error/execution_error', details => { error => $@, sparql => $sparql });
}
}
} elsif ($req->method eq 'POST') {
$content = "POST without recognized query or update";
$self->log_error( $req, $content );
die AtteanX::Endpoint::ClientError->new(message => 'Missing SPARQL Query/Update String', uri => 'http://id.kasei.us/rdf-endpoint/error/missing_sparql_string');
} else {
my $stype = 'text/html';
my $dir = $ENV{ATTEAN_ENDPOINT_SHAREDIR} || File::Spec->catdir((eval { dist_dir('AtteanX-Endpoint') } || 'share'), 'endpoint');
my $template = File::Spec->catfile($dir, 'index.html');
my $parser = XML::LibXML->new(validation => 0, suppress_errors => 1, no_network => 1, recover => 2);
my $doc = $parser->parse_file( $template );
# my $gen = RDF::RDFa::Generator->new( style => 'HTML::Head');
# $gen->inject_document($doc, $sdmodel);
lib/AtteanX/Endpoint.pm view on Meta::CPAN
=back
=head1 BUGS
Please report any bugs or feature requests to through the GitHub web interface
at L<https://github.com/kasei/atteanx-endpoint/issues>.
=head1 SEE ALSO
L<http://www.perlrdf.org/>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AtteanX/Query/AccessPlan/Cache.pm view on Meta::CPAN
my $model = shift;
my $active_graphs = shift;
my $pattern = shift;
# First, add any plans coming from the original planner (which will
# include queries to the remote SPARQL endpoint
my @plans = $orig->(@params);
my @vars = $pattern->values_consuming_role('Attean::API::Variable');
my @varstrings = map { $_->value } @vars;
# Start checking the cache
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AtteanX/RDFQueryTranslator.pm view on Meta::CPAN
my $s = $self->translate($a->start);
my $o = $self->translate($a->end);
my $path = $self->translate_path($a->path);
return Attean::Algebra::Path->new( subject => $s, path => $path, object => $o );
} elsif ($a->isa('RDF::Query::Algebra::Service')) {
my $endpoint = $self->translate($a->endpoint);
my $p = $self->translate($a->pattern);
return Attean::Algebra::Service->new( children => [$p], endpoint => $endpoint );
} elsif ($a->isa('RDF::Query::Algebra::NamedGraph')) {
my $graph = $self->translate($a->graph);
my $p = $self->translate($a->pattern);
return Attean::Algebra::Graph->new( children => [$p], graph => $graph );
} elsif ($a->isa('RDF::Query::Algebra::Filter')) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AtteanX/Query/AccessPlan/LDF.pm view on Meta::CPAN
my $model = shift;
my $active_graphs = shift;
my $pattern = shift;
# First, add any plans coming from the original planner (which will
# include queries to the remote SPARQL endpoint
my @plans = $orig->(@params);
# Add my plans
push(@plans, AtteanX::Plan::LDF::Triple->new(subject => $pattern->subject,
predicate => $pattern->predicate,
object => $pattern->object,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AtteanX/Model/SPARQL.pm view on Meta::CPAN
AtteanX::Model::SPARQL - Attean SPARQL Model
=head1 SYNOPSIS
my $store = Attean->get_store('SPARQL')->new(endpoint_url => $url);
my $model = AtteanX::Model::SPARQL->new( store => $store );
=head1 DESCRIPTION
This model is in practice a thin wrapper around the underlying SPARQL
view all matches for this distribution
view release on metacpan or search on metacpan
t/30-utf8.t view on Meta::CPAN
my $test = Plack::Test->create($app);
my $json = JSON::MaybeXS->new->utf8->allow_nonref;
my $res = $test->request(POST "/faces");
ok $res->is_success, "request to endpoint succeeded";
is $json->decode($res->content), $faces, "request returned expected response";
done_testing;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Audio/Nama.pm view on Meta::CPAN
add_mark: _add_mark ident { Audio::Nama::drop_mark(name => $item{ident}); 1}
add_mark: _add_mark { Audio::Nama::drop_mark(); 1}
next_mark: _next_mark { Audio::Nama::next_mark(); 1}
previous_mark: _previous_mark { Audio::Nama::previous_mark(); 1}
loop: _loop someval(s) {
my @new_endpoints = @{ $item{"someval(s)"}};
$Audio::Nama::mode->{loop_enable} = 1;
@{$Audio::Nama::setup->{loop_endpoints}} = (@new_endpoints, @{$Audio::Nama::setup->{loop_endpoints}});
@{$Audio::Nama::setup->{loop_endpoints}} = @{$Audio::Nama::setup->{loop_endpoints}}[0,1];
1;}
noloop: _noloop { $Audio::Nama::mode->{loop_enable} = 0; 1}
name_mark: _name_mark ident {$Audio::Nama::this_mark->set_name( $item{ident}); 1}
list_marks: _list_marks {
my $i = 0;
view all matches for this distribution
view release on metacpan or search on metacpan
#
# Authen::Challenge::Basic: Provides a trivial challenge/response protocol
# to assist in authentication tasks. It provides for time-window
# challenge/response sessions.
#
# Using this module, it's possible to autenticate both endpoints of
# a transaction provided that a shared-secret was exchanged prior to
# the session among the endpoints. As timestamps are part of the
# protocol, some restrictions can be applied to the timing, to help
# prevent hijacked connections.
#
# This is free software. You can use at will provided that proper
# credit is given to the author(s). This module requires MD5.
The following functions are provided by this class.
new()
Creates a new instance of a challenge/response endpoint. It has three
parameters that influence its behavior. Those can be seen next
$server = Authen::Challenge::Basic->new ('Secret' => 'known2us',
'Timeout' => 30,
'Sync' => 10);
view all matches for this distribution
view release on metacpan or search on metacpan
t/10-metadata.t view on Meta::CPAN
# Extract a bit of iCMS metadata
my $method = eval { $sp->_icms_method_data('Validate'); } || {};
is($@, '', "parsed iCMS config without error");
is($method->{url}, 'https://ws.test.logon.fakeme.govt.nz/icms/Validate_v1_1',
'got iCMS endpoint for FLT resolution');
done_testing();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Authen/Tcpdmatch/Tcpdmatch.pm view on Meta::CPAN
=back
=head2 LIMITATIONS
It does not support shell commands, client lookups, endpoint patterns, spoofing attacks,
and expansions. If these features are important to you,
perhaps you should be using libwarp.so with Authen::Libwrap .
=head2 EXPORT
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Autodia/Diagram.pm view on Meta::CPAN
[% FOREACH inheritance = inheritances %]
[%- IF inheritance.Parent >0 AND inheritance.Child >0 -%]
<assocwidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" widgetbid="[% inheritance.Parent %]" widgetaid="[% inheritance.Child %]" xmi.id="[% inheritance.Id %]" >
<linepath>
<startpoint startx="[% inheritance.left_x %]" starty="[% inheritance.top_y %]" />
<endpoint endx="[% inheritance.right_x %]" endy="[% inheritance.bottom_y %]" />
</linepath>
</assocwidget>
[%- END %]
[% END %]
[% SET dependencies = diagram.Dependancies %]
[% FOREACH dependency = dependencies %]
[%- IF dependency.Parent >0 AND dependency.Child >0 -%]
<assocwidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" widgetbid="[% dependency.Parent %]" widgetaid="[% dependency.Child %]" xmi.id="[% dependency.Id %]" >
<linepath>
<startpoint startx="[% dependency.left_x %]" starty="[% dependency.top_y %]" />
<endpoint endx="[% dependency.right_x %]" endy="[% dependency.bottom_y %]" />
</linepath>
</assocwidget>
[%- END %]
[% END %]
</associations>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Avatica/Client.pm view on Meta::CPAN
// Generic metadata for the server to return with each response.
message RpcMetadata {
string server_address = 1; // The host:port of the server
}
// Message which encapsulates another message to support a single RPC endpoint
message WireMessage {
string name = 1;
bytes wrapped_message = 2;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Azure/AD/ClientCredentials.pm view on Meta::CPAN
default => sub {
'https://login.microsoftonline.com'
},
);
has token_endpoint => (
is => 'ro',
isa => Str,
lazy => 1,
default => sub {
my $self = shift;
lib/Azure/AD/ClientCredentials.pm view on Meta::CPAN
}
return if $self->expiration >= time;
my $auth_response = $self->ua->post_form(
$self->token_endpoint,
{
grant_type => 'client_credentials',
client_id => $self->client_id,
client_secret => $self->secret_id,
resource => $self->resource_id,
lib/Azure/AD/ClientCredentials.pm view on Meta::CPAN
A Key assigned to the Client Id.
=head2 ad_url
This defaults to C<https://login.microsoftonline.com>, and generally doesn't need to
be specified. Azure AD has more endpoints for some clouds:
C<https://login.chinacloudapi.cn> China Cloud
C<https://login.microsoftonline.us> US Gov Cloud
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Azure/Storage/Blob/Client/Call.pm view on Meta::CPAN
package Azure::Storage::Blob::Client::Call;
use Moose::Role;
requires 'endpoint';
requires 'method';
requires 'operation';
sub serialize_uri_parameters {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
etc/bgp_monitor_2_00.xsd view on Meta::CPAN
<xsd:element name="BGP_MONITOR_MESSAGE" type="bgpm:bgp_monitor_message_type" />
<xsd:complexType name="bgp_monitor_message_type">
<xsd:sequence>
<xsd:element name="SOURCE" type="bgpm:endpoint_type" minOccurs="0" maxOccurs="1"/>
<xsd:element name="DEST" type="bgpm:endpoint_type" minOccurs="0" maxOccurs="1" />
<xsd:element name="MONITOR" type="bgpm:endpoint_type" minOccurs="1" maxOccurs="1"/>
<xsd:element name="RELAY" type="bgpm:endpoint_type" minOccurs="0" maxOccurs="1"/>
<xsd:element name="OBSERVED_TIME" type="bgpm:observed_time_type" minOccurs="1" maxOccurs="1" />
<xsd:element name="SEQUENCE_NUMBER" type="xsd:unsignedLong" minOccurs="1" maxOccurs="1"/>
<xsd:element name="COLLECTION" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="PARSE_ERROR" type="xfb:parse_error_type" maxOccurs="1" minOccurs="0" />
<xsd:choice minOccurs="1" maxOccurs="1">
etc/bgp_monitor_2_00.xsd view on Meta::CPAN
<xsd:element minOccurs="1" maxOccurs="1" name="NODE_PATH" type="xsd:string"/>
<xsd:element minOccurs="1" maxOccurs="1" name="ANNOTATION" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="endpoint_type">
<xsd:sequence>
<xsd:element name="ADDRESS" type="ne:network_address_type" />
<xsd:element name="PORT" type="ne:port_type" />
<xsd:choice minOccurs="1" maxOccurs="1">
<xsd:element name="ASN2" type="ne:asn2_type" />
view all matches for this distribution
view release on metacpan or search on metacpan
etc/bgp_monitor_2_00.xsd view on Meta::CPAN
<xsd:element name="BGP_MONITOR_MESSAGE" type="bgpm:bgp_monitor_message_type" />
<xsd:complexType name="bgp_monitor_message_type">
<xsd:sequence>
<xsd:element name="SOURCE" type="bgpm:endpoint_type" minOccurs="0" maxOccurs="1"/>
<xsd:element name="DEST" type="bgpm:endpoint_type" minOccurs="0" maxOccurs="1" />
<xsd:element name="MONITOR" type="bgpm:endpoint_type" minOccurs="1" maxOccurs="1"/>
<xsd:element name="RELAY" type="bgpm:endpoint_type" minOccurs="0" maxOccurs="1"/>
<xsd:element name="OBSERVED_TIME" type="bgpm:observed_time_type" minOccurs="1" maxOccurs="1" />
<xsd:element name="SEQUENCE_NUMBER" type="xsd:unsignedLong" minOccurs="1" maxOccurs="1"/>
<xsd:element name="COLLECTION" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="PARSE_ERROR" type="xfb:parse_error_type" maxOccurs="1" minOccurs="0" />
<xsd:choice minOccurs="1" maxOccurs="1">
etc/bgp_monitor_2_00.xsd view on Meta::CPAN
<xsd:element minOccurs="1" maxOccurs="1" name="NODE_PATH" type="xsd:string"/>
<xsd:element minOccurs="1" maxOccurs="1" name="ANNOTATION" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="endpoint_type">
<xsd:sequence>
<xsd:element name="ADDRESS" type="ne:network_address_type" />
<xsd:element name="PORT" type="ne:port_type" />
<xsd:choice minOccurs="1" maxOccurs="1">
<xsd:element name="ASN2" type="ne:asn2_type" />
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Backblaze/B2/v1/AnyEvent.pm view on Meta::CPAN
my( $self, %options) = @_;
$options{ method } ||= 'GET';
#my $completed = delete $options{ cb };
my $method = delete $options{ method };
my $endpoint = delete $options{ api_endpoint };
my $headers = delete $options{ headers } || {};
$headers = { $self->get_headers, %$headers };
my $body = delete $options{ _body };
my $url;
if( ! $options{url} ) {
croak "Don't know the api_endpoint for the request"
unless $endpoint;
$url = URI->new( join( "/b2api/v1/",
$self->apiUrl,
$endpoint)
);
} else {
$url = delete $options{ url };
$url = URI->new( $url )
if( ! ref $url );
lib/Backblaze/B2/v1/AnyEvent.pm view on Meta::CPAN
croak "Need a bucket name"
unless defined $options{ bucketName };
$options{ accountId } ||= $self->accountId;
$options{ bucketType } ||= 'allPrivate'; # let's be defensive here...
$self->json_request(api_endpoint => 'b2_create_bucket',
accountId => $options{ accountId },
bucketName => $options{ bucketName },
bucketType => $options{ bucketType },
%options
)
lib/Backblaze/B2/v1/AnyEvent.pm view on Meta::CPAN
croak "Need a bucketId"
unless defined $options{ bucketId };
$options{ accountId } ||= $self->accountId;
my $res = AnyEvent->condvar;
$self->json_request(api_endpoint => 'b2_delete_bucket',
accountId => $options{ accountId },
bucketId => $options{ bucketId },
%options
);
}
lib/Backblaze/B2/v1/AnyEvent.pm view on Meta::CPAN
sub list_buckets {
my( $self, %options ) = @_;
$options{ accountId } ||= $self->accountId;
$self->json_request(api_endpoint => 'b2_list_buckets',
accountId => $options{ accountId },
%options
)
}
lib/Backblaze/B2/v1/AnyEvent.pm view on Meta::CPAN
my( $self, %options ) = @_;
croak "Need a bucketId"
unless defined $options{ bucketId };
$self->json_request(api_endpoint => 'b2_get_upload_url',
%options
)
}
=head2 C<< $b2->upload_file >>
lib/Backblaze/B2/v1/AnyEvent.pm view on Meta::CPAN
croak "Need a bucket id"
unless defined $options{ bucketId };
$self->json_request(
api_endpoint => 'b2_list_file_names',
%options
);
}
=head2 C<< $b2->list_all_file_names >>
lib/Backblaze/B2/v1/AnyEvent.pm view on Meta::CPAN
unless defined $options{ fileNamePrefix };
croak "Need a duration for the token"
unless defined $options{ validDurationInSeconds };
$self->json_request(
api_endpoint => 'b2_get_download_authorization',
%options
);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Backblaze/B2V2Client.pm view on Meta::CPAN
return $self->{current_status};
}
# no need to proceed if we already have done for this bucket this during this session
# return if $self->{bucket_info}{$bucket_name}{upload_url};
# COMMENTED OUT: It seems like B2 wants a new upload_url endpoint for each upload,
# and we may want to upload multiple files into each bucket...so this won't work
# if we don't have the info for the bucket name, retrieve the bucket's ID
if (ref($self->{buckets}{$bucket_name}) ne 'HASH') {
$self->b2_list_buckets($bucket_name);
lib/Backblaze/B2V2Client.pm view on Meta::CPAN
# generic method to handle communication to B2
sub b2_talker {
my $self = shift;
# args hash must include 'url' for the target API endpoint URL
# most other requests will also include a 'post_params' hashref, and 'authorization' value for the header
# for the b2_upload_file function, there will be several other headers + a file_contents arg
my (%args) = @_;
if (!$args{url}) {
$self->error_tracker('Can not use b2_talker() without an endpoint URL.');
}
# if they sent an Authorization header, set that value
if ($args{authorization}) {
$self->{mech}->delete_header( 'Authorization' );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/BankDetails/India.pm view on Meta::CPAN
print $fh $xml;
close($fh);
}
sub get_response {
my ($self, $endpoint, $ifsc) = @_;
return if ( !$self->ping_api || !defined $endpoint || length $endpoint <= 0);
$ifsc = uc($ifsc);
my $request_url = $endpoint.$ifsc;
my $cache_key = md5_hex(encode_sereal($ifsc));
my $response_data;
my $cache_response_data = $self->cache_data->get($cache_key);
if (defined $cache_response_data) {
$response_data = decode_sereal($cache_response_data);
lib/BankDetails/India.pm view on Meta::CPAN
=head3 api_url
The URL of the API resource is read only attribute.
# get the API endpoint.
$api->api_url;
=head3 cache_data
The cache engine used to cache the web service API calls. By default, it uses
lib/BankDetails/India.pm view on Meta::CPAN
# get cache engine.
$api->cache_data
=head2 ping_api()
Checks whether the API endpoint is currently up.
# Returns 1 if up or 0 if not.
$api->ping_api();
=head2 get_all_data_by_ifsc
view all matches for this distribution
view release on metacpan or search on metacpan
lib/BarefootJS/DevReload.pm view on Meta::CPAN
=head1 SYNOPSIS
# Plain PSGI / Plack (e.g. the Text::Xslate backend)
use BarefootJS::DevReload;
# Mount the SSE endpoint (dev only):
my $reload = BarefootJS::DevReload->to_app(dist_dir => 'dist');
# ... route '/_bf/reload' => $reload ...
# And emit the browser snippet before </body> in your layout:
BarefootJS::DevReload->snippet('/_bf/reload');
=head1 DESCRIPTION
Companion to C<barefoot build --watch> in C<@barefootjs/cli>. The CLI drops
C<< <dist>/.dev/build-id >> after every successful rebuild that changed output;
a browser snippet subscribes to an SSE endpoint that emits C<< event: reload >>
when that file changes, so an editor save triggers an automatic reload.
This module holds the engine-agnostic pieces â the browser snippet, the
build-id reader, and a ready-made PSGI streaming app for the SSE endpoint â so
both L<Mojolicious::Plugin::BarefootJS::DevReload> (Mojo streaming) and plain
PSGI/Plack hosts (the Text::Xslate backend) share one implementation.
=cut
lib/BarefootJS/DevReload.pm view on Meta::CPAN
# The browser snippet: a small IIFE â EventSource subscriber + scrollY
# preservation across reloads. Idempotent across duplicate mounts (the
# window.__bfDevReload guard). Returns a plain HTML string; callers mark it raw
# for their template engine.
sub snippet ($class, $endpoint) {
my $ep = _js_str($endpoint);
my $sk = _js_str($SCROLL_STORAGE_KEY);
return qq{<script>(function(){if(window.__bfDevReload)return;window.__bfDevReload=1;try{var s=sessionStorage.getItem($sk);if(s){sessionStorage.removeItem($sk);var y=parseInt(s,10);if(!isNaN(y)){var restore=function(){window.scrollTo(0,y)};if(docu...
}
# A ready-made PSGI app for the SSE endpoint. Streams `event: reload` whenever
# <dist>/.dev/build-id changes, with `: hb` heartbeats in between.
#
# Implemented with the PSGI streaming interface and a blocking poll loop, so it
# holds one worker per open connection for the connection's lifetime â run it
# under a prefork PSGI server (Starman / Starlet) in dev, which is the natural
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bb/Collaborate/V3/Connection.pm view on Meta::CPAN
use Elive;
use Elive::Util;
=head1 NAME
Bb::Collaborate::V3::Connection - Manage Collaborate SOAP V3 endpoint connections.
=head1 DESCRIPTION
This module handles logical connections to the C<.../webservice.event> endpoint
on the Collaborate server. This endpoint implements the Standard Bridge API.
=cut
our %KnownCommands = (
view all matches for this distribution
view release on metacpan or search on metacpan
share/SpamAssassin/easy_ham/00606.9733a34d34069bbc9671b0292068449d view on Meta::CPAN
very visible.
[1] That is to say, rates will
be exponential in the free
energy differences between
endpoints and a transition
state. We can ignore that
complication in this model.
view all matches for this distribution
view release on metacpan or search on metacpan
script/lccnorm view on Meta::CPAN
If no file is specified, or if the file name C<-> is specified, standard input
will be processed.
Normalization of call number ranges is a special challenge, because ranges are
not normally specified using the exact endpoint. Consider the range C<B708-B713>; while
C<B708> does indicate the beginning point -- a no call number that comes before B 708 can
fall within the range -- the end point is only a guide, not a strict limit, since the intent
is that call numbers such as C<B 713 .H94> and C<B 713 .W55 L86> B<do> fall within the
range. Unfortunately, ranges are often specified ambiguously; for example, the call number
C<B 713.14 G92> might or might not be considered to fall within this range.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/BigIP/iControl.pm view on Meta::CPAN
=head3 create_subscription_list (%args)
my $subscription = $ic->create_subscription_list (
name => 'my_subscription_name',
url => 'http://company.com/my/eventnotification/endpoint,
username => 'username',
password => 'password',
ttl => -1,
min_events_per_timeslice => 10,
max_timeslice => 10
lib/BigIP/iControl.pm view on Meta::CPAN
A user-friendly name for the subscription.
=item url
The target URL endpoint for the event notification interface to send event notifications.
=item username
The basic authentication username required to access the URL endpoint.
=item password
The basic authentication password required to access the URL endpoint.
=item ttl
The time to live (in seconds) for this subscription. After the ttl is reached, the subscription
will be removed from the system. A value of -1 indicates an infinite life time.
=item min_events_per_timeslice
The minimum number of events needed to trigger a notification. If this value is 50, then this
means that when 50 events are queued up they will be sent to the notification endpoint no matter
what the max_timeslice is set to.
=item max_timeslice
This maximum time to wait (in seconds) before event notifications are sent to the notification
endpoint. If this value is 30, then after 30 seconds a notification will be sent with the events
in the subscription queue.
=back
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Binance/API.pm view on Meta::CPAN
[OPTIONAL] Number of milliseconds the request is valid for. Applies only in
signed requests.
=item baseUrl
[OPTIONAL] Base URL of Binance endpoint.
=item logger
[OPTIONAL] See L<Binance::API::Logger/new>
lib/Binance/API.pm view on Meta::CPAN
sub log { return $_[0]->{logger}; }
=head2 ua
$api->ua->get('/binance/endpoint');
B<PARAMETERS>
=over
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/ConnectDots/SimpleGraph.pm view on Meta::CPAN
Note : The software caches the components once computed, so it's efficient
to call this repeatedly.
Title : shortest_paths
Usage : my $paths=$graph->shortest_paths;
while(my($endpoints,$path)=each %$paths) {
my($start,$stop)=split($;,$endpoints);
my @nodes_on_path=@$path;
print "Path from $start to $stop: @$nodes_on_path\n";
}
-- OR --
my ($paths,$distances)=$graph->shortest_paths(-want_distances=>1);
while(my($endpoints,$path)=each %$paths) {
my $distance=$distances->{$endpoints};
my($start,$stop)=split($;,$endpoints);
my @nodes_on_path=@$path;
print "Path from $start to $stop, distance $distance: @$nodes_on_path\n";
}
Function: Compute shortest path between each pair of nodes.
Args : (optional)
lib/Bio/ConnectDots/SimpleGraph.pm view on Meta::CPAN
Paths longer than this are not found
-want_distances=>Boolean. If true, distances are also returned
Returns : HASH whose keys are pairs of nodes (encoded in the standard
Perl manner as two strings joined by $;) and whose values
are paths. Each path is an ARRAY ref of nodes starting at
the first endpoint and ending at the second.
The first endpoint is always lexically smaller (lt) than
the second.
If -want_distances is specified, the result is a pair of
HASHes, one containing paths and the other containing
distances.
Title : distances
Usage : my $distances=$graph->distances;
while(my($endpoints,$distance)=each %$distances) {
my($start,$stop)=split($;,$endpoints);
print "Path from $start to $stop has distance $distance\n";
}
-- OR --
my ($paths,$distances)=$graph->distances(-want_paths=>1);
while(my($endpoints,$distance)=each %$distances) {
my $path=$paths->{$endpoints};
my($start,$stop)=split($;,$endpoints);
my @nodes_on_path=@$path;
print "Path from $start to $stop, distance $distance: @$nodes_on_path\n";
}
Function: Compute distance between each pair of nodes. This is the
length of the shortest path
lib/Bio/ConnectDots/SimpleGraph.pm view on Meta::CPAN
-want_paths=>Boolean. If true, paths are also returned
Returns : HASH whose keys are pairs of nodes (encoded in the standard
Perl manner as two strings joined by $;) and whose values
are distances.
The first endpoint is always lexically smaller (lt) than
the second.
If -want_paths is specified, the result is a pair of
HASHes, one containing paths and the other containing
distances.
view all matches for this distribution