Commit ba4b99cd authored by Pablo Panero's avatar Pablo Panero
Browse files

Refactor: rename project to cern-search-rest-api and pymodule to cern_search_rest_api

parent 5b36ece8
......@@ -6,7 +6,7 @@
# Python compiled files
*pyc
cern_search_rest.egg-info/
cern_search_rest_api.egg-info/
# OpenShift Secrets
......
......@@ -40,8 +40,8 @@ RUN chmod g=u /etc/passwd && \
chown -R invenio:root /code
# uWSGI configuration
ARG UWSGI_WSGI_MODULE=cern_search_rest.wsgi:application
ENV UWSGI_WSGI_MODULE ${UWSGI_WSGI_MODULE:-cern_search_rest.wsgi:application}
ARG UWSGI_WSGI_MODULE=cern_search_rest_api.wsgi:application
ENV UWSGI_WSGI_MODULE ${UWSGI_WSGI_MODULE:-cern_search_rest_api.wsgi:application}
ARG UWSGI_PORT=5000
ENV UWSGI_PORT ${UWSGI_PORT:-5000}
ARG UWSGI_PROCESSES=2
......
......@@ -457,7 +457,7 @@ stringData:
Starting command throw ssl:
```bash
gunicorn -b :5000 --certfile=ssl.crt --keyfile=ssl.key cern_search_rest.wsgi
gunicorn -b :5000 --certfile=ssl.crt --keyfile=ssl.key cern_search_rest_api.wsgi
```
## Configuration
......@@ -471,11 +471,11 @@ your server, which if it is deployed in OpenShift would be like ``you-project-na
- DEFAULT_DOC_TYPE: The value of the default document type. It must be part of the default index,
defined in the above variable.
- SEARCH_INSTANCE: The name of the instance. A folder with this name must exist in
``cern_search_rest/modules/cernsearch/jsonschemas/``, therefore, upon index creation an alias will be set for all the
``cern_search_rest_api/modules/cernsearch/jsonschemas/``, therefore, upon index creation an alias will be set for all the
indexes (mappings existing in this folder). This indexes will be the ones over whom searches will be performed.
- ADMIN_USER: Superuser's email account. If it is a non-CERN account, it should go without a domain
(``@cern.ch``).
The rest of the configuration comes from parameters that are configurable through the Invenio Framework or Flask.
The full list of the overwritten ones can be found in ``cern_search_rest/config.py``, nonetheless, if needed
The full list of the overwritten ones can be found in ``cern_search_rest_api/config.py``, nonetheless, if needed
others can be overwritten (check documentation of the corresponding project in the
[invenio repository](www.github.com/inveniosoftware)).
\ No newline at end of file
[invenio repository](www.github.com/inveniosoftware)).
......@@ -32,7 +32,7 @@ CERN_REMOTE_APP["params"].update(dict(request_token_params={
"scope": "Name Email Bio Groups",
}))
CERN_REMOTE_APP["authorized_handler"] = 'cern_search_rest.modules.cernsearch.handlers:cern_authorized_signup_handler'
CERN_REMOTE_APP["authorized_handler"] = 'cern_search_rest_api.modules.cernsearch.handlers:cern_authorized_signup_handler'
OAUTHCLIENT_REMOTE_APPS = dict(
cern=CERN_REMOTE_APP,
......@@ -47,7 +47,7 @@ ACCOUNTS_SESSION_ACTIVITY_ENABLED = False
# Admin
# =====
ADMIN_PERMISSION_FACTORY = 'cern_search_rest.modules.cernsearch.permissions:admin_permission_factory'
ADMIN_PERMISSION_FACTORY = 'cern_search_rest_api.modules.cernsearch.permissions:admin_permission_factory'
# JSON Schemas configuration
# ==========================
......@@ -75,7 +75,7 @@ SEARCH_MAPPINGS = [os.getenv('CERN_SEARCH_INSTANCE', 'cernsearch-test')]
#: Records REST API configuration
_Record_PID = 'pid(recid, record_class="cern_search_rest.modules.cernsearch.api:CernSearchRecord")' # TODO
_Record_PID = 'pid(recid, record_class="cern_search_rest_api.modules.cernsearch.api:CernSearchRecord")' # TODO
RECORDS_REST_ENDPOINTS = dict(
docid=dict(
......@@ -87,12 +87,12 @@ RECORDS_REST_ENDPOINTS = dict(
item_route='/record/<{0}:pid_value>'.format(_Record_PID),
list_route='/records/',
links_factory_imp='invenio_records_rest.links:default_links_factory',
record_class='cern_search_rest.modules.cernsearch.api:CernSearchRecord',
record_class='cern_search_rest_api.modules.cernsearch.api:CernSearchRecord',
record_serializers={
'application/json': ('invenio_records_rest.serializers'
':json_v1_response'),
},
search_class='cern_search_rest.modules.cernsearch.search.RecordCERNSearch',
search_class='cern_search_rest_api.modules.cernsearch.search.RecordCERNSearch',
search_index='cernsearch-test', # TODO: Parametrize this, along with the rest of the config file
search_serializers={
'application/json': ('invenio_records_rest.serializers'
......
......@@ -21,7 +21,7 @@ from invenio_oauthclient.handlers import oauth_error_handler, token_session_key,
token_getter, get_session_next_url
from cern_search_rest.modules.cernsearch.utils import get_user_provides
from cern_search_rest_api.modules.cernsearch.utils import get_user_provides
@oauth_error_handler
......
......@@ -6,7 +6,7 @@ from flask import request, g, current_app
from invenio_indexer.utils import default_record_to_index
from invenio_search import current_search_client
from cern_search_rest.modules.cernsearch.utils import get_user_provides
from cern_search_rest_api.modules.cernsearch.utils import get_user_provides
"""Access control for CERN Search."""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment