Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • alexander.pace/server
  • geoffrey.mo/gracedb-server
  • deep.chatterjee/gracedb-server
  • cody.messick/server
  • sushant.sharma-chaudhary/server
  • michael-coughlin/server
  • daniel.wysocki/gracedb-server
  • roberto.depietri/gracedb
  • philippe.grassia/gracedb
  • tri.nguyen/gracedb
  • jonah-kanner/gracedb
  • brandon.piotrzkowski/gracedb
  • joseph-areeda/gracedb
  • duncanmmacleod/gracedb
  • thomas.downes/gracedb
  • tanner.prestegard/gracedb
  • leo-singer/gracedb
  • computing/gracedb/server
18 results
Show changes
Commits on Source (3)
......@@ -150,6 +150,13 @@ SEND_MATTERMOST_ALERTS = False
# IGWN_ALERT_GROUP environment variable.
DEFAULT_IGWN_ALERT_GROUP = 'lvalert-dev'
# enable/disable sending alerts to topics that have the search tag
# for g/e-events. default to false, so only send to {group}_{pipeline}
SEND_TO_SEARCH_TOPICS = parse_envvar_bool(
get_from_env('IGWN_ALERT_SEARCH_TOPICS',
fail_if_not_found=False, default_value="false")
)
# overseer timeout:
OVERSEER_TIMEOUT = float(get_from_env('IGWN_ALERT_OVERSEER_TIMEOUT',
fail_if_not_found=False, default_value=0.1))
......@@ -351,7 +358,7 @@ X509_INFOS_HEADER = 'HTTP_X_FORWARDED_TLS_CLIENT_CERT_INFOS'
CAPATH = '/etc/grid-security/certificates'
# SciTokens claims settings
SCITOKEN_ISSUER = "https://cilogon.org/igwn"
SCITOKEN_ISSUER = ['https://cilogon.org/igwn', 'https://test.cilogon.org/igwn', 'https://osdf.igwn.org/cit']
SCITOKEN_AUDIENCE = ["ANY"]
SCITOKEN_SCOPE = "gracedb.read"
......
......@@ -14,7 +14,7 @@ The different types of events in GraceDB are distinguished by the following para
- ``Pipeline``: the data analysis software tool used make the detection
- values: ``MBTA``, ``MBTAOnline``, ``CWB``, ``CWB2G``, ``gstlal``, ``pycbc``, ``spiir``, ``HardwareInjection``, ``Fermi``, ``Swift``, ``INTEGRAL``, ``AGILE``, ``SNEWS``, ``oLIB``, ``MLy``
- ``Search``: the search activity which led to the detection
- values: ``AllSky``, ``AllSkyLong``, ``LowMass``, ``HighMass``, ``GRB``, ``Supernova``, ``MDC``, ``BBH``, ``EarlyWarning``, ``IMBH``, ``SubGRB``, ``SubGRBTargeted``
- values: ``AllSky``, ``AllSkyLong``, ``LowMass``, ``HighMass``, ``GRB``, ``Supernova``, ``MDC``, ``BBH``, ``EarlyWarning``, ``IMBH``, ``SubGRB``, ``SubGRBTargeted``, ``VTInjection``
An individual "event stream" is specified by setting the values of these three parameters.
For example, choosing ``Group=CBC``, ``Pipeline=gstlal``, and ``Search=LowMass`` selects the event stream consisting of low-mass inspiral events detected by the gstlal pipeline from the CBC group.
......
......@@ -48,7 +48,7 @@ def get_xmpp_node_names(event_or_superevent):
gp_node = "{group}_{pipeline}".format(group=event.group.name,
pipeline=event.pipeline.name).lower()
node_names.append(gp_node)
if event.search:
if event.search and settings.SEND_TO_SEARCH_TOPICS:
gps_node = gp_node + "_{search}".format(
search=event.search.name.lower())
node_names.append(gps_node)
......
......@@ -71,6 +71,16 @@ class GraceDbBasicAuthentication(authentication.BasicAuthentication):
class GraceDbSciTokenAuthentication(authentication.BasicAuthentication):
class MultiIssuerEnforcer(scitokens.Enforcer):
def __init__(self, issuer, **kwargs):
if not isinstance(issuer, (tuple, list)):
issuer = [issuer]
super().__init__(issuer, **kwargs)
def _validate_iss(self, value):
return value in self._issuer
def authenticate(self, request, public_key=None):
# Get token from header
try:
......@@ -93,7 +103,7 @@ class GraceDbSciTokenAuthentication(authentication.BasicAuthentication):
return None
# Enforce scitoken logic
enforcer = scitokens.Enforcer(
enforcer = self.MultiIssuerEnforcer(
settings.SCITOKEN_ISSUER,
audience = settings.SCITOKEN_AUDIENCE,
)
......
......@@ -145,7 +145,7 @@ class TestGraceDbBasicAuthentication(GraceDbApiTestBase):
class TestGraceDbSciTokenAuthentication(GraceDbTestBase):
"""Test SciToken auth backend for API"""
TEST_ISSUER = "local"
TEST_ISSUER = ['local', 'local2']
TEST_AUDIENCE = ["TEST"]
TEST_SCOPE = "gracedb.read"
......
# -*- coding: utf-8 -*-
from django.db import migrations
# Search names and descriptions
SEARCH_TYPES = [
{'name': 'VTInjection', 'description': 'VTInjection Search'},
]
def add_searches(apps, schema_editor):
Search = apps.get_model('events', 'Search')
Label = apps.get_model('events', 'Label')
# Create searches
for search_dict in SEARCH_TYPES:
search, created = Search.objects.get_or_create(name=search_dict['name'])
if 'description' in search_dict:
search.description = search_dict['description']
search.save()
def remove_searches(apps, schema_editor):
Search = apps.get_model('events', 'Search')
Label = apps.get_model('events', 'Label')
# Delete searches
Search.objects.filter(name__in=[s['name'] for s in SEARCH_TYPES]).delete()
class Migration(migrations.Migration):
dependencies = [
('events', '0087_add_detection_statistic'),
]
operations = [
migrations.RunPython(add_searches, remove_searches),
]
......@@ -276,7 +276,7 @@ def is_in_rrt_subcategory(event, rrt_subcategory):
return (
event.group.name == "CBC"
and not event.search.name == "EarlyWarning"
and not event.search.name in {"EarlyWarning", "VTInjection"}
) | (
event.group.name == "Burst"
and event.search
......