Skip to content

Commit

Permalink
feat: several further simplifications
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Feb 6, 2024
1 parent c5c089a commit b81cc46
Show file tree
Hide file tree
Showing 15 changed files with 7 additions and 61 deletions.
3 changes: 1 addition & 2 deletions dirac.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,7 @@ Registry
# Admin group
lhcb_admin
{
Properties = AlarmsManagement # Allow to set notifications and manage alarms
Properties += ServiceAdministrator # DIRAC Service Administrator
Properties = ServiceAdministrator # DIRAC Service Administrator
Properties += CSAdministrator # possibility to edit the Configuration Service
Properties += JobAdministrator # Job Administrator can manipulate everybody's jobs
Properties += FullDelegation # Allow getting full delegated proxies
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,5 @@ Services associated with Framework system are:
.. toctree::
:maxdepth: 2

Notification/index
SystemAdministrator/index
UserProfileManager/index
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ are showed in the next table:
+----------------------------+------------------------------------------------------------------+-------------+
| *AccountingMonitor* | Allow access to accounting data for all groups | |
+----------------------------+------------------------------------------------------------------+-------------+
| *AlarmsManagement* | Allow to set notifications and manage alarms | |
+----------------------------+------------------------------------------------------------------+-------------+
| *CSAdministrator* | CS Administrator - possibility to edit the Configuration Service | |
+----------------------------+------------------------------------------------------------------+-------------+
| *FileCatalogManagement* | Allow FC Management | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The Framework/Notification service
==================================


The Framework/Notification service is responsible for notification, like as send mail, sms or alarm window on DIRAC portal.
The Framework/Notification service is responsible for sending mail.
Send an email with supplied body to the specified address using the Mail utility.
Emails with the same address, subject, and content are only sent once every 24h.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ Actions
DIRAC.RSS has the following actions:

* **EmailAction** : sends an email notification
* **SMSAction** : sends a sms notification ( not certified yet ).
* **LogStatusAction** : updates the <element>Status table with the new computed status
* **LogPolicyResultAction** : updates the PolicyResult table with the results of the policies in singlePolicyResults.

Expand Down
3 changes: 1 addition & 2 deletions docs/source/AdministratorGuide/Tutorials/basicTutoSetup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,7 @@ The Configuration service will serve the content of the file ``/opt/dirac/etc/My
dirac_admin
{
Users = ciuser
Properties = AlarmsManagement
Properties += ServiceAdministrator
Properties = ServiceAdministrator
Properties += CSAdministrator
Properties += JobAdministrator
Properties += FullDelegation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ If you use a proxy with the ``ProxyManagement`` permission, like the ``dirac_adm
rfc : True
path : /tmp/x509up_u501
username : ciuser
properties : AlarmsManagement, ServiceAdministrator, CSAdministrator, JobAdministrator, FullDelegation, ProxyManagement, Operator
properties : ServiceAdministrator, CSAdministrator, JobAdministrator, FullDelegation, ProxyManagement, Operator
[diracuser@dirac-tuto ~]$ dirac-admin-get-proxy ciuser dirac_user
Proxy downloaded to /home/diracuser/proxy.ciuser.dirac_user

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ Registry
Properties += Operator
Properties += CSAdministrator
Properties += ProductionManagement
Properties += AlarmsManagement
Properties += TrustedHost
Properties += SiteManager
}
Expand All @@ -84,7 +83,6 @@ Registry
Properties += Operator
Properties += CSAdministrator
Properties += ProductionManagement
Properties += AlarmsManagement
Properties += TrustedHost
Properties += SiteManager
}
Expand Down
3 changes: 0 additions & 3 deletions src/DIRAC/Core/Security/Properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ class SecurityProperty(str, Enum):
PPG_AUTHORITY = "PPGAuthority"
#: Allow Bookkeeping Management
BOOKKEEPING_MANAGEMENT = "BookkeepingManagement"
#: Allow to set notifications and manage alarms
ALARMS_MANAGEMENT = "AlarmsManagement"
#: Allow FC Management - FC root user
FC_MANAGEMENT = "FileCatalogManagement"
#: Allow staging files
Expand Down Expand Up @@ -152,6 +150,5 @@ def __call__(self, properties: list[SecurityProperty]) -> bool:
PRODUCTION_MANAGEMENT = SecurityProperty.PRODUCTION_MANAGEMENT.value
PPG_AUTHORITY = SecurityProperty.PPG_AUTHORITY.value
BOOKKEEPING_MANAGEMENT = SecurityProperty.BOOKKEEPING_MANAGEMENT.value
ALARMS_MANAGEMENT = SecurityProperty.ALARMS_MANAGEMENT.value
FC_MANAGEMENT = SecurityProperty.FC_MANAGEMENT.value
STAGE_ALLOWED = SecurityProperty.STAGE_ALLOWED.value
2 changes: 0 additions & 2 deletions src/DIRAC/FrameworkSystem/Client/ComponentInstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
)
from DIRAC.Core.Base.private.ModuleLoader import ModuleLoader
from DIRAC.Core.Security.Properties import (
ALARMS_MANAGEMENT,
CS_ADMINISTRATOR,
FULL_DELEGATION,
JOB_ADMINISTRATOR,
Expand Down Expand Up @@ -423,7 +422,6 @@ def _getCentralCfg(self, installCfg):
hostDN = self.localCfg.getOption(cfgInstallPath("HostDN"), "")
defaultGroupName = self.localCfg.getOption(cfgInstallPath("DefaultGroupName"), "dirac_user")
adminGroupProperties = [
ALARMS_MANAGEMENT,
SERVICE_ADMINISTRATOR,
CS_ADMINISTRATOR,
JOB_ADMINISTRATOR,
Expand Down
4 changes: 0 additions & 4 deletions src/DIRAC/FrameworkSystem/ConfigTemplate.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,8 @@ Services
Notification
{
Port = 9154
SMSSwitch = sms.switch.ch
Authorization
{
Default = AlarmsManagement
sendMail = authenticated
}
}
Expand All @@ -152,10 +150,8 @@ Services
TornadoNotification
{
Protocol = https
SMSSwitch = sms.switch.ch
Authorization
{
Default = AlarmsManagement
sendMail = authenticated
}
}
Expand Down
13 changes: 1 addition & 12 deletions src/DIRAC/FrameworkSystem/Service/NotificationHandler.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
""" The Notification service provides a toolkit to contact people via email
(eventually SMS etc.) to trigger some actions.
The original motivation for this is due to some sites restricting the
sending of email but it is useful for e.g. crash reports to get to their
destination.
Another use-case is for users to request an email notification for the
completion of their jobs. When output data files are uploaded to the
Grid, an email could be sent by default with the metadata of the file.
It can also be used to set alarms to be promptly forwarded to those
subscribing to them.
to trigger some actions.
"""
from DIRAC import S_OK, gConfig
from DIRAC.ConfigurationSystem.Client import PathFinder
Expand Down
3 changes: 1 addition & 2 deletions src/DIRAC/Interfaces/API/DiracAdmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,8 +796,7 @@ def sendMail(self, address, subject, body, fromAddress=None, localAttempt=True,
"""
Send mail to specified address with body.
"""
notification = NotificationClient()
return notification.sendMail(address, subject, body, fromAddress, localAttempt, html)
return NotificationClient().sendMail(address, subject, body, fromAddress, localAttempt, html)


# EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#
2 changes: 1 addition & 1 deletion tests/Jenkins/utilities.sh
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ diracUserAndGroup() {
exit 1
fi

if ! dirac-admin-add-group -G prod -U adminusername,ciuser,trialUser -P Operator,FullDelegation,ProxyManagement,ServiceAdministrator,JobAdministrator,CSAdministrator,AlarmsManagement,FileCatalogManagement,SiteManager,NormalUser,ProductionManagement VO=vo "${DEBUG}"; then
if ! dirac-admin-add-group -G prod -U adminusername,ciuser,trialUser -P Operator,FullDelegation,ProxyManagement,ServiceAdministrator,JobAdministrator,CSAdministrator,FileCatalogManagement,SiteManager,NormalUser,ProductionManagement VO=vo "${DEBUG}"; then
echo 'ERROR: dirac-admin-add-group failed' >&2
exit 1
fi
Expand Down

0 comments on commit b81cc46

Please sign in to comment.