From 6857bed21319f88895404548a10e010d5cbe1a02 Mon Sep 17 00:00:00 2001 From: John Nduli Date: Thu, 5 Sep 2024 02:09:50 +0300 Subject: feat: require auth for edit api call --- gn3/api/metadata_api/wiki.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gn3/api') diff --git a/gn3/api/metadata_api/wiki.py b/gn3/api/metadata_api/wiki.py index 6436f3d..72bbda2 100644 --- a/gn3/api/metadata_api/wiki.py +++ b/gn3/api/metadata_api/wiki.py @@ -2,6 +2,7 @@ import datetime from typing import Any, Dict +from gn3.auth.authorisation.oauth2.resource_server import require_oauth from flask import Blueprint, request, jsonify, current_app, make_response from gn3 import db_utils from gn3.db import wiki @@ -13,6 +14,7 @@ wiki_blueprint = Blueprint("wiki", __name__, url_prefix="wiki") @wiki_blueprint.route("//edit", methods=["POST"]) +@require_oauth("profile") def edit_wiki(comment_id: int): """Edit wiki comment. This is achieved by adding another entry with a new VersionId""" # FIXME: attempt to check and fix for types here with relevant errors -- cgit v1.2.3