core (memory): Modernize methods signature/docstrings of encrypt_value and decrypt_value:

- Use `client` instead of `profile`
- Add `decrypt_value_by_profile` which is notably useful on client startup, when the
  encrypted password needs to be retrieved, and the `SatXMPPEntity` instance is not yet
  created.
- Add type hints/update docstrings

rel 477
This commit is contained in:
Goffi 2026-06-06 11:23:51 +02:00
commit ed462a661b

View file

@ -16,6 +16,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from libervia.backend import G
from libervia.backend.core.i18n import _, D_
from libervia.backend.core import exceptions
@ -515,7 +516,7 @@ class Params(object):
raise exceptions.ProfileNotSetError(
"The profile is needed to decrypt a password"
)
password = self.host.memory.decrypt_value(value, profile)
password = self.host.memory.decrypt_value_by_profile(value, profile)
if password is None:
raise exceptions.InternalError("password should never be None")