cleanup unused endpoints
rm /users - not used by any API user rm /audit - replaced by visibility state few commits ago
This commit is contained in:
@@ -23,13 +23,6 @@ def check_api_key(f):
|
|||||||
return f(*args, **kwargs)
|
return f(*args, **kwargs)
|
||||||
return decorated_function
|
return decorated_function
|
||||||
|
|
||||||
@page_api.route("/users")
|
|
||||||
@check_api_key
|
|
||||||
def view_users():
|
|
||||||
resp = g.users
|
|
||||||
print(resp)
|
|
||||||
return jsonify(resp)
|
|
||||||
|
|
||||||
@page_api.route("/cards", methods=["POST"])
|
@page_api.route("/cards", methods=["POST"])
|
||||||
@check_api_key
|
@check_api_key
|
||||||
def get_group_cards():
|
def get_group_cards():
|
||||||
|
@@ -19,5 +19,5 @@ INVENTORY_ASSETS_BASE_URL = os.environ["INVENTORY_ASSETS_BASE_URL"]
|
|||||||
MONGO_URI = os.environ["MONGO_URI"]
|
MONGO_URI = os.environ["MONGO_URI"]
|
||||||
SLACK_VERIFICATION_TOKEN = os.environ["SLACK_VERIFICATION_TOKEN"] # used to verify (deprecated) incoming requests from slack
|
SLACK_VERIFICATION_TOKEN = os.environ["SLACK_VERIFICATION_TOKEN"] # used to verify (deprecated) incoming requests from slack
|
||||||
SLACK_DOORLOG_CALLBACK = os.environ["SLACK_DOORLOG_CALLBACK"] # used for sending logs to private channel
|
SLACK_DOORLOG_CALLBACK = os.environ["SLACK_DOORLOG_CALLBACK"] # used for sending logs to private channel
|
||||||
INVENTORY_API_KEY = os.environ["INVENTORY_API_KEY"]
|
INVENTORY_API_KEY = os.environ["INVENTORY_API_KEY"] # used by doorboy-proxy (@check_api_key)
|
||||||
MACADDRESS_OUTLINK_BASEURL = os.environ["MACADDRESS_OUTLINK_BASEURL"]
|
MACADDRESS_OUTLINK_BASEURL = os.environ["MACADDRESS_OUTLINK_BASEURL"]
|
||||||
|
@@ -256,18 +256,6 @@ def save_inventory_item(item_id=None, **_):
|
|||||||
return render_template("inventory_edit.html", **locals())
|
return render_template("inventory_edit.html", **locals())
|
||||||
return redirect("/m/inventory/%s/view" % item_id)
|
return redirect("/m/inventory/%s/view" % item_id)
|
||||||
|
|
||||||
@page_inventory.route("/m/inventory/<item_id>/archive", methods=['POST'])
|
|
||||||
@login_required
|
|
||||||
def archive_inventory_item(item_id):
|
|
||||||
item = db.inventory.find_one({"_id": ObjectId(item_id)})
|
|
||||||
if not item:
|
|
||||||
return abort(404)
|
|
||||||
if not check_edit_permission(item_id):
|
|
||||||
return abort(403)
|
|
||||||
db.archive.insert_one(item);
|
|
||||||
db.inventory.delete_one({"_id": ObjectId(item_id)})
|
|
||||||
return redirect("/m/inventory")
|
|
||||||
|
|
||||||
@page_inventory.route("/m/inventory/add-slug/<slug>", methods=['GET'])
|
@page_inventory.route("/m/inventory/add-slug/<slug>", methods=['GET'])
|
||||||
@login_required
|
@login_required
|
||||||
def add_inventory_slug(slug):
|
def add_inventory_slug(slug):
|
||||||
|
@@ -192,16 +192,6 @@ def login_dummy():
|
|||||||
def index():
|
def index():
|
||||||
return redirect("/m/inventory")
|
return redirect("/m/inventory")
|
||||||
|
|
||||||
@app.route("/me")
|
|
||||||
@login_required
|
|
||||||
def view_profile():
|
|
||||||
user = read_user()
|
|
||||||
return f"Hello {user['name']}"
|
|
||||||
|
|
||||||
@app.route("/hello")
|
|
||||||
def view_hello():
|
|
||||||
return "Hello!"
|
|
||||||
|
|
||||||
def get_mac_metrics():
|
def get_mac_metrics():
|
||||||
registry = CollectorRegistry()
|
registry = CollectorRegistry()
|
||||||
inventory_item = Gauge('inventory_item_info', 'Information about inventory item', ['mac', 'slug', 'owner', 'user', 'name'], registry=registry)
|
inventory_item = Gauge('inventory_item_info', 'Information about inventory item', ['mac', 'slug', 'owner', 'user', 'name'], registry=registry)
|
||||||
|
Reference in New Issue
Block a user