Commit fcb9b2e5 authored by janis.streib's avatar janis.streib 🦉
Browse files

ADD: auth

parent adee9f3f
import requests
from net_suite import app
from flask import jsonify
from net_suite.views import api_login_required
from . import apliste
@apliste.route("/json", methods=["GET"])
@api_login_required
def get_data():
user = request.environ['beaker.session']['login']
if not user.has_permission('nd.global_reader'):
return abort(400)
data = requests.get('{url}/json'.format(url=app.config.get('APLISTE_SERVER_URL')),
cert=(app.config.get('APLISTE_CERT'), app.config.get('APLISTE_KEY'))).json()
return jsonify(data)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment