HomePhabricator
Diffusion Comm ceaadc14b3b9

[1/2][services] Tunnelbroker - ConfigManager implementation and config file.

Description

[1/2][services] Tunnelbroker - ConfigManager implementation and config file.

Summary:
We currently have hard-coded config in Constants.h. This diff moves some of that config into tunnelbroker.ini.

This diff provides an implementation of the ConfigManager and D3075 provides replacing constants to the usage of this class in the current codebase.

Parameters that moves to the config:
*Required (throw a startup error if not provided):*

[tunnelbroker]
instance-id = ...

[keyserver]
default_keyserver_id = ...

[amqp]
uri = ...

*Optional (fallback to defaults if not provided):*

[amqp]
fanout_exchange_name = ...

[dynamodb]
sessions_table_name = ...
sessions_verification_table_name = ...
sessions_public_key_table_name = ...

The config file location is ~/tunnelbroker/tunnelbroker.ini

Test Plan:
Tested config file parameters usage inside the codebase.
Tested default parameters assignment.
Tested errors:

  • no config file present, can't open the config file,
  • no required parameter is present in the config file.

Reviewers: palys-swm, ashoat, varun

Reviewed By: palys-swm, ashoat

Subscribers: benschac, ashoat, palys-swm, Adrian, atul

Differential Revision: https://phabricator.ashoat.com/D2903

Details

Provenance
maxAuthored on Feb 2 2022, 6:35 PM
Reviewer
tomek
Differential Revision
Restricted Differential Revision
Parents
rCOMMbfd20c07b583: [19/n] DeviceID validation.
Branches
Unknown
Tags
Unknown