Skip to content

Conversation

jpl-btlunsfo
Copy link
Contributor

@jpl-btlunsfo jpl-btlunsfo commented Jun 9, 2025

Purpose

  • Implements the cognito token expiration checking

Proposed Changes

  • CHANGE cognito token fetching to store expiry date
  • CHANGE _is_expired method to actually validate something

Issues

  • none

Testing

  • Tested with:
process_service = unity.client(UnityServices.PROCESS_SERVICE)
process_service.endpoint = "https://api.dev.mdps.mcp.nasa.gov/unity/dev/ogc/api"

processes = process_service.get_processes()
print(process_service._session.get_auth()._token)
print(process_service._session.get_auth()._token_expiration)

for process in processes:
    print("Process ID: {}\n".format(process.id))

time.sleep(3601)

print("retrying with same client")

processes = process_service.get_processes()
print(process_service._session.get_auth()._token)
print(process_service._session.get_auth()._token_expiration)

for process in processes:
    print("Process ID: {}\n".format(process.id))

Successfully showed key re-fetching.

@jpl-btlunsfo jpl-btlunsfo self-assigned this Jun 9, 2025
@coveralls
Copy link

coveralls commented Jun 9, 2025

Pull Request Test Coverage Report for Build 15542829983

Details

  • 16 of 23 (69.57%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.002%) to 50.887%

Changes Missing Coverage Covered Lines Changed/Added Lines %
libs/unity-py/unity_sds_client/unity_session.py 16 23 69.57%
Files with Coverage Reduction New Missed Lines %
libs/unity-py/unity_sds_client/unity_session.py 1 79.75%
Totals Coverage Status
Change from base Build 15125113440: -0.002%
Covered Lines: 861
Relevant Lines: 1692

💛 - Coveralls

@jpl-btlunsfo jpl-btlunsfo merged commit c2f9f1d into main Jun 10, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants