2023-07-31 09:39:30 +00:00
|
|
|
from common.utils import get_logger
|
2024-11-29 09:51:28 +00:00
|
|
|
from ..base.vault import BaseVault
|
2024-11-19 14:08:03 +00:00
|
|
|
from ...const import VaultTypeChoices
|
2023-07-31 09:39:30 +00:00
|
|
|
|
|
|
|
logger = get_logger(__name__)
|
|
|
|
|
|
|
|
__all__ = ['Vault']
|
|
|
|
|
|
|
|
|
|
|
|
class Vault(BaseVault):
|
2024-11-19 14:08:03 +00:00
|
|
|
type = VaultTypeChoices.local
|
2023-07-31 09:39:30 +00:00
|
|
|
|
|
|
|
def is_active(self):
|
|
|
|
return True, ''
|
|
|
|
|
2024-11-29 09:51:28 +00:00
|
|
|
def _get(self, entry):
|
|
|
|
secret = getattr(entry.instance, '_secret', None)
|
2023-07-31 09:39:30 +00:00
|
|
|
return secret
|
|
|
|
|
2024-11-29 09:51:28 +00:00
|
|
|
def _create(self, entry):
|
2023-07-31 09:39:30 +00:00
|
|
|
""" Ignore """
|
|
|
|
pass
|
|
|
|
|
2024-11-29 09:51:28 +00:00
|
|
|
def _update(self, entry):
|
2023-07-31 09:39:30 +00:00
|
|
|
""" Ignore """
|
|
|
|
pass
|
|
|
|
|
2024-11-29 09:51:28 +00:00
|
|
|
def _delete(self, entry):
|
2023-07-31 09:39:30 +00:00
|
|
|
""" Ignore """
|
|
|
|
pass
|
|
|
|
|
2024-11-29 09:51:28 +00:00
|
|
|
def _save_metadata(self, entry, metadata):
|
2023-07-31 09:39:30 +00:00
|
|
|
""" Ignore """
|
|
|
|
pass
|
|
|
|
|
|
|
|
def _clean_db_secret(self, instance):
|
|
|
|
""" Ignore *重要* 不能删除本地 secret """
|
|
|
|
pass
|