Bug #17568

Get API token dialog shows incorrect token expiration on federated tokens

Added by Lucas Di Pentima 23 days ago. Updated 8 days ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Start date:
04/29/2021
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Story points:
-
Release relationship:
Auto

Description

Federated tokens make WB2 to show their internal refresh token timeout setting instead of the real token expiration.


Subtasks

Arvados - Task #17588: Review 17568-api-token-dialog-expiration-fixResolvedPeter Amstutz

Associated revisions

Revision fcfb353f
Added by Lucas Di Pentima 8 days ago

Merge branch '17568-api-token-dialog-expiration-fix'
Closes #17568

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <>

History

#1 Updated by Lucas Di Pentima 22 days ago

  • Status changed from New to In Progress

#2 Updated by Peter Amstutz 21 days ago

  • Release set to 38

#3 Updated by Lucas Di Pentima 16 days ago

Updates at arvados-workbench2|7d40a4a - branch 17568-api-token-dialog-expiration-fix
Test run: https://ci.arvados.org/view/Developer/job/developer-tests-workbench2/397/

  • Makes wb2 ask for federated token to the correct cluster.
  • Adds unit test -- lots of mocking to simulate a federation, I hope the approach is correct.

#4 Updated by Lucas Di Pentima 15 days ago

  • Target version changed from 2021-04-28 bughunt sprint to 2021-05-12 sprint

#5 Updated by Peter Amstutz 9 days ago

17568-api-token-dialog-expiration-fix @ 7d40a4a432ce8dfea8e49f3d330220aea6957790

This LGTM, just a couple of comments:

  • Does typescript have finally ?
    -            await dispatch<any>(saveApiToken(token)); // .then(() => {
    -            await dispatch(progressIndicatorActions.STOP_WORKING(WORKBENCH_LOADING_SCREEN));
    -        } catch (e) {
    -            dispatch(progressIndicatorActions.STOP_WORKING(WORKBENCH_LOADING_SCREEN));
    -        }
    +            await dispatch<any>(saveApiToken(token));
    +        } catch (e) {}
    +        dispatch(progressIndicatorActions.STOP_WORKING(WORKBENCH_LOADING_SCREEN));
    
  • It would be nice if the expiration time was also expressed as an approximate duration: "will expire in X days|hours|minutes" in addition to giving the time and date. This is not a blocker, just an observation.

#6 Updated by Lucas Di Pentima 8 days ago

Peter Amstutz wrote:

  • Does typescript have finally ?

Whoops, you're right, fixed!

  • It would be nice if the expiration time was also expressed as an approximate duration: "will expire in X days|hours|minutes" in addition to giving the time and date. This is not a blocker, just an observation.

Found a nice library (Moment.js) that does this and other time related tasks really nicely.

Updates at arvados-workbench2|ec121e0
Test run: https://ci.arvados.org/view/Developer/job/developer-tests-workbench2/400/

#7 Updated by Anonymous 8 days ago

  • Status changed from In Progress to Resolved

Also available in: Atom PDF