Skip to content

Commit

Permalink
Merge 9c69ff5 into 29bba5e
Browse files Browse the repository at this point in the history
  • Loading branch information
hachreak committed Aug 9, 2017
2 parents 29bba5e + 9c69ff5 commit 1fd3bda
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 12 deletions.
8 changes: 4 additions & 4 deletions invenio_app/config.py
Expand Up @@ -84,12 +84,12 @@
"""Talisman default Secure Headers configuration.
As default, invenio assumes that HTTPS is enabled.
If you are not using SSL, then remember to disable the `force_https`
configuration options related to HTTPS.
If you are not using SSL, then remember to disable the `force_https` and
`session_cookie_secure` configuration options related to HTTPS.
Please note that, as default talisman behaviour, if Flask `DEBUG` mode is on,
Please note that, as default `Talisman` behaviour, if Flask `DEBUG` mode is on,
then also many security barriers are automatically switched off
(e.g. `force_https`).
(e.g. `force_https` and `session_cookie_secure`).
.. note:: Overwrite
`Flask-Talisman
Expand Down
12 changes: 6 additions & 6 deletions invenio_app/factory.py
Expand Up @@ -32,6 +32,7 @@
import pkg_resources
from invenio_base.app import create_app_factory
from invenio_base.wsgi import create_wsgi_factory, wsgi_proxyfix
from invenio_cache import BytecodeCache
from invenio_config import create_config_loader
from jinja2 import ChoiceLoader, FileSystemLoader

Expand Down Expand Up @@ -75,12 +76,11 @@ def config_loader(app, **kwargs_config):
app.jinja_loader,
])

# FIXME: Add Jinja byte code caching.
# app.jinja_options = dict(
# app.jinja_options,
# cache_size=1000,
# bytecode_cache=RedisBytecodeCache(app)
# )
app.jinja_options = dict(
app.jinja_options,
cache_size=1000,
bytecode_cache=BytecodeCache(app)
)

invenio_config_loader(app, **kwargs_config)

Expand Down
2 changes: 1 addition & 1 deletion pytest.ini
Expand Up @@ -24,4 +24,4 @@

[pytest]
pep8ignore = docs/conf.py ALL
addopts = --pep8 --doctest-glob="*.rst" --doctest-modules --cov=invenio_app --cov-report=term-missing docs tests invenio_app
addopts = --pep8 --doctest-glob="*.rst" --doctest-modules --cov=invenio_app --cov-report=term-missing
6 changes: 5 additions & 1 deletion requirements-devel.txt
Expand Up @@ -23,5 +23,9 @@
# as an Intergovernmental Organization or submit itself to any jurisdiction.
#

-e git+https://github.com/alisaifee/flask-limiter.git#egg=Flask-Limiter
-e git+https://github.com/GoogleCloudPlatform/flask-talisman.git#egg=Flask-Talisman
-e git+https://github.com/alisaifee/flask-limiter.git#egg=Flask-Limiter
-e git+https://github.com/inveniosoftware/flask-celeryext.git#egg=flask-celeryext
-e git+https://github.com/inveniosoftware/invenio-base.git#egg=invenio-base
-e git+https://github.com/inveniosoftware/invenio-cache.git#egg=invenio-cache
-e git+https://github.com/inveniosoftware/invenio-config.git#egg=invenio-config
2 changes: 2 additions & 0 deletions run-tests.sh
Expand Up @@ -23,6 +23,8 @@
# waive the privileges and immunities granted to it by virtue of its status
# as an Intergovernmental Organization or submit itself to any jurisdiction.

export PYTEST_ADDOPTS='docs tests invenio_app'

pydocstyle invenio_app tests docs && \
isort -rc -c -df && \
check-manifest --ignore ".travis-*" && \
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Expand Up @@ -40,6 +40,7 @@
'pytest-cov>=1.8.0',
'pytest-pep8>=1.0.6',
'pytest>=2.8.0',
'redis>=2.10.5',
]

extras_require = {
Expand All @@ -63,6 +64,7 @@
'flask-shell-ipython>=0.3.0',
'flask-talisman>=0.3.2',
'invenio-base>=1.0.0a14,<1.1.0',
'invenio-cache>=1.0.0b1,<1.1.0',
'invenio-config>=1.0.0b2,<1.1.0',
]

Expand Down
8 changes: 8 additions & 0 deletions tests/test_factory.py
Expand Up @@ -26,8 +26,16 @@

from __future__ import absolute_import, print_function

from invenio_app.factory import create_ui


def test_version():
"""Test version import."""
from invenio_app import __version__
assert __version__


def test_config_loader():
"""Test config loader."""
app = create_ui()
assert 'cache_size' in app.jinja_options

0 comments on commit 1fd3bda

Please sign in to comment.