Skip to content

Commit 60fd953

Browse files
fix bandit false positive error
1 parent a35b6a0 commit 60fd953

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

archipy/helpers/utils/jwt_utils.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,9 @@ def create_token(
7777
to_encode.update(additional_claims)
7878

7979
# Validate SECRET_KEY
80-
arg_secret_key = "SECRET_KEY"
8180
secret_key = configs.SECRET_KEY
8281
if secret_key is None:
83-
raise InvalidArgumentError(arg_secret_key)
82+
raise InvalidArgumentError("SECRET_KEY")
8483
return jwt.encode(to_encode, secret_key.get_secret_value(), algorithm=configs.HASH_ALGORITHM)
8584

8685
@classmethod
@@ -183,10 +182,9 @@ def decode_token(
183182

184183
try:
185184
# Validate SECRET_KEY
186-
arg_secret_key = "SECRET_KEY"
187185
secret_key = configs.SECRET_KEY
188186
if secret_key is None:
189-
raise InvalidArgumentError(arg_secret_key)
187+
raise InvalidArgumentError("SECRET_KEY")
190188

191189
payload = jwt.decode(
192190
token,

0 commit comments

Comments
 (0)