/usr/lib/ruby/vendor_ruby/ms_rest/credentials/string_token_provider.rb is in ruby-ms-rest 0.6.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | # encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
module MsRest
#
# Class that provides access to authentication token.
#
class StringTokenProvider < TokenProvider
private
# @return [String] the access token.
attr_accessor :token
# @return [String] the token type.
attr_accessor :token_type
public
#
# Creates and initalizes a new instance of StringTokenProvider class.
# @param token [String] the access token.
# @param token_type [String] the token type.
#
def initialize(token, token_type = TokenCredentials::DEFAULT_SCHEME)
@token = token
@token_type = token_type
end
#
# Returns the string value which needs to be attached
# to HTTP request header in order to be authorized.
#
# @return [String] authentication headers.
def get_authentication_header
"#{token_type} #{token}"
end
end
end
|