From 11acbd8e1e67f127d29cdebc77d6479d6ee7c1cc Mon Sep 17 00:00:00 2001 From: iFargle Date: Tue, 21 Feb 2023 11:34:40 +0900 Subject: [PATCH] test --- server.py | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/server.py b/server.py index f301074..f37aba7 100644 --- a/server.py +++ b/server.py @@ -76,20 +76,6 @@ if AUTH_TYPE == "oidc": from flask_oidc import OpenIDConnect oidc = OpenIDConnect(app) - # Decorate all functions with @oidc.require_login: - # Get a list of all public pages: - output = [] - for rule in app.url_map.iter_rules(): - options = {} - for arg in rule.arguments: - options[arg] = "[{0}]".format(arg) - methods = ','.join(rule.methods) - url = url_for(rule.endpoint, **options) - line = urllib.unquote("{:50s} {:20s} {}".format(rule.endpoint, methods, url)) - output.append(line) - for line in sorted(output): - LOG.error(line) - elif AUTH_TYPE == "basic": # https://flask-basicauth.readthedocs.io/en/latest/ LOG.error("Loading basic auth libraries and configuring app...") @@ -109,6 +95,11 @@ elif AUTH_TYPE == "basic": #def oidctest_page(): # return 'Welcome %s' % oidc.user_getfield('email') +# Get URL list +@app.route('/site-map') +def site_map_page(): + return ['%s' % rule for rule in app.url_map.iter_rules()] + @app.route('/') @app.route('/overview') def overview_page():