view release on metacpan or search on metacpan
lib/Catmandu/Importer/OAI.pm view on Meta::CPAN
sub _build_oai {
my ($self) = @_;
my $agent = HTTP::OAI::Harvester->new(baseURL => $self->url, resume => 0, keep_alive => 1);
if( $self->has_username && $self->has_password ) {
my $uri = URI->new( $self->url );
my @credentials = (
$uri->host_port,
$self->realm || undef,
$self->username,
$self->password
);
$agent->credentials( @credentials );
}
$agent->env_proxy;
$agent;
}
view all matches for this distribution
view release on metacpan or search on metacpan
share/plotly.js/plotly.min.js view on Meta::CPAN
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
"use strict";var e=t("base64-js"),n=t("ieee754");r.Buffer=a,r.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},r.INSPECT_MAX_BYTES=50;function i(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=ne...
/*! Native Promise Only
v0.8.1 (c) Kyle Simpson
MIT License: http://getify.mit-license.org
*/
!function(t,r,n){r[t]=r[t]||n(),void 0!==e&&e.exports&&(e.exports=r[t])}("Promise",void 0!==t?t:this,(function(){"use strict";var t,e,n,i=Object.prototype.toString,a=void 0!==r?function(t){return r(t)}:setTimeout;try{Object.defineProperty({},"x",{}),...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cisco/UCS.pm view on Meta::CPAN
Expires the current authentication token. This method should always be called
on completion of a script to expire the authentication token and free the
current session for use by others. The UCS XML API has a maximum number of
available connections, and a maximum number of sessions per user. In order to
ensure that the session remain available (especially if using common
credentials), you should always call this method on completion of a script, as
an argument to die, or in any eval where a script may fail and exit before
logging out;
=head3 cookie ()
view all matches for this distribution
view release on metacpan or search on metacpan
t/autodb.000.reqs.t view on Meta::CPAN
$errstr or $errstr=DBI->errstr;
my $diag=<<DIAG
These tests require that MySQL be running on 'localhost', that the user
running the tests can access MySQL without a password, and with these
credentials, has sufficient privileges to (1) create a 'test' database,
(2) create, alter, and drop tables in the 'test' database, (3) create and
drop views, and (4) run queries and updates on the database.
When verifying these capabilities, the test driver got the following
error message:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Class/User/DBI.pm view on Meta::CPAN
my $sth = $self->_db_run( $USER_QUERY{SQL_exists_user}, $self->userid );
return defined $sth->fetchrow_array ? 1 : 0;
}
# Fetch user's salt_hex, pass_hex, ip_required, and valid ip's from database.
sub get_credentials {
my $self = shift;
my $sth = $self->_db_run( $USER_QUERY{SQL_get_credentials}, $self->userid );
my ( $salt_hex, $pass_hex, $ip_required ) = $sth->fetchrow_array;
return if not defined $salt_hex; # User wasn't found.
my @valid_ips = $self->get_valid_ips;
return {
userid => $self->userid,
lib/Class/User/DBI.pm view on Meta::CPAN
# Save ourselves work if user is already authenticated.
if ( !$force_revalidate && $self->validated ) {
return 1;
}
my $credentials = $self->get_credentials;
my $auth = Authen::Passphrase::SaltedSHA512->new(
salt_hex => $credentials->{salt_hex},
hash_hex => $credentials->{pass_hex}
);
if ( !$auth->match($password) ) {
$self->validated(0);
return 0;
}
# Return 0 if an IP is required, and IP param is not in whitelist,
# or no IP parameter passed.
if ( $credentials->{ip_required} ) {
if ( !defined $ip
|| !any { $ip eq $_ } @{ $credentials->{valid_ips} } )
{
$self->validated(0);
return 0;
}
}
lib/Class/User/DBI.pm view on Meta::CPAN
return if !$self->exists_user;
# If an old passphrase is supplied, only update if it validates.
if ( defined $oldpass ) {
my $credentials = $self->get_credentials;
my $auth = Authen::Passphrase::SaltedSHA512->new(
salt_hex => $credentials->{salt_hex},
hash_hex => $credentials->{pass_hex}
);
# Return undef if password doesn't authenticate for the user.
return unless $auth->match($oldpass); ## no critic (postfix)
}
lib/Class/User/DBI.pm view on Meta::CPAN
__END__
=head1 NAME
Class::User::DBI - A User class: Login credentials, roles, privileges, domains.
=head1 VERSION
Version 0.10
=head1 SYNOPSIS
This module models a "User" class, with login credentials, and Roles Based
Access Control. Additionally, IP whitelists may be used as an additional
validation measure. Domain (locality) based access control is also provided
independently of role based access control.
A brief description of authentication: Passphrases are stored as randomly
lib/Class/User/DBI.pm view on Meta::CPAN
my $validated = $user->validated;
my $invalidated = $user->validated(0); # Cancel authentication.
my $is_valid = $user->validate( $pass, $ip ); # Validate including IP.
my $is_valid = $user->validate( $pass ); # Validate without IP.
my $info_href = $user->load_profile;
my $credentials = $user->get_credentials; # Returns a useful hashref.
my @valid_ips = $user->get_valid_ips;
my $ip_required = $user->get_ip_required;
my $success = $user->set_ip_required(1);
my $ exists = $user->exists_user;
my $success = $user->delete_user;
lib/Class/User/DBI.pm view on Meta::CPAN
The module is designed to simplify user logins, authentication, role based
access control (authorization), as well as domain (locality) constraint access
control.
It stores user credentials, roles, and basic user information in a database via
a DBIx::Connector database connection.
User passphrases are salted with a 512 bit random salt (unique per user) using
a cryptographically strong random number generator, and converted to a SHA2-512
digest before being stored in the database. All subsequent passphrase
lib/Class/User/DBI.pm view on Meta::CPAN
Use L<Class::User::DBI::Domains> to create a list of domains (localities), along
with their descriptions.
Use L<Class::User::DBI> (This module) to create a set of users, establish
login credentials such as passphrases and optional IP whitelists, and assign
them roles.
Use L<Class::User::DBI::UserDomains> to associate one or more localities
(domains) with each user.
lib/Class/User/DBI.pm view on Meta::CPAN
database, such as C<< $user->delete_user >> will remove the cache entry, and
subsequent tests will access the database on each call to C<exists_user()>,
until such time that the result flips to positive again.
=head2 get_credentials
my $credentials_href = $user->get_credentials;
my @fields = qw( userid salt_hex pass_hex ip_required );
foreach my $field ( @fields ) {
print "$field => $credentials_href->{$field}\n";
}
my @valid_ips = @{$valid_ips};
foreach my $ip ( @valid_ips ) {
print "Whitelisted IP: $ip\n";
}
Accepts no parameters. Returns a hashref holding a small datastructure that
describes the user's credentials. The structure looks like this:
$href = {
userid => $userid, # The target user's userid.
salt_hex => $salt, # A 128 hex-character representation of
lib/Class/User/DBI.pm view on Meta::CPAN
A typical usage probably won't require calling this function directly very
often, if at all. In most cases where it would be useful to look at the salt,
the passphrase digest, and IP whitelists, the
C<< $user->validate( $passphrase, $ip ) >> method is easier to use and less
prone to error. But for those cases I haven't considered, the
C<get_credentials()> method exists.
=head2 get_role
my $user_role = $user->get_role;
lib/Class/User/DBI.pm view on Meta::CPAN
=head1 DIAGNOSTICS
If you find that your particular database engine is not playing nicely with the
test suite from this module, it may be necessary to provide the database login
credentials for a test database using the same engine that your application
will actually be using. You may do this by setting C<$ENV{CUDBI_TEST_DSN}>,
C<$ENV{CUDBI_TEST_DATABASE}>, C<$ENV{CUDBI_TEST_USER}>,
and C<$ENV{CUDBI_TEST_PASS}>.
Currently the test suite tests against a SQLite database since it's such a
lightweight dependency for the testing. The author also uses this module
with several MySQL databases. As you're configuring your database, providing
its credentials to the tests and running the test scripts will offer really
good diagnostics if some aspect of your database tables proves to be at odds
with what this module needs.
Be advised that the the test suite drops its tables after completion, so be sure
to run the test suite only against a database set up explicitly for testing
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Class/Usul/Schema.pm view on Meta::CPAN
}
return OK;
}
sub create_schema : method { # Create databases and edit credentials
my $self = shift;
my $default = $self->yes;
my $text = 'Schema creation requires a database, id and password. '
. 'For Postgres the driver is Pg and the port 5432. For '
. 'MySQL the driver is mysql and the port 3306';
$self->output( $text, AS_PARA );
$self->yorn( '+Create database schema', $default, TRUE, 0 ) or return OK;
$self->edit_credentials;
$self->connect_options;
$self->drop_database;
$self->drop_user;
$self->create_user;
$self->create_database;
lib/Class/Usul/Schema.pm view on Meta::CPAN
$self->debug and $self->dumper( $r );
return OK;
}
sub edit_credentials : method {
my $self = shift;
my $self_cfg = $self->config;
my $db = $self->database;
my $bootstrap = $self->options->{bootstrap};
my $cfg_data = $bootstrap ? {} : $self->load_config_data( $self_cfg, $db );
lib/Class/Usul/Schema.pm view on Meta::CPAN
$field ne 'name' and $self->$setter( $value // NUL );
$is_pw and $value = encrypt_for_config $self_cfg, $value, $stored_pw;
$copts->{ $field } = $value // NUL;
}
$cfg_data->{credentials}->{ $copts->{name} } = $copts;
$self->dry_run and $self->dumper( $cfg_data ) and return OK;
$self->dump_config_data( $self_cfg, $copts->{name}, $cfg_data );
return OK;
}
lib/Class/Usul/Schema.pm view on Meta::CPAN
=head2 create_schema - Creates a database then deploys and populates the schema
$self->create_schema;
Calls L<edit_credentials>, L<create_database>, L<create_user>, and
L<deploy_and_populate>
=head2 create_user - Creates a database user
$self->create_user;
lib/Class/Usul/Schema.pm view on Meta::CPAN
$self->dsn;
Returns the DSN from the call to
L<get_connect_info|Class::Usul::TraitFor::ConnectInfo/get_connect_info>
=head2 edit_credentials - Edits the database login information
$self->edit_credentials;
Encrypts the database connection password before storage
=head2 execute_ddl
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ClearPress/authenticator/db.pm view on Meta::CPAN
}
return $DEFAULT_CIPHER;
}
sub authen_credentials {
my ($self, $ref) = @_;
if(!$ref ||
!$ref->{username} ||
!$ref->{password} ) {
lib/ClearPress/authenticator/db.pm view on Meta::CPAN
=head2 dbh - get/set accessor for database handle to use for query
$oDBAuth->dbh($oDBH);
my $oDBH = $oDBAuth->dbh();
=head2 authen_credentials - attempt to authenticate against database using given username & password
my $hrAuthenticated = $oDBAuth->authen_credentials({username => $sUsername, password => $sPassword});
returns undef or hashref
=head1 DIAGNOSTICS
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CloudApp/REST.pm view on Meta::CPAN
my $params = shift;
my $email = $params->{email} || $params->{username} || $params->{user} || $self->email || die "You have to provide an email address";
my $pass = $params->{password} || $params->{pass} || $self->password || die "You have to provide a password";
$self->useragent->credentials($self->auth_netloc, $self->auth_realm, $email, $pass);
return 1;
}
=head2 account_register
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CCfnX/VagrantDeployer.pm view on Meta::CPAN
@lines = @{ $self->origin->Resource('Instance')->Properties->UserData->process_with_context($self->origin, \@lines) };
my $content = join '', @lines;
$content =~ s/\\/\\\\/;
warn "I'm extending a 900 second (15 min) token with you're actual credentials to vagrant";
my $creds = Paws::Credential::ProviderChain->new();
my $aws_access_key = $creds->access_key;
my $aws_secret_key = $creds->secret_key;
lib/CCfnX/VagrantDeployer.pm view on Meta::CPAN
my $vag_file = '
VAGRANTFILE_API_VERSION = "2"
$script = <<SCRIPT
#!/bin/bash
# Create temporary credentials
export AWS_ACCESS_KEY_ID=' . $aws_access_key . '
export AWS_SECRET_ACCESS_KEY=' . $aws_secret_key . '
export AWS_SESSION_TOKEN=' . $aws_token . '
cat > /etc/skel/.aws_creds <<ALIASES
export AWS_ACCESS_KEY_ID=' . $aws_access_key . '
export AWS_SECRET_ACCESS_KEY=' . $aws_secret_key . '
export AWS_SESSION_TOKEN=' . $aws_token . '
ALIASES
' . $content . '
# Clean temporary credentials
rm -f /etc/skel/.aws_creds
find /home -type f -name ".aws_creds" -delete
SCRIPT
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CloudFlare/Client.pm view on Meta::CPAN
use LWP::Protocol::https 6.02;
use JSON::MaybeXS;
our $VERSION = 'v0.55.4'; # VERSION
# CF credentials
has '_user' => (
is => 'ro',
isa => Str,
required => 1,
init_arg => 'user',);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CloudHealth/API.pm view on Meta::CPAN
has call_former => (is => 'ro', isa => HasMethods['params2request'], default => sub {
require CloudHealth::API::CallObjectFormer;
CloudHealth::API::CallObjectFormer->new;
});
has credentials => (is => 'ro', isa => HasMethods['api_key'], default => sub {
require CloudHealth::API::Credentials;
CloudHealth::API::Credentials->new;
});
has io => (is => 'ro', isa => HasMethods['call'], default => sub {
require CloudHealth::API::Caller;
lib/CloudHealth/API.pm view on Meta::CPAN
CloudHealth::API::ResultParser->new
});
sub _invoke {
my ($self, $method, $params) = @_;
my $req = $self->call_former->params2request($method, $self->credentials, $params);
my $result = $self->io->call($req);
return $self->result_parser->result2return($result);
}
sub method_classification {
lib/CloudHealth/API.pm view on Meta::CPAN
=head1 AUTHENTICATION
As the documentation states, you need an API KEY to query the API. The default authentication
mechanism expects to find that API key in the C<CLOUDHEALTH_APIKEY> environment variable.
You can also pass any object that implements an C<api_key> method to the C<credentials> attribute
of the constructor
=head1 RESULTS
Results are returned as a Perl HashRef representing the JSON returned by the API.
view all matches for this distribution
view release on metacpan or search on metacpan
bin/cloudhealth view on Meta::CPAN
return $arg_parser->parse;
});
has argv => (is => 'ro', isa => ArrayRef, required => 1);
has ch => (is => 'ro', lazy => 1, default => sub { CloudHealth::API->new });
has credentials_detected => (is => 'ro', isa => Bool, lazy => 1, default => sub {
my $self = shift;
$self->ch->credentials->is_set;
});
has run_method => (is => 'ro', isa => Maybe[Str], lazy => 1, default => sub { shift->argv->[0] });
has method_specified => (is => 'ro', isa => Bool, lazy => 1, default => sub {
bin/cloudhealth view on Meta::CPAN
});
sub usage {
my $self = shift;
say " * Didn't detect credentials. Set env CLOUDHEALTH_APIKEY" if (not $self->credentials_detected);
say " * Didn't specify the method to call" if (not $self->method_specified);
say sprintf(" * Don't know method %s", $self->run_method) if ($self->method_specified and not $self->method_exists);
if (not $self->method_specified or not $self->method_exists or $self->wants_help) {
say 'The following methods are available:';
foreach my $kind (sort keys %{ $self->ch->method_classification }) {
bin/cloudhealth view on Meta::CPAN
}
sub run {
my ($self) = shift;
return $self->usage if (not $self->credentials_detected);
return $self->usage if (not $self->method_specified);
return $self->usage if (not $self->method_exists);
return $self->usage if ($self->wants_help);
my $method = $self->run_method;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Clustericious/Client.pm view on Meta::CPAN
has server_url => '';
has [qw(tx res userinfo ua )];
has _remote => ''; # Access via remote()
has _cache => sub { + {} }; # cache of credentials
sub client
{
carp "Clustericious::Client->client is deprecated (use ua instead)";
shift->ua(@_);
lib/Clustericious/Client.pm view on Meta::CPAN
$self->tx($tx);
my $auth_header;
if (($tx->res->code||0) == 401 && ($auth_header = $tx->res->headers->www_authenticate)
&& !$url->userinfo && ($self->_has_auth || $self->_can_auth)) {
DEBUG "received code 401, trying again with credentials";
my ($realm) = $auth_header =~ /realm=(.*)$/i;
my $host = $url->host;
$self->login( $self->_has_auth ? () : $self->_get_user_pw($host,$realm) );
return $self->_doit($meta ? $meta : (), @_);
}
view all matches for this distribution
view release on metacpan or search on metacpan
examples/helloworld/app/lib/App/Controller/ApiBase.pm view on Meta::CPAN
'CGI::SpeedyCGI' => {},
'MouseX::Types::Common' => {},
'CORS' => {
origin => c->base_url,
credentials => 1,
headers => [qw/X-Requested-With Authorization Content-Type/],
maxage => 7200,
},
'JSON' => {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Config/AWS.pm view on Meta::CPAN
list_profiles
read_file
read_string
read_handle
config_file
credentials_file
default_profile
);
our $VERSION = '0.12';
our %EXPORT_TAGS = (
ini => [qw( read_file read_string read_handle )],
aws => [qw( config_file default_profile credentials_file )],
read => [qw( read read_all list_profiles )],
all => [qw( :ini :aws :read )],
);
# Internal methods for parsing and validation
my $prepare = sub {
# Input is given argument or credentials file (if exists) or config file.
my $input = shift // do {
my $cred_file = credentials_file();
-r $cred_file ? $cred_file : config_file();
};
unless ( Ref::Util::is_ref $input ) {
require Path::Tiny;
lib/Config/AWS.pm view on Meta::CPAN
sub default_profile {
$ENV{AWS_DEFAULT_PROFILE} // 'default';
}
sub credentials_file {
$ENV{AWS_SHARED_CREDENTIALS_FILE} // ( glob '~/.aws/credentials' )[0];
}
sub config_file {
$ENV{AWS_CONFIG_FILE} // ( glob '~/.aws/config' )[0];
}
lib/Config/AWS.pm view on Meta::CPAN
# Or read the default profile from the default file
$config = read();
# Which is the same as
$config = read(
-r credentials_file() ? credentials_file() : config_file(),
default_profile()
);
# Read all of the profiles from a file
$profiles = read_all( $source );
lib/Config/AWS.pm view on Meta::CPAN
=item * An B<undefined> value
=back
If the source is undefined, a default file name will be used. This will be
the result of calling B<credentials_file> (if it is a readable file) or the
result of calling B<config_file> otherwise.
B<read_all> will return the results of parsing all of the content in the
source, for all profiles that may be defined in it.
lib/Config/AWS.pm view on Meta::CPAN
=item B<config_file>
Returns the contents of the C<AWS_CONFIG_FILE> environment variable, or
C<~/.aws/config> if undefined.
=item B<credentials_file>
Returns the contents of the C<AWS_SHARED_CREDENTIALS_FILE> environment
variable, or C<~/.aws/credentials> if undefined.
=back
=head2 Compatibility with Config::INI
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Config/Model/models/Ssh/HostElement.pl view on Meta::CPAN
'type' => 'leaf',
'value_type' => 'uniline'
},
'GSSAPIDelegateCredentials',
{
'description' => 'Forward (delegate) credentials
to the server. The default is B<no>.Forward (delegate) credentials
to the server. The default is B<no>.',
'type' => 'leaf',
'upstream_default' => 'no',
'value_type' => 'boolean',
'write_as' => [
lib/Config/Model/models/Ssh/HostElement.pl view on Meta::CPAN
]
},
'GSSAPIRenewalForcesRekey',
{
'description' => "If set to B<yes> then
renewal of the client\x{2019}s GSSAPI credentials will force
the rekeying of the ssh connection. With a compatible
server, this can delegate the renewed credentials to a
session on the server. The default is B<no>.If set to B<yes> then
renewal of the client\x{2019}s GSSAPI credentials will force
the rekeying of the ssh connection. With a compatible
server, this can delegate the renewed credentials to a
session on the server. The default is B<no>.",
'type' => 'leaf',
'upstream_default' => 'no',
'value_type' => 'boolean',
'write_as' => [
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Config/Model/models/Systemd/Common/Exec.pl view on Meta::CPAN
with memory protection keys (L<pkeys(7)>)\@privilegedAll system calls which need super-user capabilities
(L<capabilities(7)>)\@processProcess control, execution, namespacing operations (L<clone(2)>, L<kill(2)>,
L<namespaces(7)>, \x{2026})\@raw-ioRaw I/O port access (L<ioperm(2)>, L<iopl(2)>, pciconfig_read(), \x{2026})\@rebootSystem calls for
rebooting and reboot preparation (L<reboot(2)>, kexec(), \x{2026})\@resourcesSystem calls for changing resource limits, memory
and scheduling parameters (L<setrlimit(2)>, L<setpriority(2)>, \x{2026})\@sandboxSystem calls for sandboxing programs
(L<seccomp(2)>, Landlock system calls, \x{2026})\@setuidSystem calls for changing user ID and group ID credentials,
(L<setuid(2)>, L<setgid(2)>, L<setresuid(2)>, \x{2026})\@signalSystem calls for manipulating and handling process signals
(L<signal(2)>, L<sigprocmask(2)>, \x{2026})\@swapSystem calls for enabling/disabling swap devices (L<swapon(2)>,
L<swapoff(2)>)\@syncSynchronizing files and memory to disk (L<fsync(2)>, L<msync(2)>, and related calls)\@system-serviceA
reasonable set of system calls used by common system services, excluding any special purpose calls. This is the
recommended starting point for allow-listing system calls for system services, as it contains what is typically needed
lib/Config/Model/models/Systemd/Common/Exec.pl view on Meta::CPAN
public and private) or certificates, user account information or identity information from host to
services. The data is accessible from the unit's processes via the file system, at a read-only
location that (if possible and permitted) is backed by non-swappable memory. The data is only
accessible to the user associated with the unit, via the
C<User>/C<DynamicUser> settings (as well as the superuser). When
available, the location of credentials is exported as the C<\$CREDENTIALS_DIRECTORY>
environment variable to the unit's processes.
The C<LoadCredential> setting takes a textual ID to use as name for a
credential plus a file system path, separated by a colon. The ID must be a short ASCII string
suitable as filename in the filesystem, and may be chosen freely by the user. If the specified path
is absolute it is opened as regular file and the credential data is read from it. If the absolute
path refers to an C<AF_UNIX> stream socket in the file system a connection is made
to it (only once at unit start-up) and the credential data read from the connection, providing an
easy IPC integration point for dynamically transferring credentials from other services.
If the specified path is not absolute and itself qualifies as valid credential identifier it is
attempted to find a credential that the service manager itself received under the specified name \x{2014}
which may be used to propagate credentials from an invoking environment (e.g. a container manager
that invoked the service manager) into a service. If no matching system credential is found, the
directories C</etc/credstore/>, C</run/credstore/> and
C</usr/lib/credstore/> are searched for files under the credential's name \x{2014} which
hence are recommended locations for credential data on disk. If
C<LoadCredentialEncrypted> is used C</run/credstore.encrypted/>,
C</etc/credstore.encrypted/>, and
C</usr/lib/credstore.encrypted/> are searched as well.
If the file system path is omitted it is chosen identical to the credential name, i.e. this is
a terse way to declare credentials to inherit from the service manager into a service. This option
may be used multiple times, each time defining an additional credential to pass to the unit.
Note that if the path is not specified or a valid credential identifier is given, i.e.
in the above two cases, a missing credential is not considered fatal.
lib/Config/Model/models/Systemd/Common/Exec.pl view on Meta::CPAN
L<systemd-creds(1)>. This
credential is loaded, decrypted, authenticated and then passed to the application in plaintext form,
in the same way a regular credential specified via C<LoadCredential> would be. A
credential configured this way may be symmetrically encrypted/authenticated with a secret key derived
from the system's TPM2 security chip, or with a secret key stored in
C</var/lib/systemd/credentials.secret>, or with both. Using encrypted and
authenticated credentials improves security as credentials are not stored in plaintext and only
authenticated and decrypted into plaintext the moment a service requiring them is started. Moreover,
credentials may be bound to the local hardware and installations, so that they cannot easily be
analyzed offline, or be generated externally. When C<DevicePolicy> is set to
C<closed> or C<strict>, or set to C<auto> and
C<DeviceAllow> is set, or C<PrivateDevices> is set, then this
setting adds C</dev/tpmrm0> with C<rw> mode to
C<DeviceAllow>. See
L<systemd.resource-control(5)>
for the details about C<DevicePolicy> or C<DeviceAllow>.
Note that encrypted credentials targeted for services of the per-user service manager must be
encrypted with systemd-creds encrypt --user, and those for the system service
manager without the C<--user> switch. Encrypted credentials are always targeted to a
specific user or the system as a whole, and it is ensured that per-user service managers cannot
decrypt secrets intended for the system or for other users.
The credential files/IPC sockets must be accessible to the service manager, but don't have to
be directly accessible to the unit's processes: the credential data is read and copied into separate,
lib/Config/Model/models/Systemd/Common/Exec.pl view on Meta::CPAN
C<ExecStart> command line use C<\${CREDENTIALS_DIRECTORY}/mycred>,
e.g. C<ExecStart=cat \${CREDENTIALS_DIRECTORY}/mycred>. In order to reference the path
a credential may be read from within a C<Environment> line use
C<%d/mycred>, e.g. C<Environment=MYCREDPATH=%d/mycred>. For system
services the path may also be referenced as
C</run/credentials/UNITNAME> in cases where no
interpolation is possible, e.g. configuration files of software that does not yet support credentials
natively. C<\$CREDENTIALS_DIRECTORY> is considered the primary interface to look for
credentials, though, since it also works for user services.
Currently, an accumulated credential size limit of 1 MB per unit is enforced.
The service manager itself may receive system credentials that can be propagated to services
from a hosting container manager or VM hypervisor. See the L<Container
Interface|https://systemd.io/CONTAINER_INTERFACE> documentation for details
about the former. For the latter, pass L<DMI/SMBIOS|https://www.dmtf.org/standards/smbios> OEM string table entries
(field type
11) with a prefix of C<io.systemd.credential:> or
lib/Config/Model/models/Systemd/Common/Exec.pl view on Meta::CPAN
parsed (thus permitting binary data to be passed in). Example
L<qemu|https://www.qemu.org/docs/master/system/index.html> switch: C<-smbios
type=11,value=io.systemd.credential:xx=yy>, or C<-smbios
type=11,value=io.systemd.credential.binary:rick=TmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXA=>. Alternatively,
use the qemu C<fw_cfg> node
C<opt/io.systemd.credentials/>. Example qemu switch:
C<-fw_cfg name=opt/io.systemd.credentials/mycred,string=supersecret>. They may also
be passed from the UEFI firmware environment via
L<systemd-stub(7)>,
from the initrd (see
L<systemd(1)>), or be
specified on the kernel command line using the C<systemd.set_credential=> and
lib/Config/Model/models/Systemd/Common/Exec.pl view on Meta::CPAN
for abstract namespace socket names), followed by a random string (consisting of alphadecimal
characters), followed by the literal string C</unit/>, followed by the requesting
unit name, followed by the literal character C</>, followed by the textual credential
ID requested. Example: C<\\0adf9d86b6eda275e/unit/foobar.service/credx> in case the
credential C<credx> is requested for a unit C<foobar.service>. This
functionality is useful for using a single listening socket to serve credentials to multiple
consumers.
For further information see L<System and Service
Credentials|https://systemd.io/CREDENTIALS> documentation.",
'type' => 'leaf',
lib/Config/Model/models/Systemd/Common/Exec.pl view on Meta::CPAN
public and private) or certificates, user account information or identity information from host to
services. The data is accessible from the unit's processes via the file system, at a read-only
location that (if possible and permitted) is backed by non-swappable memory. The data is only
accessible to the user associated with the unit, via the
C<User>/C<DynamicUser> settings (as well as the superuser). When
available, the location of credentials is exported as the C<\$CREDENTIALS_DIRECTORY>
environment variable to the unit's processes.
The C<LoadCredential> setting takes a textual ID to use as name for a
credential plus a file system path, separated by a colon. The ID must be a short ASCII string
suitable as filename in the filesystem, and may be chosen freely by the user. If the specified path
is absolute it is opened as regular file and the credential data is read from it. If the absolute
path refers to an C<AF_UNIX> stream socket in the file system a connection is made
to it (only once at unit start-up) and the credential data read from the connection, providing an
easy IPC integration point for dynamically transferring credentials from other services.
If the specified path is not absolute and itself qualifies as valid credential identifier it is
attempted to find a credential that the service manager itself received under the specified name \x{2014}
which may be used to propagate credentials from an invoking environment (e.g. a container manager
that invoked the service manager) into a service. If no matching system credential is found, the
directories C</etc/credstore/>, C</run/credstore/> and
C</usr/lib/credstore/> are searched for files under the credential's name \x{2014} which
hence are recommended locations for credential data on disk. If
C<LoadCredentialEncrypted> is used C</run/credstore.encrypted/>,
C</etc/credstore.encrypted/>, and
C</usr/lib/credstore.encrypted/> are searched as well.
If the file system path is omitted it is chosen identical to the credential name, i.e. this is
a terse way to declare credentials to inherit from the service manager into a service. This option
may be used multiple times, each time defining an additional credential to pass to the unit.
Note that if the path is not specified or a valid credential identifier is given, i.e.
in the above two cases, a missing credential is not considered fatal.
lib/Config/Model/models/Systemd/Common/Exec.pl view on Meta::CPAN
L<systemd-creds(1)>. This
credential is loaded, decrypted, authenticated and then passed to the application in plaintext form,
in the same way a regular credential specified via C<LoadCredential> would be. A
credential configured this way may be symmetrically encrypted/authenticated with a secret key derived
from the system's TPM2 security chip, or with a secret key stored in
C</var/lib/systemd/credentials.secret>, or with both. Using encrypted and
authenticated credentials improves security as credentials are not stored in plaintext and only
authenticated and decrypted into plaintext the moment a service requiring them is started. Moreover,
credentials may be bound to the local hardware and installations, so that they cannot easily be
analyzed offline, or be generated externally. When C<DevicePolicy> is set to
C<closed> or C<strict>, or set to C<auto> and
C<DeviceAllow> is set, or C<PrivateDevices> is set, then this
setting adds C</dev/tpmrm0> with C<rw> mode to
C<DeviceAllow>. See
L<systemd.resource-control(5)>
for the details about C<DevicePolicy> or C<DeviceAllow>.
Note that encrypted credentials targeted for services of the per-user service manager must be
encrypted with systemd-creds encrypt --user, and those for the system service
manager without the C<--user> switch. Encrypted credentials are always targeted to a
specific user or the system as a whole, and it is ensured that per-user service managers cannot
decrypt secrets intended for the system or for other users.
The credential files/IPC sockets must be accessible to the service manager, but don't have to
be directly accessible to the unit's processes: the credential data is read and copied into separate,
lib/Config/Model/models/Systemd/Common/Exec.pl view on Meta::CPAN
C<ExecStart> command line use C<\${CREDENTIALS_DIRECTORY}/mycred>,
e.g. C<ExecStart=cat \${CREDENTIALS_DIRECTORY}/mycred>. In order to reference the path
a credential may be read from within a C<Environment> line use
C<%d/mycred>, e.g. C<Environment=MYCREDPATH=%d/mycred>. For system
services the path may also be referenced as
C</run/credentials/UNITNAME> in cases where no
interpolation is possible, e.g. configuration files of software that does not yet support credentials
natively. C<\$CREDENTIALS_DIRECTORY> is considered the primary interface to look for
credentials, though, since it also works for user services.
Currently, an accumulated credential size limit of 1 MB per unit is enforced.
The service manager itself may receive system credentials that can be propagated to services
from a hosting container manager or VM hypervisor. See the L<Container
Interface|https://systemd.io/CONTAINER_INTERFACE> documentation for details
about the former. For the latter, pass L<DMI/SMBIOS|https://www.dmtf.org/standards/smbios> OEM string table entries
(field type
11) with a prefix of C<io.systemd.credential:> or
lib/Config/Model/models/Systemd/Common/Exec.pl view on Meta::CPAN
parsed (thus permitting binary data to be passed in). Example
L<qemu|https://www.qemu.org/docs/master/system/index.html> switch: C<-smbios
type=11,value=io.systemd.credential:xx=yy>, or C<-smbios
type=11,value=io.systemd.credential.binary:rick=TmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXA=>. Alternatively,
use the qemu C<fw_cfg> node
C<opt/io.systemd.credentials/>. Example qemu switch:
C<-fw_cfg name=opt/io.systemd.credentials/mycred,string=supersecret>. They may also
be passed from the UEFI firmware environment via
L<systemd-stub(7)>,
from the initrd (see
L<systemd(1)>), or be
specified on the kernel command line using the C<systemd.set_credential=> and
lib/Config/Model/models/Systemd/Common/Exec.pl view on Meta::CPAN
for abstract namespace socket names), followed by a random string (consisting of alphadecimal
characters), followed by the literal string C</unit/>, followed by the requesting
unit name, followed by the literal character C</>, followed by the textual credential
ID requested. Example: C<\\0adf9d86b6eda275e/unit/foobar.service/credx> in case the
credential C<credx> is requested for a unit C<foobar.service>. This
functionality is useful for using a single listening socket to serve credentials to multiple
consumers.
For further information see L<System and Service
Credentials|https://systemd.io/CREDENTIALS> documentation.",
'type' => 'leaf',
'value_type' => 'uniline'
},
'ImportCredential',
{
'description' => "Pass one or more credentials to the unit. Takes a credential name for which we'll
attempt to find a credential that the service manager itself received under the specified name \x{2014}
which may be used to propagate credentials from an invoking environment (e.g. a container manager
that invoked the service manager) into a service. If the credential name is a glob, all credentials
matching the glob are passed to the unit. Matching credentials are searched for in the system
credentials, the encrypted system credentials, and under C</etc/credstore/>,
C</run/credstore/>, C</usr/lib/credstore/>,
C</run/credstore.encrypted/>, C</etc/credstore.encrypted/>, and
C</usr/lib/credstore.encrypted/> in that order. When multiple credentials of the
same name are found, the first one found is used.
The globbing expression implements a restrictive subset of L<glob(7)>: only
a single trailing C<*> wildcard may be specified. Both C<?> and
C<[]> wildcards are not permitted, nor are C<*> wildcards anywhere
except at the end of the glob expression.
Optionally, the credential name or glob may be followed by a colon followed by a rename pattern.
If specified, all credentials matching the credential name or glob are renamed according to the given
pattern. For example, if C<ImportCredential=my.original.cred:my.renamed.cred> is
specified, the service manager will read the C<my.original.cred> credential and make
it available as the C<my.renamed.cred> credential to the service. Similarly, if
C<ImportCredential=my.original.*:my.renamed.> is specified, the service manager will
read all credentials starting with C<my.original.> and make them available as
C<my.renamed.xxx> to the service.
If C<ImportCredential> is specified multiple times and multiple credentials
end up with the same name after renaming, the first one is kept and later ones are dropped.
When multiple credentials of the same name are found, credentials found by
C<LoadCredential> and C<LoadCredentialEncrypted> take priority over
credentials found by C<ImportCredential>.",
'type' => 'leaf',
'value_type' => 'uniline'
},
'SetCredential',
{
lib/Config/Model/models/Systemd/Common/Exec.pl view on Meta::CPAN
C-style escaping (i.e. C<\\n> to embed a newline, or C<\\x00> to embed
a C<NUL> byte).
The C<SetCredentialEncrypted> setting is identical to
C<SetCredential> but expects an encrypted credential in literal form as value. This
allows embedding confidential credentials securely directly in unit files. Use
L<systemd-creds(1)>\'
C<-p> switch to generate suitable C<SetCredentialEncrypted> lines
directly from plaintext credentials. For further details see
C<LoadCredentialEncrypted> above.
When multiple credentials of the same name are found, credentials found by
C<LoadCredential>, C<LoadCredentialEncrypted> and
C<ImportCredential> take priority over credentials found by
C<SetCredential>. As such, C<SetCredential> will act as default if
no credentials are found by any of the former. In this case not being able to retrieve the credential
from the path specified in C<LoadCredential> or
C<LoadCredentialEncrypted> is not considered fatal.',
'type' => 'leaf',
'value_type' => 'uniline'
},
lib/Config/Model/models/Systemd/Common/Exec.pl view on Meta::CPAN
C-style escaping (i.e. C<\\n> to embed a newline, or C<\\x00> to embed
a C<NUL> byte).
The C<SetCredentialEncrypted> setting is identical to
C<SetCredential> but expects an encrypted credential in literal form as value. This
allows embedding confidential credentials securely directly in unit files. Use
L<systemd-creds(1)>\'
C<-p> switch to generate suitable C<SetCredentialEncrypted> lines
directly from plaintext credentials. For further details see
C<LoadCredentialEncrypted> above.
When multiple credentials of the same name are found, credentials found by
C<LoadCredential>, C<LoadCredentialEncrypted> and
C<ImportCredential> take priority over credentials found by
C<SetCredential>. As such, C<SetCredential> will act as default if
no credentials are found by any of the former. In this case not being able to retrieve the credential
from the path specified in C<LoadCredential> or
C<LoadCredentialEncrypted> is not considered fatal.',
'type' => 'leaf',
'value_type' => 'uniline'
},
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Connector/Builtin/Authentication/LDAP.pm view on Meta::CPAN
$userdn = $dn;
last;
}
}
# restore the connection using the orginal credentials
$self->rebind();
if(!defined $userdn) {
$self->log()->warn('Authentication failed');
return 0;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Context/Singleton/Tutorial.pod view on Meta::CPAN
=head1 TASK
Let's have an application handling web requests and emails, eg ticket system.
Application has config file providing database credentials.
=head1 IMPLEMENTATION
=head2 Root context resources
lib/Context/Singleton/Tutorial.pod view on Meta::CPAN
=item Override resources after using them
sub do_something {
my $db = deduce 'db';
my ($dsn, $user, $password) = $db->fetch_user_db_credentials;
frame {
proclaim db_dsn => $dsn;
proclaim db_user => $user;
proclaim db_password => $password;
# db will be recaluclated when requested
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
($args{host}, $args{port}) = ($1, $2);
}
}
else {
my @validArgs = ('host', 'port', 'username', 'password', 'publickey', 'privatekey', 'passphrase',
'prompt_credentials', 'baudrate', 'parity', 'databits', 'stopbits', 'handshake',
'errmode', 'connection_timeout', 'timeout', 'read_attempts', 'wake_console',
'return_reference', 'blocking', 'data_with_error', 'terminal_type', 'window_size',
'callback', 'forcebaud', 'atomic_connect');
%args = parseMethodArgs($pkgsub, \@_, \@validArgs);
}
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
baudrate => $args{baudrate},
parity => $args{parity},
databits => $args{databits},
stopbits => $args{stopbits},
handshake => $args{handshake},
prompt_credentials => defined $args{prompt_credentials} ? $args{prompt_credentials} : $self->{prompt_credentials},
terminal_type => $args{terminal_type},
window_size => $args{window_size},
callback => $args{callback},
forcebaud => $args{forcebaud},
atomic_connect => $args{atomic_connect},
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
sub login { # Handles steps necessary to get to CLI session, including menu, banner and Telnet/Serial login
my $pkgsub = "${Package}::login";
my $self =shift;
my @validArgs = ('username', 'password', 'prompt_credentials', 'timeout', 'errmode', 'return_reference',
'read_attempts', 'wake_console', 'blocking', 'data_with_error');
my %args = parseMethodArgs($pkgsub, \@_, \@validArgs);
# Initialize the base POLL structure
$self->poll_struct( # $methodName, $codeRef, $blocking, $timeout, $errmode, $outputType, $outputRequested, $returnReference, $returnList
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
);
$self->{POLL}{$pkgsub} = { # Populate structure with method arguments/storage
# Set method argument keys
username => $args{username},
password => $args{password},
prompt_credentials => defined $args{prompt_credentials} ? $args{prompt_credentials} : $self->{prompt_credentials},
read_attempts => defined $args{read_attempts} ? $args{read_attempts} : $LoginReadAttempts,
data_with_error => defined $args{data_with_error} ? $args{data_with_error} : $self->{data_with_error},
wake_console => defined $args{wake_console} ? $args{wake_console} : $self->{$Package}{wake_console},
# Declare method storage keys which will be used
stage => 0,
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
my %args;
if (@_ == 1) { # Method invoked with just the command argument
$args{password} = shift;
}
else {
my @validArgs = ('password', 'prompt_credentials', 'timeout', 'errmode', 'blocking');
%args = parseMethodArgs($pkgsub, \@_, \@validArgs);
}
# Initialize the base POLL structure
$self->poll_struct( # $methodName, $codeRef, $blocking, $timeout, $errmode, $outputType, $outputRequested, $returnReference, $returnList
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
undef, # n/a
);
$self->{POLL}{$pkgsub} = { # Populate structure with method arguments/storage
# Set method argument keys
enable_password => defined $args{password} ? $args{password} : $self->{$Package}{ENABLEPWD},
prompt_credentials => defined $args{prompt_credentials} ? $args{prompt_credentials} : $self->{prompt_credentials},
# Declare method storage keys which will be used
stage => 0,
login_attempted => undef,
password_sent => undef,
login_failed => undef,
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
sub device_peer_cpu { # Connect to peer CPU on ERS8x00 / VSP9000
my $pkgsub = "${Package}::device_peer_cpu";
my $self = shift;
my $familyType;
my @validArgs = ('username', 'password', 'prompt_credentials', 'timeout', 'errmode', 'blocking');
my %args = parseMethodArgs($pkgsub, \@_, \@validArgs);
# Initialize the base POLL structure
$self->poll_struct( # $methodName, $codeRef, $blocking, $timeout, $errmode, $outputType, $outputRequested, $returnReference, $returnList
$pkgsub,
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
);
$self->{POLL}{$pkgsub} = { # Populate structure with method arguments/storage
# Set method argument keys
username => defined $args{username} ? $args{username} : $self->username,
password => defined $args{password} ? $args{password} : $self->password,
prompt_credentials => defined $args{prompt_credentials} ? $args{prompt_credentials} : $self->{prompt_credentials},
# Declare method storage keys which will be used
stage => 0,
};
local $self->{POLLING} = 1; # True until we come out of this polling-capable method
local $self->{errmode} = $self->{POLL}{errmode} if defined $self->{POLL}{errmode};
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
}
#################################### Methods to set/read Object variables ####################################
sub flush_credentials { # Clear the stored username, password, passphrases, and enable password, if any
my $self = shift;
$self->SUPER::flush_credentials;
$self->{$Package}{ENABLEPWD} = undef;
return 1;
}
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
croak "$pollsub (called from $fileName line $lineNumber) can only be used within polled methods";
}
unless (defined $self->{POLL}{$pollsub}) { # Only applicable if called from another method already in polling mode
my @validArgs = ('host', 'port', 'username', 'password', 'publickey', 'privatekey', 'passphrase',
'prompt_credentials', 'baudrate', 'parity', 'databits', 'stopbits', 'handshake',
'errmode', 'connection_timeout', 'login_timeout', 'read_attempts', 'wake_console',
'data_with_error', 'terminal_type', 'window_size', 'callback', 'forcebaud',
'atomic_connect');
my %args = parseMethodArgs($pkgsub, \@_, \@validArgs, 1);
if (@_ && !%args) { # Legacy syntax
($args{host}, $args{port}, $args{username}, $args{password}, $args{publickey}, $args{privatekey},
$args{passphrase}, $args{baudrate}, $args{parity}, $args{databits}, $args{stopbits},
$args{handshake}, $args{prompt_credentials}, $args{read_attempts}, $args{wake_console},
$args{connection_timeout}, $args{login_timeout}, $args{errmode}) = @_;
}
# In which case we need to setup the poll structure for them here (the main poll structure remains unchanged)
$self->{POLL}{$pollsub} = { # Populate structure with method arguments/storage
# Set method argument keys
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
baudrate => $args{baudrate},
parity => $args{parity},
databits => $args{databits},
stopbits => $args{stopbits},
handshake => $args{handshake},
prompt_credentials => defined $args{prompt_credentials} ? $args{prompt_credentials} : $self->{prompt_credentials},
terminal_type => $args{terminal_type},
window_size => $args{window_size},
callback => $args{callback},
forcebaud => $args{forcebaud},
atomic_connect => $args{atomic_connect},
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
ForceBaud => $connect->{forcebaud},
Parity => $connect->{parity},
DataBits => $connect->{databits},
StopBits => $connect->{stopbits},
Handshake => $connect->{handshake},
Prompt_credentials => $connect->{prompt_credentials},
Terminal_type => $connect->{terminal_type},
Window_size => $connect->{window_size},
Callback => $connect->{callback},
Atomic_connect => $connect->{atomic_connect},
);
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
my ($ok, $outRef) = $self->poll_login($pkgsub,
Username => $connect->{username},
Password => $connect->{password},
Read_attempts => $connect->{read_attempts},
Wake_console => $connect->{wake_console},
Prompt_credentials => $connect->{prompt_credentials},
Data_with_error => $connect->{data_with_error},
Timeout => $connect->{login_timeout},
);
$self->{POLL}{output_buffer} = $$outRef if $ok;
return $self->poll_return($ok);
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
my (undef, $fileName, $lineNumber) = caller;
croak "$pollsub (called from $fileName line $lineNumber) can only be used within polled methods";
}
unless (defined $self->{POLL}{$pollsub}) { # Only applicable if called from another method already in polling mode
my @validArgs = ('username', 'password', 'prompt_credentials', 'timeout', 'errmode', 'read_attempts', 'wake_console', 'data_with_error');
my %args = parseMethodArgs($pkgsub, \@_, \@validArgs, 1);
if (@_ && !%args) { # Legacy syntax
($args{username}, $args{password}, $args{read_attempts}, $args{wake_console},
$args{prompt_credentials}, $args{data_with_error}, $args{timeout}, $args{errmode}) = @_;
}
# In which case we need to setup the poll structure for them here (the main poll structure remains unchanged)
$self->{POLL}{$pollsub} = { # Populate structure with method arguments/storage
# Set method argument keys
username => defined $args{username} ? $args{username} : $self->{USERNAME},
password => defined $args{password} ? $args{password} : $self->{PASSWORD},
read_attempts => defined $args{read_attempts} ? $args{read_attempts} : $LoginReadAttempts,
data_with_error => defined $args{data_with_error} ? $args{data_with_error} : $self->{data_with_error},
wake_console => defined $args{wake_console} ? $args{wake_console} : $self->{$Package}{wake_console},
prompt_credentials => defined $args{prompt_credentials} ? $args{prompt_credentials} : $self->{prompt_credentials},
# Declare method storage keys which will be used
stage => 0,
login_attempted => undef,
password_sent => undef,
login_error => '',
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
unless ($login->{username}) {
if ($self->{TYPE} eq 'SSH') { # If an SSH connection, we already have the username
$login->{username} = $self->{USERNAME};
}
else {
unless ($login->{prompt_credentials}) {
$self->{LOGINSTAGE} = 'username';
return $self->poll_return($self->error("$pkgsub: Username required"));
}
$login->{username} = promptCredential($login->{prompt_credentials}, 'Clear', 'Username');
}
}
$self->print(line => $login->{username}, errmode => 'return')
or return $self->poll_return($self->error("$pkgsub: Unable to send username // ".$self->errmsg));
$self->{LOGINSTAGE} = '';
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
if ($login->{password_sent}) {
$self->{LOGINSTAGE} = 'password';
return $self->poll_return($self->error("$pkgsub: Incorrect Username or Password"));
}
unless ($login->{password}) {
unless ($login->{prompt_credentials}) {
$self->{LOGINSTAGE} = 'password';
return $self->poll_return($self->error("$pkgsub: Password required"));
}
$login->{password} = promptCredential($login->{prompt_credentials}, 'Hide', 'Password');
}
$self->print(line => $login->{password}, errmode => 'return')
or return $self->poll_return($self->error("$pkgsub: Unable to send password // ".$self->errmsg));
$self->{LOGINSTAGE} = '';
$login->{password_sent} = 1;
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
$self->_setAttrib('is_dual_cpu', 1) if $self->{LASTPROMPT} =~ /^@/;
}
$self->_setAttrib('family_type', $login->{family_type}) if $login->{detectionFromPrompt};
}
# Store credentials if these were used
($self->{USERNAME}, $self->{PASSWORD}) = ($login->{username}, $login->{password}) if $login->{login_attempted};
return $self->poll_return(1);
}
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
my (undef, $fileName, $lineNumber) = caller;
croak "$pollsub (called from $fileName line $lineNumber) can only be used within polled methods";
}
unless (defined $self->{POLL}{$pollsub}) { # Only applicable if called from another method already in polling mode
my @validArgs = ('password', 'prompt_credentials', 'timeout', 'errmode');
my %args = parseMethodArgs($pkgsub, \@_, \@validArgs, 1);
if (@_ && !%args) { # Legacy syntax
($args{password}, $args{prompt_credentials}, $args{timeout}, $args{errmode}) = @_;
}
# In which case we need to setup the poll structure for them here (the main poll structure remains unchanged)
$self->{POLL}{$pollsub} = { # Populate structure with method arguments/storage
# Set method argument keys
enable_password => defined $args{password} ? $args{password} : $self->{$Package}{ENABLEPWD},
prompt_credentials => defined $args{prompt_credentials} ? $args{prompt_credentials} : $self->{prompt_credentials},
# Declare method storage keys which will be used
stage => 0,
login_attempted => undef,
login_failed => undef,
# Declare keys to be set if method called from another polled method
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
$self->debugMsg(4,"enable() Sending login password for enable password\n");
$self->print(line => $enablePwd, errmode => 'return')
or return $self->poll_return($self->error("$pkgsub: Unable to send cached password // ".$self->errmsg));
}
else { # Third try; prompt?
if ($enable->{prompt_credentials}) {
$enablePwd = promptCredential($enable->{prompt_credentials}, 'Hide', 'Enable Password');
$self->print(line => $enablePwd, errmode => 'return')
or return $self->poll_return($self->error("$pkgsub: Unable to send enable password // ".$self->errmsg));
}
else { # Enter blanks
$enablePwd = '';
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
my (undef, $fileName, $lineNumber) = caller;
croak "$pollsub (called from $fileName line $lineNumber) can only be used within polled methods";
}
unless (defined $self->{POLL}{$pollsub}) { # Only applicable if called from another method already in polling mode
my @validArgs = ('username', 'password', 'prompt_credentials', 'timeout', 'errmode');
my %args = parseMethodArgs($pkgsub, \@_, \@validArgs, 1);
if (@_ && !%args) { # Legacy syntax
($args{username}, $args{password}, $args{prompt_credentials}, $args{timeout}, $args{errmode}) = @_;
}
# In which case we need to setup the poll structure for them here (the main poll structure remains unchanged)
$self->{POLL}{$pollsub} = { # Populate structure with method arguments/storage
# Set method argument keys
username => defined $args{username} ? $args{username} : $self->username,
password => defined $args{password} ? $args{password} : $self->password,
prompt_credentials => defined $args{prompt_credentials} ? $args{prompt_credentials} : $self->{prompt_credentials},
# Declare method storage keys which will be used
stage => 0,
# Declare keys to be set if method called from another polled method
errmode => $args{errmode},
};
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
return $self->poll_return($self->error("$pkgsub: Attribute family_type not set"));
}
unless ($familyType eq $Prm{pers}) {
return $self->poll_return($self->error("$pkgsub: No peer CPU on family_type $familyType"));
}
unless (($devPeerCpu->{username} && $devPeerCpu->{password}) || $devPeerCpu->{prompt_credentials}) {
return $self->poll_return($self->error("$pkgsub: Username & password required"));
}
$devPeerCpu->{stage}++; # Move to 2nd stage
}
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
if ($devPeerCpu->{stage} < 3) { # 3rd stage
my $ok = $self->poll_waitfor($pkgsub, 'Login: $', undef, 'return');
return $self->poll_return($self->error("$pkgsub: Never got peer login prompt // ".$self->errmsg)) unless defined $ok;
return $self->poll_return($ok) unless $ok;
$devPeerCpu->{username} = promptCredential($devPeerCpu->{prompt_credentials}, 'Clear', 'Username') unless defined $devPeerCpu->{username};
$self->print(line => $devPeerCpu->{username}, errmode => 'return')
or return $self->poll_return($self->error("$pkgsub: Unable to send username // ".$self->errmsg));
$devPeerCpu->{stage}++; # Move to 4th stage
}
if ($devPeerCpu->{stage} < 4) { # 4th stage
my $ok = $self->poll_waitfor($pkgsub, 'Password: $', undef, 'return');
return $self->poll_return($self->error("$pkgsub: Never got peer password prompt // ".$self->errmsg)) unless defined $ok;
return $self->poll_return($ok) unless $ok;
$devPeerCpu->{password} = promptCredential($devPeerCpu->{prompt_credentials}, 'Hide', 'Password') unless defined $devPeerCpu->{password};
$self->print(line => $devPeerCpu->{password}, errmode => 'return')
or return $self->poll_return($self->error("$pkgsub: Unable to send password // ".$self->errmsg));
$devPeerCpu->{stage}++; # Move to last stage
}
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
[Password_prompt => $passwordPrompt,]
[Input_log => $fhOrFilename,]
[Output_log => $fhOrFilename,]
[Dump_log => $fhOrFilename,]
[Blocking => $flag,]
[Prompt_credentials => $flag,]
[Read_attempts => $numberOfReadAttemps,]
[Readwait_timer => $millisecs,]
[Data_with_error => $flag,]
[Read_block_size => $bytes,]
[Output_record_separator => $ors,]
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
[Username => $username,]
[Password => $password,]
[PublicKey => $publicKey,]
[PrivateKey => $privateKey,]
[Passphrase => $passphrase,]
[Prompt_credentials => $flag,]
[BaudRate => $baudRate,]
[ForceBaud => $flag,]
[Parity => $parity,]
[DataBits => $dataBits,]
[StopBits => $stopBits,]
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
[Username => $username,]
[Password => $password,]
[PublicKey => $publicKey,]
[PrivateKey => $privateKey,]
[Passphrase => $passphrase,]
[Prompt_credentials => $flag,]
[BaudRate => $baudRate,]
[ForceBaud => $flag,]
[Parity => $parity,]
[DataBits => $dataBits,]
[StopBits => $stopBits,]
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
This method overrides Control::CLI::connect() and calls both the Control::CLI::connect() method as well as the login() method from this class. This allows the connect() method to seamlessly handle connection and login for both SSH (which normally han...
In non-blocking mode (blocking disabled) the connect() method will immediately return with a false, but defined, value of 0. You will then need to call the connect_poll() method at regular intervals until it returns a true (1) value indicating that t...
The "host" argument is required by both Telnet and SSH. All the other arguments are optional.
If username/password or SSH Passphrase are not provided but are required and prompt_credentials is true, the method will automatically prompt the user for them; otherwise the error mode action is performed. The "errmode" argument is provided to overr...
The "prompt_credentials" argument is provided to override the global setting of the parameter by the same name which is by default false. See prompt_credentials().
The "read_attempts" argument is simply fed to the login() method. See login().
The "connection_timeout" argument can be used to set a connection timeout when establishing Telnet and SSH TCP connections; this is fed to Control::CLI::connect(). Whereas the "timeout" argument is the normal timeout used for reading the connection o...
The "terminal_type" and "window_size" arguments are Control::CLI arguments and are not overrides, they will change the object parameter as these settings are only applied during a connection. It is not necessary to set these for Avaya devices.
Which other arguments are used depends on the whether the object was created for Telnet, SSH or Serial port.
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
$ok = $obj->connect(
Host => $host,
[Port => $port,]
[Username => $username,]
[Password => $password,]
[Prompt_credentials => $flag,]
[Timeout => $secs,]
[Connection_timeout => $secs,]
[Read_attempts => $numberOfLoginReadAttemps,]
[Data_with_error => $flag,]
[Wake_console => $string,]
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
[Username => $username,]
[Password => $password,]
[PublicKey => $publicKey,]
[PrivateKey => $privateKey,]
[Passphrase => $passphrase,]
[Prompt_credentials => $flag,]
[Timeout => $secs,]
[Connection_timeout => $secs,]
[Read_attempts => $numberOfLoginReadAttemps,]
[Data_with_error => $flag,]
[Wake_console => $string,]
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
[Atomic_connect => $flag,]
);
If not specified, the default port number for SSH is 22. The wake_console argument is only relevant when connecting to a SSH port other than 22 (i.e. to a Terminal Server device) or if console() has been manually set; see console(). In which case, th...
A username must always be provided for all SSH connections. If not provided and prompt_credentials is true then this method will prompt for it.
Once the SSH conection is established, this method will attempt one of two possible authentication types, based on the accepted authentications of the remote host:
=over 4
=item *
B<Publickey authentication> : If the remote host accepts it and the method was supplied with public/private keys. The public/private keys need to be in OpenSSH format. If the private key is protected by a passphrase then this must also be provided or...
=item *
B<Password authentication> : If the remote host accepts either 'password' or 'keyboard-interactive' authentication methods. A password must be provided or, if prompt_credentials is true, this method will prompt for the password. If password authentic...
=back
=item *
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
[DataBits => $dataBits,]
[StopBits => $stopBits,]
[Handshake => $handshake,]
[Username => $username,]
[Password => $password,]
[Prompt_credentials => $flag,]
[Timeout => $secs,]
[Read_attempts => $numberOfLoginReadAttemps,]
[Data_with_error => $flag,]
[Wake_console => $string,]
[Blocking => $flag,]
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
=item B<login() & login_poll()> - handle login for Telnet / Serial port; also set the host CLI prompt
$ok = $obj->login(
[Username => $username,]
[Password => $password,]
[Prompt_credentials => $flag,]
[Timeout => $secs,]
[Read_attempts => $numberOfLoginReadAttemps,]
[Data_with_error => $flag,]
[Wake_console => $string,]
[Blocking => $flag,]
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
);
($ok, $output || $outputRef) = $obj->login(
[Username => $username,]
[Password => $password,]
[Prompt_credentials => $flag,]
[Timeout => $secs,]
[Return_reference => $flag,]
[Read_attempts => $numberOfLoginReadAttemps,]
[Data_with_error => $flag,]
[Wake_console => $string,]
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
$ok = $obj->enable($enablePassword);
$ok = $obj->enable(
[Password => $enablePassword,]
[Prompt_credentials => $flag,]
[Blocking => $flag,]
[Timeout => $secs,]
[Errmode => $errmode,]
);
$ok = $obj->enable_poll(); # Only applicable in non-blocking mode
This method checks whether the 'is_acli' attribute is set and, if so, whether the last prompt ends with '>'; if both conditions are true, it will flush any unread pending input from the device and will just send an 'enable' command to enter Priviledg...
The method can take a password argument which only applies to the WLAN2300 series and in some older software versions of the ERS-8300 in NNCLI mode.
If a password is required, but not supplied, this method will try supplying first a blank password, then the same password which was used to connect/login and finally, if prompt_credentials is true for the object, prompt for it. On I/O failure, the e...
The optional "prompt_credentials" argument is provided to override the global setting of the parameter by the same name which is by default false. See prompt_credentials().
In non-blocking mode (blocking disabled), the enable() method will most likely immediately return with a false, but defined, value of 0. You will then need to call the enable_poll() method at regular intervals until it returns a true (1) value indica...
$ok = $obj->enable(Blocking => 0);
until ($ok) {
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
=item B<device_peer_cpu() & device_peer_cpu_poll()> - Connect to peer CPU on ERS8x00 / VSP9000
$ok = $obj->device_peer_cpu(
[Username => $username,]
[Password => $password,]
[Prompt_credentials => $flag,]
[Blocking => $flag,]
[Timeout => $secs,]
[Errmode => $errmode,]
);
$ok = $obj->device_peer_cpu_poll(); # Only applicable in non-blocking mode
This method, only applicable on ERS8x00 and VSP9000, will try to connect to the peer CPU. On success a true (1) value is returned otherwise the error mode action is performed. See errmode().
It should not normally be necessary to provide username/password since the credentials used to connect to the current CPU will automatically be used. If not so, or to override the cached ones, optional "username" & "password" arguments can be provide...
Attributes 'cpu_slot' and 'is_master_cpu' are automatically updated once the connection to the peer CPU succeeds. See attribute().
In non-blocking mode (blocking disabled), the device_peer_cpu() method will most likely immediately return with a false, but defined, value of 0. You will then need to call the device_peer_cpu_poll() method at regular intervals until it returns a tru...
$ok = $obj->device_peer_cpu(Blocking => 0);
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
=head2 Methods to set/read Object variables
=over 4
=item B<flush_credentials> - flush the stored username, password, passphrase and enable password credentials
$obj->flush_credentials;
The connect(), login() and enable() methods, if successful in authenticating, will automatically store the username/password/enable-password or SSH passphrase supplied to them.
These can be retrieved via the username, password, passphrase and enable_password methods. If you do not want these to persist in memory once the authentication has completed, use this method to flush them. This method always returns 1.
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
=item B<return_reference()> - set whether read methods should return a hard reference or not
=item B<output_record_separator()> - set the Output Record Separator automatically appended by print & cmd methods
=item B<prompt_credentials()> - set whether connect() and login() methods should be able to prompt for credentials
=item B<username_prompt()> - set the login() username prompt match pattern for this object
=item B<password_prompt()> - set the login() password prompt match pattern for this object
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
[Username => $username,]
[Password => $password,]
[PublicKey => $publicKey,]
[PrivateKey => $privateKey,]
[Passphrase => $passphrase,]
[Prompt_credentials => $flag,]
[BaudRate => $baudRate,]
[Parity => $parity,]
[DataBits => $dataBits,]
[StopBits => $stopBits,]
[Handshake => $handshake,]
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
[Username => $username,]
[Password => $password,]
[PublicKey => $publicKey,]
[PrivateKey => $privateKey,]
[Passphrase => $passphrase,]
[Prompt_credentials => $flag,]
[BaudRate => $baudRate,]
[Parity => $parity,]
[DataBits => $dataBits,]
[StopBits => $stopBits,]
[Handshake => $handshake,]
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
=item B<poll_login()> - performs a non-blocking poll for login()
$ok = $obj->poll_login($pkgsub,
[Username => $username,]
[Password => $password,]
[Prompt_credentials => $flag,]
[Timeout => $secs,]
[Read_attempts => $numberOfLoginReadAttemps,]
[Data_with_error => $flag,]
[Wake_console => $string,]
[Errmode => $errmode,]
);
($ok, $outputref) = $obj->poll_login($pkgsub,
[Username => $username,]
[Password => $password,]
[Prompt_credentials => $flag,]
[Timeout => $secs,]
[Read_attempts => $numberOfLoginReadAttemps,]
[Data_with_error => $flag,]
[Wake_console => $string,]
[Errmode => $errmode,]
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
$ok = $obj->poll_enable($pkgsub, $password);
$ok = $obj->poll_enable($pkgsub,
[Password => $enablePassword,]
[Prompt_credentials => $flag,]
[Timeout => $secs,]
[Errmode => $errmode,]
);
Normally this is the internal method used by enable() and enable_poll() methods.
lib/Control/CLI/AvayaData.pm view on Meta::CPAN
=item B<poll_device_peer_cpu()> - performs a non-blocking poll for device_peer_cpu()
$ok = $obj->poll_device_peer_cpu($pkgsub,
[Username => $username,]
[Password => $password,]
[Prompt_credentials => $flag,]
[Timeout => $secs,]
[Errmode => $errmode,]
);
Normally this is the internal method used by device_peer_cpu() and device_peer_cpu_poll() methods.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Control/CLI/Extreme.pm view on Meta::CPAN
($args{host}, $args{port}) = ($1, $2);
}
}
else {
my @validArgs = ('host', 'port', 'username', 'password', 'publickey', 'privatekey', 'passphrase',
'prompt_credentials', 'baudrate', 'parity', 'databits', 'stopbits', 'handshake',
'errmode', 'connection_timeout', 'timeout', 'read_attempts', 'wake_console',
'return_reference', 'blocking', 'data_with_error', 'terminal_type', 'window_size',
'callback', 'forcebaud', 'atomic_connect', 'non_recognized_login', 'generic_login');
%args = parseMethodArgs($pkgsub, \@_, \@validArgs);
}
lib/Control/CLI/Extreme.pm view on Meta::CPAN
baudrate => $args{baudrate},
parity => $args{parity},
databits => $args{databits},
stopbits => $args{stopbits},
handshake => $args{handshake},
prompt_credentials => defined $args{prompt_credentials} ? $args{prompt_credentials} : $self->{prompt_credentials},
terminal_type => $args{terminal_type},
window_size => $args{window_size},
callback => $args{callback},
forcebaud => $args{forcebaud},
atomic_connect => $args{atomic_connect},
lib/Control/CLI/Extreme.pm view on Meta::CPAN
sub login { # Handles steps necessary to get to CLI session, including menu, banner and Telnet/Serial login
my $pkgsub = "${Package}::login";
my $self =shift;
my @validArgs = ('username', 'password', 'prompt_credentials', 'timeout', 'errmode', 'return_reference',
'read_attempts', 'wake_console', 'blocking', 'data_with_error', 'non_recognized_login', 'generic_login');
my %args = parseMethodArgs($pkgsub, \@_, \@validArgs);
# Initialize the base POLL structure
$self->poll_struct( # $methodName, $codeRef, $blocking, $timeout, $errmode, $outputType, $outputRequested, $returnReference, $returnList
lib/Control/CLI/Extreme.pm view on Meta::CPAN
);
$self->{POLL}{$pkgsub} = { # Populate structure with method arguments/storage
# Set method argument keys
username => $args{username},
password => $args{password},
prompt_credentials => defined $args{prompt_credentials} ? $args{prompt_credentials} : $self->{prompt_credentials},
read_attempts => defined $args{read_attempts} ? $args{read_attempts} : $LoginReadAttempts,
data_with_error => defined $args{data_with_error} ? $args{data_with_error} : $self->{data_with_error},
wake_console => defined $args{wake_console} ? $args{wake_console} : $self->{$Package}{wake_console},
non_recognized_login => defined $args{non_recognized_login} ? $args{non_recognized_login} : $NonRecognizedLogin,
generic_login => defined $args{generic_login} ? $args{generic_login} : $GenericLogin,
lib/Control/CLI/Extreme.pm view on Meta::CPAN
my %args;
if (@_ == 1) { # Method invoked with just the command argument
$args{password} = shift;
}
else {
my @validArgs = ('password', 'prompt_credentials', 'timeout', 'errmode', 'blocking');
%args = parseMethodArgs($pkgsub, \@_, \@validArgs);
}
# Initialize the base POLL structure
$self->poll_struct( # $methodName, $codeRef, $blocking, $timeout, $errmode, $outputType, $outputRequested, $returnReference, $returnList
lib/Control/CLI/Extreme.pm view on Meta::CPAN
undef, # n/a
);
$self->{POLL}{$pkgsub} = { # Populate structure with method arguments/storage
# Set method argument keys
enable_password => defined $args{password} ? $args{password} : $self->{$Package}{ENABLEPWD},
prompt_credentials => defined $args{prompt_credentials} ? $args{prompt_credentials} : $self->{prompt_credentials},
# Declare method storage keys which will be used
stage => 0,
login_attempted => undef,
password_sent => undef,
login_failed => undef,
lib/Control/CLI/Extreme.pm view on Meta::CPAN
sub device_peer_cpu { # Connect to peer CPU on ERS8x00 / VSP9000
my $pkgsub = "${Package}::device_peer_cpu";
my $self = shift;
my $familyType;
my @validArgs = ('username', 'password', 'prompt_credentials', 'timeout', 'errmode', 'blocking');
my %args = parseMethodArgs($pkgsub, \@_, \@validArgs);
# Initialize the base POLL structure
$self->poll_struct( # $methodName, $codeRef, $blocking, $timeout, $errmode, $outputType, $outputRequested, $returnReference, $returnList
$pkgsub,
lib/Control/CLI/Extreme.pm view on Meta::CPAN
);
$self->{POLL}{$pkgsub} = { # Populate structure with method arguments/storage
# Set method argument keys
username => defined $args{username} ? $args{username} : $self->username,
password => defined $args{password} ? $args{password} : $self->password,
prompt_credentials => defined $args{prompt_credentials} ? $args{prompt_credentials} : $self->{prompt_credentials},
# Declare method storage keys which will be used
stage => 0,
};
local $self->{POLLING} = 1; # True until we come out of this polling-capable method
local $self->{errmode} = $self->{POLL}{errmode} if defined $self->{POLL}{errmode};
lib/Control/CLI/Extreme.pm view on Meta::CPAN
}
#################################### Methods to set/read Object variables ####################################
sub flush_credentials { # Clear the stored username, password, passphrases, and enable password, if any
my $self = shift;
$self->SUPER::flush_credentials;
$self->{$Package}{ENABLEPWD} = undef;
return 1;
}
lib/Control/CLI/Extreme.pm view on Meta::CPAN
croak "$pollsub (called from $fileName line $lineNumber) can only be used within polled methods";
}
unless (defined $self->{POLL}{$pollsub}) { # Only applicable if called from another method already in polling mode
my @validArgs = ('host', 'port', 'username', 'password', 'publickey', 'privatekey', 'passphrase',
'prompt_credentials', 'baudrate', 'parity', 'databits', 'stopbits', 'handshake',
'errmode', 'connection_timeout', 'login_timeout', 'read_attempts', 'wake_console',
'data_with_error', 'terminal_type', 'window_size', 'callback', 'forcebaud',
'atomic_connect', 'non_recognized_login', 'generic_login');
my %args = parseMethodArgs($pkgsub, \@_, \@validArgs, 1);
if (@_ && !%args) { # Legacy syntax
($args{host}, $args{port}, $args{username}, $args{password}, $args{publickey}, $args{privatekey},
$args{passphrase}, $args{baudrate}, $args{parity}, $args{databits}, $args{stopbits},
$args{handshake}, $args{prompt_credentials}, $args{read_attempts}, $args{wake_console},
$args{connection_timeout}, $args{login_timeout}, $args{errmode}) = @_;
}
# In which case we need to setup the poll structure for them here (the main poll structure remains unchanged)
$self->{POLL}{$pollsub} = { # Populate structure with method arguments/storage
# Set method argument keys
lib/Control/CLI/Extreme.pm view on Meta::CPAN
baudrate => $args{baudrate},
parity => $args{parity},
databits => $args{databits},
stopbits => $args{stopbits},
handshake => $args{handshake},
prompt_credentials => defined $args{prompt_credentials} ? $args{prompt_credentials} : $self->{prompt_credentials},
terminal_type => $args{terminal_type},
window_size => $args{window_size},
callback => $args{callback},
forcebaud => $args{forcebaud},
atomic_connect => $args{atomic_connect},
lib/Control/CLI/Extreme.pm view on Meta::CPAN
ForceBaud => $connect->{forcebaud},
Parity => $connect->{parity},
DataBits => $connect->{databits},
StopBits => $connect->{stopbits},
Handshake => $connect->{handshake},
Prompt_credentials => $connect->{prompt_credentials},
Terminal_type => $connect->{terminal_type},
Window_size => $connect->{window_size},
Callback => $connect->{callback},
Atomic_connect => $connect->{atomic_connect},
);
lib/Control/CLI/Extreme.pm view on Meta::CPAN
Read_attempts => $connect->{read_attempts},
Wake_console => $connect->{wake_console},
Data_with_error => $connect->{data_with_error},
Non_recognized_login => $connect->{non_recognized_login},
Generic_login => $connect->{generic_login},
Prompt_credentials => $connect->{prompt_credentials},
Timeout => $connect->{login_timeout},
);
$self->{POLL}{output_buffer} = $$outRef if $ok;
return $self->poll_return($ok);
}
lib/Control/CLI/Extreme.pm view on Meta::CPAN
my (undef, $fileName, $lineNumber) = caller;
croak "$pollsub (called from $fileName line $lineNumber) can only be used within polled methods";
}
unless (defined $self->{POLL}{$pollsub}) { # Only applicable if called from another method already in polling mode
my @validArgs = ('username', 'password', 'prompt_credentials', 'timeout', 'errmode', 'read_attempts', 'wake_console',
'data_with_error', 'non_recognized_login', 'generic_login');
my %args = parseMethodArgs($pkgsub, \@_, \@validArgs, 1);
if (@_ && !%args) { # Legacy syntax
($args{username}, $args{password}, $args{read_attempts}, $args{wake_console},
$args{prompt_credentials}, $args{data_with_error}, $args{timeout}, $args{errmode}) = @_;
}
# In which case we need to setup the poll structure for them here (the main poll structure remains unchanged)
$self->{POLL}{$pollsub} = { # Populate structure with method arguments/storage
# Set method argument keys
username => defined $args{username} ? $args{username} : $self->{USERNAME},
password => defined $args{password} ? $args{password} : $self->{PASSWORD},
prompt_credentials => defined $args{prompt_credentials} ? $args{prompt_credentials} : $self->{prompt_credentials},
read_attempts => defined $args{read_attempts} ? $args{read_attempts} : $LoginReadAttempts,
data_with_error => defined $args{data_with_error} ? $args{data_with_error} : $self->{data_with_error},
wake_console => defined $args{wake_console} ? $args{wake_console} : $self->{$Package}{wake_console},
non_recognized_login => defined $args{non_recognized_login} ? $args{non_recognized_login} : $NonRecognizedLogin,
generic_login => defined $args{generic_login} ? $args{generic_login} : $GenericLogin,
lib/Control/CLI/Extreme.pm view on Meta::CPAN
unless ($login->{username}) {
if ($self->{TYPE} eq 'SSH') { # If an SSH connection, we already have the username
$login->{username} = $self->{USERNAME};
}
else {
unless ($login->{prompt_credentials}) {
$self->{LOGINSTAGE} = 'username';
return $self->poll_return($self->error("$pkgsub: Username required"));
}
$login->{username} = promptCredential($login->{prompt_credentials}, 'Clear', 'Username');
}
}
$self->print(line => $login->{username}, errmode => 'return')
or return $self->poll_return($self->error("$pkgsub: Unable to send username // ".$self->errmsg));
$self->{LOGINSTAGE} = '';
lib/Control/CLI/Extreme.pm view on Meta::CPAN
if ($login->{password_sent}) {
$self->{LOGINSTAGE} = 'password';
return $self->poll_return($self->error("$pkgsub: Incorrect Username or Password"));
}
unless (defined $login->{password}) {
unless ($login->{prompt_credentials}) {
$self->{LOGINSTAGE} = 'password';
return $self->poll_return($self->error("$pkgsub: Password required"));
}
$login->{password} = promptCredential($login->{prompt_credentials}, 'Hide', 'Password');
}
$self->print(line => $login->{password}, errmode => 'return')
or return $self->poll_return($self->error("$pkgsub: Unable to send password // ".$self->errmsg));
$self->{LOGINSTAGE} = '';
$login->{password_sent} = 1;
lib/Control/CLI/Extreme.pm view on Meta::CPAN
$self->_setAttrib('is_dual_cpu', 1) if $self->{LASTPROMPT} =~ /^@/;
}
$self->_setFamilyTypeAttrib($login->{family_type}) if $login->{detectionFromPrompt};
}
# Store credentials if these were used
($self->{USERNAME}, $self->{PASSWORD}) = ($login->{username}, $login->{password}) if $login->{login_attempted};
return $self->poll_return(1);
}
lib/Control/CLI/Extreme.pm view on Meta::CPAN
my (undef, $fileName, $lineNumber) = caller;
croak "$pollsub (called from $fileName line $lineNumber) can only be used within polled methods";
}
unless (defined $self->{POLL}{$pollsub}) { # Only applicable if called from another method already in polling mode
my @validArgs = ('password', 'prompt_credentials', 'timeout', 'errmode');
my %args = parseMethodArgs($pkgsub, \@_, \@validArgs, 1);
if (@_ && !%args) { # Legacy syntax
($args{password}, $args{prompt_credentials}, $args{timeout}, $args{errmode}) = @_;
}
# In which case we need to setup the poll structure for them here (the main poll structure remains unchanged)
$self->{POLL}{$pollsub} = { # Populate structure with method arguments/storage
# Set method argument keys
enable_password => defined $args{password} ? $args{password} : $self->{$Package}{ENABLEPWD},
prompt_credentials => defined $args{prompt_credentials} ? $args{prompt_credentials} : $self->{prompt_credentials},
# Declare method storage keys which will be used
stage => 0,
login_attempted => undef,
login_failed => undef,
# Declare keys to be set if method called from another polled method
lib/Control/CLI/Extreme.pm view on Meta::CPAN
$self->debugMsg(4,"enable() Sending login password for enable password\n");
$self->print(line => $enablePwd, errmode => 'return')
or return $self->poll_return($self->error("$pkgsub: Unable to send cached password // ".$self->errmsg));
}
else { # Third try; prompt?
if ($enable->{prompt_credentials}) {
$enablePwd = promptCredential($enable->{prompt_credentials}, 'Hide', 'Enable Password');
$self->print(line => $enablePwd, errmode => 'return')
or return $self->poll_return($self->error("$pkgsub: Unable to send enable password // ".$self->errmsg));
}
else { # Enter blanks
$enablePwd = '';
lib/Control/CLI/Extreme.pm view on Meta::CPAN
my (undef, $fileName, $lineNumber) = caller;
croak "$pollsub (called from $fileName line $lineNumber) can only be used within polled methods";
}
unless (defined $self->{POLL}{$pollsub}) { # Only applicable if called from another method already in polling mode
my @validArgs = ('username', 'password', 'prompt_credentials', 'timeout', 'errmode');
my %args = parseMethodArgs($pkgsub, \@_, \@validArgs, 1);
if (@_ && !%args) { # Legacy syntax
($args{username}, $args{password}, $args{prompt_credentials}, $args{timeout}, $args{errmode}) = @_;
}
# In which case we need to setup the poll structure for them here (the main poll structure remains unchanged)
$self->{POLL}{$pollsub} = { # Populate structure with method arguments/storage
# Set method argument keys
username => defined $args{username} ? $args{username} : $self->username,
password => defined $args{password} ? $args{password} : $self->password,
prompt_credentials => defined $args{prompt_credentials} ? $args{prompt_credentials} : $self->{prompt_credentials},
# Declare method storage keys which will be used
stage => 0,
# Declare keys to be set if method called from another polled method
errmode => $args{errmode},
};
lib/Control/CLI/Extreme.pm view on Meta::CPAN
return $self->poll_return($self->error("$pkgsub: Attribute family_type not set"));
}
unless ($familyType eq $Prm{pers}) {
return $self->poll_return($self->error("$pkgsub: No peer CPU on family_type $familyType"));
}
unless (($devPeerCpu->{username} && $devPeerCpu->{password}) || $devPeerCpu->{prompt_credentials}) {
return $self->poll_return($self->error("$pkgsub: Username & password required"));
}
$devPeerCpu->{stage}++; # Move to 2nd stage
}
lib/Control/CLI/Extreme.pm view on Meta::CPAN
if ($devPeerCpu->{stage} < 3) { # 3rd stage
my $ok = $self->poll_waitfor($pkgsub, 'Login: $', undef, 'return');
return $self->poll_return($self->error("$pkgsub: Never got peer login prompt // ".$self->errmsg)) unless defined $ok;
return $self->poll_return($ok) unless $ok;
$devPeerCpu->{username} = promptCredential($devPeerCpu->{prompt_credentials}, 'Clear', 'Username') unless defined $devPeerCpu->{username};
$self->print(line => $devPeerCpu->{username}, errmode => 'return')
or return $self->poll_return($self->error("$pkgsub: Unable to send username // ".$self->errmsg));
$devPeerCpu->{stage}++; # Move to 4th stage
}
if ($devPeerCpu->{stage} < 4) { # 4th stage
my $ok = $self->poll_waitfor($pkgsub, 'Password: $', undef, 'return');
return $self->poll_return($self->error("$pkgsub: Never got peer password prompt // ".$self->errmsg)) unless defined $ok;
return $self->poll_return($ok) unless $ok;
$devPeerCpu->{password} = promptCredential($devPeerCpu->{prompt_credentials}, 'Hide', 'Password') unless defined $devPeerCpu->{password};
$self->print(line => $devPeerCpu->{password}, errmode => 'return')
or return $self->poll_return($self->error("$pkgsub: Unable to send password // ".$self->errmsg));
$devPeerCpu->{stage}++; # Move to last stage
}
lib/Control/CLI/Extreme.pm view on Meta::CPAN
[Password_prompt => $passwordPrompt,]
[Input_log => $fhOrFilename,]
[Output_log => $fhOrFilename,]
[Dump_log => $fhOrFilename,]
[Blocking => $flag,]
[Prompt_credentials => $flag,]
[Read_attempts => $numberOfReadAttemps,]
[Readwait_timer => $millisecs,]
[Data_with_error => $flag,]
[Read_block_size => $bytes,]
[Output_record_separator => $ors,]
lib/Control/CLI/Extreme.pm view on Meta::CPAN
[Username => $username,]
[Password => $password,]
[PublicKey => $publicKey,]
[PrivateKey => $privateKey,]
[Passphrase => $passphrase,]
[Prompt_credentials => $flag,]
[BaudRate => $baudRate,]
[ForceBaud => $flag,]
[Parity => $parity,]
[DataBits => $dataBits,]
[StopBits => $stopBits,]
lib/Control/CLI/Extreme.pm view on Meta::CPAN
[Username => $username,]
[Password => $password,]
[PublicKey => $publicKey,]
[PrivateKey => $privateKey,]
[Passphrase => $passphrase,]
[Prompt_credentials => $flag,]
[BaudRate => $baudRate,]
[ForceBaud => $flag,]
[Parity => $parity,]
[DataBits => $dataBits,]
[StopBits => $stopBits,]
lib/Control/CLI/Extreme.pm view on Meta::CPAN
This method overrides Control::CLI::connect() and calls both the Control::CLI::connect() method as well as the login() method from this class. This allows the connect() method to seamlessly handle connection and login for both SSH (which normally han...
In non-blocking mode (blocking disabled) the connect() method will immediately return with a false, but defined, value of 0. You will then need to call the connect_poll() method at regular intervals until it returns a true (1) value indicating that t...
The "host" argument is required by both Telnet and SSH. All the other arguments are optional.
If username/password or SSH Passphrase are not provided but are required and prompt_credentials is true, the method will automatically prompt the user for them; otherwise the error mode action is performed. The "errmode" argument is provided to overr...
The "prompt_credentials" argument is provided to override the global setting of the parameter by the same name which is by default false. See prompt_credentials().
The "read_attempts" argument is simply fed to the login() method. See login().
The "connection_timeout" argument can be used to set a connection timeout when establishing Telnet and SSH TCP connections; this is fed to Control::CLI::connect(). Whereas the "timeout" argument is the normal timeout used for reading the connection o...
The "terminal_type" and "window_size" arguments are Control::CLI arguments and are not overrides, they will change the object parameter as these settings are only applied during a connection. It is not necessary to set these for Extreme devices.
Which other arguments are used depends on the whether the object was created for Telnet, SSH or Serial port.
lib/Control/CLI/Extreme.pm view on Meta::CPAN
$ok = $obj->connect(
Host => $host,
[Port => $port,]
[Username => $username,]
[Password => $password,]
[Prompt_credentials => $flag,]
[Timeout => $secs,]
[Connection_timeout => $secs,]
[Read_attempts => $numberOfLoginReadAttemps,]
[Data_with_error => $flag,]
[Wake_console => $string,]
lib/Control/CLI/Extreme.pm view on Meta::CPAN
[Username => $username,]
[Password => $password,]
[PublicKey => $publicKey,]
[PrivateKey => $privateKey,]
[Passphrase => $passphrase,]
[Prompt_credentials => $flag,]
[Timeout => $secs,]
[Connection_timeout => $secs,]
[Read_attempts => $numberOfLoginReadAttemps,]
[Data_with_error => $flag,]
[Wake_console => $string,]
lib/Control/CLI/Extreme.pm view on Meta::CPAN
[Generic_login => $flag,]
);
If not specified, the default port number for SSH is 22. The wake_console argument is only relevant when connecting to a SSH port other than 22 (i.e. to a Terminal Server device) or if console() has been manually set; see console(). In which case, th...
A username must always be provided for all SSH connections. If not provided and prompt_credentials is true then this method will prompt for it.
Once the SSH conection is established, this method will attempt one of two possible authentication types, based on the accepted authentications of the remote host:
=over 4
=item *
B<Publickey authentication> : If the remote host accepts it and the method was supplied with public/private keys. The public/private keys need to be in OpenSSH format. If the private key is protected by a passphrase then this must also be provided or...
=item *
B<Password authentication> : If the remote host accepts either 'password' or 'keyboard-interactive' authentication methods. A password must be provided or, if prompt_credentials is true, this method will prompt for the password. If password authentic...
=back
=item *
lib/Control/CLI/Extreme.pm view on Meta::CPAN
[DataBits => $dataBits,]
[StopBits => $stopBits,]
[Handshake => $handshake,]
[Username => $username,]
[Password => $password,]
[Prompt_credentials => $flag,]
[Timeout => $secs,]
[Read_attempts => $numberOfLoginReadAttemps,]
[Data_with_error => $flag,]
[Wake_console => $string,]
[Blocking => $flag,]
lib/Control/CLI/Extreme.pm view on Meta::CPAN
=item B<login() & login_poll()> - handle login for Telnet / Serial port; also set the host CLI prompt
$ok = $obj->login(
[Username => $username,]
[Password => $password,]
[Prompt_credentials => $flag,]
[Timeout => $secs,]
[Read_attempts => $numberOfLoginReadAttemps,]
[Data_with_error => $flag,]
[Wake_console => $string,]
[Blocking => $flag,]
lib/Control/CLI/Extreme.pm view on Meta::CPAN
);
($ok, $output || $outputRef) = $obj->login(
[Username => $username,]
[Password => $password,]
[Prompt_credentials => $flag,]
[Timeout => $secs,]
[Return_reference => $flag,]
[Read_attempts => $numberOfLoginReadAttemps,]
[Data_with_error => $flag,]
[Wake_console => $string,]
lib/Control/CLI/Extreme.pm view on Meta::CPAN
$ok = $obj->enable($enablePassword);
$ok = $obj->enable(
[Password => $enablePassword,]
[Prompt_credentials => $flag,]
[Blocking => $flag,]
[Timeout => $secs,]
[Errmode => $errmode,]
);
$ok = $obj->enable_poll(); # Only applicable in non-blocking mode
This method checks whether the 'is_acli' attribute is set and, if so, whether the last prompt ends with '>'; if both conditions are true, it will flush any unread pending input from the device and will just send an 'enable' command to enter Priviledg...
The method can take a password argument which only applies to the WLAN2300 series and in some older software versions of the ERS-8300 in NNCLI mode.
If a password is required, but not supplied, this method will try supplying first a blank password, then the same password which was used to connect/login and finally, if prompt_credentials is true for the object, prompt for it. On I/O failure, the e...
The optional "prompt_credentials" argument is provided to override the global setting of the parameter by the same name which is by default false. See prompt_credentials().
In non-blocking mode (blocking disabled), the enable() method will most likely immediately return with a false, but defined, value of 0. You will then need to call the enable_poll() method at regular intervals until it returns a true (1) value indica...
$ok = $obj->enable(Blocking => 0);
until ($ok) {
lib/Control/CLI/Extreme.pm view on Meta::CPAN
=item B<device_peer_cpu() & device_peer_cpu_poll()> - Connect to peer CPU on ERS8x00 / VSP9000
$ok = $obj->device_peer_cpu(
[Username => $username,]
[Password => $password,]
[Prompt_credentials => $flag,]
[Blocking => $flag,]
[Timeout => $secs,]
[Errmode => $errmode,]
);
$ok = $obj->device_peer_cpu_poll(); # Only applicable in non-blocking mode
This method, only applicable on ERS8x00 and VSP9000, will try to connect to the peer CPU. On success a true (1) value is returned otherwise the error mode action is performed. See errmode().
It should not normally be necessary to provide username/password since the credentials used to connect to the current CPU will automatically be used. If not so, or to override the cached ones, optional "username" & "password" arguments can be provide...
Attributes 'cpu_slot' and 'is_master_cpu' are automatically updated once the connection to the peer CPU succeeds. See attribute().
In non-blocking mode (blocking disabled), the device_peer_cpu() method will most likely immediately return with a false, but defined, value of 0. You will then need to call the device_peer_cpu_poll() method at regular intervals until it returns a tru...
$ok = $obj->device_peer_cpu(Blocking => 0);
lib/Control/CLI/Extreme.pm view on Meta::CPAN
=head2 Methods to set/read Object variables
=over 4
=item B<flush_credentials> - flush the stored username, password, passphrase and enable password credentials
$obj->flush_credentials;
The connect(), login() and enable() methods, if successful in authenticating, will automatically store the username/password/enable-password or SSH passphrase supplied to them.
These can be retrieved via the username, password, passphrase and enable_password methods. If you do not want these to persist in memory once the authentication has completed, use this method to flush them. This method always returns 1.
lib/Control/CLI/Extreme.pm view on Meta::CPAN
=item B<binmode()> - enable/disable newline translation
=item B<output_record_separator()> - set the Output Record Separator automatically appended by print & cmd methods (Note that unlike Control::CLI this class will default to "\r")
=item B<prompt_credentials()> - set whether connect() and login() methods should be able to prompt for credentials
=item B<username_prompt()> - set the login() username prompt match pattern for this object
=item B<password_prompt()> - set the login() password prompt match pattern for this object
lib/Control/CLI/Extreme.pm view on Meta::CPAN
[Username => $username,]
[Password => $password,]
[PublicKey => $publicKey,]
[PrivateKey => $privateKey,]
[Passphrase => $passphrase,]
[Prompt_credentials => $flag,]
[BaudRate => $baudRate,]
[Parity => $parity,]
[DataBits => $dataBits,]
[StopBits => $stopBits,]
[Handshake => $handshake,]
lib/Control/CLI/Extreme.pm view on Meta::CPAN
[Username => $username,]
[Password => $password,]
[PublicKey => $publicKey,]
[PrivateKey => $privateKey,]
[Passphrase => $passphrase,]
[Prompt_credentials => $flag,]
[BaudRate => $baudRate,]
[Parity => $parity,]
[DataBits => $dataBits,]
[StopBits => $stopBits,]
[Handshake => $handshake,]
lib/Control/CLI/Extreme.pm view on Meta::CPAN
=item B<poll_login()> - performs a non-blocking poll for login()
$ok = $obj->poll_login($pkgsub,
[Username => $username,]
[Password => $password,]
[Prompt_credentials => $flag,]
[Timeout => $secs,]
[Read_attempts => $numberOfLoginReadAttemps,]
[Data_with_error => $flag,]
[Wake_console => $string,]
[Errmode => $errmode,]
lib/Control/CLI/Extreme.pm view on Meta::CPAN
);
($ok, $outputref) = $obj->poll_login($pkgsub,
[Username => $username,]
[Password => $password,]
[Prompt_credentials => $flag,]
[Timeout => $secs,]
[Read_attempts => $numberOfLoginReadAttemps,]
[Data_with_error => $flag,]
[Wake_console => $string,]
[Errmode => $errmode,]
lib/Control/CLI/Extreme.pm view on Meta::CPAN
$ok = $obj->poll_enable($pkgsub, $password);
$ok = $obj->poll_enable($pkgsub,
[Password => $enablePassword,]
[Prompt_credentials => $flag,]
[Timeout => $secs,]
[Errmode => $errmode,]
);
Normally this is the internal method used by enable() and enable_poll() methods.
lib/Control/CLI/Extreme.pm view on Meta::CPAN
=item B<poll_device_peer_cpu()> - performs a non-blocking poll for device_peer_cpu()
$ok = $obj->poll_device_peer_cpu($pkgsub,
[Username => $username,]
[Password => $password,]
[Prompt_credentials => $flag,]
[Timeout => $secs,]
[Errmode => $errmode,]
);
Normally this is the internal method used by device_peer_cpu() and device_peer_cpu_poll() methods.
view all matches for this distribution
view release on metacpan or search on metacpan
examples/nonblockpoll-ex1.pl view on Meta::CPAN
MAIN:{
my (%cli, %output);
#
# Get credentials if not already set
#
$username = promptClear("Please enter username to use for hosts") unless defined $username;
$password = promptHide("Please enter password to use for hosts") unless defined $password;
#
examples/nonblockpoll-ex1.pl view on Meta::CPAN
Connection_timeout => $connectionTimeout,
Input_log => $debug ? $host.'.in' : undef,
Output_log => $debug ? $host.'.out' : undef,
Dump_log => $debug ? $host.'.dump' : undef,
Blocking => 0,
Prompt_credentials => 1,
Debug => $debug,
);
print " - $host\n";
}
view all matches for this distribution
view release on metacpan or search on metacpan
examples/ldap view on Meta::CPAN
-- 1 and 2 reserved
sasl [3] SaslCredentials }
SaslCredentials ::= SEQUENCE {
mechanism LDAPString,
credentials OCTET STRING OPTIONAL }
BindResponse ::= [APPLICATION 1] SEQUENCE {
COMPONENTS OF LDAPResult,
serverSaslCreds [7] OCTET STRING OPTIONAL }
view all matches for this distribution
view release on metacpan or search on metacpan
</termEntry>
<termEntry id="aid1602">
<descrip type="subjectField">5.2 Interpreting / interpretation</descrip>
<note>Rejected</note>
<langSet xml:lang="en" id="cid2088">
<descrip type="definition">[[interpreter]] who has qualifications or credentials for the specific job at hand and who exhibits interpreting skills, has experience and observes the code of ethics of the profession and is able to carry out an...
<admin type="source">ISO/AWI 188413.6</admin>
<descrip type="definition">Alt.def: </descrip>
<admin type="source"/>
<note/>
<note/>
</termEntry>
<termEntry id="aid1355">
<descrip type="subjectField">5.2 Interpreting / interpretation</descrip>
<note>Rejected</note>
<langSet xml:lang="en" id="cid1806">
<descrip type="definition">person who may exhibit the ability to speak both the [[source]] and [[target languages]] and who may have some experience as an [[interpreter]] or may have been directed to interpret by an authority in the past, b...
<admin type="source">ISO/DIS 13611.2rev2.7</admin>
<descrip type="definition">Alt.def: person who neither holds a degree in interpreting, nor has any other qualifications or credentials, and who can have any experience in doing the task at hand or not, and can observe any code of ethics or ...
<admin type="source">ISO/AWI 188413.7</admin>
<note/>
<note/>
<note/>
<transacGrp>
view all matches for this distribution
view release on metacpan or search on metacpan
t/profile.t
t/redis-url.t
t/redis-version.t
t/register-invite-only.t
t/register-normal.t
t/register-server-credentials.t
t/release-production.t
t/secure-cookies.t
t/server-notice.t
t/sidebar-connection.t
t/start-with-embedded-server.t
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Coro/Amazon/SimpleDB.pm view on Meta::CPAN
=head1 ATTRIBUTES
=head2 aws_access_key
=head2 aws_secret_access_key
These are the AWS credentials providing access to your account. These
should be available on security credentials page of the AWS portal.
=head2 domain_name
A default domain to use for requests. This may be over-ridden in
requests passed as hash refs or objects.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Couchbase/Client.pm view on Meta::CPAN
likely to know of alternate entry points, and thus the server list is only
useful for discovering the initial entry point.
=item username, password
Authentication credentials for the connection. Defaults to NULL
=item bucket
The bucket name for the connection. Defaults to C<default>
view all matches for this distribution
view release on metacpan or search on metacpan
eg/sendgrid view on Meta::CPAN
subject($subject),
plain_body($plain),
html_body($html),
);
# Sendgrid login credentials
my $username = 'yourlogin@sendgrid.net';
my $password = "yourpassword";
my $transport = Email::Sender::Transport::SMTP->new(
host => 'smtp.sendgrid.net',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/Credentials.pm view on Meta::CPAN
use YAML::PP;
sub new {
my ($class, %args) = @_;
my $dir = rel2abs($args{dir} // catdir(curdir, 'credentials'));
my $check_file = catfile($dir, 'check.enc');
my $real_key;
lib/Crypt/Credentials.pm view on Meta::CPAN
sub _get {
my ($self, $filename, $key) = @_;
my $raw = read_binary($filename);
my ($iv, $tag, $ciphertext) = unpack $format, $raw;
my $plaintext = gcm_decrypt_verify('AES', $key, $iv, '', $ciphertext, $tag);
croak 'Could not decrypt credentials file' if not defined $plaintext;
return $plaintext;
}
sub get {
my ($self, $name) = @_;
my $filename = catfile($self->{dir}, "$name.yml.enc");
croak "No such credentials '$name'" if not -f $filename;
return $self->_get($filename, $self->{key});
}
sub get_yaml {
my ($self, $name) = @_;
lib/Crypt/Credentials.pm view on Meta::CPAN
version 0.006
=head1 SYNOPSIS
my $credentials = Crypt::Credentials->new(
dir => $dir,
keys => split /:/, $ENV{CREDENTIAL_KEYS},
);
my $password = $credentials->get('password');
=head1 DESCRIPTION
This module implements a credentials store. Essentially it allows you to expand one secret (the key of the store) into any number of secrets.
=head1 METHODS
=head2 new
$self->new(keys => \@keys, dir => $dir)
This creates a new C<Crypt::Credentials> object. It takes two named arguments: C<@keys> (mandatory) are the cryptographic keys used to encrypt the credentials, they must be either 16, 24, or 32 bytes long. If multiple keys are given they're tried unt...
=head2 get
$self->get($name)
This reads the credentials entry for C<$name>, or throws an exception if it can't be opened for any reason.
=head2 get_yaml
$self->get_yaml($name)
lib/Crypt/Credentials.pm view on Meta::CPAN
=head2 put
$self->put($name, $value)
This will write the values to the named credentials entry.
=head2 put_yaml
$self->put_yaml($name, \%values)
lib/Crypt/Credentials.pm view on Meta::CPAN
=head2 has
$self->has($name)
This checks if a credentials entry exists
=head2 remove
$self->remove($name)
This removes a credentials entry. It will silently succeed if no such entry exists.
=head2 list
$self->list
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/LE.pm view on Meta::CPAN
$self->{tos_changed} = 1;
$tos_message = "You need to accept TOS at $self->{links}->{'terms-of-service'}";
}
$self->_debug("New key is now registered, reg path: $self->{directory}->{reg}. $tos_message");
} elsif ($status == BAD_REQUEST and $kid and $mac and $self->_pull_error($content)=~/not awaiting/) {
# EAB credentials were already associated with the key.
if ($self->{directory}->{reg}) {
$self->_debug("EAB credentials already associated. Account URL is: $self->{directory}->{reg}.");
} else {
return $self->_status(ERROR, "EAB credentials already associated and no EAB id was provided.");
}
} else {
return $self->_status(ERROR, $content);
}
if ($self->{registration_info} and ref $self->{registration_info} eq 'HASH') {
view all matches for this distribution