Update the API Tokens UI for new token format and status.

Review Request #12527 — Created Aug. 10, 2022 and submitted — Latest diff uploaded

Information

Review Board
release-5.0.x

Reviewers

This change updates the API tokens config page for most of the
features supported by the new API token generator:

  • Long API tokens are displayed nicely, inside an <input> element with
    a copy button.
  • A label shows when each token was last used.
  • Tokens which are expired or invalidated will show when that happened,
    and in the case of invalidation, will show the message.
  • Tokens with an expiration date will show the time left.

There's still some future work left to do in later changes:

  • Allow people to set the expiration date.
  • Show a warning when a token was created with a deprecated generator
    class.

Based on work by Michelle Aubin at /r/12492/

  • Ran unit tests.
  • Ran js-tests.
  • Set up a bunch of different API tokens with various expiration dates
    and validity settings. Checked that everything displayed correctly.
  • Checked that the copy button functioned as expected.

Diff Revision 2 (Latest)

orig
1
2

Commits

First Last Summary ID Author
Update the API Tokens UI for new token format and status.
This change updates the API tokens config page for most of the features supported by the new API token generator: - Long API tokens are displayed nicely, inside an `<input>` element with a copy button. - A label shows when each token was last used. - Tokens which are expired or invalidated will show when that happened, and in the case of invalidation, will show the message. - Tokens with an expiration date will show the time left. There's still some future work left to do in later changes: - Allow people to set the expiration date. - Show a warning when a token was created with a deprecated generator class. Based on work by Michelle Aubin at /r/12492/ Testing Done: - Ran unit tests. - Ran js-tests. - Set up a bunch of different API tokens with various expiration dates and validity settings. Checked that everything displayed correctly. - Checked that the copy button functioned as expected.
737831d73541319b9f4b973c71106f6a6dae78c1 David Trowbridge
reviewboard/accounts/forms/pages.py
reviewboard/static/rb/css/pages/my-account.less
reviewboard/static/rb/js/accountPrefsPage/views/apiTokensView.es6.js
reviewboard/static/rb/js/resources/models/apiTokenModel.es6.js
reviewboard/templates/notifications/password_changed.html
reviewboard/webapi/admin.py
reviewboard/webapi/resources/api_token.py
Loading...