commit 1a300de277f40e9572a3fcad2e209b1e3ff96c8a parent 9f6a3d8a62cc245451da61d14f9779b0c1453179 Author: MS <ms@taler.net> Date: Thu, 24 Nov 2022 19:35:39 +0100 Drafting the per-service TypeScript config. Diffstat:
| A | docker/demo/config/deployment-per-service.ts | | | 57 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 57 insertions(+), 0 deletions(-)
diff --git a/docker/demo/config/deployment-per-service.ts b/docker/demo/config/deployment-per-service.ts @@ -0,0 +1,57 @@ +class ApiKey { + apikey: string; + constructor(apikey: string) { + if (!apikey.startsWith("secret-token:")) { + throw Error("Given API key lacks leading 'secret-token:' part.") + } + this.apikey = apikey; + } +} + +interface BankAccount { + username: string; + password: string; +} + +interface NexusAccount { + username: string; + password: string; +} + + +// Values (potentially) needed by more than one container. +interface GlobalConfig { + currency: string; + dbPassword: string; + exchangeBaseUrl: URL; // used by merchant and exchange. + exchangeNexusAccount: NexusAccount; // used by libeufin and exchange. + bankAccounts: [BankAccount]; +} + +interface BankConfig { + baseUrl: URL; + allowRegistrations: boolean; + withSignupBonus: boolean; + bankMaxDebt: number; + customerMaxDebt: number; +} + +interface BankWebUi { + backendUrl: URL; +} + +interface ExchangeConfig { + bankAccount: BankAccount; +} + +interface MerchantConfig { + baseUrl: URL; + instances: [InstanceConfig]; +} + +interface InstanceConfig { + id: string; + url: URL; + apikey: ApiKey; + bankAccount: BankAccount; +}