96c7a43187
Pydantic's AnyHttpUrl automatically appends a trailing slash to bare hostnames (e.g., http://localhost:8000 becomes http://localhost:8000/). This causes OAuth discovery to fail in clients that validate per RFC 8414 §3.3 and RFC 9728 §3, which require the returned issuer/resource URL to be identical to the URL used for discovery. Add field_serializer to OAuthMetadata.issuer, ProtectedResourceMetadata.resource, and ProtectedResourceMetadata.authorization_servers to strip the trailing slash during JSON serialization. Fixes #1919 Fixes #1265 Reported-by: joar Github-Issue: #1919