class Proxy::ContainerGateway::Api::AuthorizationHeader

Constants

UNAUTHORIZED_TOKEN

Public Class Methods

new(value) click to toggle source
# File lib/smart_proxy_container_gateway/container_gateway_api.rb, line 122
def initialize(value)
  @value = value || ''
end

Public Instance Methods

basic_auth?() click to toggle source
# File lib/smart_proxy_container_gateway/container_gateway_api.rb, line 146
def basic_auth?
  @value.split(' ')[0] == 'Basic'
end
present?() click to toggle source
# File lib/smart_proxy_container_gateway/container_gateway_api.rb, line 134
def present?
  !@value.nil? && @value != ""
end
raw_header() click to toggle source
# File lib/smart_proxy_container_gateway/container_gateway_api.rb, line 130
def raw_header
  @value
end
token_auth?() click to toggle source
# File lib/smart_proxy_container_gateway/container_gateway_api.rb, line 142
def token_auth?
  @value.split(' ')[0] == 'Bearer'
end
unauthorized_token?() click to toggle source
# File lib/smart_proxy_container_gateway/container_gateway_api.rb, line 138
def unauthorized_token?
  @value.split(' ')[1] == UNAUTHORIZED_TOKEN
end
valid_user_token?() click to toggle source
# File lib/smart_proxy_container_gateway/container_gateway_api.rb, line 126
def valid_user_token?
  token_auth? && ContainerGateway.valid_token?(@value.split(' ')[1])
end