Packages
ex_infisical
0.1.0
Elixir client for the Infisical secrets API. Universal Auth with skew-aware token caching, optional Cloudflare Access headers, and ergonomic Livebook / Mix.install helpers that load an entire Infisical folder into System.put_env in a single call.
Current section
Files
Jump to
Current section
Files
ex_infisical
mix.exs
mix.exs
defmodule ExInfisical.MixProject do
use Mix.Project
@version "0.1.0"
@source_url "https://github.com/noizu-labs-scaffolding/ex-infisical"
@description """
Elixir client for the Infisical secrets API. Universal Auth with \
skew-aware token caching, optional Cloudflare Access headers, and \
ergonomic Livebook / Mix.install helpers that load an entire Infisical \
folder into System.put_env in a single call.\
"""
def project do
[
app: :ex_infisical,
version: @version,
elixir: "~> 1.15",
start_permanent: Mix.env() == :prod,
name: "ExInfisical",
description: @description,
source_url: @source_url,
homepage_url: @source_url,
package: package(),
docs: docs(),
deps: deps(),
aliases: aliases(),
elixirc_paths: elixirc_paths(Mix.env()),
dialyzer: dialyzer(),
preferred_cli_env: [
docs: :docs,
"hex.publish": :docs,
dialyzer: :dev
]
]
end
def application do
[
extra_applications: [:logger, :crypto, :inets, :ssl],
mod: {ExInfisical.Application, []}
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
defp deps do
[
# Runtime
{:req, "~> 0.5"},
{:jason, "~> 1.4"},
# Test
{:bypass, "~> 2.1", only: :test},
# Dev / docs / static analysis
{:ex_doc, "~> 0.34", only: [:dev, :docs], runtime: false},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false}
]
end
defp package do
[
name: "ex_infisical",
maintainers: ["Keith Brings"],
licenses: ["MIT"],
links: %{
"GitHub" => @source_url,
"Changelog" => @source_url <> "/blob/main/CHANGELOG.md",
"Issues" => @source_url <> "/issues",
"HexDocs" => "https://hexdocs.pm/ex_infisical",
"Infisical" => "https://infisical.com"
},
files: ~w(lib .formatter.exs mix.exs README.md LICENSE CHANGELOG.md)
]
end
defp docs do
[
main: "readme",
name: "ExInfisical",
source_ref: "v#{@version}",
source_url: @source_url,
homepage_url: @source_url,
formatters: ["html", "epub"],
extras: [
"README.md",
"CHANGELOG.md",
"LICENSE",
"docs/PROJ-ARCH.md": [title: "Architecture"],
"docs/PROJ-LAYOUT.md": [title: "Directory Layout"]
],
groups_for_extras: [
Guides: ["README.md", "CHANGELOG.md"],
Internals: ["docs/PROJ-ARCH.md", "docs/PROJ-LAYOUT.md"]
],
groups_for_modules: [
"Public API": [ExInfisical],
Errors: [ExInfisical.Error],
Configuration: [ExInfisical.Config],
Internals: [
ExInfisical.Application,
ExInfisical.Auth,
ExInfisical.Client,
ExInfisical.Secrets,
ExInfisical.TokenCache
]
]
]
end
defp dialyzer do
[
plt_core_path: "priv/plts/core",
plt_local_path: "priv/plts/local.plt",
plt_add_apps: [:ex_unit, :mix],
flags: [:error_handling, :underspecs, :unknown, :unmatched_returns]
]
end
defp aliases do
[
# Full verification — what CI should run before tagging a release.
check: [
"format --check-formatted",
"compile --warnings-as-errors",
"credo --strict",
"test",
"docs"
],
# Build the hex tarball locally without publishing.
"hex.build.local": ["hex.build"],
# Convenience: generate docs + open them.
"docs.open": ["docs", &open_docs/1]
]
end
defp open_docs(_) do
docs_index = Path.join([File.cwd!(), "doc", "index.html"])
case :os.type() do
{:unix, :darwin} -> System.cmd("open", [docs_index])
{:unix, _} -> System.cmd("xdg-open", [docs_index])
{:win32, _} -> System.cmd("cmd", ["/c", "start", docs_index])
end
:ok
end
end