MCPcopy Index your code
hub / github.com/1Panel-dev/MaxKB / get_key_pair_by_sql

Function get_key_pair_by_sql

apps/common/utils/rsa_util.py:55–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53
54
55def get_key_pair_by_sql():
56 system_setting = QuerySet(SystemSetting).filter(type=SettingType.RSA.value).first()
57 if system_setting is None:
58 kv = generate()
59 system_setting = SystemSetting(type=SettingType.RSA.value,
60 meta={'key': kv.get('key').decode(), 'value': kv.get('value').decode()})
61 system_setting.save()
62 return system_setting.meta
63
64
65def encrypt(msg, public_key: str | None = None):

Callers 3

profileMethod · 0.90
profileMethod · 0.90
get_key_pairFunction · 0.70

Calls 5

SystemSettingClass · 0.90
decodeMethod · 0.80
generateFunction · 0.70
getMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected