Skip to content

Commit 27c2050

Browse files
mgr/dashboard: add an option to control the dashboard crypto caller
Add a mgr config option `crypto_caller` that lets a ceph user override the default behavior of using the remote crypto caller. Supported values are `internal` and `remote`. Signed-off-by: John Mulligan <jmulligan@redhat.com>
1 parent 2128ffa commit 27c2050

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/pybind/mgr/dashboard/module.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
else:
2424
from typing_extensions import Literal
2525

26+
from ceph.cryptotools.select import choose_crypto_caller
2627
from mgr_module import CLIReadCommand, CLIWriteCommand, HandleCommandResult, \
2728
MgrModule, MgrStandbyModule, NotifyType, Option, _get_localized_key
2829
from mgr_util import ServerConfigException, build_url, \
@@ -275,6 +276,7 @@ class Module(MgrModule, CherryPyConfig):
275276
Option(name='redirect_resolve_ip_addr', type='bool', default=False),
276277
Option(name='cross_origin_url', type='str', default=''),
277278
Option(name='sso_oauth2', type='bool', default=False),
279+
Option(name='crypto_caller', type='str', default=''),
278280
]
279281
MODULE_OPTIONS.extend(options_schema_list())
280282
for options in PLUGIN_MANAGER.hook.get_options() or []:
@@ -288,6 +290,9 @@ class Module(MgrModule, CherryPyConfig):
288290
def __init__(self, *args, **kwargs):
289291
super(Module, self).__init__(*args, **kwargs)
290292
CherryPyConfig.__init__(self)
293+
# configure the dashboard's crypto caller. by default it will
294+
# use the remote caller to avoid pyo3 conflicts
295+
choose_crypto_caller(str(self.get_module_option('crypto_caller', '')))
291296

292297
mgr.init(self)
293298

@@ -563,6 +568,9 @@ def __init__(self, *args, **kwargs):
563568
super(StandbyModule, self).__init__(*args, **kwargs)
564569
CherryPyConfig.__init__(self)
565570
self.shutdown_event = threading.Event()
571+
# configure the dashboard's crypto caller. by default it will
572+
# use the remote caller to avoid pyo3 conflicts
573+
choose_crypto_caller(str(self.get_module_option('crypto_caller', '')))
566574

567575
# We can set the global mgr instance to ourselves even though
568576
# we're just a standby, because it's enough for logging.

src/pybind/mgr/dashboard/services/access_control.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from string import ascii_lowercase, ascii_uppercase, digits, punctuation
1313
from typing import List, Optional, Sequence
1414

15+
from ceph.cryptotools.select import get_crypto_caller
1516
from mgr_module import CLICheckNonemptyFileInput, CLIReadCommand, CLIWriteCommand
1617
from mgr_util import password_hash
1718

@@ -23,8 +24,6 @@
2324
from ..security import Permission, Scope
2425
from ..settings import Settings
2526

26-
from ceph.cryptotools.select import get_crypto_caller
27-
2827
logger = logging.getLogger('access_control')
2928
DEFAULT_FILE_DESC = 'password/secret'
3029

0 commit comments

Comments
 (0)