Sybren A. Stüvel
00a7406a1e
Ignore .pytest_cache
2018-08-30 11:00:36 +02:00
Sybren A. Stüvel
82aa521b5f
Merge branch 'master' into wip-flask-one
2018-08-30 10:59:00 +02:00
Sybren A. Stüvel
f7220924bc
Replaced deprecated call to collection.count()
2018-08-30 10:33:30 +02:00
Sybren A. Stüvel
595bb48741
Silence warning of Flask-Caching about NULL cache during testing
2018-08-29 15:23:47 +02:00
Sybren A. Stüvel
1c430044b9
More urljoin() instead of string concatenation
2018-08-29 14:28:24 +02:00
Sybren A. Stüvel
73bc084417
Cerberus or Eve apparently changed validator._id to document_id
2018-08-29 14:18:24 +02:00
Sybren A. Stüvel
37ca803162
Flask wrapped Response replaced json() function with json property
2018-08-29 14:18:07 +02:00
Sybren A. Stüvel
939bb97f13
Revert 9389fef8ba
2018-08-29 14:17:38 +02:00
Sybren A. Stüvel
2c40665271
Use urljoin() to compose OAuth URLs instead of string concatenation
...
String concatenation is bound to mess up; in this case it was producing
double slashes instead of single ones when `BLENDER_ID_ENDPOINT` ends in
a slash. Since URLs generally end in a slash, this should be supported.
2018-08-29 14:17:17 +02:00
Sybren A. Stüvel
e8123b7839
Apparently the test client now uses ` https://localhost.local/ ' as URL
...
Previously this was 'http://localhost/ '
2018-08-29 11:27:00 +02:00
Sybren A. Stüvel
6d6a40b8c0
Empty lists don't seem to be stored in MongoDB any more
...
It looks like with the new Eve (or one of its dependencies) empty lists
aren't stored any more; rather than storing `{'org_roles': []}`, it skips
the `'org_roles'` key altogether. Not sure what caused this, as it was
mentioned in neither the Eve nor the PyMongo changelog.
2018-08-29 11:26:19 +02:00
Sybren A. Stüvel
efd345ec46
Upgrade attachments CLI cmd: added compatibility with new 'validator' key
...
We now support both the old coerce=markdown and the new validator=markdown.
Probably support for the old can be removed, but I'm keeping it around
just to be sure.
2018-08-29 11:24:44 +02:00
Sybren A. Stüvel
d655d2b749
Users schema: don't supply schema when allow_known=True
...
Apparently the new Cerberus doesn't like this, and will check against the
schema only and ignore `allow_unknown` when it's there.
2018-08-29 11:23:19 +02:00
Sybren A. Stüvel
a58e616769
Markdown validator: gracefully handle partial document validation
...
Validation of partial documents can happen when validating an update.
Missing data is fine then.
2018-08-29 11:22:39 +02:00
Sybren A. Stüvel
a8a7166e78
Use self.assertRaises as context manager
2018-08-28 17:45:58 +02:00
Sybren A. Stüvel
1649591d75
Create a copy in the validator's self.document
...
This ensures that further modifications (like setting '_etag' etc.) aren't
done in-place.
2018-08-28 17:45:44 +02:00
Sybren A. Stüvel
9389fef8ba
Explicitly install pyasn1, solves certain build/test problems
2018-08-28 17:29:53 +02:00
Sybren A. Stüvel
6737aa1123
Markdown validator now also updates the doc with post_internal
...
The post_internal function does `document = validator.document`, replacing
the to-be-posted document by the copy that Cerberus made (and which we
cannot add keys to because it iterates over the keys and the dict size thus
isn't allowed to change).
I hope this doesn't break other validators who expect to be able to write
to `self.document`.
2018-08-28 17:29:29 +02:00
Pablo Vazquez
5238e2c26d
Pillar Font: Use variable for path
2018-08-22 19:57:22 +02:00
Sybren A. Stüvel
469f24d113
Fix for {validate: markdown} when used in Eve
...
Eve's Validator has not only a validate() function, but also
validate_update() and validate_replace(). Those set
self.persisted_document, so if that attribute exists we just use it.
2018-07-13 17:14:06 +02:00
Sybren A. Stüvel
8a0f582a80
Removed dependency on flask_pymongo
2018-07-13 17:08:06 +02:00
Sybren A. Stüvel
559e212c55
Removed debug prints + added TODO(fsiddi)
2018-07-13 17:04:23 +02:00
Sybren A. Stüvel
61278730c6
De-indent the code a bit
2018-07-13 17:02:47 +02:00
Sybren A. Stüvel
0fdcbc3947
Restored MarkDown conversion using 'validator': 'markdown'
2018-07-13 17:02:38 +02:00
Sybren A. Stüvel
8dc3296bd5
Schema change for IP range, use validator instead of type
...
Custom types became rather useless in Cerberus 1.0 since the type checker
is cripled (doesn't know field name, cannot return useful/detailed error
messages). Instead we use a validator now.
2018-07-13 15:03:35 +02:00
Sybren A. Stüvel
a699138fd6
Merge branch 'master' into wip-flask-one
2018-07-13 13:50:24 +02:00
Sybren A. Stüvel
466adabbb0
Added unit tests for IP range validation
2018-07-13 13:50:01 +02:00
Sybren A. Stüvel
7da741f354
Re-enabled PATCH handler for organisations
2018-07-13 13:36:59 +02:00
Sybren A. Stüvel
41369d134c
Fix bloody Eve raising exceptions instead of returning status code
2018-07-13 12:45:58 +02:00
Sybren A. Stüvel
61ed083218
Don't change the global schema!
2018-07-13 12:33:22 +02:00
Sybren A. Stüvel
46777f7f8c
Removed unnecessary ['shema']
2018-07-13 12:06:48 +02:00
Sybren A. Stüvel
ef94c68177
Re-enabled the 'valid_properties': True in nodes_schema
2018-07-13 12:06:38 +02:00
Sybren A. Stüvel
aaf452e18b
Fixed Cerberus canary unit test
...
Apparently it's no longer possible for Cerberus to validate its own schemas.
2018-07-13 12:02:40 +02:00
Sybren A. Stüvel
c607eaf23d
Added magic custom validation rule schemas in docstrings
2018-07-13 12:02:18 +02:00
Sybren A. Stüvel
baa77a7de5
Merge branch 'master' into wip-flask-one
2018-07-13 11:43:57 +02:00
Sybren A. Stüvel
5fb40eb32b
Simple unittests for Cerberus validation
2018-07-13 11:42:31 +02:00
Sybren A. Stüvel
c83a1a21b8
Unpinned a bunch of package versions
...
This helps us get the latest versions and test with those, instead.
2018-07-13 11:01:22 +02:00
Francesco Siddi
549cf0a3e8
WIP on libraries upgrade
2018-07-12 15:23:57 +02:00
Francesco Siddi
9f380751f5
Support for capabilities check in any shortcode
...
Use the @capcheck decorator on any shortcode that should support
this. Currently used by iframe and youtube.
2018-07-11 12:32:00 +02:00
Francesco Siddi
49075cbc60
Local development server uses http, not https
2018-06-23 01:25:35 +02:00
Francesco Siddi
81848c2c44
Introducing package-lock.json
2018-06-22 19:38:49 +02:00
Francesco Siddi
9ee7b742ab
Make more consistent use of BLENDER_ID_ENDPOINT
...
Now BLENDER_ID_ENDPOINT is used for the Blender ID OAuth config,
and it's directly accessed when building requests for Blender ID token
validation (without using utility functions).
2018-06-22 19:38:27 +02:00
Francesco Siddi
58c33074c3
Fix unittest for jinja.do_markdown
...
We were passing invalid html to do_markdown, which was returning a valid
version, by closing the <script> tag.
2018-06-22 17:10:38 +02:00
Pablo Vazquez
756427b34e
Link Markdown Cheatsheet to CommonMark help
2018-06-10 10:03:56 +02:00
Pablo Vazquez
7e06212cd5
CSS: Tweaks to pre/code
2018-06-10 09:41:26 +02:00
Pablo Vazquez
ef3912b647
CSS: Fix for emojis on lists
2018-06-10 09:01:44 +02:00
Francesco Siddi
151484dee3
Support parsing of bare links in Markdown text
2018-06-08 19:35:14 +02:00
Francesco Siddi
bec1f209ba
Update bleach library from 1.4.3 to 2.1.3
2018-06-08 19:34:39 +02:00
Francesco Siddi
0e14bdd09f
Introduce rating functions
...
These hotness and confidence calculation algorithms come from Reddit
and have been tweaked based on our experience on the Dillo project.
2018-06-03 02:09:20 +02:00
Francesco Siddi
ce6df542cc
Add ratings_embedded_schema to node_types
...
Ratings, like attachments, are a common feature in node_types.
By adding this schema definition, we reduce code duplication.
No functional changes are introduced introduced in this commit.
2018-05-11 01:32:39 +02:00