Class: Nonnative::Header

Inherits:
Object
  • Object
show all
Defined in:
lib/nonnative/header.rb

Class Method Summary collapse

Class Method Details

.auth_basic(credentials) ⇒ Object



14
15
16
# File 'lib/nonnative/header.rb', line 14

def auth_basic(credentials)
  { authorization: "Basic #{Base64.strict_encode64(credentials)}" }
end

.auth_bearer(token) ⇒ Object



18
19
20
# File 'lib/nonnative/header.rb', line 18

def auth_bearer(token)
  { authorization: "Bearer #{token}" }
end

.grpc_user_agent(user_agent) ⇒ Object



10
11
12
# File 'lib/nonnative/header.rb', line 10

def grpc_user_agent(user_agent)
  { 'grpc.primary_user_agent' => user_agent }
end

.http_user_agent(user_agent) ⇒ Object



6
7
8
# File 'lib/nonnative/header.rb', line 6

def http_user_agent(user_agent)
  { user_agent: }
end