Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  web-identity

  Sprache: C
 

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)

Messung V0.5 in Prozent
C=83 H=96 G=89

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© 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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002