merchant test: auth is not a management API

This commit is contained in:
Florian Dold 2021-08-05 22:55:58 +02:00
parent b0e05fcdbc
commit ea0e058b34
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -1016,7 +1016,7 @@ export class ExchangeService implements ExchangeServiceInterface {
const config = Configuration.load(this.configFilename); const config = Configuration.load(this.configFilename);
for (const sectionName of config.getSectionNames()) { for (const sectionName of config.getSectionNames()) {
if (sectionName.startsWith("EXCHANGE-ACCOUNT")) { if (sectionName.startsWith("EXCHANGE-ACCOUNT-")) {
const paytoUri = config.getString(sectionName, "payto_uri").required(); const paytoUri = config.getString(sectionName, "payto_uri").required();
const p = parsePaytoUri(paytoUri); const p = parsePaytoUri(paytoUri);
if (!p) { if (!p) {
@ -1156,15 +1156,13 @@ export class MerchantApiClient {
) {} ) {}
async changeAuth(auth: MerchantAuthConfiguration): Promise<void> { async changeAuth(auth: MerchantAuthConfiguration): Promise<void> {
const baseUrl = this.baseUrl; const url = new URL("private/auth", this.baseUrl);
const url = new URL("management/auth", baseUrl);
await axios.post(url.href, auth, { await axios.post(url.href, auth, {
headers: this.makeAuthHeader(), headers: this.makeAuthHeader(),
}); });
} }
async deleteInstance(instanceId: string) { async deleteInstance(instanceId: string) {
const baseUrl = this.baseUrl;
const url = new URL(`management/instances/${instanceId}`, this.baseUrl); const url = new URL(`management/instances/${instanceId}`, this.baseUrl);
await axios.delete(url.href, { await axios.delete(url.href, {
headers: this.makeAuthHeader(), headers: this.makeAuthHeader(),
@ -1172,8 +1170,7 @@ export class MerchantApiClient {
} }
async createInstance(req: MerchantInstanceConfig): Promise<void> { async createInstance(req: MerchantInstanceConfig): Promise<void> {
const baseUrl = this.baseUrl; const url = new URL("management/instances", this.baseUrl);
const url = new URL("management/instances", baseUrl);
await axios.post(url.href, req, { await axios.post(url.href, req, {
headers: this.makeAuthHeader(), headers: this.makeAuthHeader(),
}); });