horsemeat 2.24.1__tar.gz → 2.25.0__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.25.0/PKG-INFO +8 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat/version.py +1 -1
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat/webapp/dispatcher.py +1 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat/webapp/handler.py +46 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat/webapp/request.py +0 -2
- horsemeat-2.25.0/horsemeat.egg-info/PKG-INFO +8 -0
- horsemeat-2.24.1/PKG-INFO +0 -20
- horsemeat-2.24.1/horsemeat.egg-info/PKG-INFO +0 -20
- {horsemeat-2.24.1 → horsemeat-2.25.0}/MANIFEST.in +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/README +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat/__init__.py +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat/configwrapper.py +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat/model/__init__.py +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat/model/newsmessage.py +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat/model/session.py +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat/model/user.py +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat/pg.py +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat/scripts/make-frippery-project +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat/tests/__init__.py +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat/tests/test_configwrapper.py +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat/webapp/__init__.py +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat/webapp/bogusrequest.py +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat/webapp/framework_templates/__init__.py +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat/webapp/frameworkhandlers.py +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat/webapp/response.py +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat/webapp/scrubber.py +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat.egg-info/SOURCES.txt +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat.egg-info/dependency_links.txt +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat.egg-info/requires.txt +1 -1
- {horsemeat-2.24.1 → horsemeat-2.25.0}/horsemeat.egg-info/top_level.txt +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/requirements.txt +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/setup.cfg +0 -0
- {horsemeat-2.24.1 → horsemeat-2.25.0}/setup.py +0 -0
@@ -0,0 +1,8 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: horsemeat
|
3
|
+
Version: 2.25.0
|
4
|
+
Summary: Web framework for the damned. The mad.
|
5
|
+
Home-page: https://github.com/216software/horsemeat
|
6
|
+
Author: 216 Software, LLC
|
7
|
+
Author-email: info@216software.com
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
@@ -317,6 +317,52 @@ class Handler(object):
|
|
317
317
|
def four_zero_four_template(self):
|
318
318
|
return 'framework_templates/404.html'
|
319
319
|
|
320
|
+
@staticmethod
|
321
|
+
@decorator.decorator
|
322
|
+
def require_is_superuser(handler_method, self, req):
|
323
|
+
|
324
|
+
"""
|
325
|
+
Add this to a handle method like this::
|
326
|
+
|
327
|
+
@Handler.require_is_superuser
|
328
|
+
def handle(self, req):
|
329
|
+
...
|
330
|
+
|
331
|
+
And then, if the request isn't from a signed-in user that's got
|
332
|
+
|
333
|
+
is_superuser = true
|
334
|
+
|
335
|
+
they'll get a JSON reply that says nope.
|
336
|
+
|
337
|
+
If the request is from a signed-in user, then your handle
|
338
|
+
method is normal.
|
339
|
+
"""
|
340
|
+
|
341
|
+
if not req.user:
|
342
|
+
|
343
|
+
resp = self.Response.json(dict(
|
344
|
+
reply_timestamp=datetime.datetime.now(),
|
345
|
+
message="Sorry, you need to log in first!",
|
346
|
+
needs_to_log_in=True,
|
347
|
+
success=False))
|
348
|
+
|
349
|
+
resp.status = '401 UNAUTHORIZED'
|
350
|
+
|
351
|
+
elif not req.user.is_superuser:
|
352
|
+
|
353
|
+
resp = self.Response.json(dict(
|
354
|
+
reply_timestamp=datetime.datetime.now(),
|
355
|
+
message=f"Sorry, {req.user.display_name}, this is for is_superuser == true accounts only",
|
356
|
+
needs_to_log_in=False,
|
357
|
+
success=False))
|
358
|
+
|
359
|
+
resp.status = '401 UNAUTHORIZED'
|
360
|
+
|
361
|
+
return resp
|
362
|
+
|
363
|
+
else:
|
364
|
+
return handler_method(self, req)
|
365
|
+
|
320
366
|
@staticmethod
|
321
367
|
@decorator.decorator
|
322
368
|
def require_login(handler_method, self, req):
|
@@ -479,13 +479,11 @@ class Request(collections.abc.MutableMapping):
|
|
479
479
|
def user(self):
|
480
480
|
|
481
481
|
"""
|
482
|
-
|
483
482
|
Is either None or is a bunch of data extracted from the
|
484
483
|
database.
|
485
484
|
|
486
485
|
When request.user is None, it means this is a user we don't
|
487
486
|
know.
|
488
|
-
|
489
487
|
"""
|
490
488
|
|
491
489
|
# First check if we already made one.
|
@@ -0,0 +1,8 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: horsemeat
|
3
|
+
Version: 2.25.0
|
4
|
+
Summary: Web framework for the damned. The mad.
|
5
|
+
Home-page: https://github.com/216software/horsemeat
|
6
|
+
Author: 216 Software, LLC
|
7
|
+
Author-email: info@216software.com
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
horsemeat-2.24.1/PKG-INFO
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.2
|
2
|
-
Name: horsemeat
|
3
|
-
Version: 2.24.1
|
4
|
-
Summary: Web framework for the damned. The mad.
|
5
|
-
Home-page: https://github.com/216software/horsemeat
|
6
|
-
Author: 216 Software, LLC
|
7
|
-
Author-email: info@216software.com
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
9
|
-
Requires-Dist: Jinja2>=2.6
|
10
|
-
Requires-Dist: PyYAML>=3.10
|
11
|
-
Requires-Dist: Werkzeug>=0.10.1
|
12
|
-
Requires-Dist: decorator>=3.4.0
|
13
|
-
Requires-Dist: psycopg2>=2.7
|
14
|
-
Requires-Dist: gunicorn
|
15
|
-
Dynamic: author
|
16
|
-
Dynamic: author-email
|
17
|
-
Dynamic: classifier
|
18
|
-
Dynamic: home-page
|
19
|
-
Dynamic: requires-dist
|
20
|
-
Dynamic: summary
|
@@ -1,20 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.2
|
2
|
-
Name: horsemeat
|
3
|
-
Version: 2.24.1
|
4
|
-
Summary: Web framework for the damned. The mad.
|
5
|
-
Home-page: https://github.com/216software/horsemeat
|
6
|
-
Author: 216 Software, LLC
|
7
|
-
Author-email: info@216software.com
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
9
|
-
Requires-Dist: Jinja2>=2.6
|
10
|
-
Requires-Dist: PyYAML>=3.10
|
11
|
-
Requires-Dist: Werkzeug>=0.10.1
|
12
|
-
Requires-Dist: decorator>=3.4.0
|
13
|
-
Requires-Dist: psycopg2>=2.7
|
14
|
-
Requires-Dist: gunicorn
|
15
|
-
Dynamic: author
|
16
|
-
Dynamic: author-email
|
17
|
-
Dynamic: classifier
|
18
|
-
Dynamic: home-page
|
19
|
-
Dynamic: requires-dist
|
20
|
-
Dynamic: summary
|
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
|