Skip to content

Commit

Permalink
flow-cfg-update remove authentication config sectuion
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed Sep 30, 2020
1 parent a860b1e commit fbad477
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 37 deletions.
18 changes: 1 addition & 17 deletions cylc/flow/cfgspec/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

from cylc.flow import LOG
from cylc.flow.parsec.exceptions import UpgradeError
from cylc.flow.network.authorisation import Priv
from cylc.flow.parsec.config import ParsecConfig, ConfigNode as Conf
from cylc.flow.parsec.OrderedDict import OrderedDictWithDefaults
from cylc.flow.parsec.upgrade import upgrader
Expand Down Expand Up @@ -270,22 +269,6 @@
with Conf('reference test'):
Conf('expected task failures', VDR.V_STRING_LIST)

with Conf('authentication'):
# Allow owners to grant public shutdown rights at the most, not
# full control.
Conf(
'public',
VDR.V_STRING,
default=Priv.STATE_TOTALS.name.lower().replace('_', '-'),
options=[
level.name.lower().replace('_', '-')
for level in [
Priv.IDENTITY, Priv.DESCRIPTION,
Priv.STATE_TOTALS, Priv.READ, Priv.SHUTDOWN
]
]
)

with Conf('scheduling', desc='''
This section allows cylc to determine when tasks are ready to run.
'''):
Expand Down Expand Up @@ -1306,6 +1289,7 @@ def upg(cfg, descr):
u.obsolete('7.8.1', ['cylc', 'events', 'reset timer'])
u.obsolete('7.8.1', ['cylc', 'events', 'reset inactivity timer'])
u.obsolete('7.8.1', ['runtime', '__MANY__', 'events', 'reset timer'])
u.obsolete('8.0.0', ['cylc', 'authentication'])
u.obsolete('8.0.0', ['cylc', 'log resolved dependencies'])
u.obsolete('8.0.0', ['cylc', 'reference test', 'allow task failures'])
u.obsolete('8.0.0', ['cylc', 'reference test', 'live mode suite timeout'])
Expand Down
4 changes: 3 additions & 1 deletion cylc/flow/network/authorisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ def _authorise(self, *args, user='?', meta=None, **kwargs):
host = meta.get('host', '?')
prog = meta.get('prog', '?')

usr_priv_level = self._get_priv_level(user)
# Hardcoded, for new - but much of this functionality can be
# removed more swingingly.
usr_priv_level = Priv.CONTROL
if usr_priv_level < req_priv_level:
LOG.warn(
"[client-connect] DENIED (privilege '%s' < '%s') %s@%s:%s",
Expand Down
20 changes: 1 addition & 19 deletions cylc/flow/network/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""Server for suite runtime API."""

import getpass
import getpass # noqa: F401
from queue import Queue
from textwrap import dedent
from time import sleep
Expand All @@ -24,7 +24,6 @@
import zmq

from cylc.flow import LOG
from cylc.flow.cfgspec.glbl_cfg import glbl_cfg
from cylc.flow.network import encode_, decode_, ZMQSocketBase
from cylc.flow.network.authorisation import Priv, authorise
from cylc.flow.network.graphql import (
Expand Down Expand Up @@ -254,23 +253,6 @@ def _receiver(self, message):

return {'data': response}

def _get_public_priv(self):
"""Return the public privilege level of this suite."""
if self.schd.config.cfg['cylc']['authentication']['public']:
return Priv.parse(
self.schd.config.cfg['cylc']['authentication']['public'])
return Priv.parse(glbl_cfg().get(['authentication', 'public']))

def _get_priv_level(self, user):
"""Return the privilege level for the given user for this suite."""
if user == getpass.getuser():
return Priv.CONTROL
if self.public_priv is None:
# cannot do this on initialisation as the suite configuration has
# not yet been parsed
self.public_priv = self._get_public_priv()
return self.public_priv

def register_endpoints(self):
"""Register all exposed methods."""
self.endpoints = {name: obj
Expand Down
1 change: 1 addition & 0 deletions tests/functional/deprecations/01-cylc8-basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ TEST_NAME=${TEST_NAME_BASE}-cmp
cylc validate -v "${SUITE_NAME}" 2>&1 \
| sed -n -e 's/^WARNING - \( \* (.*$\)/\1/p' > 'val.out'
cmp_ok val.out <<__END__
* (8.0.0) [cylc][authentication] - DELETED (OBSOLETE)
* (8.0.0) [cylc][log resolved dependencies] - DELETED (OBSOLETE)
* (8.0.0) [cylc][reference test][allow task failures] - DELETED (OBSOLETE)
* (8.0.0) [cylc][reference test][live mode suite timeout] - DELETED (OBSOLETE)
Expand Down
1 change: 1 addition & 0 deletions tests/functional/deprecations/01-cylc8-basic/flow.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[cylc]
log resolved dependencies =
abort if any task fails =
authentication =
[[reference test]]
allow task failures =
live mode suite timeout =
Expand Down

0 comments on commit fbad477

Please sign in to comment.