Sha256: a8528d3057513e9f803121b91d367ae91a1d3b41cea97813f5b25fa2e0a2c7b3
Contents?: true
Size: 814 Bytes
Versions: 25
Compression:
Stored size: 814 Bytes
Contents
module Roqua module CoreApi module Sessions class BasicAuthSession < AuthSession attr_reader :username attr_reader :password def initialize(username: ENV.fetch('CORE_BASICAUTH_ID'), password: ENV.fetch('CORE_BASICAUTH_SECRET'), **additional_arguments) @username = username @password = password super additional_arguments end private # handle 401 response. def access_denied(response) if response.headers['WWW-Authenticate'] fail 'basic auth for core invalid' else fail Unauthorized end end def basic_auth {username: username, password: password} end end end end end
Version data entries
25 entries across 25 versions & 1 rubygems