diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-03-07 09:29:55 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-03-07 09:29:55 -0600 |
commit | 6a52cda31da4becc3e342530a2bdf0868d8921cc (patch) | |
tree | c1dda64455fb29597100513596ae02f1d1946089 /lib/api/entities.rb | |
parent | 61cfe6dea6f2d6725771a0f341e70975cf91c7f7 (diff) | |
parent | 005749a616c19b90d6ec0415df9ae5e35151e33c (diff) | |
download | gitlab-ce-6a52cda31da4becc3e342530a2bdf0868d8921cc.tar.gz |
Merge remote-tracking branch 'origin/personal_access_token_api_and_impersonation_token'
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r-- | lib/api/entities.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index c8f21fc9ca8..0a12ee72d49 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -706,6 +706,22 @@ module API expose :active?, as: :active end + class PersonalAccessToken < Grape::Entity + expose :id, :name, :revoked, :created_at, :scopes + expose :active?, as: :active + expose :expires_at do |personal_access_token| + personal_access_token.expires_at ? personal_access_token.expires_at.strftime("%Y-%m-%d") : nil + end + end + + class PersonalAccessTokenWithToken < PersonalAccessToken + expose :token + end + + class ImpersonationToken < PersonalAccessTokenWithToken + expose :impersonation + end + module JobRequest class JobInfo < Grape::Entity expose :name, :stage |