Merge pull request #22330 from blaggacao/feat/improve-openid-connect-devx

feat: improve openid connect devx
This commit is contained in:
mergify[bot] 2023-10-07 13:43:36 +00:00 committed by GitHub
commit eee418a4c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 1 deletions

View file

@ -9,6 +9,7 @@ import re
from werkzeug.exceptions import HTTPException, NotFound
from werkzeug.middleware.profiler import ProfilerMiddleware
from werkzeug.middleware.proxy_fix import ProxyFix
from werkzeug.middleware.shared_data import SharedDataMiddleware
from werkzeug.wrappers import Request, Response
from werkzeug.wsgi import ClosingIterator
@ -413,7 +414,13 @@ def sync_database(rollback: bool) -> bool:
def serve(
port=8000, profile=False, no_reload=False, no_threading=False, site=None, sites_path="."
port=8000,
profile=False,
no_reload=False,
no_threading=False,
site=None,
sites_path=".",
proxy=False,
):
global application, _site, _sites_path
_site = site
@ -427,6 +434,9 @@ def serve(
if not os.environ.get("NO_STATICS"):
application = application_with_statics()
if proxy or os.environ.get("USE_PROXY"):
application = ProxyFix(application, x_for=1, x_proto=1, x_host=1, x_port=1, x_prefix=1)
application.debug = True
application.config = {"SERVER_NAME": "127.0.0.1:8000"}

View file

@ -929,6 +929,12 @@ def run_ui_tests(
@click.command("serve")
@click.option("--port", default=8000)
@click.option("--profile", is_flag=True, default=False)
@click.option(
"--proxy",
is_flag=True,
default=False,
help="The development server may be run behind a proxy, e.g. ngrok / localtunnel",
)
@click.option("--noreload", "no_reload", is_flag=True, default=False)
@click.option("--nothreading", "no_threading", is_flag=True, default=False)
@click.option("--with-coverage", is_flag=True, default=False)
@ -937,6 +943,7 @@ def serve(
context,
port=None,
profile=False,
proxy=False,
no_reload=False,
no_threading=False,
sites_path=".",
@ -958,6 +965,7 @@ def serve(
frappe.app.serve(
port=port,
profile=profile,
proxy=proxy,
no_reload=no_reload,
no_threading=no_threading,
site=site,

View file

@ -61,6 +61,10 @@ website_route_rules = [
website_redirects = [
{"source": r"/desk(.*)", "target": r"/app\1"},
{
"source": "/.well-known/openid-configuration",
"target": "/api/method/frappe.integrations.oauth2.openid_configuration",
},
]
base_template = "templates/base.html"