Doesnt work but may be getting somewhere.

dev
Sean McArdle 2018-11-05 16:18:27 -08:00
parent 62a54b0cd0
commit 688be51a2e
3 changed files with 78 additions and 10 deletions

64
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,64 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File (Integrated Terminal)",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
},
{
"name": "Python: Attach",
"type": "python",
"request": "attach",
"port": 5678,
"host": "localhost"
},
{
"name": "Python: Module",
"type": "python",
"request": "launch",
"module": "enter-your-module-name-here",
"console": "integratedTerminal"
},
{
"name": "Python: Django",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/manage.py",
"console": "integratedTerminal",
"args": [
"runserver",
"--noreload",
"--nothreading"
],
"django": true
},
{
"name": "Python: Flask",
"type": "python",
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "claims.py"
},
"args": [
"run",
"--no-debugger",
"--no-reload"
],
"jinja": true
},
{
"name": "Python: Current File (External Terminal)",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "externalTerminal"
}
]
}

View File

@ -1,4 +1,4 @@
@echo off
set FLASK_ENV=development
set FLASK_APP=src/claims.py
flask run
python %FLASK_APP%

View File

@ -1,6 +1,8 @@
#!/usr/bin/env python3
import flask
import json
from flask import jsonify
from flask import request
from flask import render_template
@ -17,20 +19,18 @@ def hello_world():
return "Hello world!"
@app.route('/claims/saml/', methods=['POST', 'GET'])
def get_saml_claims(foo):
@app.route('/claims/saml', methods=['POST', 'GET'])
def get_saml_claims():
error = None
if request.method == 'POST':
r = request
pass
return json.dumps(request.get_data(), sort_keys=True)
if request.method == 'GET':
#
pass
return render_template('claims.html', error=error)
return "Dude where's my claims?"
@app.route('/claims/oauth/', methods=['POST', 'GET'])
def get_oauth_claims(foo):
def get_oauth_claims():
error = None
if request.method == 'POST':
# handle claims token
@ -38,4 +38,8 @@ def get_oauth_claims(foo):
if request.method == 'GET':
#
pass
return render_template('claims.html', error=error)
return render_template('claims.html', error=error)
if __name__ == "__main__":
app.run(ssl_context='adhoc')