Skip to content

Commit 90da23c

Browse files
committed
kms_keymaster: allow specifying barbican_endpoint
Under a multi-region deployment with a single Keystone server, specifying the Keystone auth credentials isn't enough. Indeed, Castellan succeeds when logging-in, but may use the wrong Barbican endpoint (if there are 2 Barbican deployed). This is what happened to us, when deploying our 2nd region. They way to fix it would be to tell Castellan what region to use, unfortunately, there's no such option in Castellan. Though we may specify the barbican_endpoint, which is what this patch allows. Change-Id: Ib7f4219ef5fdef65e9cfd5701e28b5288741783e
1 parent 1d5b1d7 commit 90da23c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

etc/keymaster.conf-sample

+6
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@
9393
# domain_id = changeme
9494
# domain_name = changeme
9595

96+
# If running on a multi-region cluster, Castellan may select the wrong
97+
# endpoint for Barbican. To avoid this, set this to the URL of the
98+
# correct barbican endpoint. If there is only a single Barbican service
99+
# in your deployment, it is fine to leave this unconfigured.
100+
# barbican_endpoint =
101+
96102
[kmip_keymaster]
97103
# The kmip_keymaster section is used to configure a keymaster that fetches an
98104
# encryption root secret from a KMIP service.

swift/common/middleware/crypto/kms_keymaster.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class KmsKeyMaster(BaseKeyMaster):
3434
'domain_id', 'domain_name', 'project_id',
3535
'project_domain_id', 'reauthenticate',
3636
'auth_endpoint', 'api_class', 'key_id*',
37-
'active_root_secret_id')
37+
'barbican_endpoint', 'active_root_secret_id')
3838
keymaster_conf_section = 'kms_keymaster'
3939

4040
def _get_root_secret(self, conf):
@@ -67,6 +67,7 @@ def _get_root_secret(self, conf):
6767
oslo_conf = cfg.ConfigOpts()
6868
options.set_defaults(
6969
oslo_conf, auth_endpoint=conf.get('auth_endpoint'),
70+
barbican_endpoint=conf.get('barbican_endpoint'),
7071
api_class=conf.get('api_class')
7172
)
7273
options.enable_logging()

0 commit comments

Comments
 (0)