Uploaded image for project: 'Managed Service - Streams'
  1. Managed Service - Streams
  2. MGDSTRM-8381

IsJWTTokenExpired returning true for every input

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Normal Normal
    • None
    • None
    • None
    • None
    • MK - Sprint 218, MK - Sprint 219

      WHAT

      IsJWTTokenExpired() is returning true for every input due to jwt.Parse() returning "no Keyfunc was provided" error. 

      Move is_jwt_token_expired.go from pkg/shared to pkg/auth.

      Add unit tests to is_jwt_token_expired.go

      WHY

      Passing nil as the second argument to jwt.Parse() makes it impossible to validate the token. Hence, jwt.Parse() will always return an error. Resulting in IsJWTToken returning true for every accessToken, including unexpired tokens. We need unexpired tokens to return false.

      HOW

      <Suggestions for how this may be solved.> [Optional]

      DONE

      Include the following where applicable:

      • IsJwtTokenExpired() no longer returns true for unexpired tokens.
      • is is_jwt_token_expired.go is moved from pkg/shared to pkg/auth.
      • Code coverage is increased for is_jwt_token_expired.go

      Guidelines

      The following steps should be adhered to:

      • Required tests should be put in place - unit, integration, manual test cases (if necessary)
      • CI and all relevant tests passing
      • Changes have been verified by one additional reviewer against:
      • each required environment
      • each supported upgrade path
      • If the changes could have an impact on the clients (either UI or CLI), a JIRA should be created for making the required changes on the client side and acknowledged by one of the client side team members. PR has been merged
         

              rh-ee-egallina Eoin Gallinagh (Inactive)
              rh-ee-egallina Eoin Gallinagh (Inactive)
              MK - Control Plane
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: