def mask_secrets(self, value):
        """
        Process the model dictionary and mask secret values.

        NOTE: This method results in one addition "get one" query where we retrieve corresponding
        action model so we can correctly mask secret parameters.

        :type value: ``dict``
        :param value: Document dictionary.

        :rtype: ``dict``
        """
        result = copy.deepcopy(value)

        action_ref = result.get("action", {}).get("ref", None)

        if not action_ref:
            return result

        action_db = self._get_referenced_action_model(action_ref=action_ref)

        if not action_db:
            return result

        secret_parameters = get_secret_parameters(parameters=action_db.parameters)
        result["action"]["parameters"] = mask_secret_parameters(
            parameters=result["action"]["parameters"],
            secret_parameters=secret_parameters,
        )

        return result

        Process the model dictionary and mask secret values.

        NOTE: This method results in one addition "get one" query where we retrieve corresponding
        action model so we can correctly mask secret parameters.

        :type value: ``dict``
        :param value: Document dictionary.

        :rtype: ``dict``
        
st2common/st2common/models/db/rule.py