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
4 changes: 2 additions & 2 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ config :logger, :console,
:proxy
]

# Use Jason for JSON parsing in Phoenix
config :phoenix, :json_library, Jason
# Use built-in JSON module for JSON parsing
config :phoenix, :json_library, JSON

config :open_api_spex, :cache_adapter, OpenApiSpex.Plug.PersistentTermCache

Expand Down
2 changes: 1 addition & 1 deletion config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ if config_env() != :test do
availability_zone: System.get_env("AVAILABILITY_ZONE"),
region: System.get_env("REGION") || System.get_env("FLY_REGION"),
fly_alloc_id: System.get_env("FLY_ALLOC_ID"),
jwt_claim_validators: System.get_env("JWT_CLAIM_VALIDATORS", "{}") |> Jason.decode!(),
jwt_claim_validators: System.get_env("JWT_CLAIM_VALIDATORS", "{}") |> JSON.decode!(),
api_jwt_secret: System.get_env("API_JWT_SECRET"),
metrics_jwt_secret: System.get_env("METRICS_JWT_SECRET"),
proxy_port_transaction:
Expand Down
7 changes: 7 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
"test/integration/"
];
};
check-yaml.enable = true;
# yamlfmt.enable = true;
};
}
{
Expand Down Expand Up @@ -118,6 +120,11 @@
languages.rust.enable = true;
languages.cplusplus.enable = true;

pre-commit.hooks = {
clippy.enable = true;
rustfmt.enable = true;
};

packages =
[
pkgs.protobuf
Expand Down
2 changes: 1 addition & 1 deletion lib/supavisor/tenants/tenant.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defmodule Supavisor.Tenants.Tenant do
@primary_key {:id, :binary_id, autogenerate: true}
@schema_prefix "_supavisor"

@derive {Jason.Encoder, except: [:upstream_tls_ca, :__meta__]}
@derive {JSON.Encoder, except: [:upstream_tls_ca, :__meta__]}

schema "tenants" do
field(:db_host, :string)
Expand Down
1 change: 0 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ defmodule Supavisor.MixProject do
{:phoenix_live_dashboard, "~> 0.7"},
{:telemetry_poller, "~> 1.0"},
{:peep, "~> 3.4"},
{:jason, "~> 1.2"},
{:plug_cowboy, "~> 2.5"},
{:joken, "~> 2.6.0"},
{:cloak_ecto, "~> 1.3.0"},
Expand Down
6 changes: 3 additions & 3 deletions test/supavisor/monitoring/prom_ex_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ defmodule Supavisor.Monitoring.PromExTest do
File.write!(file, metrics)

assert {out, 0} = System.cmd(exe, [file])
assert {:ok, measurements} = Jason.decode(out)
assert {:ok, measurements} = JSON.decode(out)

assert %{"metrics" => metrics} =
Enum.find(measurements, &(&1["name"] == "supavisor_client_joins_ok"))
Expand Down Expand Up @@ -73,7 +73,7 @@ defmodule Supavisor.Monitoring.PromExTest do
File.write!(file, metrics)

assert {out, 0} = System.cmd(exe, [file])
assert {:ok, measurements} = Jason.decode(out)
assert {:ok, measurements} = JSON.decode(out)

assert %{"metrics" => metrics} =
Enum.find(measurements, &(&1["name"] == "supavisor_client_joins_ok"))
Expand Down Expand Up @@ -101,7 +101,7 @@ defmodule Supavisor.Monitoring.PromExTest do
File.write!(file, metrics)

assert {out, 0} = System.cmd(exe, [file])
assert {:ok, measurements} = Jason.decode(out)
assert {:ok, measurements} = JSON.decode(out)

assert %{"metrics" => metrics} =
Enum.find(measurements, &(&1["name"] == "supavisor_client_joins_ok"))
Expand Down
Loading