Preserve empty URL paths on OAuth metadata models (#2925)
This commit is contained in:
parent
5a3412ddc1
commit
b7a5bffed0
1 changed files with 19 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
|||
from typing import Any, Literal
|
||||
|
||||
from pydantic import AnyHttpUrl, AnyUrl, BaseModel, Field, field_validator
|
||||
from pydantic import AnyHttpUrl, AnyUrl, BaseModel, ConfigDict, Field, field_validator
|
||||
|
||||
|
||||
class OAuthToken(BaseModel):
|
||||
|
|
@ -37,6 +37,8 @@ class OAuthClientMetadata(BaseModel):
|
|||
See https://datatracker.ietf.org/doc/html/rfc7591#section-2
|
||||
"""
|
||||
|
||||
model_config = ConfigDict(url_preserve_empty_path=True)
|
||||
|
||||
redirect_uris: list[AnyUrl] | None = Field(..., min_length=1)
|
||||
# supported auth methods for the token endpoint
|
||||
token_endpoint_auth_method: (
|
||||
|
|
@ -123,6 +125,8 @@ class OAuthMetadata(BaseModel):
|
|||
See https://datatracker.ietf.org/doc/html/rfc8414#section-2
|
||||
"""
|
||||
|
||||
model_config = ConfigDict(url_preserve_empty_path=True)
|
||||
|
||||
issuer: AnyHttpUrl
|
||||
authorization_endpoint: AnyHttpUrl
|
||||
token_endpoint: AnyHttpUrl
|
||||
|
|
@ -152,6 +156,8 @@ class ProtectedResourceMetadata(BaseModel):
|
|||
See https://datatracker.ietf.org/doc/html/rfc9728#section-2
|
||||
"""
|
||||
|
||||
model_config = ConfigDict(url_preserve_empty_path=True)
|
||||
|
||||
resource: AnyHttpUrl
|
||||
authorization_servers: list[AnyHttpUrl] = Field(..., min_length=1)
|
||||
jwks_uri: AnyHttpUrl | None = None
|
||||
|
|
|
|||
Loading…
Reference in a new issue