-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Packages refactoring, ETL improved, new PartialRetrievalDictionary, E…
…urostat read bulk files modified, new FADN support, many to many mapping, new REST functions, (Workspace - Concepts Helper - Serialization - Data Input - Manager) Improved Incorporates minified version of NIS frontend.
- Loading branch information
Showing
100 changed files
with
6,605 additions
and
532 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,31 @@ | ||
FROM grahamdumpleton/mod-wsgi-docker:python-3.5 | ||
FROM grahamdumpleton/mod-wsgi-docker:python-3.6 | ||
|
||
# The image used, "grahamdumpleton/mod-wsgi-docker:python-3.6" is not in "Docker Hub" | ||
# It has to be built from the original source code of 3.5 image (source code in Github), with the following versions | ||
# in the corresponding Dockerfile section: | ||
# | ||
# ENV PYTHON_VERSION=3.6.5 \ | ||
# NGHTTP2_VERSION=1.32.0 \ | ||
# APR_VERSION=1.6.3 \ | ||
# APR_UTIL_VERSION=1.6.1 \ | ||
# APACHE_VERSION=2.4.33 \ | ||
# MOD_WSGI_VERSION=4.6.4 \ | ||
# NSS_WRAPPER_VERSION=1.1.3 \ | ||
# TINI_VERSION=0.18.0 | ||
# | ||
# Build the image using the modified Dockerfile, with the name "grahamdumpleton/mod-wsgi-docker:python-3.6" | ||
|
||
# TODO | ||
# Rewrite to contain three things: | ||
# * NIS application. Run using "gunicorn" | ||
# * R modules | ||
# * Celery | ||
# The tool is "supervisor". An example in: | ||
# | ||
# The tool to run both "gunicorn" and "Celery" is "supervisor". An example in: | ||
# https://github.com/pm990320/docker-flask-celery | ||
# | ||
# | ||
# This one container is for MOD_WSGI (Apache2) <<<<<<<<<<<<<<<<<< | ||
# The present container is for MOD_WSGI (Apache2) <<<<<<<<<<<<<<<<<< | ||
# | ||
# | ||
# Build: | ||
|
@@ -28,16 +44,18 @@ FROM grahamdumpleton/mod-wsgi-docker:python-3.5 | |
# -v /home/rnebot/DATOS/docker/nis-local:/srv | ||
# -e MAGIC_NIS_SERVICE_CONFIG_FILE="nis_docker_local_sqlite.conf" magic-nis:latest | ||
# | ||
# Production server: | ||
# docker create --name nis-local -l magic-postgis -l magic-redis -v /srv/docker/magic/data/nis:/srv | ||
# -e VIRTUAL_HOST=one.nis.magic-nexus-eu -e VIRTUAL_PORT=80 -e LETSENCRYPT_HOST=one.nis.magic-nexus-eu | ||
# NOTE: in the example, the host directory (/home/rnebot/DATOS/docker/nis-local) must have RWX permissions | ||
# for all users: chmod rwx+o ... | ||
# If not, it may not be possible to create | ||
# | ||
# PRODUCTION SERVER: | ||
# | ||
# docker create --name nis-local --network=magic-net -l magic-postgis -l magic-redis -v /srv/docker/magic/data/nis:/srv | ||
# -e VIRTUAL_HOST=one.nis.magic-nexus.eu -e VIRTUAL_PORT=80 -e LETSENCRYPT_HOST=one.nis.magic-nexus.eu | ||
# -e [email protected] -e MAGIC_NIS_SERVICE_CONFIG_FILE="nis_docker_naples.conf" | ||
# magic-nis:latest | ||
# | ||
# | ||
# NOTE: in this last example, the host directory (/home/rnebot/DATOS/docker/nis-local) must have RWX permissions | ||
# for all users: chmod rwx+o ... | ||
# If not, it may not be possible to create | ||
|
||
ENV MAGIC_NIS_SERVICE_CONFIG_FILE="" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
""" | ||
An authenticator is in charge of receiving some credentials to LOGIN | ||
As a result, some demonstration of the success is obtained | ||
It can be an OAuth2 Bearer Token | ||
Or an API Key ("X-api-key" header; provided by Backend) | ||
Or some other | ||
""" | ||
from abc import ABCMeta, abstractmethod | ||
|
||
from backend.common.helper import create_dictionary | ||
|
||
|
||
class IAuthenticator(metaclass=ABCMeta): | ||
@abstractmethod | ||
def get_name(self) -> str: | ||
""" Authenticator name """ | ||
pass | ||
|
||
@abstractmethod | ||
def check(self, request) -> str: | ||
""" Checks Cookies or Headers for existing "passport" or similar. | ||
If existent, checks for the validity. | ||
If valid, obtains data allowing to match with some identity | ||
:param request: The Request object as received by Flask | ||
:return Information on what happened (if the passport is present or not; | ||
if it is valid; the information to match with identity) | ||
""" | ||
pass | ||
|
||
def elaborate_from_credentials(self, credentials): | ||
""" | ||
Elaborate passport from credentials | ||
TODO Is the passport stored in some standard place, or return just the structure | ||
:param credentials: | ||
:return: | ||
""" | ||
|
||
|
||
class AuthenticatorsManager: | ||
def __init__(self): | ||
self.registry = create_dictionary() | ||
|
||
def check(self, request) -> str: | ||
for s in self.registry: | ||
d = self.registry[s].check(request) | ||
if d.get("exists", False): | ||
# Continue | ||
pass | ||
else: | ||
d = None | ||
break | ||
return d | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
backend/command_executors/specification/scale_conversion_command.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.