8000 [#1683] Fix is_skill_claim validation for anonymous authentication (#… · marmikreal/botbuilder-python@2bd4d42 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2bd4d42

Browse files
authored
[microsoft#1683] Fix is_skill_claim validation for anonymous authentication (microsoft#1684)
* Fix validation order for anonymous skill claims. * Fix test
1 parent 9f7e654 commit 2bd4d42

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

libraries/botframework-connector/botframework/connector/auth/skill_validation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ def is_skill_claim(claims: Dict[str, object]) -> bool:
6565
:param claims: A dict of claims.
6666
:return bool:
6767
"""
68-
if AuthenticationConstants.VERSION_CLAIM not in claims:
69-
return False
70-
7168
if (
7269
claims.get(AuthenticationConstants.APP_ID_CLAIM, None)
7370
== AuthenticationConstants.ANONYMOUS_SKILL_APP_ID
7471
):
7572
return True
7673

74+
if AuthenticationConstants.VERSION_CLAIM not in claims:
75+
return False
76+
7777
audience = claims.get(AuthenticationConstants.AUDIENCE_CLAIM)
7878

7979
# The audience is https://api.botframework.com and not an appId.

libraries/botframework-connector/tests/test_auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class TestAuth:
5959

6060
@pytest.mark.asyncio
6161
async def test_claims_validation(self):
62-
claims: List[Dict] = []
62+
claims: List[Dict] = {}
6363
default_auth_config = AuthenticationConfiguration()
6464

6565
# No validator should pass.

0 commit comments

Comments
 (0)
0