|
1 | 1 | from typing import Any, Literal |
2 | 2 |
|
3 | | -from pydantic import AnyHttpUrl, AnyUrl, BaseModel, Field, field_validator |
| 3 | +from pydantic import AnyHttpUrl, AnyUrl, BaseModel, ConfigDict, Field, field_validator |
4 | 4 |
|
5 | 5 |
|
6 | 6 | class OAuthToken(BaseModel): |
@@ -37,6 +37,8 @@ class OAuthClientMetadata(BaseModel): |
37 | 37 | See https://datatracker.ietf.org/doc/html/rfc7591#section-2 |
38 | 38 | """ |
39 | 39 |
|
| 40 | + model_config = ConfigDict(url_preserve_empty_path=True) |
| 41 | + |
40 | 42 | redirect_uris: list[AnyUrl] | None = Field(..., min_length=1) |
41 | 43 | # supported auth methods for the token endpoint |
42 | 44 | token_endpoint_auth_method: ( |
@@ -123,6 +125,8 @@ class OAuthMetadata(BaseModel): |
123 | 125 | See https://datatracker.ietf.org/doc/html/rfc8414#section-2 |
124 | 126 | """ |
125 | 127 |
|
| 128 | + model_config = ConfigDict(url_preserve_empty_path=True) |
| 129 | + |
126 | 130 | issuer: AnyHttpUrl |
127 | 131 | authorization_endpoint: AnyHttpUrl |
128 | 132 | token_endpoint: AnyHttpUrl |
@@ -152,6 +156,8 @@ class ProtectedResourceMetadata(BaseModel): |
152 | 156 | See https://datatracker.ietf.org/doc/html/rfc9728#section-2 |
153 | 157 | """ |
154 | 158 |
|
| 159 | + model_config = ConfigDict(url_preserve_empty_path=True) |
| 160 | + |
155 | 161 | resource: AnyHttpUrl |
156 | 162 | authorization_servers: list[AnyHttpUrl] = Field(..., min_length=1) |
157 | 163 | jwks_uri: AnyHttpUrl | None = None |
|
0 commit comments