Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow non-HTTPS issuer when OAUTHLIB_INSECURE_TRANSPORT. #803

Merged
merged 2 commits into from Mar 6, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion oauthlib/oauth2/rfc6749/endpoints/metadata.py
Expand Up @@ -16,6 +16,7 @@
from .introspect import IntrospectEndpoint
from .revocation import RevocationEndpoint
from .token import TokenEndpoint
from .utils import is_secure_transport

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -68,7 +69,7 @@ def validate_metadata(self, array, key, is_required=False, is_list=False, is_url
raise ValueError("key {} is a mandatory metadata.".format(key))

elif is_issuer:
if not array[key].startswith("https"):
if not is_secure_transport(array[key]):
luhn marked this conversation as resolved.
Show resolved Hide resolved
raise ValueError("key {}: {} must be an HTTPS URL".format(key, array[key]))
if "?" in array[key] or "&" in array[key] or "#" in array[key]:
raise ValueError("key {}: {} must not contain query or fragment components".format(key, array[key]))
Expand Down