mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-10 01:31:45 +00:00
25 lines
421 B
Ruby
25 lines
421 B
Ruby
# 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
|