diff options
Diffstat (limited to 'lib/api/entities/personal_access_token.rb')
-rw-r--r-- | lib/api/entities/personal_access_token.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/api/entities/personal_access_token.rb b/lib/api/entities/personal_access_token.rb new file mode 100644 index 00000000000..d6fb9af6ab3 --- /dev/null +++ b/lib/api/entities/personal_access_token.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module API + module Entities + 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 + end +end |