1- \" \" \ "OAuth 2.0 URL validation helpers for MCP authorization servers .
1+ "" "OAuth 2.0 URL validation helpers for MCP authorization servers.
22
33RFC 9700 4.1.1 and RFC 7591 2 require HTTPS for authorization endpoint URLs
44and registered redirect_uris, with an HTTP loopback exception for local
55development.
6- \" \" \ "
6+ "" "
77
88from pydantic import AnyHttpUrl
99
1010
1111def validate_issuer_url (url : AnyHttpUrl ):
12- \" \" \ "Validate that the issuer URL meets OAuth 2.0 requirements .
12+ "" "Validate that the issuer URL meets OAuth 2.0 requirements.
1313
1414 Args:
1515 url: The issuer URL to validate.
1616
1717 Raises:
1818 ValueError: If the issuer URL is invalid.
19- \ " \" \ "
19+ "" "
2020 if url .scheme != "https" and url .host not in ("localhost" , "127.0.0.1" , "[::1]" ):
2121 raise ValueError ("Issuer URL must be HTTPS" )
2222
@@ -27,7 +27,7 @@ def validate_issuer_url(url: AnyHttpUrl):
2727
2828
2929def validate_redirect_uri (url : AnyHttpUrl ):
30- \" \" \ "Validate a registered redirect_uri for DCR .
30+ "" "Validate a registered redirect_uri for DCR.
3131
3232 RFC 9700 section 4.1.1 and RFC 7591 section 2 require HTTPS for
3333 redirect_uris, with an HTTP loopback exception for local development.
@@ -38,7 +38,7 @@ def validate_redirect_uri(url: AnyHttpUrl):
3838 Raises:
3939 ValueError: If the redirect URI uses an unsafe scheme or contains
4040 a fragment.
41- \ " \" \ "
41+ "" "
4242 if url .scheme != "https" and url .host not in ("localhost" , "127.0.0.1" , "[::1]" ):
4343 raise ValueError ("Redirect URI must use HTTPS (or HTTP loopback for local development)" )
4444
0 commit comments