diff --git a/routes/settings.py b/routes/settings.py index 74395c8..481b2bd 100644 --- a/routes/settings.py +++ b/routes/settings.py @@ -18,14 +18,18 @@ def api_keys(): if isinstance(key['scopes'], str): key['scopes'] = json.loads(key['scopes']) + # Fetch user's functions for scoping + functions = db.get_http_functions_for_user(user_id) + if htmx: return render_block( environment, "dashboard/settings/api_keys.html", "page", - api_keys=api_keys + api_keys=api_keys, + functions=functions ) - return render_template("dashboard/settings/api_keys.html", api_keys=api_keys) + return render_template("dashboard/settings/api_keys.html", api_keys=api_keys, functions=functions) @settings.route("/api-keys", methods=["POST"]) @login_required diff --git a/templates/dashboard/settings/api_keys.html b/templates/dashboard/settings/api_keys.html index ff13a6c..e82699c 100644 --- a/templates/dashboard/settings/api_keys.html +++ b/templates/dashboard/settings/api_keys.html @@ -96,9 +96,21 @@ class="rounded border-gray-300 text-blue-600 focus:ring-blue-500"> Full Access (*) - + +
Or limit to specific functions:
+Currently only full access is supported via UI.
+Select "Full Access" or specific functions.