Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/testing/web-platform/tests/.well-known/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 2 kB image not shown  

Quelle  web-identity   Sprache: Unknown

 

import importlib
keys = importlib.import_module("fedcm.support.keys")

def main(request, response):
  namespace = "/.well-known/web-identity"

  well_known_format = request.server.stash.take(keys.WELL_KNOWN_FORMAT_KEY, namespace)

  port = request.server.config.ports["https"][0]
  hostname = request.url_parts.hostname
  base_url = "https://{0}:{1}".format(hostname, str(port))

  manifest_url = request.server.stash.take(keys.MANIFEST_URL_IN_MANIFEST_LIST_KEY, namespace)

  if manifest_url is None or not len(manifest_url):
    manifest_url = "{0}/fedcm/support/manifest.py".format(base_url)
  else:
    try:
      manifest_url = manifest_url.decode()
    except (UnicodeDecodeError, AttributeError):
      pass

  if len(request.cookies) > 0:
    return (530, [], "Cookie should not be sent to manifest list endpoint")
  if request.headers.get(b"Accept") != b"application/json":
    return (531, [], "Wrong Accept")
  if request.headers.get(b"Sec-Fetch-Dest") != b"webidentity":
    return (532, [], "Wrong Sec-Fetch-Dest header")
  if request.headers.get(b"Referer"):
    return (533, [], "Should not have Referer")
  if request.headers.get(b"Origin"):
    return (534, [], "Should not have Origin")
  if request.headers.get(b"Sec-Fetch-Mode") != b"no-cors":
    return (535, [], "Wrong Sec-Fetch-Mode header")
  if request.headers.get(b"Sec-Fetch-Site") != b"cross-site":
    return (536, [], "Wrong Sec-Fetch-Site header")

  response.headers.set(b"Content-Type", b"application/json")

  # Handle different well-known formats
  if well_known_format:
    try:
      format_type = well_known_format.decode()
    except (UnicodeDecodeError, AttributeError):
      format_type = str(well_known_format)

    if format_type == "direct":
      # Direct endpoints format with abs URLs
      return """
{{
  "accounts_endpoint": "{0}/fedcm/support/accounts.py",
  "login_url": "{0}/fedcm/support/login.html"
}}
""".format(base_url)
    elif format_type == "empty":
      # Empty endpoints (keep as empty strings)
      return """
{
  "accounts_endpoint": "",
  "login_url": ""
}
"""
    elif format_type == "missing":
      # Missing required endpoints
      return """
{
}
"""
    elif format_type == "partial_accounts":
      # Only accounts_endpoint with abs URL
      return """
{{
  "accounts_endpoint": "{0}/fedcm/support/accounts.py"
}}
""".format(base_url)
    elif format_type == "partial_login":
      # Only login_url with abs URL
      return """
{{
  "login_url": "{0}/fedcm/support/login.html"
}}
""".format(base_url)
  # Default: provider_urls
  return """
{{
  "provider_urls": [
    "{0}"
  ]
}}
""".format(manifest_url)

¤ Dauer der Verarbeitung: 0.17 Sekunden  (vorverarbeitet am  2026-10-11) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.