=head3 get_hash
Generates a hashed value for $s (e.g. borrowernumber) with Bcrypt.
- Needs config entry 'key' in koha-conf.
+ Needs config entry 'bcrypt_settings' in koha-conf.
=cut
sub get_hash {
my ( $class, $s ) = @_;
- my $key = C4::Context->config('key');
+ my $bcrypt_settings = C4::Context->config('bcrypt_settings');
Koha::Exceptions::Config::MissingEntry->throw(
- "Missing 'key' entry in config file") unless $key;
+ "Missing 'bcrypt_settings' entry in config file") unless $bcrypt_settings;
- return bcrypt($s, $key);
+ return bcrypt($s, $bcrypt_settings);
}
=head2 Internal methods
}
{
- # Test 'key' config for Pseudonymization
- $template->param( config_key_no_set => 1 )
+ # Test 'bcrypt_settings' config for Pseudonymization
+ $template->param( config_bcrypt_settings_no_set => 1 )
if C4::Context->preference('Pseudonymization')
- and not C4::Context->config('key');
+ and not C4::Context->config('bcrypt_settings');
}
my %versions = C4::Context::get_versions();
-e "s/__UNIXGROUP__/$username/g" \
-e "s#__TEMPLATE_CACHE_DIR__#$TEMPLATE_CACHE_DIR#g" \
-e "s#__TIMEZONE__#$TIMEZONE#g" \
- -e "s#__KEY__#$KEY#g" \
+ -e "s#__BCRYPT_SETTINGS__#$BCRYPT_SETTINGS#g" \
-e "s#__UPLOAD_PATH__#$UPLOAD_PATH#g" \
-e "s#__TMP_PATH__#$TMP_PATH#g" \
-e "s/__LOG_DIR__/\/var\/log\/koha\/$name/g" \
ELASTICSEARCH_SERVER="${CLO_ELASTICSEARCH_SERVER}"
fi
-KEY=$(htpasswd -bnBC 10 "" password | tr -d ':\n' | sed 's/$2y/$2a/');
+BCRYPT_SETTINGS=$(htpasswd -bnBC 10 "" password | tr -d ':\n' | sed 's/$2y/$2a/');
if [ "$ENABLE_SRU" != "no" ]; then
server. e.g. Antarctica/South_Pole -->
<timezone>__TIMEZONE__</timezone>
- <!-- This is the salt used to generated anonymized content -->
- <key>__KEY__</key>
+ <!-- This is the bcryt settings used to generated anonymized content -->
+ <key>__BCRYPT_SETTINGS__</key>
<!-- flag for development purposes
dev_install is used to adjust some paths specific to dev installations
server. e.g. Antarctica/South_Pole -->
<timezone></timezone>
- <!-- This is the salt used to generated anonymized content -->
- <key>__KEY__</key>
+ <!-- This is the bcryt settings used to generated anonymized content -->
+ <key>__BCRYPT_SETTINGS__</key>
<!-- flag for development purposes
dev_install is used to adjust some paths specific to dev installations
</div>
<div id="sysinfo">
- [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnNoActiveCurrency || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships || log4perl_errors || config_key_no_set %]
+ [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnNoActiveCurrency || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships || log4perl_errors || config_bcrypt_settings_no_set %]
[% IF (warnIsRootUser) %]
<h2>Warning regarding current user</h2>
<p>You are logged in as the database administrative user. This is not recommended because some parts of Koha will not function as expected when using this account.</p>
[% END %]
[% END %]
- [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnNoActiveCurrency || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules || config_key_no_set %]
+ [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnNoActiveCurrency || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules || config_bcrypt_settings_no_set %]
<h2>Warnings regarding the system configuration</h2>
<table>
<caption>Preferences and parameters</caption>
Some system preferences have badly formatted YAML content: [% bad_yaml_prefs.join(', ') | html %]
</td></tr>
[% END %]
- [% IF config_key_no_set %]
+ [% IF config_bcrypt_settings_no_set %]
<tr><th scope="row"><b>Warning</b> </th><td>
- System preference 'Pseudonymization' is set, but there is not 'key' entry defined in the $KOHA_CONF file.
+ System preference 'Pseudonymization' is set, but there is not 'bcrypt_settings' entry defined in the $KOHA_CONF file.
</td></tr>
[% END %]
</table>
$schema->storage->txn_begin;
- t::lib::Mocks::mock_config( 'key', '' );
+ t::lib::Mocks::mock_config( 'bcrypt_settings', '' );
t::lib::Mocks::mock_preference( 'Pseudonymization', 1 );
t::lib::Mocks::mock_preference( 'PseudonymizationPatronFields', 'branchcode,categorycode,sort1' );
);
} catch {
- ok($_->isa('Koha::Exceptions::Config::MissingEntry'), "Koha::Patron->store should raise a Koha::Exceptions::Config::MissingEntry if 'key' is not defined in the config");
- is( $_->message, "Missing 'key' entry in config file");
+ ok($_->isa('Koha::Exceptions::Config::MissingEntry'), "Koha::Patron->store should raise a Koha::Exceptions::Config::MissingEntry if 'bcrypt_settings' is not defined in the config");
+ is( $_->message, "Missing 'bcrypt_settings' entry in config file");
};
$schema->storage->txn_rollback;
$schema->storage->txn_begin;
- t::lib::Mocks::mock_config( 'key', '$2a$08$9lmorEKnwQloheaCLFIfje' );
+ t::lib::Mocks::mock_config( 'bcrypt_settings', '$2a$08$9lmorEKnwQloheaCLFIfje' );
my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
$schema->storage->txn_begin;
- t::lib::Mocks::mock_config( 'key', '$2a$08$9lmorEKnwQloheaCLFIfje' );
+ t::lib::Mocks::mock_config( 'bcrypt_settings', '$2a$08$9lmorEKnwQloheaCLFIfje' );
t::lib::Mocks::mock_preference( 'Pseudonymization', 1 );
t::lib::Mocks::mock_preference( 'PseudonymizationPatronFields',
'branchcode,categorycode,sort1' );