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

Document ideas for how to deal with API Gateway #8

Open
bethesque opened this issue Jun 25, 2020 · 0 comments
Open

Document ideas for how to deal with API Gateway #8

bethesque opened this issue Jun 25, 2020 · 0 comments

Comments

@bethesque
Copy link
Member

bethesque commented Jun 25, 2020

Background conversation:

A 11:32 AM
To that specific example, we’ve hit similar conceptual problems with a client. I expect that there’s an API gateway which is a single deployment unit, and it fronts two services, which are also separate deployment units. I think they’re asking about a contract to the gateway, which is defined by two swagger documents (only)

B 11:35 AM
That situation may have more nuance to it. If the gateway is just a pass thru, then for the purposes of contract testing I may likely pretend like it doesn’t exist in the first place and have separate contracts with the target APIs

A 11:35 AM
Yep.

B 11:36 AM
Otherwise, the gateway tests are going to have to do a lot of mocking and not a lot of useful things. It gets messier if the gateway does more than a gateway should - orchestration, re-mapping paths etc.
11:36
I still tend to avoid contracts with a gateway, but to be fair, haven’t encountered situations where that may genuinely be necessary

A 11:37 AM
What do you think of the path rewrite per service pattern? Where a gateway accepts /users/whatever, and redirects that to /whatever on the users service?

B 11:45 AM
Pretty standard for gateways to do that, and quite easy to deal with.
Have the consumer configure the path (possibly least optimal)
Have the provider re-write the path during verification, knowing how it is mapped behind the gateway
2 - can be done in multiple ways: re-map the paths in the app, little proxy in front of it or request filters (edited)
👍
1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant