Sha256: 8f802b5d8516c32b0f03835d29a49092a0e2812442a889684fceec9da426f66e
Contents?: true
Size: 725 Bytes
Versions: 12
Compression:
Stored size: 725 Bytes
Contents
# frozen_string_literal: true module IronBank # Get a valid token or session HTTP request header for IronBank # class Authentication extend Forwardable attr_reader :session def_delegators :session, :header, :expired? def initialize(params) @auth_type = params.delete(:auth_type) @params = params create_session end def create_session @session = adapter.new(**params) end alias renew_session create_session private attr_reader :auth_type, :params def adapter @adapter ||= if auth_type == "cookie" IronBank::Authentications::Cookie else IronBank::Authentications::Token end end end end
Version data entries
12 entries across 12 versions & 1 rubygems