File size: 710 Bytes
dcb132a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import flask
import src.functions.config

rebuildBP = flask.Blueprint("rebuild", __name__)

import main


@rebuildBP.route("/api/v1/rebuild")
def rebuildFunction():
    secret = flask.request.args.get("secret")  # SECRET
    config = src.functions.config.readConfig()

    if secret == config.get("secret_key"):
        res, code = main.threaded_metadata()
        return flask.jsonify(res), code
    else:
        return (
            flask.jsonify(
                {
                    "code": 401,
                    "content": None,
                    "message": "The secret key provided was incorrect.",
                    "success": False,
                }
            ),
            401,
        )