Skip to content

Commit ce7cfe7

Browse files
committed
Raise a deprecation warning when calling hash_attributes
Previously, when hash_attributes was provided an empty list of attributes whose values were to be hashed, the deprecation warning would be skipped. Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent a0885b7 commit ce7cfe7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/satosa/deprecated.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -331,15 +331,15 @@ def oidc_subject_type_to_hash_type(subject_type):
331331

332332

333333
def hash_attributes(hash_attributes, internal_attributes, salt):
334+
msg = (
335+
"'USER_ID_HASH_SALT' configuration option is deprecated."
336+
" 'hash' configuration option is deprecated."
337+
" Use the hasher microservice instead."
338+
)
339+
_warnings.warn(msg, DeprecationWarning)
340+
334341
# Hash all attributes specified in INTERNAL_ATTRIBUTES["hash"]
335342
for attribute in hash_attributes:
336-
msg = (
337-
"'USER_ID_HASH_SALT' configuration option is deprecated."
338-
" 'hash' configuration option is deprecated."
339-
" Use the hasher microservice instead."
340-
)
341-
_warnings.warn(msg, DeprecationWarning)
342-
343343
# hash all attribute values individually
344344
if attribute in internal_attributes:
345345
hashed_values = [

0 commit comments

Comments
 (0)