view release on metacpan or search on metacpan
azure-pipelines.yml view on Meta::CPAN
resources:
repositories:
- repository: ci-perl-helpers
type: github
name: houseabsolute/ci-perl-helpers
endpoint: houseabsolute
stages:
- template: templates/helpers/build.yml@ci-perl-helpers
parameters:
debug: true
view all matches for this distribution
view release on metacpan or search on metacpan
azure-pipelines.yml view on Meta::CPAN
resources:
repositories:
- repository: ci-perl-helpers
type: github
name: houseabsolute/ci-perl-helpers
endpoint: houseabsolute
stages:
- template: templates/helpers/build.yml@ci-perl-helpers
parameters:
debug: true
view all matches for this distribution
view release on metacpan or search on metacpan
azure-pipelines.yml view on Meta::CPAN
resources:
repositories:
- repository: ci-perl-helpers
type: github
name: houseabsolute/ci-perl-helpers
endpoint: houseabsolute
stages:
- template: templates/helpers/build.yml@ci-perl-helpers
parameters:
debug: true
view all matches for this distribution
view release on metacpan or search on metacpan
t/19spanset_daylight_savings.t view on Meta::CPAN
use DateTime;
use DateTime::SpanSet;
# Check that SpanSets return spans with the correct endpoints during daylight
# savings changeovers given a weekly recurrence.
BEGIN {
if (eval 'use DateTime::Event::Recurrence; 1') {
plan tests => 552;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Decision/ParseTree.pm view on Meta::CPAN
=item * ARRAYS are a series of rules run in order
=item * HASHES are a series of answers
=item * SCALARS are endpoints
=back
=head2 Why add more parts, why blow everything in to separate objects.
lib/Decision/ParseTree.pm view on Meta::CPAN
=head2 ParseTree($tree, $rules, $obj)
Runs $obj thru $tree, using $rules as the library of rules.
Returns the first endpoint that you run into as the answer.
=cut
#=== FUNCTION ================================================================
# NAME: ParseTree
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Deplide/RFID/EPCISSubmitter.pm view on Meta::CPAN
sub new {
my $class = shift;
my $user = shift;
my $password = shift;
my $endpointURL = shift || $Deplide::RFID::EPCISSubmitter::DEFAULT_ENDPOINT_URL;
my $ua = LWP::UserAgent->new();
$ua->agent("Deplide::RFID::EPCISSubmitter/$Deplide::RFID::EPCISSubmitter::VERSION");
my $self = {
_user => $user,
_password => $password,
_url => $endpointURL,
_ua => $ua
};
bless $self, ref($class) || $class;
return $self;
lib/Deplide/RFID/EPCISSubmitter.pm view on Meta::CPAN
Deplide::RFID::EPCISSubmitter - Perl extension for submission of EPCIS documents with RFID reading data to Deplide
=head1 SYNOPSIS
use Deplide::RFID::EPCISSubmitter;
my $submitter = Deplide::RFID::EPCISSubmitter->new($user, $password, $endpointURL);
$submitter->submit($epcisMessage);
=head1 DESCRIPTION
Deplide::RFID::EPCISSubmitter lets you submit data to the EPCIS Train RFID streams
view all matches for this distribution
view release on metacpan or search on metacpan
0.24 2018-08-29T15:01:51Z
- good bye Magnum CI
0.23 2018-08-28T16:31:09Z
- use https endpoint
0.22 2018-01-16T17:38:24Z
- support perl 5.8.1 or later
0.21 2017-10-01T05:36:04Z
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Devel/Cover/Report/Coveralls.pm view on Meta::CPAN
$json->{repo_token} = $ENV{COVERALLS_REPO_TOKEN} if $ENV{COVERALLS_REPO_TOKEN};
$json->{flag_name} = $ENV{COVERALLS_FLAG_NAME} if $ENV{COVERALLS_FLAG_NAME};
$json->{parallel} = \1 if $ENV{COVERALLS_PARALLEL};
my $is_travis;
my $endpoint = ($ENV{COVERALLS_ENDPOINT} || $API_ENDPOINT) . $API_ENDPOINT_STEM;
if ($ENV{TRAVIS}) {
$is_travis = 1;
$json->{service_name} = $config->{service_name} || 'travis-ci';
$json->{service_job_id} = $ENV{TRAVIS_JOB_ID};
if($ENV{TRAVIS_PULL_REQUEST} && $ENV{TRAVIS_PULL_REQUEST} ne 'false'){
lib/Devel/Cover/Report/Coveralls.pm view on Meta::CPAN
if (exists $ENV{COVERALLS_PERL_SERVICE_NAME} && $ENV{COVERALLS_PERL_SERVICE_NAME}) {
$json->{service_name} = $ENV{COVERALLS_PERL_SERVICE_NAME};
}
return ($json, $endpoint);
}
sub _parse_line ($) {
my $c = shift;
lib/Devel/Cover/Report/Coveralls.pm view on Meta::CPAN
my $c = $f->statement();
push @sfs, get_source( $file, _parse_line $c );
}
my ($json, $endpoint) = get_config();
$json->{git} = eval { get_git_info() } || {};
$json->{source_files} = \@sfs;
my $coder = JSON::PP->new->ascii;
my $response = HTTP::Tiny->new( verify_SSL => 1 )
->post_form( $endpoint, { json => $coder->encode($json) } );
my $res = eval { decode_json $response->{content} };
print("- Report::Coveralls --------\n");
view all matches for this distribution
view release on metacpan or search on metacpan
Devel/Debug/DBGp.pm view on Meta::CPAN
DB::connectOrReconnect();
Connects to the debugger client (closes the current connection if any).
If the debugger client is not listening at the specified endpoint,
debugging is disabled (via L</disable>) and execution continues
normally.
=head2 isConnected
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Devel/Probe.pm view on Meta::CPAN
One typical use case would be to have a signal handler associated with a
specific signal, which when triggered would disable the module, read the
configuration from a given place, reconfigure the module accordingly and then
enable it. Similarly, this kind of control can be implemented using remote
endpoints to deal with reconfiguring, disabling and enabling the module.
=head1 TODO
=over 4
view all matches for this distribution
view release on metacpan or search on metacpan
azure-pipelines.yml view on Meta::CPAN
resources:
repositories:
- repository: ci-perl-helpers
type: github
name: houseabsolute/ci-perl-helpers
endpoint: houseabsolute
stages:
- template: templates/helpers/build.yml@ci-perl-helpers
parameters:
debug: true
view all matches for this distribution
view release on metacpan or search on metacpan
integration/blank-env/run-integration.pl view on Meta::CPAN
:--------------------------------------------------------------------------------:
BOOKMARK: legacy-ajax
:--------------------------------------------------------------------------------:
HTML: <script>var configs = {};</script>
:--------------------------------------------------------------------------------:
CODE1: Ajax jvar => 'configs.project.endpoint', type => 'text', file => 'project-endpoint.json', code => q{
print "saved-start\n";
warn "saved-warn\n";
system 'sh', '-c', 'printf "saved-child-out\n"; printf "saved-child-err\n" >&2';
die "saved-die\n";
};
integration/blank-env/run-integration.pl view on Meta::CPAN
_assert_match( $project_dom, qr/Alpha Nav Current/, 'browser renders shared nav TT output against the outer page path' );
_assert_match( $project_dom, qr{<div id="nav-beta">/app/project-home / /app/project-home</div>}, 'browser exposes current_page through env and env.runtime_context for shared nav TT fragments' );
_assert( index( $project_dom, 'nav-alpha' ) < index( $project_dom, 'nav-beta' ), 'browser renders shared nav bookmark fragments in sorted filename order' );
_assert( index( $project_dom, 'dashboard-nav-items' ) < index( $project_dom, 'project-marker' ), 'browser renders shared nav fragments before the main page body' );
my $legacy_ajax_page = _run_shell( 'curl legacy ajax saved page', q{curl -fsS http://127.0.0.1:7890/app/legacy-ajax} );
_assert_match( $legacy_ajax_page->{stdout}, qr{/ajax/project-endpoint\.json\?type=text}, 'saved bookmark Ajax renders a stable file-backed ajax endpoint by default' );
my $legacy_ajax_saved = _run_shell( 'curl saved bookmark ajax endpoint', q{curl -fsS 'http://127.0.0.1:7890/ajax/project-endpoint.json?type=text'} );
_assert_match( $legacy_ajax_saved->{stdout}, qr/saved-start/, 'saved bookmark ajax endpoint streams direct perl stdout' );
_assert_match( $legacy_ajax_saved->{stdout}, qr/saved-warn/, 'saved bookmark ajax endpoint streams perl stderr warnings' );
_assert_match( $legacy_ajax_saved->{stdout}, qr/saved-child-out/, 'saved bookmark ajax endpoint streams child stdout' );
_assert_match( $legacy_ajax_saved->{stdout}, qr/saved-child-err/, 'saved bookmark ajax endpoint streams child stderr' );
_assert_match( $legacy_ajax_saved->{stdout}, qr/saved-die/, 'saved bookmark ajax endpoint streams uncaught perl die output' );
my $legacy_ajax_stream_page = _run_shell( 'curl legacy ajax stream saved page', q{curl -fsS http://127.0.0.1:7890/app/legacy-ajax-stream} );
_assert_match( $legacy_ajax_stream_page->{stdout}, qr{/ajax/project-stream\.txt\?type=text}, 'saved bookmark ajax stream page renders a stable default text ajax endpoint' );
my $legacy_ajax_stream = _capture_stream_prefix(
'curl saved bookmark ajax stream endpoint',
q{curl --no-buffer -fsS 'http://127.0.0.1:7890/ajax/project-stream.txt'},
expected_chunks => [ 'stream1', 'stream2' ],
timeout => 4,
);
_assert( @{ $legacy_ajax_stream->{events} || [] } >= 2, 'saved bookmark ajax stream endpoint produced multiple early chunks before process exit' );
_assert( ( $legacy_ajax_stream->{events}[0]{at} || 99 ) < 1.5, 'saved bookmark ajax stream endpoint flushes the first chunk before the long-running ajax loop finishes' );
_assert( ( $legacy_ajax_stream->{events}[1]{at} || 99 ) < 2.5, 'saved bookmark ajax stream endpoint keeps flushing later chunks during the long-running ajax loop' );
my $container_ip = _trim( _run_shell( 'container ip', q{hostname -I | awk '{print $1}'} )->{stdout} );
_assert( $container_ip ne '', 'container ip discovered for helper-access path' );
my $helper_root_disabled = _run_shell(
view all matches for this distribution
view release on metacpan or search on metacpan
linux-labjack/INSTALL view on Meta::CPAN
HID NOTE: If the hid module is loaded (use lsmod to view the modules and
look for "hid"), the provided labjack driver will not work correctly.
Since the Labjack is classified as a HID device, the hid driver will
claim the device. However, the hid driver does not support the "Interrupt"
out endpoint used by the Labjack and thus cannot communicate with the
Labjack. You must remove the hid driver prior to loading the labjack
driver. The following command, as root, should suffice:
# modprobe -r hid
linux-labjack/INSTALL view on Meta::CPAN
HID NOTE: If the hid module is loaded (use lsmod to view the modules and
look for "hid"), the provided labjack driver will not work correctly.
Since the Labjack is classified as a HID device, the hid driver will claim
the device. However, the hid driver does not support the "Interrupt" out
endpoint used by the Labjack and thus cannot communicate with the Labjack.
You must remove the hid driver prior to loading the labjack driver. The
following command, as root, should suffice:
# modprobe -r hid
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Device/Serial/MSLuRM.pm view on Meta::CPAN
This variant of L<Device::Serial::SLuRM> allows communication with a
collection of nodes using Multi-drop SLµRM over a serial port, such as over
an RS-485 bus.
The endpoint running with this module takes the role of the bus controller.
Currently this module does not support being a non-controller node.
=cut
use constant is_multidrop => 1;
view all matches for this distribution
view release on metacpan or search on metacpan
Win32Async.pm view on Meta::CPAN
functionality is the same as the libusb function whose name is
the method name prepended with "usb_".
Generally, define a $Context variable which the library will use to keep track of
the asynchronous call. Activate the transfer (read or write, depending on the
endpoint) using submit_async() as shown, then loop calling reap_async_nocancel()
while checking the return code.
You can have any number of async operations pending on different endpoints - just
define multiple context variables as needed (ie - $Context1, $Context2, &c).
=cut
Win32Async.pm view on Meta::CPAN
A scalar to store opaque information about the operation
=item Endpoint
The endpoint the asynchronous operation will use
=item Packetsize
The size of the isochronous packets
Win32Async.pm view on Meta::CPAN
A scalar to store opaque information about the operation
=item Endpoint
The endpoint the asynchronous operation will use
=back
Returns 0 on success, < 0 on error (consult errno.h for explanation)
Win32Async.pm view on Meta::CPAN
A scalar to store opaque information about the operation
=item Endpoint
The endpoint the asynchronous operation will use
=back
Returns 0 on success, < 0 on error (consult errno.h for explanation)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Device/USB.pm view on Meta::CPAN
=item level
0 disables debugging, 1 enables some debug messages, and 2 enables verbose
debug messages
Any other values are forced to the nearest endpoint.
=back
=cut
lib/Device/USB.pm view on Meta::CPAN
=item libusb_get_descriptor(void *dev, unsigned char type, unsigned char index, char *buf, int size)
=item libusb_get_descriptor_by_endpoint(void *dev, int ep, unsigned char type, unsigned char index, char *buf, int size)
=item libusb_bulk_write(void *dev, int ep, char *bytes, int size, int timeout)
lib/Device/USB.pm view on Meta::CPAN
int libusb_get_descriptor(void *dev, unsigned char type, unsigned char index, char *buf, int size)
{
return usb_get_descriptor((usb_dev_handle *)dev, type, index, buf, size);
}
int libusb_get_descriptor_by_endpoint(void *dev, int ep, unsigned char type, unsigned char index, char *buf, int size)
{
return usb_get_descriptor_by_endpoint((usb_dev_handle *)dev, ep, type, index, buf, size);
}
int libusb_bulk_write(void *dev, int ep, char *bytes, int size, int timeout)
{
return usb_bulk_write((usb_dev_handle *)dev, ep, bytes, size, timeout);
lib/Device/USB.pm view on Meta::CPAN
return newRV_noinc( (SV*)hash );
}
/*
* Given a pointer to a usb_endpoint_descriptor struct, create a reference
* to a Device::USB::DevEndpoint object that represents it.
*/
static SV* build_endpoint( struct usb_endpoint_descriptor* endpt )
{
HV* hash = newHV();
hashStoreInt( hash, "bDescriptorType", endpt->bDescriptorType );
hashStoreInt( hash, "bEndpointAddress", endpt->bEndpointAddress );
lib/Device/USB.pm view on Meta::CPAN
gv_stashpv( "Device::USB::DevEndpoint", 1 )
);
}
/*
* Given a pointer to an array of usb_endpoint_descriptor structs, create a
* reference to a Perl array containing the same data.
*/
static SV* list_endpoints( struct usb_endpoint_descriptor* endpt, unsigned count )
{
AV* array = newAV();
unsigned i = 0;
for(i=0; i < count; ++i)
{
av_push( array, build_endpoint( endpt+i ) );
}
return newRV_noinc( (SV*)array );
}
lib/Device/USB.pm view on Meta::CPAN
hashStoreInt( hash, "bNumEndpoints", inter->bNumEndpoints );
hashStoreInt( hash, "bInterfaceClass", inter->bInterfaceClass );
hashStoreInt( hash, "bInterfaceSubClass", inter->bInterfaceSubClass );
hashStoreInt( hash, "bInterfaceProtocol", inter->bInterfaceProtocol );
hashStoreInt( hash, "iInterface", inter->iInterface );
hashStoreSV( hash, "endpoints",
list_endpoints( inter->endpoint, inter->bNumEndpoints )
);
/* TODO: handle the 'extra' data */
return sv_bless( newRV_noinc( (SV*)hash ),
gv_stashpv( "Device::USB::DevInterface", 1 )
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Device/XBee/API.pm view on Meta::CPAN
};
use constant XBEE_API_TRANSMIT_STATUS_TO_STRING => {
0x00 => 'Success',
0x02 => 'CCA Failure',
0x15 => 'Invalid destination endpoint',
0x21 => 'Network ACK Failure',
0x22 => 'Not Joined to Network',
0x23 => 'Self-addressed',
0x24 => 'Address Not Found',
0x25 => 'Route Not Found',
lib/Device/XBee/API.pm view on Meta::CPAN
}
=head2 remote_at
Send an AT command to a remote module. Accepts three parameters: a hashref with
endpoint addresses, command options, frame_id; the AT command name (as
two-character string); and the third as the expected data for that command (if
any) as a string. See the XBee datasheet for a list of supported AT commands
and expected data for each.
Endpoint addresses should be specified as a hashref containing the following
lib/Device/XBee/API.pm view on Meta::CPAN
}
=head2 tx
Sends a transmit request to the XBee. Accepts three parameters, the first is the
endpoint address, the second is a scalar containing the data to be sent, and the
third is an optional flag (known as the async flag) specifying whether or not
the method should wait for an acknowledgement from the XBee.
Endpoint addresses should be specified as a hashref containing the following
keys:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DeyeCloud/Client.pm view on Meta::CPAN
#
$deye->baseurl('https://eu1-developer.deyecloud.com/v1.0');
$deye->method('POST');
my $data = $deye->call('station/latest', 'stationId' => INTEGER);
Available options list depends on endpoint. Most endpoints are described
in Deye Cloud developer guide.
=back
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DigitalOcean/Droplet/Upgrade.pm view on Meta::CPAN
A time value given in ISO8601 combined date and time format that represents when the migration will occur for the droplet.
=head2 url
A URL pointing to the Droplet's API endpoint. This is the endpoint to be used if you want to retrieve information about the droplet.
=head2 id
=head1 AUTHOR
view all matches for this distribution
view release on metacpan or search on metacpan
instead of doing it longhand
0.03 2018-01-29
[!!BREAKING CHANGES!!]
- major re-arrangement of the internals for building
a stream, there is no longer an endpoint called
`stream` which you must call before things are
usable, instead things are just always usable.
- removed the `stream` method from `Directory::Scanner`
- moved all the builder methods from `Directory::Scanner`
to `Directory::Scanner::API::Stream` instead, so that
view all matches for this distribution
view release on metacpan or search on metacpan
azure-pipelines.yml view on Meta::CPAN
resources:
repositories:
- repository: ci-perl-helpers
type: github
name: houseabsolute/ci-perl-helpers
endpoint: houseabsolute
stages:
- template: templates/helpers/build.yml@ci-perl-helpers
parameters:
debug: true
view all matches for this distribution
view release on metacpan or search on metacpan
bin/createrelease.pl view on Meta::CPAN
generate_release_notes => $github_notes,
}
);
die "Unable to create release for $identity{login}\\$releases->{repo}" if ($response->code eq '404');
#die "Validation failed, or the endpoint has been spammed." if ($response->code eq '422');
die "login or token invalid for the specified repository: $identity{login}\\$releases->{repo}\n"
if ($response->code eq '403');
if ($response->code ne '201') {
my $message = $response->raw_content();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Pod/Weaver/PluginBundle/Author/GETTY.pm view on Meta::CPAN
Parse a configuration file and return a hashref.
=head2 =resource
Documents available resources, features, or API endpoints.
=resource servers
Cloud servers (create, delete, power on/off)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Docker/Client.pm view on Meta::CPAN
our $VERSION = '0.1.1';
class_type 'Mojo::URL';
coerce 'Mojo::URL', from 'Str', via { Mojo::URL->new(shift) };
has 'endpoint' => (
is => 'ro',
isa => 'Mojo::URL',
default => sub {
return Mojo::URL->new('http+unix://%2Fvar%2Frun%2Fdocker.sock');
},
lib/Docker/Client.pm view on Meta::CPAN
default => sub {
my $self = shift;
## Making sure we use the correct version path
my $base_url =
$self->endpoint()->clone()->path( sprintf '/%s', $self->version() );
## Loading correct version specification from disk.
my $spec =
Mojo::File->new( dist_dir('Docker-Client') )->child('specs')
->child( sprintf '%s.yaml', $self->version() );
## Creating the OpenAPI Client instance using the defined parameters.
my $api =
OpenAPI::Client->new( $spec->to_string(),
base_url => $self->endpoint() );
## If the protocol is local we need to replace the "Host" header on each request
if ( $self->endpoint()->protocol() eq 'http+unix' ) {
$api->ua()->on(
start => sub {
my ( $ua, $tx ) = @_;
$tx->req()->headers()->header( 'Host' => 'localhost' );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Docker/Registry/Auth/Gitlab.pm view on Meta::CPAN
The repository you request access to.
=head2 jwt
The endpoint to request the JWT token from, defaults to
'https://gitlab.com/jwt/auth'. You can use a 'Str' or an URI object.
=head1 METHODS
=head2 get_bearer_token
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dubber/API.pm view on Meta::CPAN
);
method _build_json_coder () { return Cpanel::JSON::XS->new->utf8; }
# ------------------------------------------------------------------------
has endpoints => (
is => 'ro',
default => sub {
{ root => { path => '/' },
# Group Methods (Group Authentication Required)
lib/Dubber/API.pm view on Meta::CPAN
};
},
);
method commands () { return $self->endpoints; }
# ------------------------------------------------------------------------
method upload_recording_mp3_file ($account_id, $call_metadata, $mp3_file_or_data) {
my @data_parts = $self->_split_recording_data($mp3_file_or_data);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ELab/Client.pm view on Meta::CPAN
is => 'ro',
isa => 'Str',
required => 1,
);
has endpoint => (
is => 'ro',
isa => 'Str',
default => 'api/v1/'
);
lib/ELab/Client.pm view on Meta::CPAN
my (%args) = validated_hash(
\@_,
file => { isa => 'Str' },
);
my $request = HTTP::Request::Common::POST(
$self->host().$self->endpoint()."experiments/$id",
{
file => [ $args{file} ]
},
Content_Type => 'form-data',
Authorization => $self->token(),
lib/ELab/Client.pm view on Meta::CPAN
my (%args) = validated_hash(
\@_,
file => { isa => 'Str' },
);
my $request = HTTP::Request::Common::POST(
$self->host().$self->endpoint()."items/$id",
{
file => [ $args{file} ]
},
Content_Type => 'form-data',
Authorization => $self->token(),
lib/ELab/Client.pm view on Meta::CPAN
sub elab_get {
my $self = shift;
my $url = shift;
my $result = $self->GET($self->endpoint().$url);
return undef unless $result->responseCode() eq '200';
return $result->responseContent();
}
sub elab_delete {
my $self = shift;
my $url = shift;
my $result = $self->DELETE($self->endpoint().$url);
return undef unless $result->responseCode() eq '200';
return $result->responseContent();
}
lib/ELab/Client.pm view on Meta::CPAN
my $self = shift;
my $url = shift;
my $data = shift;
$data =~ s/^\?//; # buildQuery starts with "?" (makes no sense here)
my $headers = { 'Content-Type' => 'application/x-www-form-urlencoded' };
my $result = $self->POST($self->endpoint().$url, $data, $headers);
return undef unless $result->responseCode() eq '200';
return $result->responseContent();
}
view all matches for this distribution
view release on metacpan or search on metacpan
script/ecs_token view on Meta::CPAN
use LWP::UserAgent;
use Term::ReadLine;
use URI::Escape;
my $SECSTOR_LOCATION = {
auth_endpoint => 'emdis/ecs/oauth/auth_endpoint',
cached_token_response => 'emdis/ecs/oauth/cached_token_response',
cached_token_timestamp => 'emdis/ecs/oauth/cached_token_timestamp',
client_id => 'emdis/ecs/oauth/client_id',
client_secret => 'emdis/ecs/oauth/client_secret',
redirect_uri => 'emdis/ecs/oauth/redirect_uri',
refresh_token => 'emdis/ecs/oauth/refresh_token',
scope => 'emdis/ecs/oauth/scope',
token_endpoint => 'emdis/ecs/oauth/token_endpoint',
};
my $SECSTOR_TIMELIMIT = 30;
if(exists $ENV{ECS_TOKEN_SECSTOR_TIMELIMIT} and
$ENV{ECS_TOKEN_SECSTOR_TIMELIMIT} =~ m/^\d+$/) {
script/ecs_token view on Meta::CPAN
"Usage:$/" .
" ecs_token <command> [options]$/" .
"Where:$/" .
" <command> is code, credentials, or refresh$/" .
" code [options] are:$/" .
" --auth_endpoint <auth_endpoint>$/" .
" --client_id <client_id>$/" .
" --client_secret <client_secret>$/" .
" --nocache$/" .
" --redirect_uri <redirect_uri>$/" .
" --scope <scope>$/" .
" --token_endpoint <token_endpoint>$/" .
" credentials [options] are:$/" .
" --client_id <client_id>$/" .
" --client_secret <client_secret>$/" .
" --nocache$/" .
" --scope <scope>$/" .
" --token_endpoint <token_endpoint>$/" .
" refresh [options] are:$/" .
" --client_id <client_id>$/" .
" --client_secret <client_secret>$/" .
" --nocache$/" .
" --refresh_token <refresh_token>$/" .
" --token_endpoint <token_endpoint>$/" .
" [options] not present on command line will be read from secure storage$/" .
"For details, refer to documentation:$/" .
" perldoc ecs_token$/";
my %options = ();
GetOptions(\%options, 'auth_endpoint=s', 'client_id=s', 'client_secret=s',
'nocache', 'redirect_uri=s', 'refresh_token=s', 'scope=s',
'token_endpoint=s')
or die "Error - Unrecognized command line option$/" . $USAGE;
my $command = ($#ARGV == 0 ? $ARGV[0] : '');
die "Error - unrecognized, invalid, or missing <command>$/" . $USAGE
unless $command eq 'code' or $command eq 'credentials' or $command eq 'refresh';
script/ecs_token view on Meta::CPAN
if($command eq 'code') {
# using authorization code flow ...
# get configuration parameters
my $auth_endpoint = get_config_param('auth_endpoint');
my $client_id = get_config_param('client_id');
my $client_secret = get_config_param('client_secret');
my $nocache = exists $options{nocache};
my $redirect_uri = get_config_param('redirect_uri');
my $scope = get_config_param('scope');
my $token_endpoint = get_config_param('token_endpoint');
# fail fast if command line contains unsupported options
die "Error - Option(s) unsupported for \"code\" command$/" . $USAGE
if exists $options{refresh_token};
script/ecs_token view on Meta::CPAN
or die "Error - Unable to initialize Term::ReadLine.$/";
$term->ornaments(0);
my $OUT = $term->OUT || *STDOUT;
# Construct URL to request authorization code.
# uses client id, redirect uri, scope, and auth endpoint
my $url = $auth_endpoint .
'?client_id=' . uri_escape($client_id) .
'&redirect_uri=' . uri_escape($redirect_uri) .
'&scope=' . uri_escape($scope) .
'&response_type=code' .
'&access_type=offline' .
script/ecs_token view on Meta::CPAN
my $authorization_code = $term->readline("Enter authorization code: ");
my $token_request_timestamp = time;
# use authorization code, client id, client secret, and redirect uri
# to request access token from token endpoint
my $response = $user_agent->post($token_endpoint, [
client_id => $client_id,
client_secret => $client_secret,
code => $authorization_code,
redirect_uri => $redirect_uri,
grant_type => 'authorization_code',
script/ecs_token view on Meta::CPAN
# get configuration parameters
my $client_id = get_config_param('client_id');
my $client_secret = get_config_param('client_secret');
my $nocache = exists $options{nocache};
my $scope = get_config_param('scope');
my $token_endpoint = get_config_param('token_endpoint');
# fail fast if command line contains unsupported options
die "Error - Option(s) unsupported for \"credentials\" command$/" . $USAGE
if exists $options{auth_endpoint} or exists $options{redirect_uri}
or exists $options{refresh_token};
if(not $nocache) {
# use cached token if available
my $cached_token = get_cached_token();
script/ecs_token view on Meta::CPAN
}
my $token_request_timestamp = time;
# use client id, client secret, and resource to request access token
# from token endpoint
my $response = $user_agent->post($token_endpoint, [
client_id => $client_id,
client_secret => $client_secret,
scope => $scope,
grant_type => 'client_credentials',
]);
script/ecs_token view on Meta::CPAN
# get configuration parameters
my $client_id = get_config_param('client_id');
my $client_secret = get_config_param('client_secret');
my $nocache = exists $options{nocache};
my $refresh_token = get_config_param('refresh_token');
my $token_endpoint = get_config_param('token_endpoint');
# fail fast if command line contains unsupported options
die "Error - Option(s) unsupported for \"refresh\" command$/" . $USAGE
if exists $options{auth_endpoint} or exists $options{redirect_uri}
or exists $options{scope};
if(not $nocache) {
# use cached token if available
my $cached_token = get_cached_token();
script/ecs_token view on Meta::CPAN
}
my $token_request_timestamp = time;
# use client id, client secret and refresh token to request access token
# from token endpoint
my $response = $user_agent->post($token_endpoint, [
client_id => $client_id,
client_secret => $client_secret,
refresh_token => $refresh_token,
grant_type => 'refresh_token',
]);
script/ecs_token view on Meta::CPAN
storage or by passing the value on the C<ecs_token> command line.
Example using C<pass> secure storage:
echo -n 'https://accounts.google.com/o/oauth2/auth' | \
pass insert --echo emdis/ecs/oauth/auth_endpoint
Example using command line parameter:
ecs_token code --auth_endpoint https://accounts.google.com/o/oauth2/auth
=over
=item auth_endpoint
OAuth 2.0 authorization code endpoint, for authorization code flow.
Required by the C<ecs_token code> command. Example value:
https://accounts.google.com/o/oauth2/auth
=item cached_token_response
script/ecs_token view on Meta::CPAN
C<ecs_token credentials> commands. Example values:
https://mail.google.com/
https://outlook.office365.com/.default
=item token_endpoint
OAuth 2.0 token endpoint. Required by the C<ecs_token code>,
C<ecs_token credentials>, and C<ecs_token refresh> commands. Example
values:
https://accounts.google.com/o/oauth2/token
https://login.microsoftonline.com/[tenant_id]/oauth2/v2.0/token
script/ecs_token view on Meta::CPAN
Populate the expected secure storage locations with information needed by
C<ecs_token>. E.g.:
echo -n 'https://accounts.google.com/o/oauth2/auth' | \
pass insert --echo emdis/ecs/oauth/auth_endpoint
echo -n '' | \
pass insert --echo emdis/ecs/oauth/cached_token_response
echo -n '0' | \
script/ecs_token view on Meta::CPAN
echo -n 'https://mail.google.com/' | \
pass insert --echo emdis/ecs/oauth/scope
echo -n 'https://accounts.google.com/o/oauth2/token' | \
pass insert --echo emdis/ecs/oauth/token_endpoint
=back
=head2 Environment Variables
view all matches for this distribution
view release on metacpan or search on metacpan
bin/epfl-net-ssl-test view on Meta::CPAN
while ( not $host = $labs->analyze( host => $domain )->complete() ) {
sleep $labs->previous_eta();
}
if ( $host->ready() ) {
foreach my $endpoint ( $host->endpoints() ) {
if ( $endpoint->ready() ) {
print "\n", $endpoint->ip_address(), "\n"
or croak "Couldn't write: $OS_ERROR";
print color('green'), 'â Diode', "\n", color('clear')
or croak "Couldn't write: $OS_ERROR";
print color('green'), 'â SSL Certificate', "\n", color('clear')
or croak "Couldn't write: $OS_ERROR";
if ( $endpoint->grade() eq 'A' or $endpoint->grade() eq 'A+' ) {
print color('green'), 'â Grade ', $endpoint->grade(), "\n\n",
color('clear')
or croak "Couldn't write: $OS_ERROR";
}
else {
print color('red'), 'â Grade ', $endpoint->grade(), "\n\n",
color('clear')
or croak "Couldn't write: $OS_ERROR";
}
}
else {
view all matches for this distribution