mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-04 01:50:08 +00:00
fix(datasource): Fix datasource resource error (#2394)
This commit is contained in:
commit
1a3970959b
1
.gitignore
vendored
1
.gitignore
vendored
@ -186,3 +186,4 @@ thirdparty
|
|||||||
/examples/**/*.gv.pdf
|
/examples/**/*.gv.pdf
|
||||||
/i18n/locales/**/**/*_ai_translated.po
|
/i18n/locales/**/**/*_ai_translated.po
|
||||||
/i18n/locales/**/**/*~
|
/i18n/locales/**/**/*~
|
||||||
|
configs/my
|
@ -39,6 +39,7 @@ class DBResource(Resource[P], Generic[P]):
|
|||||||
dialect: Optional[str] = None,
|
dialect: Optional[str] = None,
|
||||||
executor: Optional[Executor] = None,
|
executor: Optional[Executor] = None,
|
||||||
prompt_template: str = _DEFAULT_PROMPT_TEMPLATE,
|
prompt_template: str = _DEFAULT_PROMPT_TEMPLATE,
|
||||||
|
**kwargs,
|
||||||
):
|
):
|
||||||
"""Initialize the DB resource."""
|
"""Initialize the DB resource."""
|
||||||
self._name = name
|
self._name = name
|
||||||
|
@ -66,7 +66,7 @@ def _generate_key_from_password(
|
|||||||
algorithm=hashes.SHA256(),
|
algorithm=hashes.SHA256(),
|
||||||
length=32,
|
length=32,
|
||||||
salt=salt,
|
salt=salt,
|
||||||
iterations=100000,
|
iterations=800000,
|
||||||
)
|
)
|
||||||
key = base64.urlsafe_b64encode(kdf.derive(password))
|
key = base64.urlsafe_b64encode(kdf.derive(password))
|
||||||
return key, salt
|
return key, salt
|
||||||
|
Loading…
Reference in New Issue
Block a user