diff --git a/physionet-django/user/validators.py b/physionet-django/user/validators.py index 2c306243b..edc19c2a4 100644 --- a/physionet-django/user/validators.py +++ b/physionet-django/user/validators.py @@ -211,6 +211,7 @@ def validate_nan(value): if re.fullmatch(r'[0-9\-+()]*', value): raise ValidationError('Cannot be a number.') + def validate_orcid_token(value): """ Validation to verify the token returned during @@ -219,6 +220,7 @@ def validate_orcid_token(value): if not re.fullmatch(r'^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$', value): raise ValidationError('ORCID token is not in expected format.') + def validate_orcid_id_token(token): """ When openid scope is enabled then ORCID returns @@ -246,7 +248,7 @@ def validate_orcid_id_token(token): audience=settings.ORCID_CLIENT_ID, issuer=settings.ORCID_DOMAIN ) - except jwt.InvalidTokenError as e: + except jwt.InvalidTokenError: raise ValidationError('ORCID id_token is invalid.') def validate_orcid_id(value): diff --git a/requirements.txt b/requirements.txt index 6e0df478e..cbbdbc7a6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -539,6 +539,9 @@ pyasn1==0.4.8 ; python_version >= "3.9" and python_version < "4.0" \ pycparser==2.20 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0 \ --hash=sha256:7582ad22678f0fcd81102833f60ef8d0e57288b6b5fb00323d101be910e35705 +pyjwt==2.9.0 ; python_version >= "3.9" and python_version < "4.0" \ + --hash=sha256:3b02fb0f44517787776cf48f2ae25d8e14f300e6d7545a4315cee571a415e850 \ + --hash=sha256:7e1e5b56cc735432a7369cbfa0efe50fa113ebecdc04ae6922deba8b84582d0c pyopenssl==23.2.0 ; python_version >= "3.9" and python_version < "4.0" \ --hash=sha256:24f0dc5227396b3e831f4c7f602b950a5e9833d292c8e4a2e06b709292806ae2 \ --hash=sha256:276f931f55a452e7dea69c7173e984eb2a4407ce413c918aa34b55f82f9b8bac