Skip to content

Commit

Permalink
Allow Audience field to be list of strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
HarryMWinters committed Jul 30, 2024
1 parent bd65d53 commit 7100a4b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fastapi_oidc/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class IDToken(BaseModel):

iss: str
sub: str
aud: str
aud: str | list[str]
exp: int
iat: int

Expand Down
10 changes: 10 additions & 0 deletions tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,13 @@ def test_IDToken_takes_arbitrary_extra_fields():
iat=42,
arbitrary_extra_field="Laskuil-Hliz",
)


def test_IDToken_takes_aud_list():
assert types.IDToken(
iss="ClearAirTurbulence",
sub="ValueJudgement",
aud=["SoberCounsel", "AnotherSoberCounsel"],
exp=3,
iat=42,
)

0 comments on commit 7100a4b

Please sign in to comment.