Use 120 characters instead of 88 (#856)
This commit is contained in:
parent
f7265f7b91
commit
543961968c
1 changed files with 687 additions and 2142 deletions
|
|
@ -31,11 +31,7 @@ def validate_issuer_url(url: AnyHttpUrl):
|
|||
"""
|
||||
|
||||
# RFC 8414 requires HTTPS, but we allow localhost HTTP for testing
|
||||
if (
|
||||
url.scheme != "https"
|
||||
and url.host != "localhost"
|
||||
and not url.host.startswith("127.0.0.1")
|
||||
):
|
||||
if url.scheme != "https" and url.host != "localhost" and not url.host.startswith("127.0.0.1"):
|
||||
raise ValueError("Issuer URL must be HTTPS")
|
||||
|
||||
# No fragments or query parameters allowed
|
||||
|
|
@ -73,9 +69,7 @@ def create_auth_routes(
|
|||
) -> list[Route]:
|
||||
validate_issuer_url(issuer_url)
|
||||
|
||||
client_registration_options = (
|
||||
client_registration_options or ClientRegistrationOptions()
|
||||
)
|
||||
client_registration_options = client_registration_options or ClientRegistrationOptions()
|
||||
revocation_options = revocation_options or RevocationOptions()
|
||||
metadata = build_metadata(
|
||||
issuer_url,
|
||||
|
|
@ -177,15 +171,11 @@ def build_metadata(
|
|||
|
||||
# Add registration endpoint if supported
|
||||
if client_registration_options.enabled:
|
||||
metadata.registration_endpoint = AnyHttpUrl(
|
||||
str(issuer_url).rstrip("/") + REGISTRATION_PATH
|
||||
)
|
||||
metadata.registration_endpoint = AnyHttpUrl(str(issuer_url).rstrip("/") + REGISTRATION_PATH)
|
||||
|
||||
# Add revocation endpoint if supported
|
||||
if revocation_options.enabled:
|
||||
metadata.revocation_endpoint = AnyHttpUrl(
|
||||
str(issuer_url).rstrip("/") + REVOCATION_PATH
|
||||
)
|
||||
metadata.revocation_endpoint = AnyHttpUrl(str(issuer_url).rstrip("/") + REVOCATION_PATH)
|
||||
metadata.revocation_endpoint_auth_methods_supported = ["client_secret_post"]
|
||||
|
||||
return metadata
|
||||
|
|
|
|||
Loading…
Reference in a new issue