|
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): |
@@ -41,6 +41,8 @@ class OAuthClientMetadata(BaseModel): |
41 | 41 | for the full specification. |
42 | 42 | """ |
43 | 43 |
|
| 44 | + model_config = ConfigDict(url_preserve_empty_path=True) |
| 45 | + |
44 | 46 | redirect_uris: list[AnyUrl] | None = Field(..., min_length=1) |
45 | 47 | # supported auth methods for the token endpoint |
46 | 48 | token_endpoint_auth_method: ( |
@@ -132,6 +134,8 @@ class OAuthMetadata(BaseModel): |
132 | 134 | See https://datatracker.ietf.org/doc/html/rfc8414#section-2 |
133 | 135 | """ |
134 | 136 |
|
| 137 | + model_config = ConfigDict(url_preserve_empty_path=True) |
| 138 | + |
135 | 139 | issuer: AnyHttpUrl |
136 | 140 | authorization_endpoint: AnyHttpUrl |
137 | 141 | token_endpoint: AnyHttpUrl |
@@ -162,6 +166,8 @@ class ProtectedResourceMetadata(BaseModel): |
162 | 166 | See https://datatracker.ietf.org/doc/html/rfc9728#section-2 |
163 | 167 | """ |
164 | 168 |
|
| 169 | + model_config = ConfigDict(url_preserve_empty_path=True) |
| 170 | + |
165 | 171 | resource: AnyHttpUrl |
166 | 172 | authorization_servers: list[AnyHttpUrl] = Field(..., min_length=1) |
167 | 173 | jwks_uri: AnyHttpUrl | None = None |
|
0 commit comments