Link: https://github.com/apache/airflow/blob/main/airflow/models/variable.py

Methods to migrate:

- val
- set 
- delete
- update

Note that get_variable_from_secrets shouls still be executed locally.

It may be better to first close https://github.com/apache/airflow/issues/28267
if self._val:
            mask_secret(self.val, self.key)
    def __repr__(self):
        
        return f"{self.key} : {self._val}"
    def get_val(self):
        """Get Airflow Variable from Metadata DB and decode it using the Fernet Key"""
        from cryptography.fernet import InvalidToken as InvalidFernetToken
        if self._val is not None and self.is_encrypted:
            try:
                fernet = get_fernet()
                return fernet.decrypt(bytes(self._val, "utf-8")).decode()
            except InvalidFernetToken:
                self.log.error("Can't decrypt _val for key=%s, invalid token or value", self.key)
                return None
            except Exception:
                self.log.error("Can't decrypt _val for key=%s, FERNET_KEY configuration missing", self.key)
                return None
        else:
            return self._val
    def set_val(self, value):
        """Encode the specified value with Fernet Key and store it in Variables Table."""
        if value is not None:
            fernet = get_fernet()
            self._val = fernet.encrypt(bytes(value, "utf-8")).decode()
            self.is_encrypted = fernet.is_encrypted
    @declared_attr
    def val(cls):