| 1 | package Protocol::Database::PostgreSQL::Constants; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | our $VERSION = '2.000'; # VERSION | |
| 7 | |||
| 8 | =head1 NAME | ||
| 9 | |||
| 10 | Protocol::Database::PostgreSQL::Constants - some constants used in the PostgreSQL protocol | ||
| 11 | |||
| 12 | =head1 DESCRIPTION | ||
| 13 | |||
| 14 | Exports some constants - mostly SSL-related. | ||
| 15 | |||
| 16 | =cut | ||
| 17 | |||
| 18 | 1 | ▶ | use Exporter qw(import export_to_level); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 19 | |||
| 20 | 1 | ▶ | use List::Util qw(uniqstr); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 21 | |||
| 22 | =head1 EXPORTS | ||
| 23 | |||
| 24 | (note that SSL here actually means TLS). | ||
| 25 | |||
| 26 | =over 4 | ||
| 27 | |||
| 28 | =item * C<SSL_DISABLE> - do not use SSL | ||
| 29 | |||
| 30 | =item * C<SSL_PREFER> - use SSL if we can | ||
| 31 | |||
| 32 | =item * C<SSL_REQUIRE> - only use SSL | ||
| 33 | |||
| 34 | =back | ||
| 35 | |||
| 36 | =cut | ||
| 37 | |||
| 38 | use constant { | ||
| 39 | 1 | SSL_DISABLE => 0, | |
| 40 | SSL_PREFER => 1, | ||
| 41 | SSL_REQUIRE => 2, | ||
| 42 | 1 | ▶ | }; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 43 | |||
| 44 | =head2 SSL_NAME_MAP | ||
| 45 | |||
| 46 | Mapping from plain text words to the C<SSL_*> constants. | ||
| 47 | |||
| 48 | =over 4 | ||
| 49 | |||
| 50 | =item * C<disable> | ||
| 51 | |||
| 52 | =item * C<prefer> | ||
| 53 | |||
| 54 | =item * C<require> | ||
| 55 | |||
| 56 | =back | ||
| 57 | |||
| 58 | =cut | ||
| 59 | |||
| 60 | 1 | our %SSL_NAME_MAP = ( | |
| 61 | disable => SSL_DISABLE, | ||
| 62 | prefer => SSL_PREFER, | ||
| 63 | require => SSL_REQUIRE, | ||
| 64 | ); | ||
| 65 | |||
| 66 | 1 | our %EXPORT_TAGS = ( | |
| 67 | v1 => [qw(SSL_DISABLE SSL_PREFER SSL_REQUIRE)], | ||
| 68 | ); | ||
| 69 | 1 | our @EXPORT_OK = uniqstr map { @$_ } values %EXPORT_TAGS; | |
| 70 | |||
| 71 | 1 | 1; | |
| 72 | |||
| 73 | __END__ | ||