class Bosh::Cli::Client::Uaa::AccessInfo
Constants
- EXPIRATION_DEADLINE_IN_SECONDS
Public Class Methods
new(token_info, token_decoder)
click to toggle source
# File lib/cli/client/uaa/access_info.rb, line 8 def initialize(token_info, token_decoder) @token_info = token_info @token_decoder = token_decoder end
Public Instance Methods
auth_header()
click to toggle source
# File lib/cli/client/uaa/access_info.rb, line 13 def auth_header @token_info.auth_header end
expires_soon?()
click to toggle source
# File lib/cli/client/uaa/access_info.rb, line 25 def expires_soon? expiration = token_data[:exp] || token_data['exp'] (Time.at(expiration).to_i - Time.now.to_i) < EXPIRATION_DEADLINE_IN_SECONDS end
refresh_token()
click to toggle source
# File lib/cli/client/uaa/access_info.rb, line 17 def refresh_token @token_info.info[:refresh_token] || @token_info.info['refresh_token'] end
to_hash()
click to toggle source
# File lib/cli/client/uaa/access_info.rb, line 34 def to_hash { 'access_token' => auth_header, 'refresh_token' => refresh_token } end
token_data()
click to toggle source
# File lib/cli/client/uaa/access_info.rb, line 30 def token_data @token_data ||= @token_decoder.decode(@token_info) end
was_issued_for?(other_username)
click to toggle source
# File lib/cli/client/uaa/access_info.rb, line 21 def was_issued_for?(other_username) username == other_username end