Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/personal_access_tokens.rb')
-rw-r--r--lib/api/personal_access_tokens.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/api/personal_access_tokens.rb b/lib/api/personal_access_tokens.rb
index 9d234ca0593..de00b66ead3 100644
--- a/lib/api/personal_access_tokens.rb
+++ b/lib/api/personal_access_tokens.rb
@@ -72,11 +72,17 @@ module API
detail 'Roates a personal access token.'
success Entities::PersonalAccessTokenWithToken
end
+ params do
+ optional :expires_at,
+ type: Date,
+ desc: "The expiration date of the token",
+ documentation: { example: '2021-01-31' }
+ end
post ':id/rotate' do
token = PersonalAccessToken.find_by_id(params[:id])
if Ability.allowed?(current_user, :manage_user_personal_access_token, token&.user)
- response = ::PersonalAccessTokens::RotateService.new(current_user, token).execute
+ response = ::PersonalAccessTokens::RotateService.new(current_user, token).execute(declared_params)
if response.success?
status :ok