From 28ea921e147cead8dda7d1c920c6e9b44f9544f6 Mon Sep 17 00:00:00 2001 From: martynia Date: Tue, 18 Oct 2022 15:47:35 +0100 Subject: [PATCH] feat: Move auth from thr code to ConfigTemplate.cfg --- src/DIRAC/WorkloadManagementSystem/ConfigTemplate.cfg | 8 ++++++++ .../Service/TornadoPilotLoggingHandler.py | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/DIRAC/WorkloadManagementSystem/ConfigTemplate.cfg b/src/DIRAC/WorkloadManagementSystem/ConfigTemplate.cfg index 958c5b9f28f..595c81a7b0c 100644 --- a/src/DIRAC/WorkloadManagementSystem/ConfigTemplate.cfg +++ b/src/DIRAC/WorkloadManagementSystem/ConfigTemplate.cfg @@ -25,6 +25,14 @@ Services Authorization { Default = authenticated + sendMessage = "Operator" + sendMessage += "Pilot" + sendMessage += "GenericPilot" + getMetadata = "Operator" + getMetadata += "TrustedHost" + finaliseLogs = "Operator" + finaliseLogs += "Pilot" + finaliseLogs += "GenericPilot" } } JobMonitoring diff --git a/src/DIRAC/WorkloadManagementSystem/Service/TornadoPilotLoggingHandler.py b/src/DIRAC/WorkloadManagementSystem/Service/TornadoPilotLoggingHandler.py index fd0c50f947f..663e1285bdc 100644 --- a/src/DIRAC/WorkloadManagementSystem/Service/TornadoPilotLoggingHandler.py +++ b/src/DIRAC/WorkloadManagementSystem/Service/TornadoPilotLoggingHandler.py @@ -53,8 +53,6 @@ def initializeRequest(self): self.log.info("Request initialised.. ") - auth_sendMessage = ["Operator", "Pilot", "GenericPilot"] - def export_sendMessage(self, message, pilotUUID): # def export_sendMessage(self, message, pilotUUID): """ @@ -77,8 +75,6 @@ def export_sendMessage(self, message, pilotUUID): result = self.loggingPlugin.sendMessage(message, pilotUUID, vo) return result - auth_getMetadata = ["Operator", "TrustedHost"] - def export_getMetadata(self): """ Get PilotLoggingHandler metadata. Intended to be used by a client or an agent. @@ -87,8 +83,6 @@ def export_getMetadata(self): """ return self.loggingPlugin.getMeta() - auth_finaliseLogs = ["Operator", "Pilot", "GenericPilot"] - def export_finaliseLogs(self, payload, pilotUUID): """ Finalise a log file. Finalised logfile can be copied to a secure location, if a file cache is used.