128 Commits

Author SHA1 Message Date
c854ccbb4b Generic PATCH handler class.
A class-based approach is easier to extend than the function-based approach
used in the nodes. That one is still there, though -- might look at it
at a later time. This handler is primarily for Flamenco.
2017-05-09 14:08:35 +02:00
fdaf4af31a Modernised some unit tests 2017-05-05 14:40:37 +02:00
69d7c5c5ce Allow service accounts to be email-less
This removes the ability of updating service accounts through the CLI
(something we never used anyway), now that service accounts cannot be
uniquely identified by their email address.
2017-05-05 14:34:18 +02:00
1a54b723aa Reworked subscription/demo role management from web to API level.
In the old situation, users had to be able to change their own roles. This
is inherently insecure.
2017-05-04 17:49:18 +02:00
d0557445cd Fix privilege escalation leak
A PUT request on /api/user/{user-id} by the user themselves would allow
too much, and would allow self-granting of roles (including admin),
group membership (so join any arbitrary project) and pretend to be
service accounts.
2017-05-04 12:48:30 +02:00
bd3f8d597a Allow upload of videos > 1080p
Videos that are larger than 1920x1080 pixels are scaled down so that they
fit that size. Care is taken to keep the width a multiple of 16 pixels and
the height a multiple of 8.
2017-03-31 14:52:58 +02:00
d8640df115 Made markdown jinja filter None-safe 2017-03-30 09:37:48 +02:00
b36dc63335 Added simple mocking test for GCS 2017-03-22 16:43:17 +01:00
563bb2c244 Added unittest for Bucket.copy_to_bucket() 2017-03-22 16:14:06 +01:00
6b526f6b53 Fixed bug in local file storage URL generation. 2017-03-22 16:05:38 +01:00
2e41c074b5 Python 3.6 compatibility: bytes vs strings stuff
These changes mostly revolve around the change in ObjectId constructor
when running on Python 3.6. Where on 2.7 the constructor would accept
12- and 24-byte strings, now only 12-byte bytes and 24-character strings
are accepted. Good thing, but required some changes in our code.

Other changes include hashing of strings, which isn't supported, so they
are converted to bytes first, and sometimes converted back afterwards.
2017-03-22 15:49:51 +01:00
bced6cae68 Ran 2to3 on unittests, same sort of manual fixups as before 2017-03-22 15:49:51 +01:00
604d6c1a07 Added pillar.web.utils.last_page_index()
This returns the last page number (base-1) of a paged Eve result.
2017-01-19 15:13:01 +01:00
76f2367e66 Added extra role to UserAdminTest. 2016-11-11 15:23:25 +01:00
5f0092cfa1 Fixed bug in /u/ where home project group membership was lost after edit.
Rather than understanding the code, I rewrote the editing and added a
unit test for it.
2016-11-11 15:06:29 +01:00
ab375b2126 Moved node_setattr() from Attract to Pillar 2016-11-09 12:50:30 +01:00
65b554986c pretty_date(None) now returns None 2016-11-08 12:56:19 +01:00
fb6e326a14 Also support future dates and times in pretty_date 2016-11-08 12:24:55 +01:00
fe4d70c0d1 CLI upgrade_attachment_schema: also remove attachments form_schema
Previously they would have {'attachments': {'visible': False}}, but this
is no longer needed.
2016-11-01 16:47:55 +01:00
a38e053c1a Added CLI command to create blogs. 2016-11-01 16:47:55 +01:00
0929a80f2b New data structure for attachments. 2016-11-01 16:47:55 +01:00
e1678537c0 Editing comments via PATCH on pillar-web, and some other comment fixes 2016-10-20 16:47:04 +02:00
e71e6a7b32 API for editing comments via PATCH 2016-10-20 16:22:11 +02:00
3afeeaccd0 Removed permission keys from node type definitions.
This prevents replace_pillar_node_type_schemas() from overwriting existing
permissions.
2016-10-20 13:05:43 +02:00
eea934a86a Added username to public user fields 2016-10-19 16:57:17 +02:00
96c9e12f7f doc_diff() optionally no longer reports differences between falsey values.
If falsey_is_equal=True, all Falsey values compare as equal, i.e. this
function won't report differences between DoesNotExist, False, '', and 0.
2016-10-12 17:09:48 +02:00
7c310e12ef Added util function to compute the difference between two dicts. 2016-10-12 16:01:30 +02:00
407aefb9ad Added CLI command for moving top-level nodes between projects.
Also introduces a slightly nicer way to get the database interface, and
an object-oriented way to allow dependency injection.
2016-09-27 12:57:57 +02:00
7968c6ca37 Added node_type_utils to assign permissions to certain node types.
This separates "mechanism" from "policy".
2016-09-23 17:13:26 +02:00
68666f0650 Updated unittest code so that we can create 100% valid projects.
This means also creating a user and groups so that the references are
valid.
2016-09-08 12:03:17 +02:00
eb7b875122 Copying files to other backend now works 2016-08-26 15:52:02 +02:00
04c9c010f0 p.view_node(): check node_id for validity, before sending it to the API
This prevents a pillarsdk.exceptions.MethodNotAllowed exception, which
would result in a 500 Internal Server Error on the frontend.
2016-08-24 14:49:30 +02:00
2e0ba4c6cd test_sdk: load BlenderDesktopLogo.png from the correct path 2016-08-23 14:32:59 +02:00
2c5dc34ea2 Introducing Pillar Framework
Refactor of pillar-server and pillar-web into a single python package. This
simplifies the overall architecture of pillar applications.

Special thanks @sybren and @venomgfx
2016-08-19 09:19:06 +02:00
ed863447cf Comment rating: fixed bug where new ratings weren't returned on no-op. 2016-07-28 12:08:40 +02:00
6a7d25cec7 Using PATCH to do comment rating. 2016-07-27 17:18:58 +02:00
2d72c96a45 Sort HDRi files by their image file size. 2016-07-26 17:22:07 +02:00
7880fb6968 Added a group_hdri node type.
This node type serves the same purpose for hdri as the group_texture
serves for the texture nodes.
2016-07-20 15:22:33 +02:00
49bd2720fa Oops. 2016-07-20 14:25:22 +02:00
4a72b377bd Include HDRi projects in /bcloud/texture-libraries
This depends on the version of the Blender Cloud Addon, which will be sent
as Blender-Cloud-Addon HTTP header in a future version of the addon.
2016-07-20 14:12:54 +02:00
9b3e75b9b9 Nodes: embed 'short_link' when 'short_code' is present and not empty.
This prevents calls to /nodes/<node-id>/share to get the short link.
2016-07-15 11:23:13 +02:00
2d5a538ad6 Added query string support to AbstractPillarTest.client_request() 2016-07-15 11:23:09 +02:00
a844f1ddda Home project: allow commenting on nodes.
This is only set up correctly for new home projects. Existing home projects
should be migrated using a yet-to-be-written script.
2016-07-13 15:40:41 +02:00
9cd7198005 Make shared nodes world-gettable 2016-07-13 12:28:01 +02:00
53c0eec8f1 PEP8 formatting 2016-07-13 12:27:50 +02:00
d996760017 Removed node type permissions from EXAMPLE_TEST_PROJECT
This makes the test project mimick actual projects more.
2016-07-13 12:27:42 +02:00
5d26de633c Limit uploadable file size to 32 MiB for non-subscribers. 2016-07-08 12:34:49 +02:00
a322aee0c7 Added file upload support to AbstractPillarTest.client_request 2016-07-08 12:34:49 +02:00
8a7c7afc3c Bugfix 2016-07-08 12:34:49 +02:00
bfba44e5b8 Merged test_home_project.py and test_bcloud_home_project.py 2016-07-08 12:34:49 +02:00