|
Lines 60-65
Config file format:
Link Here
|
| 60 |
add_only_for_matches, add_only_for_new or ignore |
60 |
add_only_for_matches, add_only_for_new or ignore |
| 61 |
import_mode - stage or direct |
61 |
import_mode - stage or direct |
| 62 |
framework - to be used if import_mode is direct |
62 |
framework - to be used if import_mode is direct |
|
|
63 |
connexion_user - User sent from connexion client |
| 64 |
connexion_password - Password sent from connexion client |
| 65 |
|
| 66 |
Note: If connexion parameters are not defined request authentication will not be checked |
| 67 |
You should specify a different user for connexion to protect the Koha credentials |
| 63 |
|
68 |
|
| 64 |
All process related parameters (all but ip and port) have default values as |
69 |
All process related parameters (all but ip and port) have default values as |
| 65 |
per Koha import process. |
70 |
per Koha import process. |
|
Lines 141-146
sub parse_config {
Link Here
|
| 141 |
$self->{password} = delete( $param{password} ) |
146 |
$self->{password} = delete( $param{password} ) |
| 142 |
or die "No koha user password in config file"; |
147 |
or die "No koha user password in config file"; |
| 143 |
|
148 |
|
|
|
149 |
if( defined $param{connexion_user} || defined $param{connexion_password}){ |
| 150 |
# If either is defined we expect both |
| 151 |
$self->{connexion_user} = delete( $param{connexion_user} ) |
| 152 |
or die "No koha connexion_user in config file"; |
| 153 |
$self->{connexion_password} = delete( $param{connexion_password} ) |
| 154 |
or die "No koha user connexion_password in config file"; |
| 155 |
} |
| 156 |
|
| 144 |
$self->{host} = delete( $param{host} ); |
157 |
$self->{host} = delete( $param{host} ); |
| 145 |
$self->{port} = delete( $param{port} ) |
158 |
$self->{port} = delete( $param{port} ) |
| 146 |
or die "Port not specified"; |
159 |
or die "Port not specified"; |
|
Lines 323-328
sub handle_request {
Link Here
|
| 323 |
my ($data, $user, $password) = $self->read_request($io) |
336 |
my ($data, $user, $password) = $self->read_request($io) |
| 324 |
or return $self->error_response("Bad request"); |
337 |
or return $self->error_response("Bad request"); |
| 325 |
|
338 |
|
|
|
339 |
unless( |
| 340 |
!(defined $self->{connexion_user}) || |
| 341 |
($user eq $self->{connexion_user} && $password eq $self->{connexion_password}) |
| 342 |
){ |
| 343 |
return $self->error_response("Unauthorized request"); |
| 344 |
} |
| 345 |
|
| 326 |
my $ua; |
346 |
my $ua; |
| 327 |
if ($self->{user}) { |
347 |
if ($self->{user}) { |
| 328 |
$user = $self->{user}; |
348 |
$user = $self->{user}; |
| 329 |
- |
|
|