Skip to content

Global only APIs need URL overwritten on each call #20

@pmalek

Description

@pmalek

Problem statement

Up until now, this SDK worked around the global URLs for calls that were not targeted for the default API (prod) with the following work around:

switch hookCtx.OperationID {
case "get-organizations-me":
// NOTE(pmalek): This is because we merge OpenAPI specs and /organizations/me
// is only served by the global API.
// @mheap mentioned that we can add operation specific URLs to do away with this.
if strings.HasSuffix(req.URL.Host, "api.konghq.tech") {
req.URL.Host = "global.api.konghq.tech"
} else {
req.URL.Host = "global.api.konghq.com"
}
}
return req, nil
}

This doesn't scale.

Recently, working on KIC's user roles cleanup code (https://github.com/Kong/kubernetes-ingress-controller/blob/main/hack/cleanup/konnect_control_planes.go) I've noticed that listing user roles has the same problem and that would require adding yet another operation ID to to above linked workaround.

This issue tracks the effort to provide a proper solution for this problem.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions