Skip to content

Commit fc270ca

Browse files
committed
Rename RBAC backend name from "enterprise" to "default"
The RBAC backend will be named "default" instead of "enterprise" after it has been open sourced. Update the API validation to look for the "default" value instead of "enterprise".
1 parent cb3c9be commit fc270ca

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

st2api/st2api/validation.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,15 @@ def validate_rbac_is_correctly_configured():
3636
'You can either enable authentication or disable RBAC.')
3737
raise ValueError(msg)
3838

39-
# 2. Verify enterprise backend is set
40-
if cfg.CONF.rbac.backend != 'enterprise':
41-
msg = ('You have enabled RBAC, but RBAC backend is not set to "enterprise". '
42-
'For RBAC to work, you need to install "bwc-enterprise" package, set '
43-
'"rbac.backend" config option to "enterprise" and restart st2api service.')
39+
# 2. Verify default backend is set
40+
if cfg.CONF.rbac.backend != 'default':
41+
msg = ('You have enabled RBAC, but RBAC backend is not set to "default". '
42+
'For RBAC to work, you need to install "st2-rbac-backend" package, set '
43+
'"rbac.backend" config option to "default" and restart st2api service.')
4444
raise ValueError(msg)
4545

46-
# 2. Verify enterprise bits are available
47-
if 'enterprise' not in available_rbac_backends:
48-
msg = ('"enterprise" RBAC backend is not available. Make sure '
49-
'"bwc-enterprise" and "st2-rbac-backend" system packages are '
50-
'installed.')
46+
# 2. Verify default RBAC backend is available
47+
if 'default' not in available_rbac_backends:
48+
msg = ('"default" RBAC backend is not available. Make sure '
49+
'"st2-rbac-backend" system packages are installed.')
5150
raise ValueError(msg)

st2api/tests/unit/test_validation_utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,20 @@ def test_validate_rbac_is_correctly_configured_auth_not_enabled(self):
4242
self.assertRaisesRegexp(ValueError, expected_msg,
4343
validate_rbac_is_correctly_configured)
4444

45-
def test_validate_rbac_is_correctly_configured_non_enterprise_backend_set(self):
45+
def test_validate_rbac_is_correctly_configured_non_default_backend_set(self):
4646
cfg.CONF.set_override(group='rbac', name='enable', override=True)
4747
cfg.CONF.set_override(group='rbac', name='backend', override='invalid')
4848
cfg.CONF.set_override(group='auth', name='enable', override=True)
4949

50-
expected_msg = ('You have enabled RBAC, but RBAC backend is not set to "enterprise".')
50+
expected_msg = ('You have enabled RBAC, but RBAC backend is not set to "default".')
5151
self.assertRaisesRegexp(ValueError, expected_msg,
5252
validate_rbac_is_correctly_configured)
5353

54-
def test_validate_rbac_is_correctly_configured_enterprise_backend_not_available(self):
54+
def test_validate_rbac_is_correctly_configured_default_backend_not_available(self):
5555
cfg.CONF.set_override(group='rbac', name='enable', override=True)
56-
cfg.CONF.set_override(group='rbac', name='backend', override='enterprise')
56+
cfg.CONF.set_override(group='rbac', name='backend', override='default')
5757
cfg.CONF.set_override(group='auth', name='enable', override=True)
5858

59-
expected_msg = ('"enterprise" RBAC backend is not available. ')
59+
expected_msg = ('"default" RBAC backend is not available. ')
6060
self.assertRaisesRegexp(ValueError, expected_msg,
6161
validate_rbac_is_correctly_configured)

0 commit comments

Comments
 (0)