32 Commits

Author SHA1 Message Date
xray7224
1c694fbec5 Fixes tests 2013-07-14 19:00:52 +01:00
xray7224
04e08d422a Moves json_response into tools/json.py 2013-07-11 18:21:43 +01:00
Aditi Mittal
665b9c420a Fix-bug-667-Use-lazy_pass_to_ugettext-for-forms. 2013-04-24 16:40:29 -05:00
Joar Wandborg
c121a7d3d0 OAuth: Support refresh tokens, etc
Initially I was going to write a failing test for refresh tokens. Thus
this fix includes an orphaned 'expect_failure' method in test utils.

I ended up writing support for OAuth refresh tokens, as well as a lot of
cleanup (hopefully) in the OAuth plugin code.

**Rebase**: While waiting for this stuff to be merged, the testing
framework changed, it comes with batteries included regarding fails.
Removed legacy nosetest helper.

Also added a lot of backref=backref([...], cascade='all, delete-orphan')
2013-04-06 22:17:27 +02:00
Hans Lo
29f523e1db Use WTForms data field in plugins/oauth/views.py 2013-03-28 00:08:18 -04:00
Christopher Allan Webber
81f73707a6 Providing warning to users about instability of OAuth/API 2013-03-08 14:38:55 -06:00
Joar Wandborg
77c85224b1 Fixed hidden fields in oauth client authorization
Removed the translation marking and passed in empty strings to avoid
WTForms automagically creating the labels from the field names (i.e.
client_id => 'Client Id').
2013-03-02 23:42:03 +01:00
Elrond
c130e3ee79 Move db.sql.migration_tools to db.migration_tools.
Follow the new trend.
2013-01-08 22:50:01 +01:00
Elrond
a050e776c6 Move all the migration tools into new migration_tools.py
Factor all the migration related stuff out into a new
.db.sql.migration_tools.
First we don't have to load this module for our normal
server.
Second it makes all the import dependencies a little more
cleaner.
2013-01-08 22:50:01 +01:00
Sebastian Spaeth
39dc3bf8db Mv db.sql.base to db.base
This concludes the db.sql.* -> db.* move. Our db abstraction layer is
sqlalchemy, so there is no need to a separate db.sql.* hierarchy.

All tests have been run for each of the commit series to make sure
everything works at every step.
2013-01-07 13:42:32 +01:00
Sebastian Spaeth
b0c8328e54 Move db.sql.models* to db.models* 2013-01-07 11:44:29 +01:00
Sebastian Spaeth
1e46dc2537 Move db.sql.util to db.util
Now that sqlalchemy is providing the database abstractions, there is no
need to hide everything in db.sql. sub-modules. It complicates the code
and provides a futher layer of indirection.

Move the db.sql.util.py to db.util.py and adapt the importers.
2013-01-07 11:31:56 +01:00
Sebastian Spaeth
bf3b9e783d Transition webob BadRequest|HTTPFound to webob/redirect
More transitioning away from webob
Response import from webob was unused
2012-12-21 08:12:25 +01:00
Sebastian Spaeth
2f5926a65d Fiy python2.7'ism (#566)
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>
2012-12-14 11:52:53 +01:00
Elrond
316e1dfdde SQL Migrations: Rewrite table creation completely.
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.
2012-11-24 19:23:08 +01:00
Joar Wandborg
5b60ec41ee Removed Routes dependency, added admin routes 2012-10-20 12:35:03 +02:00
Joar Wandborg
d56e82635f Fixed OAuth access_token duplicate route
Changed route name to "[...]list_connections"
2012-10-15 22:59:53 +02:00
Joar Wandborg
7742dcc1fb Switched most stuff over from Routes
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.
2012-10-14 13:46:31 +02:00
Joar Wandborg
111a609df5 Replaced all request.POST with request.form, ...
- Fixed error handling in OAuth plugin
- Changed request.POST file fields to request.files
2012-09-29 21:08:20 +02:00
Christopher Allan Webber
315ac0a2d3 Correcting a couple of spelling errors. Thanks elesa, for finding them! 2012-09-24 11:40:47 -05:00
Joar Wandborg
5ee1ab2abb Fixed typos visisble, appplication 2012-09-22 12:03:32 +02:00
Joar Wandborg
6b8c66d44c Added name kwarg to Column(Enum(...)) in OAuth models 2012-09-21 13:20:56 +02:00
Joar Wandborg
88a9662be4 Added client registration caps to OAuth plugin
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.
2012-09-21 13:09:42 +02:00
Joar Wandborg
d4c066abf0 Fixed typo in OAuth README 2012-09-19 22:13:16 +02:00
Joar Wandborg
6ed236d5b5 Added security warning to OAuth README 2012-09-19 22:12:13 +02:00
Joar Wandborg
f26224d433 Fixed a horrible security issue in the OAuth plugin.
Also added some real triggering logic to the OAuthAuth Auth object.
2012-09-19 21:57:59 +02:00
Joar Wandborg
a7b8c214e9 Added some more helpful links to the OAuth docs
- OAuth v2.25 draft
- IRC channel
- OAuth plugin source code
2012-09-18 21:51:22 +02:00
Joar Wandborg
4427b1bea4 Fixed typo in OAuth docs, recieve => receive 2012-09-18 21:44:02 +02:00
Joar Wandborg
df3147b986 Added documentation for the OAuth plugin 2012-09-18 21:42:10 +02:00
Joar Wandborg
42c837523e Added /api/entries view 2012-09-15 15:25:26 +02:00
Joar Wandborg
a062149e90 Created API plugin, moved api_auth to the API plugin 2012-09-13 20:59:00 +02:00
Joar Wandborg
f46e2a4db9 Add OAuth models, plugin DB migrations, api_auth 2012-09-13 20:38:59 +02:00