Skip to content

Commit 5c2cd72

Browse files
committed
chore(fixtures): rebless install_golden from current sigra.install
Regenerated via MIX_ENV=test mix sigra.fixture.rebless_golden after fixing Hex interactive auth in InstallFixture (36 files under tree/). Made-with: Cursor
1 parent 8499b9b commit 5c2cd72

36 files changed

Lines changed: 434 additions & 765 deletions

test/fixtures/install_golden/tree/lib/sigra_install_golden_tmp/accounts.ex

Lines changed: 96 additions & 212 deletions
Large diffs are not rendered by default.

test/fixtures/install_golden/tree/lib/sigra_install_golden_tmp/accounts/emails.ex

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,7 @@ defmodule SigraInstallGoldenTmp.Accounts.Emails do
223223
@doc "Builds a notification email when a passkey is registered on an account."
224224
def passkey_registration_email(user, details) do
225225
ip = details |> Map.get(:ip, "Unknown") |> html_escape_string()
226-
227-
city =
228-
details |> Map.get(:city, Map.get(details, :geo_city, "Unknown")) |> html_escape_string()
229-
226+
city = details |> Map.get(:city, Map.get(details, :geo_city, "Unknown")) |> html_escape_string()
230227
device = details |> Map.get(:device, "Unknown device") |> html_escape_string()
231228

232229
time =
@@ -869,6 +866,7 @@ defmodule SigraInstallGoldenTmp.Accounts.Emails do
869866

870867
defp humanize_role(role), do: role |> to_string() |> String.capitalize()
871868

869+
872870
# -- Private helpers --
873871

874872
defp base_email(to) do

test/fixtures/install_golden/tree/lib/sigra_install_golden_tmp/accounts/organization.ex

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ defmodule SigraInstallGoldenTmp.Accounts.Organization do
4444
|> validate_required([:name, :slug])
4545
|> validate_length(:name, min: 1, max: 255)
4646
|> validate_length(:slug, min: 3, max: 63)
47-
|> validate_format(:slug, ~r/^[a-z][a-z0-9-]*[a-z0-9]$/,
48-
message: "must be lowercase alphanumeric with hyphens"
49-
)
47+
|> validate_format(:slug, ~r/^[a-z][a-z0-9-]*[a-z0-9]$/, message: "must be lowercase alphanumeric with hyphens")
5048
|> unique_constraint(:slug, name: :organizations_slug_active_index)
5149
end
5250
end

test/fixtures/install_golden/tree/lib/sigra_install_golden_tmp/accounts/scope.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ defmodule SigraInstallGoldenTmp.Accounts.Scope do
2727

2828
@type t :: %__MODULE__{
2929
user: %User{} | nil,
30+
3031
active_organization: %SigraInstallGoldenTmp.Accounts.Organization{} | nil,
3132
membership: %SigraInstallGoldenTmp.Accounts.OrganizationMembership{} | nil,
33+
3234
impersonating_from: %User{} | nil
3335
}
3436

test/fixtures/install_golden/tree/lib/sigra_install_golden_tmp/accounts/user.ex

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,7 @@ defmodule SigraInstallGoldenTmp.Accounts.User do
148148
def pending_email_changeset(user, attrs) do
149149
user
150150
|> cast(attrs, [:pending_email])
151-
|> validate_format(:pending_email, ~r/^[^\s]+@[^\s]+$/,
152-
message: "must have the @ sign and no spaces"
153-
)
151+
|> validate_format(:pending_email, ~r/^[^\s]+@[^\s]+$/, message: "must have the @ sign and no spaces")
154152
|> unsafe_validate_unique(:pending_email, SigraInstallGoldenTmp.Repo)
155153
|> unique_constraint(:pending_email)
156154
end
@@ -160,14 +158,7 @@ defmodule SigraInstallGoldenTmp.Accounts.User do
160158
"""
161159
def deletion_changeset(user, attrs) do
162160
user
163-
|> cast(attrs, [
164-
:deleted_at,
165-
:scheduled_deletion_at,
166-
:original_email,
167-
:pending_email,
168-
:email,
169-
:hashed_password
170-
])
161+
|> cast(attrs, [:deleted_at, :scheduled_deletion_at, :original_email, :pending_email, :email, :hashed_password])
171162
end
172163

173164
@doc """

test/fixtures/install_golden/tree/lib/sigra_install_golden_tmp/accounts/user_passkey.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ defmodule SigraInstallGoldenTmp.Accounts.UserPasskey do
1515
@primary_key {:id, :binary_id, autogenerate: true}
1616
@foreign_key_type :binary_id
1717

18+
1819
schema "user_passkeys" do
1920
belongs_to :user, SigraInstallGoldenTmp.Accounts.User
2021
field :credential_id, :binary

test/fixtures/install_golden/tree/lib/sigra_install_golden_tmp/application.ex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ defmodule SigraInstallGoldenTmp.Application do
1111
{SigraInstallGoldenTmp.Vault, []},
1212
SigraInstallGoldenTmpWeb.Telemetry,
1313
SigraInstallGoldenTmp.Repo,
14-
{DNSCluster,
15-
query: Application.get_env(:sigra_install_golden_tmp, :dns_cluster_query) || :ignore},
14+
{DNSCluster, query: Application.get_env(:sigra_install_golden_tmp, :dns_cluster_query) || :ignore},
1615
{Phoenix.PubSub, name: SigraInstallGoldenTmp.PubSub},
1716
# Start a worker by calling: SigraInstallGoldenTmp.Worker.start_link(arg)
1817
# {SigraInstallGoldenTmp.Worker, arg},

test/fixtures/install_golden/tree/lib/sigra_install_golden_tmp/organizations.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,6 @@ defmodule SigraInstallGoldenTmp.Organizations do
9292

9393
@doc "Change a member's role with last-owner guard (D-18)."
9494
def change_member_role(scope, membership, new_role),
95-
do: Sigra.Organizations.change_role(__sigra_org_config__(), scope, membership, new_role)
95+
do:
96+
Sigra.Organizations.change_role(__sigra_org_config__(), scope, membership, new_role)
9697
end

test/fixtures/install_golden/tree/lib/sigra_install_golden_tmp/vault.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ defmodule SigraInstallGoldenTmp.Vault do
2323
Keyword.put(config, :ciphers,
2424
default: {
2525
Cloak.Ciphers.AES.GCM,
26-
tag: "AES.GCM.V1", key: decode_env!("CLOAK_KEY"), iv_length: 12
26+
tag: "AES.GCM.V1",
27+
key: decode_env!("CLOAK_KEY"),
28+
iv_length: 12
2729
}
2830
)
2931

test/fixtures/install_golden/tree/lib/sigra_install_golden_tmp_web/auth_error_handler.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,19 @@ defmodule SigraInstallGoldenTmpWeb.AuthErrorHandler do
3838
|> send_resp(429, "Too many requests. Please try again later.")
3939
end
4040

41+
4142
@impl true
4243
def auth_error(conn, :no_active_org, _opts) do
4344
conn
4445
|> put_flash(:info, "Pick or create an organization to continue.")
4546
|> redirect(to: ~p"/organizations")
4647
end
4748

49+
4850
@impl true
4951
def auth_error(conn, :insufficient_role, _opts) do
5052
conn
51-
|> put_flash(
52-
:error,
53-
"You don't have permission to access this page in the current organization."
54-
)
53+
|> put_flash(:error, "You don't have permission to access this page in the current organization.")
5554
|> put_status(:forbidden)
5655
|> put_view(SigraInstallGoldenTmpWeb.ErrorHTML)
5756
|> render(:"403")
@@ -79,4 +78,5 @@ defmodule SigraInstallGoldenTmpWeb.AuthErrorHandler do
7978
"Not found. This organization admin scope is unavailable."
8079
)
8180
end
81+
8282
end

0 commit comments

Comments
 (0)