Refactor access token serialization
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
asapp/serializers/access_token_entity_base.rb
-
Make the personal/impersonation/group/project entity tokens to inherit from
AccessTokenEntityBase
. Each of these entities adds their ownrevoke_path
and, for group/project entities, therole
properties.
Screenshots or screen recordings
No change.
How to set up and validate locally
- Go to User Settings > Access Tokens: https://gdk.test:3443/-/profile/personal_access_tokens
- Create a new token that expires tomorrow.
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Eduardo Sanz García