Sha256: a4873fc4f5f712282170a393264be5b81df5aaf73ba430164e0d73627c22beef
Contents?: true
Size: 1.3 KB
Versions: 1
Compression:
Stored size: 1.3 KB
Contents
module Zetto::Services::Cookie class SaveSession include Zetto::Modules::Crypto def initialize(session, cookies) unless session.class.to_s == "Zetto::Storage::Session::Data::Response" raise ArgumentError.new(I18n.t('exseptions.isnt_object', class_name: 'Zetto::Storage::Session::Data::Response')) end unless cookies.class.to_s == "ActionDispatch::Cookies::CookieJar" raise ArgumentError.new(I18n.t('exseptions.save_session_cookies')) end @session = session @cookies = cookies end def execute impuretyData = Zetto::Storage::ImpuretyData::Generate.new.execute ciphered_impurity_hash = generate_hashing(@session.algorithm, impuretyData['impurity_hash']) mixed_hash = get_mix_hashes(@session.session_id, ciphered_impurity_hash, impuretyData['hash_step']) value = save_cookie(impuretyData, mixed_hash) Zetto::Storage::ImpuretyData::Save.new.execute(impuretyData) value rescue Exception => e Zetto::Services::Info.error_message I18n.t('exseptions.unknown_error', argument: 'Zetto::Services::Cookie::SaveSession', current_method: __method__), e nil end private def save_cookie(impuretyData, mixed_hash) @cookies[:rembo] = {impuretyData['key'] => mixed_hash}.to_json end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
zetto-2.2.0 | lib/zetto/services/cookie/save_session.rb |