Class: OmniauthOpenidFederation::Federation::EntityStatementFetcher::FileFetcher

Inherits:
Base
  • Object
show all
Defined in:
lib/omniauth_openid_federation/federation/entity_statement_fetcher.rb

Overview

Fetches entity statement from a local file

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#entity_statement, #reload!

Constructor Details

#initialize(file_path, allowed_dirs: nil) ⇒ FileFetcher

Initialize file fetcher

Parameters:

  • file_path (String)

    Path to the entity statement file

  • allowed_dirs (Array<String>, nil) (defaults to: nil)

    Allowed directories for path validation (default: Rails.root/config if Rails available)



113
114
115
116
# File 'lib/omniauth_openid_federation/federation/entity_statement_fetcher.rb', line 113

def initialize(file_path, allowed_dirs: nil)
  @file_path = file_path
  @allowed_dirs = allowed_dirs || ((defined?(Rails) && Rails.root) ? [Rails.root.join("config").to_s] : nil)
end

Instance Attribute Details

#file_pathObject (readonly)

Returns the value of attribute file_path.



107
108
109
# File 'lib/omniauth_openid_federation/federation/entity_statement_fetcher.rb', line 107

def file_path
  @file_path
end