Commit afa62bc3 authored by Nico Vermaas's avatar Nico Vermaas

Merge branch 'esap-gateway-query' into 'master'

connect SAMP to shopping basket

See merge request !60
parents d1767652 5a7864b0
Pipeline #13092 passed with stages
in 1 minute and 8 seconds
......@@ -4,6 +4,7 @@ from rest_framework import viewsets
from rest_framework import permissions
from .serializers import *
from ..models import *
from django.conf import settings
logger = logging.getLogger(__name__)
......@@ -61,17 +62,35 @@ class EsapUserProfileViewSet(viewsets.ModelViewSet):
print("EsapUserProfileViewSet.get_queryset()")
try:
id_token = self.request.session["oidc_id_token"]
try:
id_token = self.request.session["oidc_id_token"]
except:
id_token = None
#uid = id_token["iss"]+id_token["sub"]
#preferred_username = id_token["preferred_username"]
#name = id_token["name"]
#access_token = self.request.session["oidc_access_token"]
# if settings.IS_DEV:
# try:
# user = auth.get_user(self.request)
# user_email = user.email
#
# except:
# # hardcode, because I don't get FAA to work in dev
# # 401 Client Error: Unauthorized for url: https://iam-escape.cloud.cnaf.infn.it/token
# user_email = "vermaas@astron.nl"
# else:
user = auth.get_user(self.request)
user_email = user.email
return EsapUserProfile.objects.filter(user_email=user_email)
except AttributeError as e:
print('ERROR: '+str(e))
user_name = self.request.query_params.get("user_name", None)
return EsapUserProfile.objects.filter(user_name=user_name)
# def update(self, request, pk=None):
# self.update()
\ No newline at end of file
......@@ -60,7 +60,7 @@ class EsapShoppingItem(models.Model):
return "ShoppingItem"
def __str__(self):
return "ShoppingItem"
return str(self.item_data)
class Meta:
verbose_name = "Selected Item"
......
......@@ -29,6 +29,7 @@ services:
- "traefik.http.services.esap-qstatic.loadbalancer.server.port=8000"
env_file:
- $HOME/shared/oidc.env
- $HOME/shared/esap.env
restart: always
volumes:
- $HOME/shared/esap-gateway-query/:/shared
......
RUCIO_AUTH_TOKEN=fake-rucio-auth-token
RUCIO_HOST=https://escape-rucio.cern.ch
RUCIO_PORT=32300
RUCIO_AUTH_PORT=32301
\ No newline at end of file
OIDC_RP_CLIENT_ID="<your_client_id>"
OIDC_RP_CLIENT_SECRET="<your_client_secret>"
\ No newline at end of file
OIDC_OP_JWKS_ENDPOINT=https://iam-escape.cloud.cnaf.infn.it/jwk
OIDC_OP_AUTHORIZATION_ENDPOINT=https://iam-escape.cloud.cnaf.infn.it/authorize
OIDC_OP_TOKEN_ENDPOINT=https://iam-escape.cloud.cnaf.infn.it/token
OIDC_OP_USER_ENDPOINT=https://iam-escape.cloud.cnaf.infn.it/userinfo
OIDC_RP_CLIENT_ID=<your-client-id>
OIDC_RP_CLIENT_SECRET=<your-client-secret>
LOGIN_REDIRECT_URL=https://sdc-dev.astron.nl/esap-gui/login
LOGOUT_REDIRECT_URL=https://sdc-dev.astron.nl/esap-gui/logout
LOGIN_REDIRECT_URL_FAILURE=https://sdc-dev.astron.nl/esap-gui/error
\ No newline at end of file
......@@ -16,6 +16,7 @@ SECRET_KEY = 'cie-((m#n$br$6l53yash45*2^mwuux*2u)bad5(0flx@krnj9'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
IS_DEV = False
ALLOWED_HOSTS = ['*']
CORS_ORIGIN_ALLOW_ALL = True
......
......@@ -12,10 +12,11 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
IS_DEV = True
# USE_DOP457 = False
CORS_ALLOWED_ORIGINS = [
"http://localhost:5555",
"https://iam-escape.cloud.cnaf.infn.it",
"http://localhost:3000",
"http://127.0.0.1:5555",
"http://127.0.0.1:3000",
......
......@@ -4670,3 +4670,60 @@
[23/Mar/2021 15:30:22,536] https://lta.lofar.eu/?target=A2255_and_units=sexagesimal_and_ref_system=J2000_and_fov_units=deg_and_antenna_type=HBA_and_public=true_and_dataproduct_type=AveragingPipeline_and_page=1
[23/Mar/2021 15:30:22,538] query_controller.run_query()
[23/Mar/2021 15:30:22,539] query:https://lta.lofar.eu/?target=A2255_and_units=sexagesimal_and_ref_system=J2000_and_fov_units=deg_and_antenna_type=HBA_and_public=true_and_dataproduct_type=AveragingPipeline_and_page=1
[30/Apr/2021 11:40:31,992] query_controller.create_and_run_query()
[30/Apr/2021 11:40:31,993] query_controller.create_query()
[30/Apr/2021 11:41:50,023] {'query_info': {'url_pattern': '{host}/dids/{scope}/files/', 'url_params': {'scope': 'undefined'}, 'where': {}}}
[30/Apr/2021 11:44:19,327] query_controller.run_query()
[30/Apr/2021 11:44:19,327] query:{'query_info': {'url_pattern': '{host}/dids/{scope}/files/', 'url_params': {'scope': 'undefined'}, 'where': {}}}
[11/May/2021 15:24:29,458] query_controller.create_and_run_query()
[11/May/2021 15:24:29,459] query_controller.create_query()
[11/May/2021 15:24:30,238] project_fields=mobile_friendly__safe__amp__catalog=zooniverse_projects
[11/May/2021 15:24:30,242] query_controller.run_query()
[11/May/2021 15:24:34,867] query_controller.create_and_run_query()
[11/May/2021 15:24:34,867] query_controller.create_query()
[11/May/2021 15:24:35,505] project_fields=mobile_friendly__safe__amp__page=1__safe__amp__catalog=zooniverse_projects
[11/May/2021 15:24:35,508] query_controller.run_query()
[11/May/2021 15:31:24,448] query_controller.create_and_run_query()
[11/May/2021 15:31:24,449] query_controller.create_query()
[11/May/2021 15:31:24,511] query_controller.create_and_run_query()
[11/May/2021 15:31:24,512] query_controller.create_query()
[11/May/2021 15:31:25,121] project_fields=mobile_friendly__safe__amp__catalog=zooniverse_projects
[11/May/2021 15:31:25,128] query_controller.run_query()
[11/May/2021 15:31:25,184] project_fields=mobile_friendly__safe__amp__page=1__safe__amp__catalog=zooniverse_projects
[11/May/2021 15:31:25,187] query_controller.run_query()
[12/May/2021 07:51:04,165] query_controller.create_and_run_query()
[12/May/2021 07:51:04,166] query_controller.create_query()
[12/May/2021 07:51:04,874] catalog=zooniverse_projects__safe__amp__project_fields=title
[12/May/2021 07:51:04,890] query_controller.run_query()
[12/May/2021 07:51:12,943] query_controller.create_and_run_query()
[12/May/2021 07:51:12,944] query_controller.create_query()
[12/May/2021 07:51:13,606] catalog=zooniverse_projects__safe__amp__project_fields=title__safe__amp__page=1
[12/May/2021 07:51:13,613] query_controller.run_query()
[12/May/2021 08:43:18,580] query_controller.create_and_run_query()
[12/May/2021 08:43:18,587] query_controller.create_query()
[12/May/2021 08:43:19,282] catalog=zooniverse_projects__safe__amp__project_fields=title
[12/May/2021 08:43:19,289] query_controller.run_query()
[12/May/2021 08:43:20,462] query_controller.create_and_run_query()
[12/May/2021 08:43:20,463] query_controller.create_query()
[12/May/2021 08:43:21,109] catalog=zooniverse_projects__safe__amp__project_fields=title__safe__amp__page=1
[12/May/2021 08:43:21,112] query_controller.run_query()
[12/May/2021 08:45:55,263] query_controller.create_and_run_query()
[12/May/2021 08:45:55,264] query_controller.create_query()
[12/May/2021 08:45:55,268] http://registry.euro-vo.org/services/RegistrySearch/sync?LANG=ADQL&REQUEST=doQuery&QUERY=SELECT+TOP+250+%2A+from+ivoa.obscore+WHERE+get-services%2F%3Fkeyword%3D%27apertif%27+
[12/May/2021 08:45:55,271] query_controller.run_query()
[18/May/2021 08:55:27,517] query_controller.create_and_run_query()
[18/May/2021 08:55:27,529] query_controller.create_query()
[18/May/2021 08:55:27,540] query_controller.create_and_run_query()
[18/May/2021 08:55:27,541] query_controller.create_query()
[18/May/2021 08:55:28,244] project_fields=urls__safe__amp__catalog=zooniverse_projects
[18/May/2021 08:55:28,274] query_controller.run_query()
[18/May/2021 08:55:28,550] project_fields=urls__safe__amp__page=1__safe__amp__catalog=zooniverse_projects
[18/May/2021 08:55:28,563] query_controller.run_query()
[18/May/2021 14:19:34,735] query_controller.create_and_run_query()
[18/May/2021 14:19:34,742] query_controller.create_query()
[18/May/2021 14:19:34,757] query_controller.create_and_run_query()
[18/May/2021 14:19:34,758] query_controller.create_query()
[18/May/2021 14:19:35,430] catalog=zooniverse_projects__safe__amp__project_fields=workflow_description
[18/May/2021 14:19:35,437] query_controller.run_query()
[18/May/2021 14:19:36,810] page=1__safe__amp__catalog=zooniverse_projects__safe__amp__project_fields=workflow_description
[18/May/2021 14:19:36,814] query_controller.run_query()
......@@ -70,7 +70,7 @@
</div>
<p class="footer" small>ASTRON - version 30 april 2021 - 09:01</p>
<p class="footer" small>ASTRON - version 20 may 2021 - 15:00</p>
{% endblock %}
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