Result:
found more than 606 distributions - search limited to the first 2001 files matching your query ( run in 2.884 )


Config-AWS

 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


Config-Model-OpenSsh

 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


Config-Model-Systemd

 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

(both public and private) or certificates, user account information or identity information from host
to services, but can be freely used to pass any kind of limited-size information to a service. 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 (once at process invocation) 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 passed credential is found, the
system service manager will search the directories C</etc/credstore/>,
C</run/credstore/> and C</usr/lib/credstore/> 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/>,

lib/Config/Model/models/Systemd/Common/Exec.pl  view on Meta::CPAN

(and the counterparts ending with C<\x{2026}/credstore.encrypted/>) instead. The
L<systemd-path(1)> tool
may be used to query the precise credential store search path.

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 or credstore directories 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

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/credential.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. 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 do not 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

(both public and private) or certificates, user account information or identity information from host
to services, but can be freely used to pass any kind of limited-size information to a service. 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 (once at process invocation) 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 passed credential is found, the
system service manager will search the directories C</etc/credstore/>,
C</run/credstore/> and C</usr/lib/credstore/> 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/>,

lib/Config/Model/models/Systemd/Common/Exec.pl  view on Meta::CPAN

(and the counterparts ending with C<\x{2026}/credstore.encrypted/>) instead. The
L<systemd-path(1)> tool
may be used to query the precise credential store search path.

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 or credstore directories 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

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/credential.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. 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 do not 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 will
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>.

Note that if decryption or authentication of a credential picked up as result of
C<ImportCredential> fails it will be skipped gracefully (a warning is generated, but
the credential will not be made available to the invoked service). This is different for those
configured via

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


Connector

 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


Context-Singleton

 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


Control-CLI-AvayaData

 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


Control-CLI-Extreme

 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


Control-CLI

 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


Convert-ASN1

 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


Convert-TBX-Basic

 view release on metacpan or  search on metacpan

i-term.tbx  view on Meta::CPAN

      </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/>

i-term.tbx  view on Meta::CPAN

      </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


Convos

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

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


Coro-Amazon-SimpleDB

 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


Couchbase-Client

 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


Courriel

 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


Crop-Config

 view release on metacpan or  search on metacpan

lib/Crop/Object/Warehouse/Pg.pm  view on Meta::CPAN

=begin nd
Constructor: new ($conn)
	Establish connection to a specified database.
	
Parameters:
	$conn - credentials for database connection (login, pass, etc.)
	
Returns:
	$self - if OK
	undef - if connection to database fails
=cut

 view all matches for this distribution


Crop

 view release on metacpan or  search on metacpan

lib/Crop/Object/Warehouse/Pg.pm  view on Meta::CPAN

=begin nd
Constructor: new ($conn)
	Establish connection to a specified database.
	
Parameters:
	$conn - credentials for database connection (login, pass, etc.)
	
Returns:
	$self - if OK
	undef - if connection to database fails
=cut

 view all matches for this distribution


Crypt-Credentials

 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


Crypt-LE

 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


Crypt-OPAQUE

 view release on metacpan or  search on metacpan

lib/Crypt/OPAQUE.pm  view on Meta::CPAN


our $VERSION = 0.012;

our @ISA    = qw(Exporter);
our @EXPORT = qw/
  create_cleartext_credentials
  store
  recover
  create_registration_request
  create_registration_response
  finalize_registration_request
  derive_random_pwd
  create_credential_request
  create_credential_response
  recover_credentials
  /;

our @EXPORT_OK = @EXPORT;

sub recover_credentials {

  my (
    $cred_request, $cred_response,   $pwd, $c_id, $s_id, $Nseed, $group_name, $info, $DST, $hash_name, $expand_message_func,
    $mac_func,     $pwd_harden_func, $unpack_func
  ) = @_;

lib/Crypt/OPAQUE.pm  view on Meta::CPAN

  ### recover s_pub: unpack("H*", $s_pub)
  ### recover c_priv:  $recover_r->{c_priv}->to_hex
  ### recover export_key: unpack("H*", $recover_r->{export_key})

  return $recover_r;
} ## end sub recover_credentials

sub create_credential_response {
  my (
    $request,   $s_pub, $oprf_seed, $credential_identifier, $DSI, $envelope, $masking_key, $Nn, $Nseed, $group_name, $info, $DST,
    $hash_name, $expand_message_func, $point_compress_t, $pack_func

lib/Crypt/OPAQUE.pm  view on Meta::CPAN

  my $blindedElement_hex = Crypt::OpenSSL::EC::EC_POINT::point2hex($ec_params->{group}, $blindedElement, 2, $ec_params->{ctx}); 
  my $request            = { data => pack( "H*", $blindedElement_hex ) };
  return { request => $request, blind => $blind, ec_params => $ec_params };
}

sub create_cleartext_credentials {
  my ( $s_pub, $c_pub, $s_id, $c_id ) = @_;

  $s_id //= $s_pub;
  $c_id //= $c_pub;

  my $cleartext_credentials = join(
    "", $s_pub,
    map { i2osp( length( $_ ), 2 ) . $_ } ( $s_id, $c_id ) );

  return $cleartext_credentials;
}

sub store {
  my ( $randomized_pwd, $s_pub, $s_id, $c_id, $Nn, $Nseed, $group_name, $info, $DST, $hash_name, $expand_message_func, $mac_func ) =
    @_;

lib/Crypt/OPAQUE.pm  view on Meta::CPAN

  my $c_ec_key_r = derive_key_pair( $group_name, $seed, $info, $DST, $hash_name, $expand_message_func );
  my $c_priv     = $c_ec_key_r->{priv_bn};
  my $c_pub      = $c_ec_key_r->{pub_bin};
  ### c_priv: $c_priv->to_hex

  my $cleartext_credentials = create_cleartext_credentials( $s_pub, $c_pub, $s_id, $c_id );
  ### cleartext_credentails: unpack("H*", $cleartext_credentials)

  my $auth_tag = $mac_func->( $envelope_nonce . $cleartext_credentials, $auth_key );

  my $envelope = { auth_tag => $auth_tag, nonce => $envelope_nonce };

  return {
    envelope              => $envelope, c_pub => $c_pub, masking_key => $masking_key,
    export_key            => $export_key,
    c_priv                => $c_priv, auth_key => $auth_key,
    cleartext_credentails => $cleartext_credentials,
  };
} ## end sub store

sub recover {
  my (

lib/Crypt/OPAQUE.pm  view on Meta::CPAN

  my $c_ec_key_r = derive_key_pair( $group_name, $seed, $info, $DST, $hash_name, $expand_message_func );
  my $c_priv     = $c_ec_key_r->{priv_bn};
  my $c_pub      = $c_ec_key_r->{pub_bin};
  ### c_priv: $c_priv->to_hex

  my $cleartext_credentials = create_cleartext_credentials( $s_pub, $c_pub, $s_id, $c_id );
  my $expected_tag          = $mac_func->( $envelope->{nonce} . $cleartext_credentials, $auth_key );

  if ( $envelope->{auth_tag} ne $expected_tag ) {
    croak "not match envelope.auth_tag";
  }

 view all matches for this distribution


Crypt-OpenSSL-CA

 view release on metacpan or  search on metacpan

lib/Crypt/OpenSSL/CA/AlphabetSoup.pod  view on Meta::CPAN


=over

=item *

the set of the cryptographic credentials (key and CA certificate) that
the CA-as-a-computing-equipment needs to perform,

=item *

the whole security domain (more computers and programs) that it relies

 view all matches for this distribution


Crypt-Protocol

 view release on metacpan or  search on metacpan

lib/Crypt/Protocol/OPAQUE.pm  view on Meta::CPAN


our $VERSION = 0.012;

our @ISA    = qw(Exporter);
our @EXPORT = qw/
  create_cleartext_credentials
  store
  recover
  create_registration_request
  create_registration_response
  finalize_registration_request
  derive_random_pwd
  create_credential_request
  create_credential_response
  recover_credentials
  /;

our @EXPORT_OK = @EXPORT;

sub recover_credentials {

  my (
    $cred_request, $cred_response,   $pwd, $c_id, $s_id, $Nseed, $group_name, $info, $DST, $hash_name, $expand_message_func,
    $mac_func,     $pwd_harden_func, $unpack_func
  ) = @_;

lib/Crypt/Protocol/OPAQUE.pm  view on Meta::CPAN

  ### recover s_pub: unpack("H*", $s_pub)
  ### recover c_priv:  $recover_r->{c_priv}->to_hex
  ### recover export_key: unpack("H*", $recover_r->{export_key})

  return $recover_r;
} ## end sub recover_credentials

sub create_credential_response {
  my (
    $request,   $s_pub, $oprf_seed, $credential_identifier, $DSI, $envelope, $masking_key, $Nn, $Nseed, $group_name, $info, $DST,
    $hash_name, $expand_message_func, $point_compress_t, $pack_func

lib/Crypt/Protocol/OPAQUE.pm  view on Meta::CPAN

  my $blindedElement_hex = sn_point2hex( $group_name, $blindedElement, 2 );
  my $request            = { data => pack( "H*", $blindedElement_hex ) };
  return { request => $request, blind => $blind, ec_params => $ec_params };
}

sub create_cleartext_credentials {
  my ( $s_pub, $c_pub, $s_id, $c_id ) = @_;

  $s_id //= $s_pub;
  $c_id //= $c_pub;

  my $cleartext_credentials = join(
    "", $s_pub,
    map { i2osp( length( $_ ), 2 ) . $_ } ( $s_id, $c_id ) );

  return $cleartext_credentials;
}

sub store {
  my ( $randomized_pwd, $s_pub, $s_id, $c_id, $Nn, $Nseed, $group_name, $info, $DST, $hash_name, $expand_message_func, $mac_func ) =
    @_;

lib/Crypt/Protocol/OPAQUE.pm  view on Meta::CPAN

  my $c_priv     = $c_ec_key_r->{priv_bn};
  my $c_pub      = $c_ec_key_r->{pub_bin};
  ### c_priv: $c_priv->to_hex
  ### c_pub: unpack("H*", $c_pub)

  my $cleartext_credentials = create_cleartext_credentials( $s_pub, $c_pub, $s_id, $c_id );
  ### cleartext_credentails: unpack("H*", $cleartext_credentials)

  my $auth_tag = $mac_func->( $envelope_nonce . $cleartext_credentials, $auth_key );

  my $envelope = { auth_tag => $auth_tag, nonce => $envelope_nonce };

  return {
    envelope              => $envelope, c_pub => $c_pub, masking_key => $masking_key,
    export_key            => $export_key,
    c_priv                => $c_priv, auth_key => $auth_key,
    cleartext_credentails => $cleartext_credentials,
  };
} ## end sub store

sub recover {
  my (

lib/Crypt/Protocol/OPAQUE.pm  view on Meta::CPAN

  my $c_ec_key_r = derive_key_pair( $group_name, $seed, $info, $DST, $hash_name, $expand_message_func );
  my $c_priv     = $c_ec_key_r->{priv_bn};
  my $c_pub      = $c_ec_key_r->{pub_bin};
  ### c_priv: $c_priv->to_hex

  my $cleartext_credentials = create_cleartext_credentials( $s_pub, $c_pub, $s_id, $c_id );
  my $expected_tag          = $mac_func->( $envelope->{nonce} . $cleartext_credentials, $auth_key );

  if ( $envelope->{auth_tag} ne $expected_tag ) {
    croak "not match envelope.auth_tag";
  }

 view all matches for this distribution


Crypt-SSLeay

 view release on metacpan or  search on metacpan

SSLeay.pm  view on Meta::CPAN

Use of the C<HTTPS_PROXY> environment variable in this way
is similar to C<LWP::UserAgent->env_proxy()> usage, but calling
that method will likely override or break the C<Crypt::SSLeay>
support, so do not mix the two.

Basic auth credentials to the proxy server can be provided
this way:

    # proxy_basic_auth
    $ENV{HTTPS_PROXY_USERNAME} = 'username';
    $ENV{HTTPS_PROXY_PASSWORD} = 'password';

 view all matches for this distribution



Curio-Role-GitLab-API-v4

 view release on metacpan or  search on metacpan

lib/Curio/Role/GitLab/API/v4.pm  view on Meta::CPAN

        );
    }

The C<myapp_secret> call is expected to be the place where you use
whatever tool you use to hold your GitLab tokens and likely all
passwords and other credentials (secrets) that your application needs.

Some common tools that people use to manage their secrets are
Kubernetes' secrets objects, AWS's Secret Manager, HashiCorp's Vault,
or just an inescure configuration file; to name a few.

 view all matches for this distribution


DB-Ent

 view release on metacpan or  search on metacpan

Ent.pm  view on Meta::CPAN


Parameters are all passed as a hash or hash reference whose keys are described below:

I<Connection Parameters>

To establish a connection to a datastore, the caller must pass credentials.  These may be passed either in URL syntax and/or as separate keys.  Any information passed separately overrides the appropriate value in the URL.  If no connection informatio...

=over

=item DBED

 view all matches for this distribution


DBD-Firebird

 view release on metacpan or  search on metacpan

t/TestFirebird.pm  view on Meta::CPAN

    my $class = shift;
    my $self = bless {@_}, $class;

    $self->read_cached_configs;

    $self->check_credentials;

    return $self;
}

sub check_credentials {
    my $self = shift;

    unless ( defined $self->{pass}
        or defined $ENV{DBI_PASS}
        or defined $ENV{ISC_PASSWORD} )

 view all matches for this distribution


DBD-MVS_FTPSQL

 view release on metacpan or  search on metacpan

lib/DBD/MVS_FTPSQL.pm  view on Meta::CPAN


  my $dbh = DBI->connect("dbi:MVS_FTPSQL:$DSN", $username, $password)
            or die $DBI::errstr;  

establishes a connection to the DB2 subsystem identified by the DSN string 
C<$DSN>, using as login credentials the C<$username> and C<$password> supplied. 
Notice that in the OS/390 or z/OS environment you don't connect to a 
database, instead you have to connect to the DB2 subsystem which gives 
access to all the databases it contains (a mainframe database has very 
little to do with its pc counterpart as it is basically a logical grouping 
of tables, other objects and so, in many ways, it's more similar to a pc 

 view all matches for this distribution


DBD-MariaDB

 view release on metacpan or  search on metacpan

dbdimp.c  view on Meta::CPAN

        mariadb_dr_do_error(dbh, CR_SERVER_GONE_ERROR, "MySQL server has gone away", "HY000");
        return 0;
      }
      mysql_options(imp_dbh->pmysql, FABRIC_OPT_MODE, str);
    }
    else if (memEQs(key, kl, "mariadb_fabric_opt_group_credentials"))
    {
      mariadb_dr_do_error(dbh, CR_UNKNOWN_ERROR, "'fabric_opt_group_credentials' is not supported", "HY000");
      return 0;
    }
  #endif
    else if (memEQs(key, kl, "mariadb_max_allowed_packet"))
    {

 view all matches for this distribution


DBD-Neo4p

 view release on metacpan or  search on metacpan

t/lib/Neo4p/Test.pm  view on Meta::CPAN

  my $class = shift;
  my ($db,$user,$pass) = @_;
  REST::Neo4p->set_handle(0);
  unless (REST::Neo4p->connected) {
    eval {
      REST::Neo4p->agent->credentials($db,'',$user,$pass) if defined $user;
      REST::Neo4p->connect($db);
    };
    if (my $e = REST::Neo4p::CommException->caught) {
      return
    }

 view all matches for this distribution


DBD-Oracle

 view release on metacpan or  search on metacpan

lib/DBD/Oracle.pm  view on Meta::CPAN

DBMS_OUTPUT.GET is discarded by the next call to DBMS_OUTPUT.PUT_LINE,
DBMS_OUTPUT.PUT, or DBMS_OUTPUT.NEW_LINE.

=head2 B<reauthenticate ( $username, $password )>

Starts a new session against the current database using the credentials
supplied. Note that this does not work with DRCP.

=head2 B<private_attribute_info>

  $hashref = $dbh->private_attribute_info();

 view all matches for this distribution


( run in 2.884 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )