Merge lp:~robru/bileto/sso-staging into lp:bileto

Proposed by Robert Bruce Park
Status: Work in progress
Proposed branch: lp:~robru/bileto/sso-staging
Merge into: lp:bileto
Diff against target: 62 lines (+11/-2)
3 files modified
tickets/login.py (+9/-0)
tickets/settings.py (+1/-1)
tickets/static/index.html (+1/-1)
To merge this branch: bzr merge lp:~robru/bileto/sso-staging
Reviewer Review Type Date Requested Status
CU2D maintainers Pending
Review via email: mp+267209@code.launchpad.net

Description of the change

Don't merge, I'm just proposing this to see a total diff.

To post a comment you must log in.

Unmerged revisions

220. By Robert Bruce Park

Merge trunk.

219. By Robert Bruce Park

iterate

218. By Robert Bruce Park

iterate

217. By Robert Bruce Park

log

216. By Robert Bruce Park

Allow GET again

215. By Robert Bruce Park

moar.

214. By Robert Bruce Park

28e61074-3ba9-11e5-9b56-0090f5d859bd

213. By Robert Bruce Park

log

212. By Robert Bruce Park

Let openid explode

211. By Robert Bruce Park

Logging.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tickets/login.py'
--- tickets/login.py 2015-08-05 21:21:09 +0000
+++ tickets/login.py 2015-08-06 15:25:15 +0000
@@ -1,3 +1,6 @@
1import logging
2
3from pprint import pformat
1from flask import request, session, redirect4from flask import request, session, redirect
25
3from tickets.app import app, oid6from tickets.app import app, oid
@@ -7,6 +10,8 @@
7@app.route('/login', methods=['GET', 'POST'])10@app.route('/login', methods=['GET', 'POST'])
8@oid.loginhandler11@oid.loginhandler
9def login():12def login():
13 logging.info('/login got: {}'.format(request.method))
14 logging.info(pformat(request.args))
10 if session.get('nickname'):15 if session.get('nickname'):
11 return redirect(oid.get_next_url())16 return redirect(oid.get_next_url())
12 openid = request.form.get('openid')17 openid = request.form.get('openid')
@@ -20,12 +25,16 @@
2025
21@oid.after_login26@oid.after_login
22def identify(resp):27def identify(resp):
28 logging.info('hi from after_login!')
29 logging.info(pformat(dir(resp)))
23 session.update(30 session.update(
24 identity_url=resp.identity_url,31 identity_url=resp.identity_url,
25 fullname=resp.fullname,32 fullname=resp.fullname,
26 nickname=resp.nickname,33 nickname=resp.nickname,
27 email=resp.email,34 email=resp.email,
28 )35 )
36 logging.info(pformat(session))
37 logging.info(pformat(session.data))
29 return redirect(oid.get_next_url())38 return redirect(oid.get_next_url())
3039
3140
3241
=== modified file 'tickets/settings.py'
--- tickets/settings.py 2015-08-03 07:51:14 +0000
+++ tickets/settings.py 2015-08-06 15:25:15 +0000
@@ -6,7 +6,7 @@
66
7logging.basicConfig(7logging.basicConfig(
8 level=logging.DEBUG, format='%(asctime)s %(levelname)s %(message)s')8 level=logging.DEBUG, format='%(asctime)s %(levelname)s %(message)s')
9logging.exception = lambda *ignore: None # OpenID abuses this, sadly.9#logging.exception = lambda *ignore: None # OpenID abuses this, sadly.
1010
1111
12SESSION_PATH = '/run/shm/bileto/session'12SESSION_PATH = '/run/shm/bileto/session'
1313
=== modified file 'tickets/static/index.html'
--- tickets/static/index.html 2015-08-05 17:34:59 +0000
+++ tickets/static/index.html 2015-08-06 15:25:15 +0000
@@ -23,7 +23,7 @@
23<div id="login">23<div id="login">
24<a href="/logout" ng-show="authenticated">log out {{authenticated}}</a>24<a href="/logout" ng-show="authenticated">log out {{authenticated}}</a>
25<form action="/login" method=post ng-hide="authenticated">25<form action="/login" method=post ng-hide="authenticated">
26<input type=hidden name=openid value="https://login.ubuntu.com/">26<input type=hidden name=openid value="https://login.staging.ubuntu.com/">
27<input type=submit value="Log in with Ubuntu SSO">27<input type=submit value="Log in with Ubuntu SSO">
28<input type=hidden name=next value="/">28<input type=hidden name=next value="/">
29</form>29</form>

Subscribers

People subscribed via source and target branches