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


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


DBD-SQLcipher

 view release on metacpan or  search on metacpan

sqlite3.c  view on Meta::CPAN

}

#if SQLITE_USER_AUTHENTICATION
/*
** Return TRUE if zTable is the name of the system table that stores the
** list of users and their access credentials.
*/
SQLITE_PRIVATE int sqlite3UserAuthTable(const char *zTable){
  return sqlite3_stricmp(zTable, "sqlite_user")==0;
}
#endif

 view all matches for this distribution


DBD-SQLeet

 view release on metacpan or  search on metacpan

sqlite3.c  view on Meta::CPAN

}

#if SQLITE_USER_AUTHENTICATION
/*
** Return TRUE if zTable is the name of the system table that stores the
** list of users and their access credentials.
*/
SQLITE_PRIVATE int sqlite3UserAuthTable(const char *zTable){
  return sqlite3_stricmp(zTable, "sqlite_user")==0;
}
#endif

 view all matches for this distribution


DBD-SQLite

 view release on metacpan or  search on metacpan

sqlite3.c  view on Meta::CPAN

}

#if SQLITE_USER_AUTHENTICATION
/*
** Return TRUE if zTable is the name of the system table that stores the
** list of users and their access credentials.
*/
SQLITE_PRIVATE int sqlite3UserAuthTable(const char *zTable){
  return sqlite3_stricmp(zTable, "sqlite_user")==0;
}
#endif

 view all matches for this distribution


DBD-WMI

 view release on metacpan or  search on metacpan

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


=over 4

=item * Implement placeholders and proper interpolation of values

=item * Need to implement DSN parameters for remote computers, credentials

=back

=head1 SEE ALSO

 view all matches for this distribution


DBD-mysql

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

perl Makefile.PL
make
make test
```

See the output of `perl Makefile.PL` for how to set database credentials.

Testing is also done via GitHub action.

## Installation

 view all matches for this distribution


DBICx-Backend-Move

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


1.000005    2012-10-08
            - Fixed: filtered column handling

1.000004    2012-09-26
            - Fixed: credentials are now transfered to commit (Steffen Schwigon)
            - Show life signal only on -vv (Steffen Schwigon)
            - Skip views for transfer (Bug #3, reported by Steffen Schwigon)

1.000003    2012-09-17
            - set user in portable way

 view all matches for this distribution


DBIx-Class-FilterColumn-Encrypt

 view release on metacpan or  search on metacpan

lib/DBIx/Class/FilterColumn/Encrypt.pm  view on Meta::CPAN

 # in application code
 $rs->create({ data => 'some secret' });

=head1 DESCRIPTION

This components transparently encrypts any value with the currently active key, or decrypts them with any known value. This is useful when needing read/write access to values that are too sensitive to store in plaintext, such as credentials for other...

To enable encryption, C<encrypt> must be a hash containing the key C<keys>, which shall be a hash mapping numberic identifiers to keys. An optional argument C<active_key> may be given which one will be used for encrypting, otherwise the key with the ...

=head1 AUTHOR

 view all matches for this distribution


DBIx-Class-Schema-Config

 view release on metacpan or  search on metacpan

lib/DBIx/Class/Schema/Config.pm  view on Meta::CPAN

        return $class->next::method( @info );
    }

    my $attrs = $class->_make_connect_attrs(@info);

    # We will not load credentials for someone who uses dbh_maker,
    # however we will pass their request through.
    return $class->next::method( $attrs )
        if defined $attrs->{dbh_maker};

    # Take responsibility for passing through normal-looking
    # credentials.
    $attrs = $class->load_credentials($attrs)
        unless $attrs->{dsn} =~ /^dbi:/i;

    return $class->next::method( $attrs );
}

sub coerce_credentials_from_mojolike {
    my ( $class, $attrs ) = @_;

    (my $in = $attrs->{dsn}) =~ s/^postgresql/http/;
    my $url = URI->new( $in );

lib/DBIx/Class/Schema/Config.pm  view on Meta::CPAN

}


sub _load_config {
    my ( $class ) = @_;
    require Config::Any; # Only loaded if we need to load credentials.

    # If we have ->config_files, we'll use those and load_files
    # instead of the default load_stems.
    my %cf_opts = ( use_ext => 1 );
    return @{$class->config_files}
        ? Config::Any->load_files({ files => $class->config_files, %cf_opts })
        : Config::Any->load_stems({ stems => $class->config_paths, %cf_opts });
}


sub load_credentials {
    my ( $class, $connect_args ) = @_;

    # Handle mojo-like postgres:// urls
    return $class->coerce_credentials_from_mojolike($connect_args)
        if $connect_args->{dsn} =~ /^postgresql:/i;

    # While ->connect is responsible for returning normal-looking
    # credential information, we do it here as well so that it can be
    # independently unit tested.
    return $connect_args if $connect_args->{dsn} =~ /^dbi:/i;

    return $class->filter_loaded_credentials(
        $class->_find_credentials( $connect_args, $class->config ),
        $connect_args
    );

}

# This will look through the data structure returned by Config::Any
# and return the first instance of the database credentials it can
# find.
sub _find_credentials {
    my ( $class, $connect_args, $ConfigAny ) = @_;

    for my $cfile ( @$ConfigAny ) {
        for my $filename ( keys %$cfile ) {
            for my $database ( keys %{$cfile->{$filename}} ) {

lib/DBIx/Class/Schema/Config.pm  view on Meta::CPAN

# Intended to be sub-classed, the default behavior is to
# overwrite the loaded configuration with any specified
# configuration from the connect() call, with the exception
# of the DSN itself.

sub filter_loaded_credentials {
    my ( $class, $new, $old ) = @_;

    local $old->{password}, delete $old->{password} unless $old->{password};
    local $old->{user},     delete $old->{user}     unless $old->{user};
    local $old->{dsn},      delete $old->{dsn};

lib/DBIx/Class/Schema/Config.pm  view on Meta::CPAN

DBIx::Class::Schema::Config - Credential Management for DBIx::Class

=head1 DESCRIPTION

DBIx::Class::Schema::Config is a subclass of DBIx::Class::Schema that allows
the loading of credentials & configuration from a file.  The actual code itself
would only need to know about the name used in the configuration file. This
aims to make it simpler for operations teams to manage database credentials.

A simple tutorial that compliments this documentation and explains converting 
an existing DBIx::Class Schema to use this software to manage credentials can 
be found at L<http://www.symkat.com/credential-management-in-dbix-class>

=head1 SYNOPSIS

    /etc/dbic.yaml

lib/DBIx/Class/Schema/Config.pm  view on Meta::CPAN


    use base 'DBIx::Class::Schema::Config';
    __PACKAGE__->config_paths([( '/var/www/secret/dbic', '/opt/database' )]);

The above code would have I</var/www/secret/dbic.*> and I</opt/database.*> 
searched, in that order.  As above, the first credentials found would be used.  
This will replace the files originally searched for, not add to them.

=head1 USE SPECIFIC CONFIG FILES

If you would rather explicitly state the configuration files you

lib/DBIx/Class/Schema/Config.pm  view on Meta::CPAN

Historical Note: This class accepts numerous ways to connect to DBIC that would
otherwise not be valid.  These connection methods are discouraged but tested for
and kept for compatibility with earlier versions.  For valid ways of connecting to DBIC
please see L<https://metacpan.org/pod/DBIx::Class::Storage::DBI#connect_info>

=head2 filter_loaded_credentials

Override this function if you want to change the loaded credentials before
they are passed to DBIC.  This is useful for use-cases that include decrypting
encrypted passwords or making programmatic changes to the configuration before
using it.

    sub filter_loaded_credentials {
        my ( $class, $loaded_credentials, $connect_args ) = @_;
        ...
        return $loaded_credentials;
    }

C<$loaded_credentials> is the structure after it has been loaded from the
configuration file.  In this case, C<$loaded_credentials-E<gt>{user}> eq
B<WalterWhite> and C<$loaded_credentials-E<gt>{dsn}> eq
B<DBI:mysql:database=students;host=%s;port=3306>.

C<$connect_args> is the structure originally passed on C<-E<gt>connect()>
after it has been turned into a hash.  For instance,
C<-E<gt>connect('DATABASE', 'USERNAME')> will result in

lib/DBIx/Class/Schema/Config.pm  view on Meta::CPAN

    package My::Schema
    use warnings;
    use strict;
    use base 'DBIx::Class::Schema::Config';

    sub filter_loaded_credentials {
        my ( $class, $loaded_credentials, $connect_args ) = @_;
        if ( $loaded_credentials->{dsn} =~ /\%s/ ) {
            $loaded_credentials->{dsn} = sprintf( $loaded_credentials->{dsn},
                $connect_args->{hostname});
        }
    }

    __PACKAGE__->load_classes;
    1;

Then the connection could be done with
C<$Schema-E<gt>connect('DATABASE', { hostname => 'my.hostname.com' });>

See L</load_credentials> for more complex changes that require changing
how the configuration itself is loaded.

=head2 load_credentials

Override this function to change the way that L<DBIx::Class::Schema::Config>
loads credentials.  The function takes the class name, as well as a hashref.

If you take the route of having C<-E<gt>connect('DATABASE')> used as a key for
whatever configuration you are loading, I<DATABASE> would be
C<$config-E<gt>{dsn}>

lib/DBIx/Class/Schema/Config.pm  view on Meta::CPAN

            TraceLevel => 1
        }
    );

Would result in the following data structure as $config in
C<load_credentials($class, $config)>:

    {
        dsn             => "SomeTarget",
        user            => "Yuri",
        password        => "Yawny",
        TraceLevel      => 1,
    }

Currently, load_credentials will NOT be called if the first argument to
C<-E<gt>connect()> looks like a valid DSN.  This is determined by match
the DSN with C</^dbi:/i>.

The function should return the same structure.  For instance:

lib/DBIx/Class/Schema/Config.pm  view on Meta::CPAN

    use strict;
    use base 'DBIx::Class::Schema::Config';
    use LWP::Simple;
    use JSON

    # Load credentials from internal web server.
    sub load_credentials {
        my ( $class, $config ) = @_;

        return decode_json(
            get( "http://someserver.com/v1.0/database?key=somesecret&db=" .
                $config->{dsn}  ));

 view all matches for this distribution


DBIx-Class

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


0.082821 2016-02-11 17:58 (UTC)
    * Fixes
        - Fix t/52leaks.t failures on compilerless systems (RT#104429)
        - Fix t/storage/quote_names.t failures on systems with specified Oracle
          test credentials while missing the optional Math::Base36
        - Fix test failures when DBICTEST_SYBASE_DSN is set (unnoticed change
          in error message wording during 0.082800 and a bogus test)
        - Remove largely obsolete test of SQLite view deployment (RT#111916)

    * Misc

 view all matches for this distribution


DBIx-Config

 view release on metacpan or  search on metacpan

lib/DBIx/Config.pm  view on Meta::CPAN

    }

    my $config = $self->_make_config(@info);

    # Take responsibility for passing through normal-looking
    # credentials.
    $config = $self->default_load_credentials($config)
        unless $config->{dsn} =~ /dbi:/i;

    return $self->_dbi_credentials($config);
}

# Normalize arguments into a single hash.  If we get a single hashref,
# return it.
# Check if $user and $pass are hashes to support things like

lib/DBIx/Config.pm  view on Meta::CPAN


# DBI's ->connect expects 
# ( "dsn", "user", "password", { option_key => option_value } )
# this function changes our friendly hashref into this format.

sub _dbi_credentials {
    my ( $class, $config ) = @_;

    return (
        delete $config->{dsn},
        delete $config->{user},
        delete $config->{password},
        $config,
    );
}

sub default_load_credentials {
    my ( $self,  $connect_args ) = @_;
    
    # To allow overriding without subclassing, if you pass a coderef
    # to ->load_credentials, we will replace our default load_credentials
    # without that function.
    if ( $self->load_credentials ) {
        return $self->load_credentials->( $self, $connect_args );
    }
    
    require Config::Any; # Only loaded if we need to load credentials.

    # While ->connect is responsible for returning normal-looking
    # credential information, we do it here as well so that it can be
    # independently unit tested.
    return $connect_args if $connect_args->{dsn} =~ /^dbi:/i; 

lib/DBIx/Config.pm  view on Meta::CPAN

    my %cf_opts = ( use_ext => 1 );
    my $ConfigAny = @{$self->config_files}
        ? Config::Any->load_files({ files => $self->config_files, %cf_opts })
        : Config::Any->load_stems({ stems => $self->config_paths, %cf_opts });

    return $self->default_filter_loaded_credentials(
        $self->_find_credentials( $connect_args, $ConfigAny ),
        $connect_args
    );

}

# This will look through the data structure returned by Config::Any
# and return the first instance of the database credentials it can
# find.
sub _find_credentials {
    my ( $class, $connect_args, $ConfigAny ) = @_;
    
    for my $cfile ( @$ConfigAny ) {
        for my $filename ( keys %$cfile ) {
            for my $database ( keys %{$cfile->{$filename}} ) {

lib/DBIx/Config.pm  view on Meta::CPAN

            }
        }
    }
}

sub default_filter_loaded_credentials {
    my ( $self, $loaded_credentials,$connect_args ) = @_;
    if ( $self->filter_loaded_credentials ) {
        return $self->filter_loaded_credentials->( 
            $self, $loaded_credentials,$connect_args 
        );
    }
    return $loaded_credentials;
}

# Assessors
sub config_paths {
    my $self = shift;

lib/DBIx/Config.pm  view on Meta::CPAN

    my $self = shift;
    $self->{config_files} = shift if @_;
    return $self->{config_files};
}

sub filter_loaded_credentials {
    my $self = shift;
    $self->{filter_loaded_credentials} = shift if @_;
    return $self->{filter_loaded_credentials};
}

sub load_credentials {
    my $self = shift;
    $self->{load_credentials} = shift if @_;
    return $self->{load_credentials};
}

1;

=head1 NAME

DBIx::Config - Manage credentials for DBI

=head1 DESCRIPTION

DBIx::Config wraps around L<DBI> to provide a simple way of loading database 
credentials from a file.  The aim is make it simpler for operations teams to 
manage database credentials.  

=head1 SYNOPSIS

Given a file like C</etc/dbi.yaml>, containing:

lib/DBIx/Config.pm  view on Meta::CPAN

            TraceLevel => 1, 
        },
    );

For cases where you may use something like C<DBIx::Connector>, a
method is provided that will simply return the connection credentials:


    !/usr/bin/perl
    use warnings;
    use strict;

lib/DBIx/Config.pm  view on Meta::CPAN

    my $conn = DBIx::Connector->new(DBIx::Config->connect_info("MY_DATABASE"));

=head1 CONFIG FILES

By default the following configuration files are examined, in order listed,
for credentials.  Configuration files are loaded with L<Config::Any>.  You
should append the extention that Config::Any will recognize your file in
to the list below.  For instance ./dbic will look for files such as
C<./dbic.yaml>, C<./dbic.conf>, etc.  For documentation on acceptable files
please see L<Config::Any>.  The first file which has the given credentials 
is used.

=over 4

=item * C<$ENV{DBIX_CONFIG_DIR}> . '/dbic', 

lib/DBIx/Config.pm  view on Meta::CPAN

    my $dbh = $DBI->connect( "MY_DATABASE" );

This would check, in order, C<dbcreds> in the current directory, and then C</etc/dbcreds>,
checking for valid configuration file extentions appended to the given file.

=head2 filter_loaded_credentials

You may want to change the credentials that have been loaded, before they are used
to connect to the DB.  A coderef is taken that will allow you to make programatic
changes to the loaded credentials, while giving you access to the origional data
structure used to connect.

    DBIx::Config->new(
        filter_loaded_credentials => sub {
            my ( $self, $loaded_credentials, $connect_args ) = @_;
            ...
            return $loaded_credentials;
        }
    )

Your coderef will take three arguments.  

=over 4

=item * C<$self>, the instance of DBIx::Config your code was called from. C

=item * C<$loaded_credentials>, the credentials loaded from the config file.

=item * C<$connect_args>, the normalized data structure of the inital C<connect> call.

=back

Your coderef should return the same structure given by C<$loaded_credentials>.

As an example, the following code will use the credentials from C</etc/dbi>, but
use its a hostname defined in the code itself.

C</etc/dbi> (note C<host=%s>):

    MY_DATABASE:

lib/DBIx/Config.pm  view on Meta::CPAN

    use strict;
    use DBIx::Config;

    my $dbh = DBIx::Config->new(
        # If we have %s, replace it with a hostname.
        filter_loaded_credentials => sub {
            my ( $self, $loaded_credentials, $connect_args ) = @_;

                if ( $loaded_credentials->{dsn} =~ /\%s/ ) {
                    $loaded_credentials->{dsn} = sprintf( 
                        $loaded_credentials->{dsn}, $connect_args->{hostname} 
                    );
                }
                return $loaded_credentials;
            }
        )->connect( "MY_DATABASE", { hostname => "127.0.0.1" } );

=head2 load_credentials

Override this function to change the way that DBIx::Config loads credentials. 
The function takes the class name, as well as a hashref.

If you take the route of having ->connect('DATABASE') used as a key for whatever 
configuration you are loading, DATABASE would be $config->{dsn}

lib/DBIx/Config.pm  view on Meta::CPAN

        { 
            TraceLevel => 1 
        } 
    );

Would result in the following data structure as $config in load_credentials($self, $config):

    {
        dsn             => "SomeTarget",
        user            => "Yuri",
        password        => "Yawny",
        TraceLevel      => 1,
    }

Currently, load_credentials will NOT be called if the first argument to ->connect() 
looks like a valid DSN. This is determined by match the DSN with /^dbi:/i.

The function should return the same structure. For instance:

    #!/usr/bin/perl

lib/DBIx/Config.pm  view on Meta::CPAN

    use DBIx::Config;
    use LWP::Simple;
    use JSON;

    my $DBI = DBIx::Config->new(
        load_credentials => sub {
            my ( $self, $config ) = @_;
            
            return decode_json( 
                get( "http://someserver.com/v1.0/database?name=" . $config->{dsn} )
            );

 view all matches for this distribution


DBIx-Cookbook

 view release on metacpan or  search on metacpan

lib/DBIx/Cookbook.pm  view on Meta::CPAN


=head2 The sakila database is installed automatically

Just FYI, there is a C<sakila> target that runs automatically when you
run C<make>. This target downloads the sakila database and loads it
into MySQL. It also stores the MySQL auth credentials in
F<lib/DBI/Cookbook/DBH.pm>. 

If you ever want to run it separately simply type

  make sakila

 view all matches for this distribution


DBIx-Custom

 view release on metacpan or  search on metacpan

t/common-sqlserver.t  view on Meta::CPAN

        |computed_columns
        |configurations
        |conversation_endpoints
        |conversation_groups
        |conversation_priorities
        |credentials
        |crypt_properties
        |cryptographic_providers
        |data_spaces
        |database_audit_specification_details
        |database_audit_specifications

t/common-sqlserver.t  view on Meta::CPAN

        |server_event_session_targets
        |server_event_sessions
        |server_events
        |server_file_audits
        |server_permissions
        |server_principal_credentials
        |server_principals
        |server_role_members
        |server_sql_modules
        |server_trigger_events
        |server_triggers

 view all matches for this distribution


DBIx-DWIW

 view release on metacpan or  search on metacpan

lib/DBIx/DWIW.pm  view on Meta::CPAN

                ## etc.) DBI::ProxyServer just reports "Unexpected EOF from
                ## server". Let's give the user a hint as to what that
                ## might mean.
                ##
                if ($ERROR =~ m/^Cannot log in to DBI::ProxyServer: Unexpected EOF from server/) {
                    $ERROR =    "Cannot log in via DBI::ProxyServer: Unexpected EOF from server (check user's MySQL credentials and privileges)";
                }
                if (not $NoAbort) {
                    die $ERROR;
                }
                elsif (not $Quiet) {

 view all matches for this distribution


DBIx-DataStore

 view release on metacpan or  search on metacpan

lib/DBIx/DataStore.pm  view on Meta::CPAN

    my $db = DBIx::DataStore->new({ config => $config });

=head2 Configuring Database Passwords

Because DBIx::DataStore uses the normal DBI/DBD layers underneath, all the
usual methods of locating and presenting database credentials to the
appropriate database server are available.  This includes methods such as the
C<.pgpass> file for PostgreSQL and equivalents for other RDBMSes. If your
DBIx::DataStore configuration does not include a C<pass> attribute for a given
database host, these alternate methods will be used as long as they are
properly configured.

 view all matches for this distribution


DBIx-Easy

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

* Mon May 21 11:38:02 2007 CEST

DBIx::Easy v0.17 released

* Fri May 18 17:27:15 2007 CEST
(Easy.pm): MySQL 5 has a different message for bad credentials
commit only if AutoCommit is turned off to avoid spurious warnings

* Fri May 18 00:17:37 2007 CEST
(Easy.pm): fixed now method for Postgresql

 view all matches for this distribution


DBIx-HTML

 view release on metacpan or  search on metacpan

lib/DBIx/HTML.pm  view on Meta::CPAN


=head1 SYNOPSIS

    use DBIx::HTML;

    my $generator = DBIx::HTML->connect( @db_credentials );
    $generator->do( $query );

    # supports multiple orientations
    print $generator->portrait;
    print $generator->landscape;

    # stackable method calls:
    print DBIx::HTML
        ->connect( @db_credentials )
        ->do( 'select foo,baz from bar' )
        ->landscape
    ;

    # rotating attributes:

lib/DBIx/HTML.pm  view on Meta::CPAN


=head1 METHODS

=over 4

=item C<connect( @database_credentials )>

Connects to the database. See L<DBI> for how to do that.
Optionally, create your own database handle and pass it:

  my $dbh = DBI->connect ( @db_creds );

 view all matches for this distribution


DBIx-JCL

 view release on metacpan or  search on metacpan

lib/DBIx/JCL.pm  view on Meta::CPAN

the various execution and output parsing that whould otherwise have to be \
handled by calling the db_sqlloader functions directly (which certainly you \
can if you prefer).

Execute SQL*Loader using the supplied paramaters. The Virtual Database \
Name is used to obtain login credentials. This will launch SQL*Loader \
and wait for it to finish, returning the SQL*Loader return code to the \
caller.

Data file name must be fully qualified. Path provided by data file name \
will be used for out, bad, and dis files.

 view all matches for this distribution


DBIx-MySQL-Replication-Slave

 view release on metacpan or  search on metacpan

t/connect.t  view on Meta::CPAN

use warnings;

=head1 SYNOPSIS

In order to run these tests, you'll need to set your MySQL slave access
credentials in %ENV.

For example:

export SLAVE_DSN="dbi:mysql:database=my_database;host=my_db_hostname"
export SLAVE_USER=replication_user

 view all matches for this distribution


DBIx-MyServer

 view release on metacpan or  search on metacpan

lib/DBIx/MyServer.pm  view on Meta::CPAN

If you are subclassing C<DBIx::MyParse>, the way C<DBIx::MyParse::DBI> does, to establish a connection you call:

=item C<< $myserver->handshake() >>

which completes the handshake between the two parties. The return value will be C<undef> if some I/O error
occured, or the result of the client authorization routine. When the client sends its credentials, the
module will call:

=item C<< $myserver->authorize($remote_host, $username, $database) >>

whose default action is to accept only localhost connections regardless of username or password. You should

 view all matches for this distribution


( run in 0.510 second using v1.01-cache-2.11-cpan-4d50c553e7e )