Class: X::BearerTokenAuthenticator

Inherits:
Authenticator show all
Defined in:
lib/x/bearer_token_authenticator.rb

Constant Summary

Constants inherited from Authenticator

Authenticator::AUTHENTICATION_HEADER

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bearer_token:) ⇒ BearerTokenAuthenticator

rubocop:disable Lint/MissingSuper



7
8
9
# File 'lib/x/bearer_token_authenticator.rb', line 7

def initialize(bearer_token:) # rubocop:disable Lint/MissingSuper
  @bearer_token = bearer_token
end

Instance Attribute Details

#bearer_tokenObject

Returns the value of attribute bearer_token.



5
6
7
# File 'lib/x/bearer_token_authenticator.rb', line 5

def bearer_token
  @bearer_token
end

Instance Method Details

#header(_request) ⇒ Object



11
12
13
# File 'lib/x/bearer_token_authenticator.rb', line 11

def header(_request)
  {AUTHENTICATION_HEADER => "Bearer #{bearer_token}"}
end