Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Includes new token's expiration date in "users/token/recreate" endpoint #10858

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

GPortas
Copy link
Contributor

@GPortas GPortas commented Sep 18, 2024

What this PR does / why we need it:

An optional query parameter called 'returnExpiration' has been added to the 'users/token/recreate' endpoint, which, if set to true, returns the expiration time in the response message.

Which issue(s) this PR closes:

Special notes for your reviewer:

I've kept the string messages as responses for backward compatibility, although it would be interesting to use JSON responses in the future, as multiple properties are being returned in the same response message.

Suggestions on how to test this:

For obtaining a new token without its expiration time (current behavior)

curl -H "X-Dataverse-key:$API_TOKEN" -X POST "$SERVER_URL/api/users/token/recreate"
This endpoint by default will return a response message indicating the user identifier and the new token.

For obtaining a new token with its expiration time

curl -H "X-Dataverse-key:$API_TOKEN" -X POST "$SERVER_URL/api/users/token/recreate?returnExpiration=true"
Does this PR introduce a user interface change? If mockups are available, please link/include them here:

No

Is there a release notes update needed for this change?:

Yes, attached.

Additional documentation:

No

@coveralls
Copy link

coveralls commented Sep 18, 2024

Coverage Status

Changes unknown
when pulling bdf626b on 10857-add-expiration-date-to-recreate-token-api
into ** on develop**.

This comment has been minimized.

@GPortas GPortas changed the title Added: optional query param returnExpiration to token/recreate endpoint New optional query param returnExpiration to token/recreate endpoint Sep 18, 2024
@GPortas GPortas changed the title New optional query param returnExpiration to token/recreate endpoint Includes new token's expiration date in "users/token/recreate" endpoint Sep 18, 2024
@GPortas GPortas marked this pull request as ready for review September 18, 2024 13:20
@GPortas GPortas added Size: 0.5 A percentage of a sprint. 0.35 hours SPA These changes are required for the Dataverse SPA labels Sep 18, 2024

This comment has been minimized.

@stevenwinship stevenwinship self-assigned this Sep 18, 2024
@stevenwinship stevenwinship removed their assignment Sep 18, 2024
@cmbz cmbz added the FY25 Sprint 6 FY25 Sprint 6 label Sep 20, 2024
@GPortas GPortas added the SPA.Q3.7 Basic account page label Sep 23, 2024
@ofahimIQSS ofahimIQSS self-assigned this Sep 24, 2024
@cmbz cmbz added the FY25 Sprint 7 FY25 Sprint 7 (2024-09-25 - 2024-10-09) label Sep 25, 2024
@ofahimIQSS
Copy link
Contributor

@GPortas Hey - can you please update the pull request with the latest from develop.

Copy link

github-actions bot commented Oct 1, 2024

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:10857-add-expiration-date-to-recreate-token-api
ghcr.io/gdcc/configbaker:10857-add-expiration-date-to-recreate-token-api

🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name.

@ofahimIQSS
Copy link
Contributor

Tested in Internal - no issues found
image

@ofahimIQSS ofahimIQSS merged commit 08249f5 into develop Oct 1, 2024
22 of 23 checks passed
@ofahimIQSS ofahimIQSS deleted the 10857-add-expiration-date-to-recreate-token-api branch October 1, 2024 18:14
@ofahimIQSS ofahimIQSS removed their assignment Oct 1, 2024
@pdurbin pdurbin added this to the 6.5 milestone Oct 1, 2024
@ofahimIQSS
Copy link
Contributor

ofahimIQSS commented Oct 2, 2024

omerfahim@HMDC-HMDCs-MacBook-Pro dataverse % curl -H "X-Dataverse-key:5a6185e1-e0a2-4b7e-b6a6-62da5b854e22 " -X POST "https://dataverse-internal.iq.harvard.edu/api/users/token/recreate?returnExpiration=true"
{"status":"OK","data":{"message":"New token for SmokeTest24 is a3d27fc6-5000-49d4-ac94-ff4cbeef0e50 and expires on 2025-10-02 13:38:25.443"}}%

Was testing again today and noticed that the Expiration date on the UI doesn't match up with the expiration date on the API call. - This is likely due to the UI following EST timezone and API using UTC timezone.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FY25 Sprint 6 FY25 Sprint 6 FY25 Sprint 7 FY25 Sprint 7 (2024-09-25 - 2024-10-09) Original size: 0.5 Size: 0.5 A percentage of a sprint. 0.35 hours SPA.Q3.7 Basic account page SPA These changes are required for the Dataverse SPA
Projects
Status: Done 🧹
Development

Successfully merging this pull request may close these issues.

Include new token's expiration date in "users/token/recreate" endpoint
6 participants