Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Caching Request Attributes At Gateway

Not applicable

Is there any caching framework available at gateway level for above mentioned use case.

Use Case :

  • Client obtains a valid access token, which will be passed to every subsequent API call
  • API gateway will use the access token to obtain the auth cookies:
    • computes a one-way hash of the access token and uses it to access auth cookies in the API Cache
    • if not in the cache, then it retrieves the auth cookies from Authentication Server
    • if invalid, returns an authentication error
    • if valid, adds them to the cache with an expiration time equal to the expiration time of the Authentication server session and injects them in the request, much like in a call coming from a browser

4148-capture.png

we do not use verifyaccestoken/generateAccessToken ,instead we use service callout to fetch and validate the open AM token from external auth server.

So we would be heading PopulateCache and LookUpCache approach .

A key value object to be stored would be like

"f2d2596d-f41d-42f1-ba15-a30dcf584dcd" :"cookiesActualValue,TTL"

This single KVM object will have multiple objects [sample object shown above] .with each cache entry to have a Time to live same as lifetime of the open AM auth token[as and when issued]. Is there a way we can provide the TTL for each entry in this cache object and then invalidate that entry from cache object.

0 5 347
5 REPLIES 5