From 9bacc257ba784e06bb5f91e8ab3b64805b552f21 Mon Sep 17 00:00:00 2001 From: John Nduli Date: Tue, 15 Oct 2024 19:34:11 +0300 Subject: fix: use require_token to validate gn3 apis --- gn3/api/metadata_api/wiki.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gn3/api/metadata_api/wiki.py') diff --git a/gn3/api/metadata_api/wiki.py b/gn3/api/metadata_api/wiki.py index e8c59b5..7a00786 100644 --- a/gn3/api/metadata_api/wiki.py +++ b/gn3/api/metadata_api/wiki.py @@ -6,7 +6,7 @@ from typing import Any, Dict from flask import Blueprint, request, jsonify, current_app, make_response from gn3 import db_utils -from gn3.auth.authorisation.oauth2.resource_server import require_oauth +from gn3.oauth2.authorisation import require_token from gn3.db import wiki from gn3.db.rdf.wiki import ( get_wiki_entries_by_symbol, @@ -21,8 +21,8 @@ rif_blueprint = Blueprint("rif", __name__, url_prefix="rif") @wiki_blueprint.route("//edit", methods=["POST"]) -@require_oauth("profile") -def edit_wiki(comment_id: int): +@require_token +def edit_wiki(comment_id: int, **kwargs): """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 payload: Dict[str, Any] = request.json # type: ignore -- cgit 1.4.1