Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(admin): fix members endpoint - fixes #206 #208

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions src/admin/lib/AdminApiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class AdminApiClient {
const config = CamundaEnvironmentConfigurator.mergeConfigWithEnvironment(
options?.config ?? {}
)
const baseUrl = RequireConfiguration(
const prefixUrl = RequireConfiguration(
config.CAMUNDA_CONSOLE_BASE_URL,
'CAMUNDA_CONSOLE_BASE_URL'
)
Expand All @@ -45,7 +45,6 @@ export class AdminApiClient {
options?.oAuthProvider ?? constructOAuthProvider(config)

this.userAgentString = createUserAgentString(config)
const prefixUrl = `${baseUrl}/clusters`
this.rest = GetCustomCertificateBuffer(config).then(
(certificateAuthority) =>
got.extend({
Expand All @@ -65,7 +64,7 @@ export class AdminApiClient {
},
})
)
debug('prefixUrl', `${baseUrl}/clusters`)
debug('prefixUrl', `${prefixUrl}`)
}

private async getHeaders() {
Expand All @@ -89,7 +88,7 @@ export class AdminApiClient {
async getClients(clusterUuid: string): Promise<Dto.ClusterClient[]> {
const headers = await this.getHeaders()
const rest = await this.rest
return rest(`${clusterUuid}/clients`, {
return rest(`clusters/${clusterUuid}/clients`, {
headers,
}).json()
}
Expand All @@ -106,7 +105,7 @@ export class AdminApiClient {
const headers = await this.getHeaders()
const rest = await this.rest
return rest
.post(`${req.clusterUuid}/clients`, {
.post(`clusters/${req.clusterUuid}/clients`, {
body: JSON.stringify({
clientName: req.clientName,
permissions: req.permissions,
Expand All @@ -129,7 +128,7 @@ export class AdminApiClient {
): Promise<Dto.ClusterClientConnectionDetails> {
const headers = await this.getHeaders()
const rest = await this.rest
return rest(`${clusterUuid}/clients/${clientId}`, {
return rest(`clusters/${clusterUuid}/clients/${clientId}`, {
headers,
}).json()
}
Expand All @@ -144,7 +143,7 @@ export class AdminApiClient {
const headers = await this.getHeaders()
const rest = await this.rest
return rest
.delete(`${clusterUuid}/clients/${clientId}`, {
.delete(`clusters/${clusterUuid}/clients/${clientId}`, {
headers,
})
.json()
Expand All @@ -158,7 +157,7 @@ export class AdminApiClient {
async getClusters(): Promise<Dto.Cluster[]> {
const headers = await this.getHeaders()
const rest = await this.rest
return rest('', {
return rest('clusters', {
headers,
}).json()
}
Expand All @@ -177,7 +176,7 @@ export class AdminApiClient {
headers,
}
const rest = await this.rest
return rest.post('', req).json()
return rest.post('clusters', req).json()
}

/**
Expand All @@ -189,7 +188,7 @@ export class AdminApiClient {
async getCluster(clusterUuid: string): Promise<Dto.Cluster> {
const headers = await this.getHeaders()
const rest = await this.rest
return rest(`${clusterUuid}`, {
return rest(`clusters/${clusterUuid}`, {
headers,
}).json()
}
Expand All @@ -204,7 +203,7 @@ export class AdminApiClient {
const headers = await this.getHeaders()
const rest = await this.rest
return rest
.delete(`${clusterUuid}`, {
.delete(`clusters/${clusterUuid}`, {
headers,
})
.json()
Expand All @@ -218,7 +217,7 @@ export class AdminApiClient {
async getParameters(): Promise<Dto.Parameters> {
const headers = await this.getHeaders()
const rest = await this.rest
return rest('parameters', {
return rest('clusters/parameters', {
headers,
}).json()
}
Expand All @@ -231,7 +230,7 @@ export class AdminApiClient {
async getSecrets(clusterUuid: string): Promise<{ [key: string]: string }> {
const headers = await this.getHeaders()
const rest = await this.rest
return rest(`${clusterUuid}/secrets`, {
return rest(`clusters/${clusterUuid}/secrets`, {
headers,
}).json()
}
Expand All @@ -256,7 +255,7 @@ export class AdminApiClient {
headers,
}
const rest = await this.rest
return rest.post(`${clusterUuid}/secrets`, req).json()
return rest.post(`clusters/${clusterUuid}/secrets`, req).json()
}

/**
Expand All @@ -268,7 +267,7 @@ export class AdminApiClient {
const headers = await this.getHeaders()
const rest = await this.rest
return rest
.delete(`${clusterUuid}/secrets/${secretName}`, {
.delete(`clusters/${clusterUuid}/secrets/${secretName}`, {
headers,
})
.json()
Expand All @@ -293,7 +292,7 @@ export class AdminApiClient {
const headers = await this.getHeaders()
const rest = await this.rest
return rest
.put(`${clusterUuid}/ipwhitelist`, {
.put(`clusters/${clusterUuid}/ipwhitelist`, {
body: JSON.stringify({
ipwhitelist,
}),
Expand Down
Loading