Skip to content

Refactor access token serialization

Eduardo Sanz García requested to merge eduardosanz/refactor-serialisers into master

What does this MR do and why?

PersonalAccessTokenWithDetails is used only internally and it is not part of the public API. Therefore, we have done the following changes:

  • Moved and rename lib/api/entities/personal_access_token_with_details.rb as app/serializers/access_token_entity_base.rb

  • Make the personal/impersonation/group/project entity tokens to inherit from AccessTokenEntityBase. Each of these entities adds their own revoke_path and, for group/project entities, the role properties.

Screenshots or screen recordings

No change.

How to set up and validate locally

  1. Go to User Settings > Access Tokens: https://gdk.test:3443/-/profile/personal_access_tokens
  2. Create a new token that expires tomorrow.
  3. The Expires column of the access token table should display, in X hours, for the new token. Thus, it should continue to do display as before.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Eduardo Sanz García

Merge request reports

Loading