123 Commits

Author SHA1 Message Date
31e802619e Support soft-deleting projects.
See http://python-eve.org/features.html#soft-delete for more info.
2016-04-25 16:14:05 +02:00
5116b74d1d Updated Eve to 0.6.3
This also updates Cerberus to 0.9.2 and simplejson to 3.8.2.

I've also changed the way we get to the application object, by replacing
   from application import app
with
   from flask import current_app
2016-04-25 16:14:05 +02:00
a6258f5193 Limit project editing for subscribers.
Certain fields are limited for subscribers. Also, subscribers are checked
against the project permissions.

Users with the 'admin' role can edit all fields, on any project.
2016-04-25 16:14:05 +02:00
4edb8cfd39 Ensure that the returned project contains the correct etag.
The etag of the post_internal response was used, which is NOT the
same as the etag of the project document itself.
2016-04-25 16:14:05 +02:00
5c590c4dc4 Put Eve in debug mode when unittesting.
This gives us much more concrete information when a test fails.
Note that this info is generally put into the HTTP response data,
and not logged to any logger.
2016-04-25 16:14:05 +02:00
9a400d5414 Use the new /p/create function from manage.py too. 2016-04-19 16:50:51 +02:00
4b9dd29ad5 Added /p/create entry point to create new projects.
This requires the user to be logged in. The project will be owned by that
user.
2016-04-19 16:50:46 +02:00
d808b76d65 Store is_subclient_token bool in token collection. 2016-04-15 16:27:24 +02:00
4e9182ef38 Missed BlenderID API change in unittest 2016-04-15 14:27:54 +02:00
0bdd3b0a31 Updated for changes in BlenderID validate_token URL and response.
See BlenderID change 432034f858fbfd695f3ce0a0b3724524de7a05bb
2016-04-15 12:19:43 +02:00
66eeb25529 Unify tokens and subclient tokens
SCST tokens are now stored in the 'tokens' table.
This unifies old token handling and new subclient-specific tokens.
Also ensures the BlenderID expiry of the token is taken into account.

Removes use of httpretty, in favour of responses.
2016-04-13 15:33:54 +02:00
bd8e0e56a4 Security: don't log subclient token. 2016-04-12 16:05:37 +02:00
aeee165ad8 subclient tokens: bugfix & return proper data.
Also introduces responses, as an alternative to httpretty (it works
better).
2016-04-12 15:24:50 +02:00
669aea7436 Testing should have debug mode disabled. 2016-04-04 16:10:55 +02:00
465b145609 More flexible, less error-prone configuration system.
WARNING: make a backup copy of your local config.py before pulling
this change, as Git will overwrite it without warning.

The configuration defaults to deployment settings, allowing overrides.
Overrides are read from config_local.py and from the file pointed to
by the PILLAR_CONFIG env var.
2016-04-04 14:59:11 +02:00
ce242e1de3 Added manage.py command to refresh (almost) expired links.
manage.py refresh_project_links  5672beecc0261b2005ed1a33 -c 4

This refreshes the oldest 4 links of that project.
2016-04-01 13:03:27 +02:00
8b4e0c4578 Fixed imports for py.test
For some reason the 'from application import utils' worked fine when
running unittests from PyCharm, but breaks in py.test. Strange.
2016-03-25 18:27:27 +01:00
7c04e01cde Some security fixes and other fixes for file storage.
Also added unittests for creating files.
2016-03-25 18:23:01 +01:00
fd5bcaec52 Some code simplifications & logging for Zencoder notifications. 2016-03-25 17:21:18 +01:00
d7ee2121d9 Renamed some test_xxx files to common_test_xxx.py
Those files contain stuff for tests, but don't contain tests themselves.
2016-03-25 16:05:36 +01:00
adb4f5b39e Added unittests for caching of file links.
Also converted test_auth.py to use the new AbstractPillarTest class.
This class ensures that we test against the testing database, which
is dropped at every setUp()/tearDown().
2016-03-25 15:57:17 +01:00
d4ed335273 Overriding app.config in unittest.
We may need something better structured in the future to handle
test configuration, but at least this gets the one test we have
running.
2016-03-25 12:22:31 +01:00
ebcb6bc5f8 Added setup.py to allow automated testing.
Also moved the tests directory to top-level, as they shouldn't be part
of the pillar directory.
2016-03-25 11:46:01 +01:00