Class: K8y::REST::Auth::Token

Inherits:
AuthBase
  • Object
show all
Defined in:
lib/k8y/rest/auth/token.rb

Instance Method Summary collapse

Constructor Details

#initialize(token:) ⇒ Token

Returns a new instance of Token.



9
10
11
12
# File 'lib/k8y/rest/auth/token.rb', line 9

def initialize(token:)
  super()
  @token = token
end

Instance Method Details

#configure_connection(connection) ⇒ Object



14
15
16
# File 'lib/k8y/rest/auth/token.rb', line 14

def configure_connection(connection)
  connection.headers[:Authorization] = "Bearer #{token}"
end