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

token_with_expiration.rb « support « api « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2cbd562c6081bd4be2810feea1b57d1e243268ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

module API
  module Support
    class TokenWithExpiration
      def initialize(strategy, instance)
        @strategy = strategy
        @instance = instance
      end

      def token
        @strategy.get_token(@instance)
      end

      def token_expires_at
        @strategy.expires_at(@instance)
      end

      def expirable?
        @strategy.expirable?
      end
    end
  end
end