From 8dbf1270830c67466099baaa3ae7570ce8ec7eb7 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 5 Aug 2021 15:02:52 -0300 Subject: issue #6945: Move instance management API to /management instead of /private --- packages/taler-wallet-cli/src/integrationtests/harness.ts | 12 ++++++------ .../src/integrationtests/test-merchant-instances-delete.ts | 2 +- .../src/integrationtests/test-merchant-instances.ts | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'packages/taler-wallet-cli') diff --git a/packages/taler-wallet-cli/src/integrationtests/harness.ts b/packages/taler-wallet-cli/src/integrationtests/harness.ts index 285e9aa10..67abdcaca 100644 --- a/packages/taler-wallet-cli/src/integrationtests/harness.ts +++ b/packages/taler-wallet-cli/src/integrationtests/harness.ts @@ -1162,7 +1162,7 @@ export class MerchantApiClient { async changeAuth(auth: MerchantAuthConfiguration): Promise { const baseUrl = this.baseUrl; - const url = new URL("private/auth", baseUrl); + const url = new URL("management/auth", baseUrl); await axios.post(url.href, auth, { headers: this.makeAuthHeader(), }); @@ -1170,7 +1170,7 @@ export class MerchantApiClient { async deleteInstance(instanceId: string) { const baseUrl = this.baseUrl; - const url = new URL(`private/instances/${instanceId}`, this.baseUrl); + const url = new URL(`management/instances/${instanceId}`, this.baseUrl); await axios.delete(url.href, { headers: this.makeAuthHeader(), }); @@ -1178,14 +1178,14 @@ export class MerchantApiClient { async createInstance(req: MerchantInstanceConfig): Promise { const baseUrl = this.baseUrl; - const url = new URL("private/instances", baseUrl); + const url = new URL("management/instances", baseUrl); await axios.post(url.href, req, { headers: this.makeAuthHeader(), }); } async getInstances(): Promise { - const url = new URL("private/instances", this.baseUrl); + const url = new URL("management/instances", this.baseUrl); const resp = await axios.get(url.href, { headers: this.makeAuthHeader(), }); @@ -1193,7 +1193,7 @@ export class MerchantApiClient { } async getInstanceFullDetails(instanceId: string): Promise { - const url = new URL(`private/instances/${instanceId}`, this.baseUrl); + const url = new URL(`management/instances/${instanceId}`, this.baseUrl); try { const resp = await axios.get(url.href, { headers: this.makeAuthHeader(), @@ -1471,7 +1471,7 @@ export class MerchantService implements MerchantServiceInterface { throw Error("merchant must be running to add instance"); } console.log("adding instance"); - const url = `http://localhost:${this.merchantConfig.httpPort}/private/instances`; + const url = `http://localhost:${this.merchantConfig.httpPort}/management/instances`; const auth = instanceConfig.auth ?? { method: "external" }; await axios.post(url, { auth, diff --git a/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances-delete.ts b/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances-delete.ts index 8b89b0768..28f729692 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances-delete.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances-delete.ts @@ -66,7 +66,7 @@ export async function runMerchantInstancesDeleteTest(t: GlobalTestState) { // Instances should initially be empty { - const r = await axios.get(new URL("private/instances", baseUrl).href); + const r = await axios.get(new URL("management/instances", baseUrl).href); t.assertDeepEqual(r.data.instances, []); } diff --git a/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances.ts b/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances.ts index 73d4a0224..da45b4661 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-merchant-instances.ts @@ -66,7 +66,7 @@ export async function runMerchantInstancesTest(t: GlobalTestState) { // Instances should initially be empty { - const r = await axios.get(new URL("private/instances", baseUrl).href); + const r = await axios.get(new URL("management/instances", baseUrl).href); t.assertDeepEqual(r.data.instances, []); } @@ -102,7 +102,7 @@ export async function runMerchantInstancesTest(t: GlobalTestState) { // Check that a "malformed" bearer Authorization header gets ignored { const url = merchant.makeInstanceBaseUrl(); - const resp = await axios.get(new URL("private/instances", url).href, { + const resp = await axios.get(new URL("management/instances", url).href, { headers: { Authorization: "foo bar-baz", }, @@ -143,7 +143,7 @@ export async function runMerchantInstancesTest(t: GlobalTestState) { // Now, try some variations. { const url = merchant.makeInstanceBaseUrl(); - const resp = await axios.get(new URL("private/instances", url).href, { + const resp = await axios.get(new URL("management/instances", url).href, { headers: { // Note the spaces Authorization: "Bearer secret-token:foobar", -- cgit v1.2.3