chore(portal): Fix some typos (#4184)

@bmanifold fixed a few instances in #3739 but I went ahead and replaced
all of them, once we merge it and rebase #3739 on top of it the diff
should be minimal.
This commit is contained in:
Andrew Dryga
2024-03-17 17:33:30 -06:00
committed by GitHub
parent 1270f34565
commit cd7cb8f2a9
17 changed files with 54 additions and 54 deletions

View File

@@ -30,7 +30,7 @@ defmodule Domain.Auth do
has access to given object. It can be done by one of `ensure_has_access_to?/2` functions
added to domain contexts responsible for the given schema, eg. `Domain.Accounts.ensure_has_access_to/2`.
Only exception is the authentication flow where user can not contain the subject yet,
Only exception is the authentication flow where user cannot contain the subject yet,
but such queries MUST be filtered by the `account_id` and use indexes to prevent
simple DDoS attacks.
@@ -39,7 +39,7 @@ defmodule Domain.Auth do
### Color Coding
The tokens are color coded using a `type` field, which means that a token issued for a browser session
can not be used for client calls and vice versa. Type of the token also limits permissions that will
cannot be used for client calls and vice versa. Type of the token also limits permissions that will
be later added to the subject.
You can find all the token types in enum value of `type` field in `Domain.Tokens.Token` schema.

View File

@@ -312,11 +312,11 @@ defmodule Domain.Billing do
{:error, :retry_later}
{:ok, {status, body}} ->
:ok = Logger.error("Can not fetch Stripe customer", status: status, body: inspect(body))
:ok = Logger.error("Cannot fetch Stripe customer", status: status, body: inspect(body))
{:error, :retry_later}
{:error, reason} ->
:ok = Logger.error("Can not fetch Stripe customer", reason: inspect(reason))
:ok = Logger.error("Cannot fetch Stripe customer", reason: inspect(reason))
{:error, :retry_later}
end
end

View File

@@ -124,13 +124,13 @@ defmodule Domain.Cluster.GoogleComputeLabelsStrategy do
{:error, reason} ->
if remaining_retry_count == 0 do
Logger.error("Can not fetch list of nodes or access token: #{inspect(reason)}",
Logger.error("Can't fetch list of nodes or access token: #{inspect(reason)}",
module: __MODULE__
)
{:error, reason}
else
Logger.warning("Can not fetch list of nodes or access token: #{inspect(reason)}",
Logger.warning("Can't fetch list of nodes or access token: #{inspect(reason)}",
module: __MODULE__
)

View File

@@ -50,7 +50,7 @@ defmodule Domain.GoogleCloudPlatform do
{:error, {response.status, response.body}}
{:error, reason} ->
Logger.error("Can not fetch instance token", reason: inspect(reason))
Logger.error("Can't fetch instance token", reason: inspect(reason))
{:error, reason}
end
end

View File

@@ -122,7 +122,7 @@ defmodule Domain.Repo.Changeset do
def validate_does_not_end_with(%Ecto.Changeset{} = changeset, field, suffix, opts \\ []) do
validate_change(changeset, field, fn _current_field, value ->
if String.ends_with?(value, suffix) do
message = Keyword.get(opts, :message, "can not end with #{inspect(suffix)}")
message = Keyword.get(opts, :message, "cannot end with #{inspect(suffix)}")
[{field, message}]
else
[]
@@ -209,7 +209,7 @@ defmodule Domain.Repo.Changeset do
{:ok, ip_or_cidr} ->
if Domain.Types.CIDR.contains?(cidr, ip_or_cidr) or
Domain.Types.CIDR.contains?(ip_or_cidr, cidr) do
message = Keyword.get(opts, :message, "can not be in the CIDR #{cidr}")
message = Keyword.get(opts, :message, "cannot be in the CIDR #{cidr}")
[{ip_or_cidr_field, message}]
else
[]

View File

@@ -57,7 +57,7 @@ defmodule Domain.Resources.Resource.Changeset do
changeset
|> validate_length(:address, min: 1, max: 253)
|> validate_does_not_end_with(:address, "localhost",
message: "localhost can not be used, please add a DNS alias to /etc/hosts instead"
message: "localhost cannot be used, please add a DNS alias to /etc/hosts instead"
)
|> validate_format(:address, ~r/^([*?]\.)?[\p{L}0-9-]{1,63}(\.[\p{L}0-9-]{1,63})*$/iu)
end
@@ -66,10 +66,10 @@ defmodule Domain.Resources.Resource.Changeset do
changeset
|> validate_and_normalize_cidr(:address)
|> validate_not_in_cidr(:address, %Postgrex.INET{address: {0, 0, 0, 0}, netmask: 32},
message: "can not contain all IPv4 addresses"
message: "cannot contain all IPv4 addresses"
)
|> validate_not_in_cidr(:address, %Postgrex.INET{address: {127, 0, 0, 0}, netmask: 8},
message: "can not contain loopback addresses"
message: "cannot contain loopback addresses"
)
|> validate_not_in_cidr(
:address,
@@ -77,7 +77,7 @@ defmodule Domain.Resources.Resource.Changeset do
address: {0, 0, 0, 0, 0, 0, 0, 0},
netmask: 128
},
message: "can not contain all IPv6 addresses"
message: "cannot contain all IPv6 addresses"
)
|> validate_not_in_cidr(
:address,
@@ -85,7 +85,7 @@ defmodule Domain.Resources.Resource.Changeset do
address: {0, 0, 0, 0, 0, 0, 0, 1},
netmask: 128
},
message: "can not contain loopback addresses"
message: "cannot contain loopback addresses"
)
|> validate_address_is_not_in_private_range()
end
@@ -94,10 +94,10 @@ defmodule Domain.Resources.Resource.Changeset do
changeset
|> validate_and_normalize_ip(:address)
|> validate_not_in_cidr(:address, %Postgrex.INET{address: {0, 0, 0, 0}, netmask: 32},
message: "can not contain all IPv4 addresses"
message: "cannot contain all IPv4 addresses"
)
|> validate_not_in_cidr(:address, %Postgrex.INET{address: {127, 0, 0, 0}, netmask: 8},
message: "can not contain loopback addresses"
message: "cannot contain loopback addresses"
)
|> validate_not_in_cidr(
:address,
@@ -105,7 +105,7 @@ defmodule Domain.Resources.Resource.Changeset do
address: {0, 0, 0, 0, 0, 0, 0, 0},
netmask: 128
},
message: "can not contain all IPv6 addresses"
message: "cannot contain all IPv6 addresses"
)
|> validate_not_in_cidr(
:address,
@@ -113,7 +113,7 @@ defmodule Domain.Resources.Resource.Changeset do
address: {0, 0, 0, 0, 0, 0, 0, 1},
netmask: 128
},
message: "can not contain loopback addresses"
message: "cannot contain loopback addresses"
)
|> validate_address_is_not_in_private_range()
end

View File

@@ -96,7 +96,7 @@ defmodule Domain.Types.CIDR do
end
def contains?(%Postgrex.INET{}, %Postgrex.INET{netmask: nil}) do
# IPv6 and IPv4 can not contain each other
# IPv6 and IPv4 can't contain each other
false
end

View File

@@ -269,7 +269,7 @@ defmodule Domain.AccountsTest do
assert update_account(other_account, %{}, subject) == {:error, :not_found}
end
test "returns error when subject can not manage account", %{
test "returns error when subject cannot manage account", %{
account: account,
subject: subject
} do

View File

@@ -1999,7 +1999,7 @@ defmodule Domain.ActorsTest do
assert fetch_actor_by_id(actor.id, subject) == {:error, :not_found}
end
test "returns error when subject can not view actors" do
test "returns error when subject cannot view actors" do
subject = Fixtures.Auth.create_subject()
subject = Fixtures.Auth.remove_permissions(subject)
@@ -2103,7 +2103,7 @@ defmodule Domain.ActorsTest do
assert Enum.sort(Enum.map(actors, & &1.id)) == Enum.sort([actor1.id, actor2.id])
end
test "returns error when subject can not view actors" do
test "returns error when subject cannot view actors" do
subject = Fixtures.Auth.create_subject()
subject = Fixtures.Auth.remove_permissions(subject)
@@ -2288,7 +2288,7 @@ defmodule Domain.ActorsTest do
assert create_actor(account, attrs, subject) == {:error, :service_accounts_limit_reached}
end
test "returns error when subject can not create actors", %{
test "returns error when subject cannot create actors", %{
account: account,
subject: subject
} do
@@ -2390,7 +2390,7 @@ defmodule Domain.ActorsTest do
update_actor(actor, %{type: :account_admin_user}, subject)
end
test "returns error when subject can not manage types", %{account: account} do
test "returns error when subject cannot manage types", %{account: account} do
actor = Fixtures.Actors.create_actor(type: :account_admin_user, account: account)
subject =
@@ -2641,7 +2641,7 @@ defmodule Domain.ActorsTest do
assert disable_actor(other_actor, subject) == {:error, :not_found}
end
test "returns error when subject can not disable actors" do
test "returns error when subject cannot disable actors" do
account = Fixtures.Accounts.create_account()
actor = Fixtures.Actors.create_actor(type: :account_admin_user, account: account)
@@ -2701,7 +2701,7 @@ defmodule Domain.ActorsTest do
assert enable_actor(other_actor, subject) == {:error, :not_found}
end
test "returns error when subject can not enable actors" do
test "returns error when subject cannot enable actors" do
account = Fixtures.Accounts.create_account()
actor = Fixtures.Actors.create_actor(type: :account_admin_user, account: account)
@@ -2963,7 +2963,7 @@ defmodule Domain.ActorsTest do
assert delete_actor(other_actor, subject) == {:error, :not_found}
end
test "returns error when subject can not delete actors" do
test "returns error when subject cannot delete actors" do
account = Fixtures.Accounts.create_account()
actor = Fixtures.Actors.create_actor(type: :account_admin_user, account: account)

View File

@@ -71,7 +71,7 @@ defmodule Domain.AuthTest do
assert fetched_provider.id == provider.id
end
test "returns error when subject can not view providers", %{
test "returns error when subject cannot view providers", %{
subject: subject
} do
subject = Fixtures.Auth.remove_permissions(subject)
@@ -200,7 +200,7 @@ defmodule Domain.AuthTest do
assert fetch_active_provider_by_adapter(:userpass, subject) == {:error, :not_found}
end
test "returns error when subject can not view providers", %{
test "returns error when subject cannot view providers", %{
subject: subject
} do
subject = Fixtures.Auth.remove_permissions(subject)
@@ -250,7 +250,7 @@ defmodule Domain.AuthTest do
assert provider.account_id == subject.account.id
end
test "returns error when subject can not manage providers" do
test "returns error when subject cannot manage providers" do
account = Fixtures.Accounts.create_account()
identity =
@@ -681,7 +681,7 @@ defmodule Domain.AuthTest do
}
end
test "returns error when subject can not create providers", %{
test "returns error when subject cannot create providers", %{
account: account
} do
subject =
@@ -825,7 +825,7 @@ defmodule Domain.AuthTest do
assert is_nil(provider.deleted_at)
end
test "returns error when subject can not manage providers", %{
test "returns error when subject cannot manage providers", %{
provider: provider,
subject: subject
} do
@@ -978,7 +978,7 @@ defmodule Domain.AuthTest do
assert disable_provider(provider, subject) == {:error, :not_found}
end
test "returns error when subject can not disable providers", %{
test "returns error when subject cannot disable providers", %{
subject: subject,
provider: provider
} do
@@ -1040,7 +1040,7 @@ defmodule Domain.AuthTest do
assert enable_provider(provider, subject) == {:error, :not_found}
end
test "returns error when subject can not enable providers", %{
test "returns error when subject cannot enable providers", %{
subject: subject,
provider: provider
} do
@@ -1242,7 +1242,7 @@ defmodule Domain.AuthTest do
assert delete_provider(provider, subject) == {:error, :not_found}
end
test "returns error when subject can not delete providers", %{
test "returns error when subject cannot delete providers", %{
subject: subject,
provider: provider
} do
@@ -1461,7 +1461,7 @@ defmodule Domain.AuthTest do
assert fetch_identity_by_id(identity.id, subject) == {:error, :not_found}
end
test "returns error when subject can not view identities", %{
test "returns error when subject cannot view identities", %{
subject: subject
} do
subject = Fixtures.Auth.remove_permissions(subject)
@@ -2588,7 +2588,7 @@ defmodule Domain.AuthTest do
assert_receive %Phoenix.Socket.Broadcast{event: "disconnect"}
end
test "returns error when subject can not delete identities", %{
test "returns error when subject cannot delete identities", %{
identity: identity,
subject: subject
} do
@@ -2761,7 +2761,7 @@ defmodule Domain.AuthTest do
assert delete_identity(identity, subject) == {:error, :not_found}
end
test "returns error when subject can not delete identities", %{subject: subject} do
test "returns error when subject cannot delete identities", %{subject: subject} do
identity = Fixtures.Auth.create_identity()
subject = Fixtures.Auth.remove_permissions(subject)

View File

@@ -769,7 +769,7 @@ defmodule Domain.ClientsTest do
assert deleted.deleted_at
end
test "admin can not delete clients in other accounts", %{
test "admin cannot delete clients in other accounts", %{
admin_subject: subject
} do
client = Fixtures.Clients.create_client()
@@ -788,7 +788,7 @@ defmodule Domain.ClientsTest do
assert deleted.deleted_at
end
test "unprivileged can not delete other people clients", %{
test "unprivileged cannot delete other people clients", %{
account: account,
unprivileged_subject: subject
} do

View File

@@ -503,7 +503,7 @@ defmodule Domain.PoliciesTest do
assert disable_policy(policy, subject) == {:error, :not_found}
end
test "returns error when subject can not disable policies", %{
test "returns error when subject cannot disable policies", %{
subject: subject,
policy: policy
} do
@@ -596,7 +596,7 @@ defmodule Domain.PoliciesTest do
assert enable_policy(policy, subject) == {:error, :not_found}
end
test "returns error when subject can not enable policies", %{
test "returns error when subject cannot enable policies", %{
subject: subject,
policy: policy
} do

View File

@@ -399,7 +399,7 @@ defmodule Domain.RepoTest do
refute metadata.previous_page_cursor
end
test "page size can not be bigger than 100", %{
test "page size cannot be bigger than 100", %{
query_module: query_module,
queryable: queryable
} do
@@ -408,7 +408,7 @@ defmodule Domain.RepoTest do
assert metadata.limit == 100
end
test "page size can not be less than 1", %{
test "page size cannot be less than 1", %{
query_module: query_module,
queryable: queryable
} do

View File

@@ -937,21 +937,21 @@ defmodule Domain.ResourcesTest do
attrs = %{"address" => "100.64.0.0/8", "type" => "cidr"}
assert {:error, changeset} = create_resource(attrs, subject)
assert "can not be in the CIDR 100.64.0.0/11" in errors_on(changeset).address
assert "cannot be in the CIDR 100.64.0.0/11" in errors_on(changeset).address
attrs = %{"address" => "fd00:2021:1111::/102", "type" => "cidr"}
assert {:error, changeset} = create_resource(attrs, subject)
assert "can not be in the CIDR fd00:2021:1111::/107" in errors_on(changeset).address
assert "cannot be in the CIDR fd00:2021:1111::/107" in errors_on(changeset).address
attrs = %{"address" => "::/0", "type" => "cidr"}
assert {:error, changeset} = create_resource(attrs, subject)
assert "can not contain loopback addresses" in errors_on(changeset).address
assert "can not contain all IPv6 addresses" in errors_on(changeset).address
assert "cannot contain loopback addresses" in errors_on(changeset).address
assert "cannot contain all IPv6 addresses" in errors_on(changeset).address
attrs = %{"address" => "0.0.0.0/0", "type" => "cidr"}
assert {:error, changeset} = create_resource(attrs, subject)
assert "can not contain loopback addresses" in errors_on(changeset).address
assert "can not contain all IPv4 addresses" in errors_on(changeset).address
assert "cannot contain loopback addresses" in errors_on(changeset).address
assert "cannot contain all IPv4 addresses" in errors_on(changeset).address
end
# We allow names to be duplicate because Resources are split into Sites

View File

@@ -444,7 +444,7 @@ defmodule Domain.TokensTest do
assert_receive %Phoenix.Socket.Broadcast{event: "disconnect"}
end
test "user can not delete other users token", %{
test "user cannot delete other users token", %{
account: account
} do
actor = Fixtures.Actors.create_actor(type: :account_user, account: account)

View File

@@ -303,7 +303,7 @@ defmodule Web.RelayGroups.NewToken do
"https://api.github.com/repos/firezone/firezone/releases/latest" | \\
grep "\\\\"tag_name\\\\":" | sed "s/.*\\\\"tag_name\\\\": \\\\"\\([^\\\\"\\\\]*\\).*/\\1/" \\
); \\
[ "$FIREZONE_VERSION" = "" ] && echo "[Error] Can not fetch latest version, rate limited by GitHub?" && exit 1; \\
[ "$FIREZONE_VERSION" = "" ] && echo "[Error] Cannot fetch latest version, rate limited by GitHub?" && exit 1; \\
echo "Downloading Firezone Relay version $FIREZONE_VERSION"; \\
arch=$(uname -m); \\
case $arch in \\

View File

@@ -103,7 +103,7 @@ config :web, Web.Endpoint,
url: [
scheme: "http",
host: "localhost",
port: 13000,
port: 13_000,
path: nil
],
render_errors: [
@@ -151,7 +151,7 @@ config :api, API.Endpoint,
url: [
scheme: "http",
host: "localhost",
port: 13001,
port: 13_001,
path: nil
],
render_errors: [