aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/plugins
Commit message (Collapse)AuthorAgeFilesLines
...
* Move DBModel._id -> DBModel.idSebastian Spaeth2012-12-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | We were refering to model._id in most of the code base as this is what Mongo uses. However, each use of _id required a) fixup of queries: e.g. what we did in our find() and find_one() functions moving all '_id' to 'id'. It also required using AliasFields to make the ._id attribute available. This all means lots of superfluous fixing and transitioning in a SQL world. It will also not work in the long run. Much newer code already refers to the objects by model.id (e.g. in the oauth plugin), which will break with Mongo. So let's be honest, rip out the _id mongoism and live with .id as the one canonical way to address objects. This commit modifies all users and providers of model._id to use model.id instead. This patch works with or without Mongo removed first, but will break Mongo usage (even more than before) I have not bothered to fixup db.mongo.* and db.sql.convert (which converts from Mongo to SQL) Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Fiy python2.7'ism (#566)Sebastian Spaeth2012-12-141-3/+7
| | | | | | | | | | | | | The oauth plugin used timedelta.total_seconds which was introduced in python 2.7 only. To preserve backwards compatability, we simply calculate the time difference in seconds manually. I considered monkeypatching total_seconds to the timedelta object, but it is a built-in type written in C (I believe) and modifying attributes failed horribly. Switch this to use total_seconds once we require python 2.7 as minimum version. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* trim_whitespace meddleware pluginSebastian Spaeth2012-12-012-0/+98
| | | | | | | | | | | | | Our HTML output is very verbose (=whitespacy) as our templates are written with an 80 char limit and lots of newlines between blocks, variables etc.... This is a plugin that naively strips of all but the first whitespace from the HTML response. We might want to have an all-fancy html tidy interface here at some point, but it nicely decreases the HTML size about a third on some simple pages. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* SQL Migrations: Rewrite table creation completely.Elrond2012-11-241-7/+85
| | | | | | | | | | | | | We have migrations creating new tables. Those currently use "raw" table definitions. This easily gives errors (we already had this problem). So instead rewrite those to use declarative tables and use those to create new tables. Just copy the new table over to the migration, strip it down to the bare minimum, rename to _v0, base it on declarative_base() and be done! Do this for the current migrations.
* Added HTTP API auth pluginJoar Wandborg2012-10-201-0/+58
|
* Removed Routes dependency, added admin routesJoar Wandborg2012-10-203-6/+1
|
* Fixed OAuth access_token duplicate routeJoar Wandborg2012-10-152-7/+13
| | | | Changed route name to "[...]list_connections"
* Switched most stuff over from RoutesJoar Wandborg2012-10-142-18/+18
| | | | | | | | | | Removed the Routes routing functionality and replaced it with werkzeug.routes. Most views are functional. Known issues: - Translation integration with the request object is not yet figured out. This breaks 404 pages.
* Replaced all request.POST with request.form, ...Joar Wandborg2012-09-293-30/+61
| | | | | - Fixed error handling in OAuth plugin - Changed request.POST file fields to request.files
* Added support for http callbacks on processingJoar Wandborg2012-09-261-0/+6
| | | | | Sends an HTTP POST request back to an URL given on submission to the API submit view.
* Correcting a couple of spelling errors. Thanks elesa, for finding them!Christopher Allan Webber2012-09-241-1/+1
|
* Fixed typos visisble, appplicationJoar Wandborg2012-09-221-2/+2
|
* Added name kwarg to Column(Enum(...)) in OAuth modelsJoar Wandborg2012-09-211-2/+4
|
* Added client registration caps to OAuth pluginJoar Wandborg2012-09-2112-37/+589
| | | | | | | | | | | | | | | | | | | THE MIGRATIONS SUPPLIED WITH THIS COMMIT WILL DROP AND RE-CREATE YOUR oauth__tokens AND oauth__codes TABLES. ALL YOUR OAUTH CODES AND TOKENS WILL BE LOST. - Fixed pylint issues in db/sql/migrations. - Added __repr__ to the User model. - Added _disable_cors option to json_response. - Added crude error handling to the api.tools.api_auth decorator - Updated the OAuth README. - Added client registration, client overview, connection overview, client authorization views and templates. - Added error handling to the OAuthAuth Auth object. - Added AuthorizationForm, ClientRegistrationForm in oauth/forms. - Added migrations for OAuth, added client registration migration. - Added OAuthClient, OAuthUserClient models. - Added oauth/tools with require_client_auth decorator method.
* Fixed typo in OAuth READMEJoar Wandborg2012-09-191-1/+1
|
* Added security warning to OAuth READMEJoar Wandborg2012-09-191-0/+5
|
* Fixed a horrible security issue in the OAuth plugin.Joar Wandborg2012-09-191-3/+6
| | | | Also added some real triggering logic to the OAuthAuth Auth object.
* Added some more helpful links to the OAuth docsJoar Wandborg2012-09-181-1/+7
| | | | | | - OAuth v2.25 draft - IRC channel - OAuth plugin source code
* Fixed typo in OAuth docs, recieve => receiveJoar Wandborg2012-09-181-1/+1
|
* Added documentation for the OAuth pluginJoar Wandborg2012-09-181-0/+130
|
* Fixed validation in API post_entry.Joar Wandborg2012-09-172-1/+11
| | | | Added state to API get_entry_serializable
* API: Fixed media file URLs, limitsJoar Wandborg2012-09-152-4/+15
| | | | | - Added default limit and limit arg to get_entries - Fixed URL generation for BasicFileStorage files in API
* Added CORS headers to API json_responseJoar Wandborg2012-09-151-0/+5
|
* Fixed ?next=<url> argument for require_active_loginJoar Wandborg2012-09-152-2/+5
| | | | It now includes the full URI, including GET args, not just the path.
* Fixed typo in API post_entryJoar Wandborg2012-09-151-1/+1
|
* Added post_entry at /api/submitJoar Wandborg2012-09-152-1/+94
|
* Added fields to /api/entries, wrote docstrings for api.toolsJoar Wandborg2012-09-152-6/+40
|
* Added /api/entries viewJoar Wandborg2012-09-154-23/+80
|
* Created API plugin, moved api_auth to the API pluginJoar Wandborg2012-09-135-14/+126
|
* Add OAuth models, plugin DB migrations, api_authJoar Wandborg2012-09-133-0/+253
|
* Updated flatpages example in plugins.rst to reflect reality & point to ↵Christopher Allan Webber2012-08-201-0/+2
| | | | flatpages docs
* Rework plugin infrastructure to nix side-effectsWill Kahn-Greene2012-07-173-64/+44
| | | | | | | | | | | | | This reworks the plugin infrastructure so as to remove module-loading side-effects which were making things a pain in the ass to test. With the new system, there's no auto-registering meta class. Instead plugins do whatever they want and then specify a hooks dict that maps hook names to callables for the things they're tying into. The most common one (and the only one we've implemented so far) is "setup". This also simplifies the sampleplugin a little by moving the code to __init__.py.
* Overhaul flatpagesWill Kahn-Greene2012-07-163-93/+108
| | | | | | | | * move contents of main.py to __init__.py * update documentation in README * change the key/value configuration specification * added a recipe for passing values from the url to the template * removed some unused code
* Fix templateWill Kahn-Greene2012-07-161-1/+1
|
* Finish flatpagesplugin; add plugin docsWill Kahn-Greene2012-07-165-61/+177
|
* Flatpages first passWill Kahn-Greene2012-07-164-0/+129
| | | | | | | | | | This fixes the template loader so that it can load plugin templates. This adds code for registering template paths so that plugins can add their own templates. This adds the base code for the flatpagesfile plugin. It doesn't serve pages, yet, but it's pretty close.
* 401. Plugin infrastructureWill Kahn-Greene2012-05-135-0/+90
* implements installing, loading and setup for plugins * codifies configuration * has a sample plugin * docs * tests