Is there a way to limit an API key to access the same API just through a specific domain.
Let say api key “aaaa” can access API “xy” through a domain aaa.com
and api key “bbbb” can access API “xy” through a domain bbb.com.
Does this make sense? Is more fr auditing purpose than anything else.
I don’t think the Key definition has a feature like that off the top of my head. I could look into it a bit more and confirm
But for something like this the easiest way is to use 2 API definitions with the different domain names as a proxy and funnel it upstream or to another master API definition.
Another method would be to use a custom plugin. I think you could check for the key and the base URL, then take an action depending on the condition. For example, you could set the expected domain name on the API key metadata. Then use a custom post-auth plugin, to check the domain name matches.
Plugins can be written in Python, Lua, Javascript or any language which supports gRPC. Here are some plugin examples in different languages.
Approximately 100 micro-services, each have it’s own base API, plus few mashup APIS (combine multiple micro-service in one use-case/mobile-app …).
So maybe duplicating APIs for internal or/and external use, might not be a good idea.