Sha256: d5ffb7a0fa7d83809ef4456ee3657eaf912a1b3dfb1b7b97c00c36bde6e36eb0

Contents?: true

Size: 734 Bytes

Versions: 14

Compression:

Stored size: 734 Bytes

Contents

module Unimatrix::Authorization

  class Railtie < Rails::Railtie
    initializer "unimatrix.authorization.configure_controller" do | app |
      ActiveSupport.on_load :action_controller do
        include Unimatrix::Authorization
      end
    end
  end

  def retrieve_policies( resource_name, access_token, realm_uuid, resource_server )
    if resource_name && access_token
      key = params.respond_to?( 'to_unsafe_h' ) ? 
            params.to_unsafe_h.sort.to_s : 
            params.sort.to_s
            
      Rails.cache.fetch(
        Digest::SHA1.hexdigest( key ),
        expires_in: 1.minute
      ) do
        request_policies( resource_name, access_token, realm_uuid, resource_server )
      end
    end
  end
  
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
unimatrix-2.6.1 lib/unimatrix/authorization/railtie.rb
unimatrix-2.6.0 lib/unimatrix/authorization/railtie.rb
unimatrix-2.5.5 lib/unimatrix/authorization/railtie.rb
unimatrix-2.5.4 lib/unimatrix/authorization/railtie.rb
unimatrix-2.5.3 lib/unimatrix/authorization/railtie.rb
unimatrix-2.5.2 lib/unimatrix/authorization/railtie.rb
unimatrix-2.5.1 lib/unimatrix/authorization/railtie.rb
unimatrix-2.5.0 lib/unimatrix/authorization/railtie.rb
unimatrix-2.4.2 lib/unimatrix/authorization/railtie.rb
unimatrix-2.3.1 lib/unimatrix/authorization/railtie.rb
unimatrix-2.2.1 lib/unimatrix/authorization/railtie.rb
unimatrix-2.1.1 lib/unimatrix/authorization/railtie.rb
unimatrix-2.0.1 lib/unimatrix/authorization/railtie.rb
unimatrix-2.0.0 lib/unimatrix/authorization/railtie.rb