horsemeat 2.22.10__tar.gz → 2.22.12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {horsemeat-2.22.10 → horsemeat-2.22.12}/PKG-INFO +1 -1
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat/configwrapper.py +1 -2
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat/model/session.py +45 -1
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat/pg.py +1 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat/version.py +1 -1
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat/webapp/request.py +2 -2
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat.egg-info/PKG-INFO +1 -1
- {horsemeat-2.22.10 → horsemeat-2.22.12}/MANIFEST.in +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/README +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat/__init__.py +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat/model/__init__.py +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat/model/newsmessage.py +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat/model/user.py +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat/scripts/make-frippery-project +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat/tests/__init__.py +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat/tests/test_configwrapper.py +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat/webapp/__init__.py +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat/webapp/bogusrequest.py +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat/webapp/dispatcher.py +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat/webapp/framework_templates/__init__.py +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat/webapp/frameworkhandlers.py +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat/webapp/handler.py +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat/webapp/response.py +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat/webapp/scrubber.py +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat.egg-info/SOURCES.txt +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat.egg-info/dependency_links.txt +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat.egg-info/requires.txt +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/horsemeat.egg-info/top_level.txt +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/requirements.txt +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/setup.cfg +0 -0
- {horsemeat-2.22.10 → horsemeat-2.22.12}/setup.py +0 -0
@@ -193,8 +193,7 @@ class ConfigWrapper(object):
|
|
193
193
|
user=self.database_user,
|
194
194
|
password=self.database_password)
|
195
195
|
|
196
|
-
log.info("Just made postgresql connection {
|
197
|
-
pgconn))
|
196
|
+
log.info(f"Just made postgresql connection {pgconn} (composite types registered: {register_composite_types}.")
|
198
197
|
|
199
198
|
psycopg2.extras.register_uuid()
|
200
199
|
psycopg2.extras.register_hstore(pgconn, globally=True)
|
@@ -177,8 +177,52 @@ class Session(object):
|
|
177
177
|
self.inserted = inserted
|
178
178
|
self.updated = updated
|
179
179
|
|
180
|
+
def expire(self, pgconn):
|
181
|
+
|
182
|
+
"""
|
183
|
+
This sets the expires field to right now, which means they are
|
184
|
+
now logged out of this session.
|
185
|
+
"""
|
186
|
+
|
187
|
+
cursor = pgconn.cursor()
|
188
|
+
|
189
|
+
cursor.execute(textwrap.dedent("""
|
190
|
+
update webapp_sessions
|
191
|
+
set expires = current_timestamp
|
192
|
+
where session_uuid = (%(session_uuid)s)
|
193
|
+
and expires > current_timestamp
|
194
|
+
returning expires
|
195
|
+
"""), {'session_uuid': self.session_uuid})
|
196
|
+
|
197
|
+
if cursor.rowcount:
|
198
|
+
return cursor.fetchone().expires
|
199
|
+
|
200
|
+
@classmethod
|
201
|
+
def expire_all_sessions_for_user(cls, pgconn, person_uuid):
|
202
|
+
|
203
|
+
cursor = pgconn.cursor()
|
204
|
+
|
205
|
+
cursor.execute(textwrap.dedent("""
|
206
|
+
update webapp_sessions
|
207
|
+
set expires = current_timestamp
|
208
|
+
where person_uuid = (%(person_uuid)s)
|
209
|
+
and expires > current_timestamp
|
210
|
+
returning (webapp_sessions.*)::webapp_sessions as expired_session
|
211
|
+
"""), {'person_uuid': self.person_uuid})
|
212
|
+
|
213
|
+
if cursor.rowcount:
|
214
|
+
return cursor
|
215
|
+
|
216
|
+
|
180
217
|
def maybe_update_session_expires_time(self, pgconn):
|
181
218
|
|
219
|
+
"""
|
220
|
+
This resets the expires field to the default, which is now() +
|
221
|
+
interval '1 hour'.
|
222
|
+
|
223
|
+
Use this to keep somebody logged in for another hour.
|
224
|
+
"""
|
225
|
+
|
182
226
|
cursor = pgconn.cursor()
|
183
227
|
|
184
228
|
cursor.execute(textwrap.dedent("""
|
@@ -187,7 +231,7 @@ class Session(object):
|
|
187
231
|
where session_uuid = (%(session_uuid)s)
|
188
232
|
and expires > current_timestamp
|
189
233
|
returning expires
|
190
|
-
|
234
|
+
"""), {'session_uuid': self.session_uuid})
|
191
235
|
|
192
236
|
if cursor.rowcount:
|
193
237
|
return cursor.fetchone().expires
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# vim: set expandtab ts=4 sw=4 filetype=python fileencoding=utf8:
|
2
2
|
|
3
3
|
import cgi
|
4
|
-
import collections
|
4
|
+
import collections.abc
|
5
5
|
import http.cookies
|
6
6
|
import hashlib
|
7
7
|
import hmac
|
@@ -20,7 +20,7 @@ from werkzeug.wrappers import Request as WerkzeugRequest
|
|
20
20
|
|
21
21
|
log = logging.getLogger(__name__)
|
22
22
|
|
23
|
-
class Request(collections.abc.MutableMapping
|
23
|
+
class Request(collections.abc.MutableMapping):
|
24
24
|
|
25
25
|
"""
|
26
26
|
Wraps up the environ dictionary in an object with lots of cute
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|