Skip to content

Commit 26bf00d

Browse files
committed
Fix algorithm instantiation in PBKDF2HMAC
1 parent cac696e commit 26bf00d

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

llmstack/base/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def salt(self):
284284
@staticmethod
285285
def get_cipher(token, salt):
286286
kdf = PBKDF2HMAC(
287-
algorithm=hashes.SHA256,
287+
algorithm=hashes.SHA256(),
288288
iterations=100000,
289289
length=32,
290290
salt=salt,

llmstack/organizations/models.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
77
from django.conf import settings
88
from django.contrib.postgres.fields import ArrayField as PGArrayField
9-
from django.db import connection
10-
from django.db import models
9+
from django.db import connection, models
1110
from django.db.models.signals import post_save
1211
from django.dispatch import receiver
1312

14-
from llmstack.common.utils.db_models import ArrayField
15-
1613
from llmstack.apps.models import AppVisibility
14+
from llmstack.common.utils.db_models import ArrayField
1715

1816

1917
class Organization(models.Model):
@@ -159,7 +157,7 @@ def salt(self):
159157
@staticmethod
160158
def get_cipher(token, salt):
161159
kdf = PBKDF2HMAC(
162-
algorithm=hashes.SHA256,
160+
algorithm=hashes.SHA256(),
163161
iterations=100000,
164162
length=32,
165163
salt=salt,

0 commit comments

Comments
 (0)