Have update user use config cost to salt passwords
`PUT /biome/user/{user_id}` used the default cost to salt new
passwords. This resulted in a performance hit when updating a user's
password. The route now uses the encryption cost defined in the
REST API config.
@@ -150,6 +150,7 @@ fn add_modify_user_method(
secret_manager: Arc<dyn SecretManager>,
key_store: Arc<dyn KeyStore>,
) -> HandlerFunction {
+ let ecryption_cost = rest_config.password_encryption_cost();
Box::new(move |request, payload| {
let credentials_store = credentials_store.clone();
let key_store = key_store.clone();
@@ -228,6 +229,7 @@ fn add_modify_user_method(
match CredentialsBuilder::default()
.with_user_id(&credentials.user_id)
.with_username(&credentials.username)
+ .with_password_encryption_cost(ecryption_cost)
.with_password(&val)
.build()
{
