Current section

Files

Jump to
sobelow lib sobelow config.ex
Raw

lib/sobelow/config.ex

defmodule Sobelow.Config do
alias Sobelow.Utils
alias Sobelow.Config.CSRF
@submodules [Sobelow.Config.CSRF,
Sobelow.Config.Secrets,
Sobelow.Config.HTTPS]
use Sobelow.Finding
def fetch(root, router) do
allowed = @submodules -- Sobelow.get_ignored()
Enum.each allowed, fn mod ->
path = if mod === CSRF, do: router, else: root
apply(mod, :run, [path])
end
end
def get_configs_by_file(secret, file) do
if File.exists?(file) do
Utils.get_configs(secret, file)
else
[]
end
end
end