diff options
author | Javier Sánchez Parra <jsanchez@soleta.eu> | 2022-05-04 17:22:38 +0200 |
---|---|---|
committer | Javier Sánchez Parra <jsanchez@soleta.eu> | 2022-05-06 09:55:58 +0200 |
commit | ce651453c420527208d2c7a26a9634de59b09a1e (patch) | |
tree | 76ea7f6013deb2b6bcda73f797e46d5ecc53b895 /ogcp/views.py | |
parent | 72c10e15298aef311eed2aeb4774bf78029ea075 (diff) |
Add MAC to pills
Retrieve and cache MACs one by one as users select clients.
Diffstat (limited to 'ogcp/views.py')
-rw-r--r-- | ogcp/views.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ogcp/views.py b/ogcp/views.py index 7f54bcf..aae889f 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -284,6 +284,18 @@ def scopes_status(): scopes, _clients = get_scopes() return jsonify(scopes) + +@app.route('/client/mac', methods=['GET']) +@login_required +def get_client_mac(): + ip = parse_elements(request.args.to_dict()) + payload = {'client': list(ip)} + resp = g.server.get('/client/info', payload) + client_info = resp.json() + mac = client_info.get('mac') + return jsonify(mac) + + @app.route('/scopes/') @login_required def scopes(): |