hobo: generate a wscall-secrets section (#10022)
This commit is contained in:
parent
e7b2a1f35a
commit
ef44e4fb69
|
@ -200,6 +200,9 @@ def test_configure_site_options():
|
|||
assert (pub.get_site_option('authentic.example.net', 'api-secrets')
|
||||
== CmdCheckHobos.shared_secret(HOBO_JSON['services'][1]['secret_key'],
|
||||
HOBO_JSON['services'][2]['secret_key']))
|
||||
assert (pub.get_site_option('authentic.example.net', 'wscall-secrets')
|
||||
== CmdCheckHobos.shared_secret(HOBO_JSON['services'][1]['secret_key'],
|
||||
HOBO_JSON['services'][2]['secret_key']))
|
||||
|
||||
def test_update_configuration():
|
||||
service = [x for x in HOBO_JSON.get('services', []) if x.get('service-id') == 'wcs'][0]
|
||||
|
|
|
@ -319,8 +319,12 @@ class CmdCheckHobos(Command):
|
|||
|
||||
if not 'api-secrets' in config.sections():
|
||||
config.add_section('api-secrets')
|
||||
if not 'wscall-secrets' in config.sections():
|
||||
config.add_section('wscall-secrets')
|
||||
for key, value in api_secrets.items():
|
||||
config.set('api-secrets', key, value)
|
||||
# for now the secrets are the same whatever the direction is.
|
||||
config.set('wscall-secrets', key, value)
|
||||
|
||||
# add known services
|
||||
for service in self.all_services.get('services', []):
|
||||
|
|
Loading…
Reference in New Issue