[MGNLRESTCL-216] Requests using securitySchemes don't use cached responses Created: 26/Jun/23  Updated: 13/Dec/23

Status: Accepted
Project: REST Client
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Roberto Gaona Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Epic Link: RESTClient 2024
Team: DeveloperX

 Description   

Steps to reproduce

  1. Making a REST call with the following configuration always goes the full :
    baseUrl: xxx
    
    securitySchemes:
      basic:
        $type: basic
        username: xxxx
        password: xxx
    
    cacheConfiguration:
      expireIn: 60
    
    timeoutConfiguration:
      readTimeout: 60
      fallbackToCache: true
    
    restCalls:
      getObject:
        path: '{path}'
        entityClass: xxx
        method: GET
        securityScheme: basic
    

    If the REST call is done with Authorization header instead of the securitySchemes the caching process works and returns the cached response after a first request:

    ....
    restCalls:
      getObject:
        path: '{path}'
        entityClass: xxx
        method: GET
        headers :
          Authorization: 'Basic xxx'
    

Development notes

It seems like the issue appears when checking the cache for a cached response on the CachingFilter. The response is stored with the authorization headers added, but it tries to recover it matching it against a request without headers. This causes that, unless the request carries the header from the start, it won't be gathered from the cache.


Generated at Mon Feb 12 10:44:17 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.