Correct me if I am wrong in my understanding, but it seems like we can use API Products long with custom resource paths to sort of slice and dice the Proxy resources in a way that allows us to restrict proxy access to various Developer Apps. Would that be a correct interpretation? If so, then that totally makes sense now.
Yes, you should think of the API Proxy as the entity where you describe the execution or handling of requests, and think of API Product as the unit of exposure of APIs to developers. There are two distinct concerns here. With the API Product, you can wrap up multiple proxies, or filter or subset proxies.
But keep in mind that the resource paths that you configure for a product are not tied to a particular proxy. They apply across all proxies in the product. So if you have /apples as a resource path in your product, then credentials for that API Product will be valid when requesting /apples, regardless which proxy included in the product handles that request, and regardless of the basepath for any of those proxies.
Updating the resource paths is simple - there’s a single Admin API call to modify it, or of course you could use the Administrative UI to make such a change. Normally I wouldn’t expect rapid change to occur at this layer. Here’s why: an API Product is the unit of exposure, and developers build apps that depend on the set of APIs included in a product. If you then change the set of APIs in the product, the developer needs to develop something new. So it perhaps makes most sense to introduce a new API product, that contains new APIs, and have the developer obtain a new credential for that app. That seems natural to me. But even if you don’t follow this typical path, you can modify products and the set of resource paths for a product.
I am wondering what happens to in-flight calls from our integrators at the time that we shift a Developer App. from one Product to another or add custom resource paths?
Geez, I can’t give an exact answer to that. I don’t expect that kind of change to be a normal occurrence. But … if you add or change settings on an API product, these changes will be available nearly immediately, dependent on the cache of the token in the message processor.
Here’s how it works: when a token or key is presented in a request, the message processor, the piece of software responsible for validating the token or key, reads from a persistent store, and evaluates the request. Is this a valid token? What’s the list of products available for this token? Is the current proxy included in any of the API products in the list? If so, is the current resource path included in that product?
For performance reasons, the MP caches the token metadata in memory. We don’t want the MP to read the mostly unchanging data, over and over again, from persistent store. If an app presents that token again, then the MP uses the cached information to satisfy the token check. This cache has a TTL currently of 180s. We may reduce this in the future. But my point is: if you change things, it may take up to 180s in order for the updated information to be refreshed into cache.