Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/run_forked_repo_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ jobs:
if: contains(github.event.pull_request.labels.*.name, 'Approved')
strategy:
matrix:
elixir-version: ['1.12']
otp: ['22.0']
elixir-version: ['1.18']
otp: ['27']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Elixir
uses: erlef/setup-beam@v1
with:
otp-version: '22.0'
elixir-version: '1.12'
otp-version: '27'
elixir-version: '1.18'
- name: Install Dependencies
run: mix deps.get
- name: Compile Repository
Expand All @@ -30,7 +30,7 @@ jobs:
- name: Run Static Code Analysis for Elixir
run: mix credo
- name: Run Static Code Analysis for Erlang
run: mix dialyzer --halt-exit-status
run: mix dialyzer
- name: Run Elixir Tests
env:
API_KEY: ${{ secrets.API_KEY }}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/run_tests_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ name: Run full Elixir workflow

on:
pull_request:
types: [ opened, reopened, edited ]
types: [ opened, reopened, edited, synchronize ]
branches:
- main
jobs:
elixir_workflow:
runs-on: ubuntu-latest
strategy:
matrix:
elixir-version: ['1.12']
otp: ['22.0']
elixir-version: ['1.18']
otp: ['27']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Elixir
uses: erlef/setup-beam@v1
with:
otp-version: '22.0'
elixir-version: '1.12'
otp-version: '27'
elixir-version: '1.18'
- name: Install Dependencies
run: mix deps.get
- name: Compile Repository
Expand All @@ -31,7 +31,7 @@ jobs:
- name: Run Static Code Analysis for Elixir
run: mix credo
- name: Run Static Code Analysis for Erlang
run: mix dialyzer --halt-exit-status
run: mix dialyzer
- name: Run Elixir Tests
env:
LOB_API_TEST_KEY: ${{ secrets.LOB_API_TEST_KEY }}
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#### 1.6.0 (2026-06-04)

##### New Features

* **bank-accounts:** Add `descriptor_code` support to bank account verification and expose `microdeposit_type` in bank account responses ([BILL-5592](https://lobsters.atlassian.net/browse/BILL-5592))

#### 1.3.0 (2021-08-25)

##### New Features
Expand Down
11 changes: 11 additions & 0 deletions config/dev.exs
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
import Config

# Cloudflare WARP does TLS inspection. Tell hackney to trust the system CA
# bundle (which already includes the Cloudflare Gateway CA via Kandji/Keychain)
# so SSL verification succeeds for outbound HTTPS requests.
config :lob_elixir,
hackney_ssl_options: fn ->
[
verify: :verify_peer,
cacerts: :public_key.cacerts_get()
]
end
11 changes: 11 additions & 0 deletions config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,16 @@ import Config
config :lob_elixir,
api_key: System.get_env("LOB_API_TEST_KEY")

# Cloudflare WARP does TLS inspection. Tell hackney to trust the system CA
# bundle (which already includes the Cloudflare Gateway CA via Kandji/Keychain)
# so SSL verification succeeds for outbound HTTPS requests.
config :lob_elixir,
hackney_ssl_options: fn ->
[
verify: :verify_peer,
cacerts: :public_key.cacerts_get()
]
end

# config :pre_commit,
# commands: ["test", "credo", "dialyzer", "coveralls"]
8 changes: 7 additions & 1 deletion lib/lob/client.ex
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,13 @@ defmodule Lob.Client do

@spec build_options(String.t()) :: Keyword.t()
defp build_options(api_key \\ api_key()) do
[hackney: [basic_auth: {api_key, ""}], recv_timeout: :infinity]
ssl_opts =
case Application.get_env(:lob_elixir, :hackney_ssl_options, []) do
fun when is_function(fun, 0) -> fun.()
opts -> opts
end

[hackney: [basic_auth: {api_key, ""}, ssl_options: ssl_opts], recv_timeout: :infinity]
end

@spec default_headers(String.t() | nil) :: %{String.t() => String.t()}
Expand Down
11 changes: 9 additions & 2 deletions lib/lob/util.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,15 @@ defmodule Lob.Util do
multipart request body.

## Example
iex> Lob.Util.build_body(%{description: "body", to: %{name: "Larry", species: "Lobster"}, front: %{local_path: "a/b/c"}})
{:multipart, [{"description", "body"}, {:file, "a/b/c", {"form-data", [name: "front", filename: "a/b/c"]}, []}, {"to[name]", "Larry"}, {"to[species]", "Lobster"}]}
iex> {:multipart, parts} = Lob.Util.build_body(%{description: "body", to: %{name: "Larry", species: "Lobster"}, front: %{local_path: "a/b/c"}})
iex> Enum.member?(parts, {"description", "body"})
true
iex> Enum.member?(parts, {"to[name]", "Larry"})
true
iex> Enum.member?(parts, {"to[species]", "Lobster"})
true
iex> Enum.member?(parts, {:file, "a/b/c", {"form-data", [name: "front", filename: "a/b/c"]}, []})
true
"""
@spec build_body(map) :: {:multipart, list}
def build_body(body) when is_map(body) do
Expand Down
3 changes: 3 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[tools]
elixir = "1.18.4-otp-27"
erlang = "27.3.4.12"
5 changes: 2 additions & 3 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule Lob.Mixfile do
use Mix.Project

@source_url "https://github.com/lob/lob-elixir"
@version "1.5.0"
@version "1.6.0"

def project do
[
Expand All @@ -20,7 +20,6 @@ defmodule Lob.Mixfile do
flags: [
:error_handling,
:no_opaque,
:race_conditions,
:unknown
],
ignore_warnings: ".dialyzer_ignore"
Expand All @@ -43,7 +42,7 @@ defmodule Lob.Mixfile do
[
{:bypass, "~> 2.1", only: :test},
{:confex, "~> 3.5.0"},
{:credo, "~> 1.5.6", only: [:dev, :test], runtime: false},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.1", only: [:dev, :test], runtime: false},
{:ex_doc, ">= 0.0.0", only: [:dev], runtime: false},
{:excoveralls, "~> 0.14", only: :test},
Expand Down
Loading
Loading