From 62a54b0cd05992f81cfedb1d642594db43cefe59 Mon Sep 17 00:00:00 2001 From: Sean McArdle Date: Mon, 5 Nov 2018 15:43:53 -0800 Subject: [PATCH] not entirely user where it's going from here. --- .vscode/settings.json | 3 +++ run_app.cmd | 4 ++++ run_app.sh | 3 +++ src/claims.py | 41 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 .vscode/settings.json create mode 100644 run_app.cmd create mode 100644 run_app.sh create mode 100644 src/claims.py diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..8c127e4 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.pythonPath": "C:\\Users\\OR0192682\\AppData\\Local\\Continuum\\anaconda3\\python.exe" +} \ No newline at end of file diff --git a/run_app.cmd b/run_app.cmd new file mode 100644 index 0000000..05fa8bd --- /dev/null +++ b/run_app.cmd @@ -0,0 +1,4 @@ +@echo off +set FLASK_ENV=development +set FLASK_APP=src/claims.py +flask run \ No newline at end of file diff --git a/run_app.sh b/run_app.sh new file mode 100644 index 0000000..9b61c3f --- /dev/null +++ b/run_app.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +FLASK_ENV=development FLASK_APP=src/claims.py flask run \ No newline at end of file diff --git a/src/claims.py b/src/claims.py new file mode 100644 index 0000000..ae6d926 --- /dev/null +++ b/src/claims.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 + +import flask +from flask import request +from flask import render_template + +app = flask.Flask(__name__) + +app.config.update({ + 'SECRET_KEY': 'super duper secret', + 'SAML_METADATA_URL': 'http://somemetadata.com', +}) + + +@app.route('/') +def hello_world(): + return "Hello world!" + + +@app.route('/claims/saml/', methods=['POST', 'GET']) +def get_saml_claims(foo): + error = None + if request.method == 'POST': + r = request + pass + if request.method == 'GET': + # + pass + return render_template('claims.html', error=error) + + +@app.route('/claims/oauth/', methods=['POST', 'GET']) +def get_oauth_claims(foo): + error = None + if request.method == 'POST': + # handle claims token + pass + if request.method == 'GET': + # + pass + return render_template('claims.html', error=error) \ No newline at end of file