Repository: rucio/rucio

Issue:
Error message for unregistered users in webui is ATLAS specific
Motivation
----------
The error message shown to unregistered users in the webui always points to ATLAS voms.

Modification
------------
Make the message configurable.


Discussion:
Hi @tbeerman can I take this up?
Hello @tbeerman, I had a small query about the configuration of the message. What type of attributes or fields may be required in the message so as to make it modified for a particular user? & what may be the intended output for the same? I do understand that we don't wish to direct the user to the ATLAS Vom directly, but I failed to understand the configurational side of the issue 😶 

Resolving patch:
diff --git a/lib/rucio/web/ui/flask/common/utils.py b/lib/rucio/web/ui/flask/common/utils.py
--- a/lib/rucio/web/ui/flask/common/utils.py
+++ b/lib/rucio/web/ui/flask/common/utils.py
@@ -86,6 +86,9 @@
 
 MULTI_VO = config_get_bool('common', 'multi_vo', raise_exception=False, default=False)
 
+# Additional error message that can have VO specific information for the user, e.g., support mailing list.
+ADDITIONAL_ERROR_MSG = config_get("webui", "additional_error_msg", raise_exception=False, default="")
+
 # excluded characters for injected JavaScript variables
 VARIABLE_VALUE_REGEX = re.compile(r"^[\w\- /=,.+*#()\[\]]*$", re.UNICODE)
 
@@ -356,12 +359,19 @@ def x509token_auth(data=None):
             vos_with_desc = get_vo_descriptions(ui_vo)
             return add_cookies(make_response(render_template("select_login_method.html", oidc_issuers=AUTH_ISSUERS, saml_support=SAML_SUPPORT, possible_vos=vos_with_desc)))
 
-    if MULTI_VO:
-        msg = "<br><br>Your certificate (%s) is not mapped to (possibly any) rucio account: %s at VO: %s." % (html_escape(dn), html_escape(ui_account), html_escape(ui_vo))
+    if not ui_account:
+        if MULTI_VO:
+            msg = "<br><br>Your certificate (%s) is not mapped to (possibly any) rucio account at VO: %s." % (html_escape(dn), html_escape(ui_vo))
+        else:
+            msg = "<br><br>Your certificate (%s) is not mapped to (possibly any) rucio account." % (html_escape(dn))
     else:
-        msg = "<br><br>Your certificate (%s) is not mapped to (possibly any) rucio account: %s." % (html_escape(dn), html_escape(ui_account))
-    msg += "<br><br><font color=\"red\">First, please make sure it is correctly registered in <a href=\"https://voms2.cern.ch:8443/voms/atlas\">VOMS</a> and be patient until it has been fully propagated through the system.</font>"
-    msg += "<br><br>Then, if it is still not working please contact <a href=\"mailto:atlas-adc-ddm-support@cern.ch\">DDM Support</a>."
+        if MULTI_VO:
+            msg = "<br><br>Your certificate (%s) is not mapped to (possibly any) rucio account: %s at VO: %s." % (html_escape(dn), html_escape(ui_account), html_escape(ui_vo))
+        else:
+            msg = "<br><br>Your certificate (%s) is not mapped to (possibly any) rucio account: %s." % (html_escape(dn), html_escape(ui_account))
+
+    if ADDITIONAL_ERROR_MSG:
+        msg += ADDITIONAL_ERROR_MSG
     if not ui_account:
         return render_template("problem.html", msg=msg)
     token = get_token(auth.get_auth_token_x509, acc=ui_account, vo=ui_vo, idt=dn)


Test patch: