Allow creation of api keys scoped to functions
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user