Merge branch 'main' into with-notifications

This commit is contained in:
Mayel 2020-12-19 14:07:04 +01:00
commit 8c2508ebdc
34 changed files with 2367 additions and 1886 deletions

1
.gitignore vendored
View file

@ -46,3 +46,4 @@ deps.path
# secrets
config/.env.secrets
deps.path.disabled

View file

@ -18,10 +18,30 @@ shell: ## Open a shell, in dev mode
pull:
git pull
update: pull build deps-local-git-pull bonfire-updates mix-updates ## Update/prepare dependencies
update: pull build deps-local-git-pull bonfire-pre-updates mix-updates bonfire-post-updates ## Update/prepare dependencies
bonfire-updates:
docker-compose run web mix bonfire.deps.update
bonfire-pre-updates:
mv deps.path deps.path.disabled
sudo rm -rf deps/pointers*
sudo rm -rf deps/bonfire*
sudo rm -rf deps/cpub*
sudo rm -rf deps/activity_pu*
bonfire-updates: bonfire-pre-updates
docker-compose run web mix bonfire.deps
make bonfire-post-updates
bonfire-post-updates:
mv deps.path.disabled deps.path
bonfire-push-updates: deps-local-commit-push
mv deps.path deps.path.disabled
docker-compose run web mix bonfire.deps
make bonfire-post-updates
git pull
git add .
git commit
git push
dep-hex-%: ## add/enable/disable/delete a hex dep with messctl command, eg: `make dep-hex-enable dep=pointers version="~> 0.2"
docker-compose run web messctl $* $(dep) $(version) deps.hex
@ -44,8 +64,13 @@ deps-local-git-%: ## runs a git command (eg. `make deps-local-git-pull` pulls th
deps-local-commit-push:
make deps-local-git-"add ."
make deps-local-git-commit
make deps-local-git-pull
make deps-local-git-push
deps-prepare-push:
mv deps.path deps.path.disabled
dep-go-local: ## Switch to using a standard local path, eg: make dep-go-local dep=pointers
make dep-go-local-path dep=$(dep) path=$(LIBS_PATH)$(dep)

View file

@ -1,7 +1,6 @@
// We need to import the CSS so that webpack will load it.
// The MiniCssExtractPlugin is used to separate it out into
// its own CSS file.
import "../css/app.scss"
// We may need to import the CSS so that webpack will load it.
// The MiniCssExtractPlugin is used to separate it out into its own CSS file.
// import "../css/app.scss" // no longer used in favour of Tailwind
// webpack automatically bundles all modules in your
// entry points. Those entry points can be configured

View file

@ -1,2 +1,2 @@
import "../css/app.scss"
// import "../css/app.scss"
import "phoenix_html"

3652
assets/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -7,29 +7,30 @@
"watch": "webpack --mode development --watch"
},
"dependencies": {
"phoenix": "file:../deps/phoenix",
"phoenix_html": "file:../deps/phoenix_html",
"phoenix_live_view": "file:../deps/phoenix_live_view",
"nprogress": "^0.2.0",
"tailwindcss": "2.0.1",
"@github/details-dialog-element": "^3.1.2",
"@github/details-menu-element": "^1.0.9",
"@tailwindcss/forms": "^0.1.4",
"@tailwindcss/typography": "^0.2.0"
"@tailwindcss/typography": "^0.2.0",
"nprogress": "^0.2.0",
"phoenix": "file:../deps/phoenix",
"phoenix_html": "file:../deps/phoenix_html",
"phoenix_live_view": "file:../deps/phoenix_live_view",
"tailwindcss": "^2.0.2"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"babel-loader": "^8.0.0",
"file-loader": "^6.1.0",
"autoprefixer": "^10.1.0",
"postcss": "^8.2.1",
"postcss-cli": "^8.3.1",
"@babel/core": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"babel-loader": "^8.2.2",
"copy-webpack-plugin": "^5.1.1",
"css-loader": "^3.4.2",
"sass-loader": "^8.0.2",
"node-sass": "^4.13.1",
"postcss-loader": "^4.0.4",
"file-loader": "^6.2.0",
"hard-source-webpack-plugin": "^0.13.1",
"mini-css-extract-plugin": "^0.9.0",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"postcss-loader": "^4.1.0",
"terser-webpack-plugin": "^2.3.2",
"webpack": "4.41.5",
"webpack-cli": "^3.3.2"

View file

@ -53,7 +53,7 @@ module.exports = (env, options) => {
use: [
MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader',
// 'sass-loader',
'postcss-loader',
],
}

View file

@ -47,14 +47,16 @@ config :pointers, Table, []
# now let's weave everything else together for convenience
alias Bonfire.Data.AccessControl.{Access, Acl, Controlled, Grant, Interact, Verb}
alias Bonfire.Data.ActivityPub.Actor
alias Bonfire.Data.AccessControl.{
Access, Acl, Controlled, InstanceAdmin, Grant, Interact, Verb
}
alias Bonfire.Data.ActivityPub.{Actor, Peer, Peered}
alias Bonfire.Data.Identity.{
Account, Accounted, Caretaker, Character, Credential, Email, Self, User
}
alias Bonfire.Data.Social.{
Article, Block, Bookmark, Circle, Encircle, Follow, FollowCount,
Like, LikeCount, Mention, Named, Post, PostContent, Profile,
Activity, Article, Block, Bookmark, Circle, Created, Encircle, Feed, FeedPublish,
Follow, FollowCount, Like, LikeCount, Mention, Named, Post, PostContent, Profile,
}
alias CommonsPub.{
Comments.Comment,
@ -87,8 +89,9 @@ config :bonfire_data_activity_pub, Peered, []
# bonfire_data_identity
config :bonfire_data_identity, Account,
has_one: [credential: {Credential, foreign_key: :id}],
has_one: [email: {Email, foreign_key: :id}]
has_one: [credential: {Credential, foreign_key: :id}],
has_one: [email: {Email, foreign_key: :id}],
has_one: [instance_admin: {InstanceAdmin, foreign_key: :id}]
config :bonfire_data_identity, Accounted,
belongs_to: [user: {User, foreign_key: :id, define_field: false}]
@ -98,13 +101,14 @@ config :bonfire_data_identity, Caretaker, []
config :bonfire_data_identity, Character, []
config :bonfire_data_identity, Credential,
belongs_to: [account: {Account, foreign_key: :id, define_field: false}],
rename_attrs: [email_address: :identity],
password: [length: [min: 8, max: 64]]
belongs_to: [account: {Account, foreign_key: :id, define_field: false}]
config :bonfire_data_identity, Email,
must_confirm: true,
belongs_to: [account: {Account, foreign_key: :id, define_field: false}]
config :bonfire_data_identity, Self, []
config :bonfire_data_identity, User,
has_one: [actor: {Actor, foreign_key: :id}],
has_one: [accounted: {Accounted, foreign_key: :id}],
@ -112,10 +116,12 @@ config :bonfire_data_identity, User,
has_one: [follow_count: {FollowCount, foreign_key: :id}],
has_one: [like_count: {LikeCount, foreign_key: :id}],
has_one: [profile: {Profile, foreign_key: :id}],
has_one: [self: {Self, foreign_key: :id}]
has_one: [self: {Self, foreign_key: :id}],
has_many: [encircles: {Encircle, foreign_key: :subject_id}]
# bonfire_data_social
config :bonfire_data_social, Activity, []
config :bonfire_data_social, Block, []
config :bonfire_data_social, Bookmark, []
@ -127,15 +133,22 @@ config :bonfire_data_social, Circle,
has_one: [named: {Named, foreign_key: :id}]
config :bonfire_data_social, Encircle, []
config :bonfire_data_social, Feed, []
config :bonfire_data_social, FeedPublish, []
config :bonfire_data_social, Follow, []
config :bonfire_data_social, FollowCount, []
config :bonfire_data_social, Like, []
config :bonfire_data_social, LikeCount, []
config :bonfire_data_social, Mention, []
config :bonfire_data_social, Named, []
config :bonfire_data_social, Post,
has_one: [post_content: {PostContent, foreign_key: :id}],
has_one: [created: {Created, foreign_key: :id}]
config :bonfire_data_social, PostContent, []
config :bonfire_data_social, Created, []
config :bonfire_data_social, Profile,
belongs_to: [user: {User, foreign_key: :id, define_field: false}]
config :bonfire_data_social, Post,
has_one: [post_content: {PostContent, foreign_key: :id}]
config :bonfire_data_social, PostContent, []

View file

@ -0,0 +1,7 @@
import Config
config :bonfire_mailer,
otp_app: :bonfire,
from_address: "noreply@bonfire.local",
check_mx: true,
check_format: true

View file

@ -20,52 +20,3 @@ alias Bonfire.Data.Identity.User
config :bonfire_me, Bonfire.Me.Users.Follows,
followable_types: [User]
#### Forms configuration
# You probably will want to leave these
alias Bonfire.Me.Identity.Accounts.{
ChangePasswordFields,
ConfirmEmailFields,
LoginFields,
ResetPasswordFields,
SignupFields,
}
# these are not used yet, but they will be
config :bonfire_me, ChangePasswordFields,
cast: [:old_password, :password, :password_confirmation],
required: [:old_password, :password, :password_confirmation],
confirm: :password,
new_password: [length: [min: 10, max: 64]]
config :bonfire_me, ConfirmEmailFields,
cast: [:email],
required: [:email],
email: [format: ~r(^[^@]{1,128}@[^@\.]+\.[^@]{2,128}$)]
config :bonfire_me, LoginFields,
cast: [:email, :password],
required: [:email, :password],
email: [format: ~r(^[^@]{1,128}@[^@\.]+\.[^@]{2,128}$)],
password: [length: [min: 10, max: 64]]
config :bonfire_me, ResetPasswordFields,
cast: [:password, :password_confirmation],
required: [:password, :password_confirmation],
confirm: :password,
password: [length: [min: 10, max: 64]]
config :bonfire_me, SignupFields,
cast: [:email, :password],
required: [:email, :password],
email: [format: ~r(^[^@]{1,128}@[^@\.]+\.[^@]{2,128}$)],
password: [length: [min: 10, max: 64]]
alias Bonfire.Me.Users.ValidFields
config :bonfire_me, ValidFields,
username: [format: ~r(^[a-z][a-z0-9_]{2,30}$)i],
name: [length: [min: 3, max: 50]],
summary: [length: [min: 20, max: 500]]

View file

@ -1,14 +1,7 @@
import Config
#### Email configuration
# You will almost certainly want to change at least some of these
alias Bonfire.Mailer
config :bonfire, Mailer,
from_address: "noreply@bonfire.local"
# include common modules
import_config "bonfire_common.exs"
@ -16,6 +9,7 @@ import_config "bonfire_common.exs"
import_config "bonfire_data.exs"
# include all used Bonfire extensions
import_config "bonfire_mailer.exs"
import_config "bonfire_me.exs"
import_config "bonfire_notifications.exs"

View file

@ -5,6 +5,7 @@ bonfire_data_activity_pub = "https://github.com/bonfire-ecosystem/bonfire_data_a
bonfire_data_identity = "https://github.com/bonfire-ecosystem/bonfire_data_identity#main"
bonfire_data_social = "https://github.com/bonfire-ecosystem/bonfire_data_social#main"
bonfire_me = "https://github.com/bonfire-ecosystem/bonfire_me#main"
bonfire_mailer = "https://github.com/bonfire-ecosystem/bonfire_mailer#main"
# bonfire_web_phoenix = "https://github.com/bonfire-ecosystem/bonfire_web_phoenix#main"
pointers = "https://github.com/bonfire-ecosystem/pointers#main"
# cpub_comments = "https://github.com/bonfire-ecosystem/cpub_comments#main"

View file

@ -1,31 +0,0 @@
defmodule Bonfire.Mailer do
use Bamboo.Mailer, otp_app: :bonfire
alias Bamboo.Email
require Logger
def send_now(email, to) do
from =
Application.get_env(:bonfire, __MODULE__, [])
|> Keyword.get(:from_address, "noreply@bonfire.local")
try do
mail =
email
|> Email.from(from)
|> Email.to(to)
deliver_now(mail)
{:ok, mail}
rescue
error in Bamboo.SMTPAdapter.SMTPError ->
# le sigh, i give up
Logger.error("Email delivery error: #{inspect(error.raw)}")
{:error, error}
# case error.raw do
# {:no_credentials, _} -> {:error, :config}
# {:retries_exceeded, _} -> {:error, :rejected}
# # give up
# _ -> raise error
# end
end
end
end

View file

@ -1,6 +1,6 @@
defmodule Bonfire.Web.HomeLive do
use Bonfire.Web, :live_view
alias Bonfire.Fake
alias Bonfire.Me.Fake
alias Bonfire.Common.Web.LivePlugs
alias Bonfire.Me.Users
alias Bonfire.Me.Web.{CreateUserLive, MeHomeLive}

View file

@ -1,19 +1,17 @@
defmodule Bonfire.Web.Plugs.AccountRequired do
use Bonfire.Web, :plug
alias Bonfire.Data.Identity.Account
def init(opts), do: opts
def call(conn, _opts) do
if conn.assigns()[:current_account],
do: conn,
else: not_permitted(conn)
end
def call(conn, _opts), do: check(conn.assigns.current_account, conn)
defp not_permitted(conn) do
defp check(%Account{}, conn), do: conn #|> IO.inspect
defp check(_, conn) do
conn
|> clear_session()
|> put_flash(:error, "You need to log in to view that page")
|> put_flash(:error, "You need to log in to view that page.")
|> redirect(to: Routes.login_path(conn, :index))
|> halt()
end

View file

@ -1,18 +1,21 @@
defmodule Bonfire.Web.Plugs.AdminRequired do
use Bonfire.Web, :plug
alias Bonfire.Data.Identity.Account
alias Bonfire.Me.Web.SwitchUserLive
alias Bonfire.Me.Web
def init(opts), do: opts
def call(conn, _opts), do: check(conn.assigns[:current_account], conn)
# TODO: better
def call(conn, opts), do: Bonfire.Web.Plugs.AccountRequired.call(conn, opts)
# defp not_permitted(conn) do
# conn
# |> put_flash(:error, "That page is only accessible if you log in.")
# |> redirect(to: "/login")
# |> halt()
# end
defp check(%Account{instance_admin: %{is_instance_admin: true}}, conn), do: conn
defp check(_, conn) do
conn
|> clear_session()
|> put_flash(:error, "That page is only accessible to instance administrators.")
|> redirect(to: Routes.live_path(conn, SwitchUserLive))
|> halt()
end
end

View file

@ -6,7 +6,7 @@ defmodule Bonfire.Web.Plugs.GuestOnly do
def init(opts), do: opts
def call(conn, _opts) do
if get_session(conn, :account_id),
if conn.assigns[:current_account],
do: not_permitted(conn),
else: conn
end

View file

@ -1,4 +1,4 @@
defmodule Bonfire.Web.Plugs.LoadSessionAccount do
defmodule Bonfire.Web.Plugs.LoadCurrentAccount do
import Plug.Conn
alias Bonfire.Me.Identity.{Accounts, Users}
@ -6,7 +6,7 @@ defmodule Bonfire.Web.Plugs.LoadSessionAccount do
def init(opts), do: opts
def call(conn, _opts), do: try_account(conn, get_session(conn, :account_id))
def call(conn, _opts), do: try_account(conn, get_session(conn, :account_id)) #|> IO.inspect
defp try_account(conn, id) when is_binary(id),
do: try_account(conn, Accounts.get_current(id))

View file

@ -8,6 +8,7 @@ defmodule Bonfire.Web.Router do
plug :put_root_layout, {Bonfire.Web.LayoutView, :root}
plug :protect_from_forgery
plug :put_secure_browser_headers
plug Bonfire.Web.Plugs.LoadCurrentAccount
end
pipeline :guest_only do
@ -15,7 +16,6 @@ defmodule Bonfire.Web.Router do
end
pipeline :account_required do
plug Bonfire.Web.Plugs.LoadSessionAccount
plug Bonfire.Web.Plugs.AccountRequired
end

View file

@ -57,12 +57,13 @@ defmodule Bonfire.MixProject do
"hex.setup": ["local.hex --force"],
"rebar.setup": ["local.rebar --force"],
"js.deps.get": ["cmd npm install --prefix assets"],
"js.deps.update": ["cmd npm update --prefix assets"],
"ecto.seeds": ["run priv/repo/seeds.exs"],
"bonfire.deps.update": ["deps.update #{@bonfire_data_deps_str}"],
"bonfire.deps.clean": ["deps.clean #{@bonfire_data_deps_str} --build"],
"bonfire.deps": ["bonfire.deps.update", "bonfire.deps.clean"],
setup: ["hex.setup", "rebar.setup", "deps.get", "bonfire.deps.clean", "ecto.setup", "js.deps.get"],
updates: ["deps.get", "bonfire.deps.clean", "ecto.migrate", "js.deps.get"],
updates: ["deps.get", "bonfire.deps", "ecto.migrate", "js.deps.get"],
"ecto.setup": ["ecto.create", "ecto.migrate", "ecto.seeds"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
test: ["ecto.create --quiet", "ecto.migrate", "test"]

View file

@ -1,78 +0,0 @@
%{
"activity_pub": {:git, "https://gitlab.com/bonfire-ecosystem/activitypub.git", "bcb67d809ce53b522c2cbd410a86ac88e1dba0ce", [branch: "develop"]},
"argon2_elixir": {:hex, :argon2_elixir, "2.3.0", "e251bdafd69308e8c1263e111600e6d68bd44f23d2cccbe43fcb1a417a76bc8e", [:make, :mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "28ccb63bff213aecec1f7f3dde9648418b031f822499973281d8f494b9d5a3b3"},
"bamboo": {:hex, :bamboo, "1.6.0", "adfb583bef028923aae6f22deaea6667290561da1246058556ecaeb0fec5a175", [:mix], [{:hackney, ">= 1.13.0", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "454e67feacbc9b6e00553ce1d2fba003c861e0035600d59b09d6159985b17f9b"},
"bamboo_smtp": {:hex, :bamboo_smtp, "3.0.0", "b7f0c371af96a1cb7131908918b02abb228f9db234910bf10cf4fb177c083259", [:mix], [{:bamboo, "~> 1.2", [hex: :bamboo, repo: "hexpm", optional: false]}, {:gen_smtp, "~> 0.15.0", [hex: :gen_smtp, repo: "hexpm", optional: false]}], "hexpm", "77cb1fa3076b24109e54df622161fe1e5619376b4ecf86d8b99b46f327acc49f"},
"bonfire_common": {:git, "https://github.com/bonfire-ecosystem/bonfire_common", "30c2af56c2ba0a88f2eee5453bfbe9d7b0652476", [branch: "main"]},
"bonfire_data_access_control": {:git, "https://github.com/bonfire-ecosystem/bonfire_data_access_control", "d7f10871aaf3ef25138f52f9b0432cfb47328217", [branch: "main"]},
"bonfire_data_activity_pub": {:git, "https://github.com/bonfire-ecosystem/bonfire_data_activity_pub", "fc2f653f46eabda1fe20097cdbc631212920b721", [branch: "main"]},
"bonfire_data_identity": {:git, "https://github.com/bonfire-ecosystem/bonfire_data_identity", "65bc2fb5914bea90e1ba0aa9fe65cea81fbfc7ed", [branch: "main"]},
"bonfire_data_social": {:git, "https://github.com/bonfire-ecosystem/bonfire_data_social", "30136e073ba5c1ffbe4d2a244b011e6d61874e62", [branch: "main"]},
"bonfire_me": {:git, "https://github.com/bonfire-ecosystem/bonfire_me", "213402e8fbd0871dc39f1b7741d950855a3ba3cb", [branch: "main"]},
"bonfire_notifications": {:git, "https://github.com/bonfire-ecosystem/bonfire_notifications", "e631efa2b1df3773102b7fbd729b9a9ff653908f", []},
"cachex": {:hex, :cachex, "3.3.0", "6f2ebb8f27491fe39121bd207c78badc499214d76c695658b19d6079beeca5c2", [:mix], [{:eternal, "~> 1.2", [hex: :eternal, repo: "hexpm", optional: false]}, {:jumper, "~> 1.0", [hex: :jumper, repo: "hexpm", optional: false]}, {:sleeplocks, "~> 1.1", [hex: :sleeplocks, repo: "hexpm", optional: false]}, {:unsafe, "~> 1.0", [hex: :unsafe, repo: "hexpm", optional: false]}], "hexpm", "d90e5ee1dde14cef33f6b187af4335b88748b72b30c038969176cd4e6ccc31a1"},
"certifi": {:hex, :certifi, "2.5.2", "b7cfeae9d2ed395695dd8201c57a2d019c0c43ecaf8b8bcb9320b40d6662f340", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm", "3b3b5f36493004ac3455966991eaf6e768ce9884693d9968055aeeeb1e575040"},
"combine": {:hex, :combine, "0.10.0", "eff8224eeb56498a2af13011d142c5e7997a80c8f5b97c499f84c841032e429f", [:mix], [], "hexpm", "1b1dbc1790073076580d0d1d64e42eae2366583e7aecd455d1215b0d16f2451b"},
"comeonin": {:hex, :comeonin, "5.3.1", "7fe612b739c78c9c1a75186ef2d322ce4d25032d119823269d0aa1e2f1e20025", [:mix], [], "hexpm", "d6222483060c17f0977fad1b7401ef0c5863c985a64352755f366aee3799c245"},
"connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"},
"cowboy": {:hex, :cowboy, "2.8.0", "f3dc62e35797ecd9ac1b50db74611193c29815401e53bac9a5c0577bd7bc667d", [:rebar3], [{:cowlib, "~> 2.9.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.7.1", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "4643e4fba74ac96d4d152c75803de6fad0b3fa5df354c71afdd6cbeeb15fac8a"},
"cowboy_telemetry": {:hex, :cowboy_telemetry, "0.3.1", "ebd1a1d7aff97f27c66654e78ece187abdc646992714164380d8a041eda16754", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3a6efd3366130eab84ca372cbd4a7d3c3a97bdfcfb4911233b035d117063f0af"},
"cowlib": {:hex, :cowlib, "2.9.1", "61a6c7c50cf07fdd24b2f45b89500bb93b6686579b069a89f88cb211e1125c78", [:rebar3], [], "hexpm", "e4175dc240a70d996156160891e1c62238ede1729e45740bdd38064dad476170"},
"db_connection": {:hex, :db_connection, "2.3.1", "4c9f3ed1ef37471cbdd2762d6655be11e38193904d9c5c1c9389f1b891a3088e", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm", "abaab61780dde30301d840417890bd9f74131041afd02174cf4e10635b3a63f5"},
"dbg": {:hex, :dbg, "1.0.1", "9c29813e5df8b4d275325416523d511e315656b8ac27a60519791f9cf476d83d", [:mix], [], "hexpm", "866159f496a1ad9b959501f16db3d1338bb6cef029a75a67ca5615d25b38345f"},
"decimal": {:hex, :decimal, "2.0.0", "a78296e617b0f5dd4c6caf57c714431347912ffb1d0842e998e9792b5642d697", [:mix], [], "hexpm", "34666e9c55dea81013e77d9d87370fe6cb6291d1ef32f46a1600230b1d44f577"},
"ecto": {:hex, :ecto, "3.5.5", "48219a991bb86daba6e38a1e64f8cea540cded58950ff38fbc8163e062281a07", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "98dd0e5e1de7f45beca6130d13116eae675db59adfa055fb79612406acf6f6f1"},
"ecto_sql": {:hex, :ecto_sql, "3.5.3", "1964df0305538364b97cc4661a2bd2b6c89d803e66e5655e4e55ff1571943efd", [:mix], [{:db_connection, "~> 2.2", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.5.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.3.0 or ~> 0.4.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.15.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d2f53592432ce17d3978feb8f43e8dc0705e288b0890caf06d449785f018061c"},
"elixir_make": {:hex, :elixir_make, "0.6.2", "7dffacd77dec4c37b39af867cedaabb0b59f6a871f89722c25b28fcd4bd70530", [:mix], [], "hexpm", "03e49eadda22526a7e5279d53321d1cced6552f344ba4e03e619063de75348d9"},
"eternal": {:hex, :eternal, "1.2.2", "d1641c86368de99375b98d183042dd6c2b234262b8d08dfd72b9eeaafc2a1abd", [:mix], [], "hexpm", "2c9fe32b9c3726703ba5e1d43a1d255a4f3f2d8f8f9bc19f094c7cb1a7a9e782"},
"exsync": {:hex, :exsync, "0.2.4", "5cdc824553e0f4c4bf60018a9a6bbd5d3b51f93ef8401a0d8545f93127281d03", [:mix], [{:file_system, "~> 0.2", [hex: :file_system, repo: "hexpm", optional: false]}], "hexpm", "f7622d8bb98abbe473aa066ae46f91afdf7a5346b8b89728404f7189d2e80896"},
"faker": {:hex, :faker, "0.16.0", "1e2cf3e8d60d44a30741fb98118fcac18b2020379c7e00d18f1a005841b2f647", [:mix], [], "hexpm", "fbcb9bf1299dff3c9dd7e50f41802bbc472ffbb84e7656394c8aa913ec315141"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
"flexto": {:hex, :flexto, "0.2.2", "3392dd9a0fbef0c4d44224ae080c613a1c2b19e055213c232e72cb4b6500f449", [:mix], [{:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}], "hexpm", "a3c1875b4cdc4ce2bc4408d648a5368183805ec02cd651fc1a990b1dd3c6681b"},
"floki": {:hex, :floki, "0.29.0", "b1710d8c93a2f860dc2d7adc390dd808dc2fb8f78ee562304457b75f4c640881", [:mix], [{:html_entities, "~> 0.5.0", [hex: :html_entities, repo: "hexpm", optional: false]}], "hexpm", "008585ce64b9f74c07d32958ec9866f4b8a124bf4da1e2941b28e41384edaaad"},
"gen_smtp": {:hex, :gen_smtp, "0.15.0", "9f51960c17769b26833b50df0b96123605a8024738b62db747fece14eb2fbfcc", [:rebar3], [], "hexpm", "29bd14a88030980849c7ed2447b8db6d6c9278a28b11a44cafe41b791205440f"},
"gettext": {:hex, :gettext, "0.18.2", "7df3ea191bb56c0309c00a783334b288d08a879f53a7014341284635850a6e55", [:mix], [], "hexpm", "f9f537b13d4fdd30f3039d33cb80144c3aa1f8d9698e47d7bcbcc8df93b1f5c5"},
"hackney": {:hex, :hackney, "1.16.0", "5096ac8e823e3a441477b2d187e30dd3fff1a82991a806b2003845ce72ce2d84", [:rebar3], [{:certifi, "2.5.2", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "6.0.1", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.0", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.6", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm", "3bf0bebbd5d3092a3543b783bf065165fa5d3ad4b899b836810e513064134e18"},
"html_entities": {:hex, :html_entities, "0.5.1", "1c9715058b42c35a2ab65edc5b36d0ea66dd083767bef6e3edb57870ef556549", [:mix], [], "hexpm", "30efab070904eb897ff05cd52fa61c1025d7f8ef3a9ca250bc4e6513d16c32de"},
"http_signatures": {:git, "https://git.pleroma.social/pleroma/http_signatures.git", "293d77bb6f4a67ac8bde1428735c3b42f22cbb30", [ref: "293d77bb6f4a67ac8bde1428735c3b42f22cbb30"]},
"httpoison": {:hex, :httpoison, "1.7.0", "abba7d086233c2d8574726227b6c2c4f6e53c4deae7fe5f6de531162ce9929a0", [:mix], [{:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "975cc87c845a103d3d1ea1ccfd68a2700c211a434d8428b10c323dc95dc5b980"},
"idna": {:hex, :idna, "6.0.1", "1d038fb2e7668ce41fbf681d2c45902e52b3cb9e9c77b55334353b222c2ee50c", [:rebar3], [{:unicode_util_compat, "0.5.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a02c8a1c4fd601215bb0b0324c8a6986749f807ce35f25449ec9e69758708122"},
"jason": {:hex, :jason, "1.2.2", "ba43e3f2709fd1aa1dce90aaabfd039d000469c05c56f0b8e31978e03fa39052", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "18a228f5f0058ee183f29f9eae0805c6e59d61c3b006760668d8d18ff0d12179"},
"jose": {:hex, :jose, "1.11.0", "b1e6145881c97f489a26c19e117be014edcd1eac71deedce09ebb3a529569578", [:mix, :rebar3], [], "hexpm", "35739462122a4d073519643e55d582375f4c43192d1bcd240357d101b80b2b34"},
"jumper": {:hex, :jumper, "1.0.1", "3c00542ef1a83532b72269fab9f0f0c82bf23a35e27d278bfd9ed0865cecabff", [:mix], [], "hexpm", "318c59078ac220e966d27af3646026db9b5a5e6703cb2aa3e26bcfaba65b7433"},
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},
"mime": {:hex, :mime, "1.5.0", "203ef35ef3389aae6d361918bf3f952fa17a09e8e43b5aa592b93eba05d0fb8d", [:mix], [], "hexpm", "55a94c0f552249fc1a3dd9cd2d3ab9de9d3c89b559c2bd01121f824834f24746"},
"mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"},
"mox": {:hex, :mox, "0.4.0", "7f120840f7d626184a3d65de36189ca6f37d432e5d63acd80045198e4c5f7e6e", [:mix], [], "hexpm", "64fca8aca4699cc1acf7db19237ce781cfa46683082a440e9f4e1ac29e290d89"},
"nodeinfo": {:git, "https://github.com/bonfire-ecosystem/nodeinfo", "d3ffc4ae2ab34ae8785ad3f2c20eee31a7ddd3f2", [branch: "main"]},
"oban": {:hex, :oban, "2.0.0", "e6ce70d94dd46815ec0882a1ffb7356df9a9d5b8a40a64ce5c2536617a447379", [:mix], [{:ecto_sql, ">= 3.4.3", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.14", [hex: :postgrex, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "cf574813bd048b98a698aa587c21367d2e06842d4e1b1993dcd6a696e9e633bd"},
"ok": {:hex, :ok, "2.3.0", "0a3d513ec9038504dc5359d44e14fc14ef59179e625563a1a144199cdc3a6d30", [:mix], [], "hexpm", "f0347b3f8f115bf347c704184b33cf084f2943771273f2b98a3707a5fa43c4d5"},
"parse_trans": {:hex, :parse_trans, "3.3.0", "09765507a3c7590a784615cfd421d101aec25098d50b89d7aa1d66646bc571c1", [:rebar3], [], "hexpm", "17ef63abde837ad30680ea7f857dd9e7ced9476cdd7b0394432af4bfc241b960"},
"phoenix": {:hex, :phoenix, "1.5.7", "2923bb3af924f184459fe4fa4b100bd25fa6468e69b2803dfae82698269aa5e0", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_html, "~> 2.13", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.2", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.1.2 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "774cd64417c5a3788414fdbb2be2eb9bcd0c048d9e6ad11a0c1fd67b7c0d0978"},
"phoenix_ecto": {:hex, :phoenix_ecto, "4.2.1", "13f124cf0a3ce0f1948cf24654c7b9f2347169ff75c1123f44674afee6af3b03", [:mix], [{:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 2.15", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "478a1bae899cac0a6e02be1deec7e2944b7754c04e7d4107fc5a517f877743c0"},
"phoenix_html": {:hex, :phoenix_html, "2.14.3", "51f720d0d543e4e157ff06b65de38e13303d5778a7919bcc696599e5934271b8", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "efd697a7fff35a13eeeb6b43db884705cba353a1a41d127d118fda5f90c8e80f"},
"phoenix_live_dashboard": {:hex, :phoenix_live_dashboard, "0.2.10", "6866fad234cbe0813de086a27fde03347162b042fd9d84a31a96433b5e486470", [:mix], [{:phoenix_html, "~> 2.14.1 or ~> 2.15", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.14.3", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.4.0 or ~> 0.5.0 or ~> 0.6.0", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "9841958d558a60530f15df18b33b63a145d1b8b1f0aed63b4eaec11bbf0b4968"},
"phoenix_live_reload": {:hex, :phoenix_live_reload, "1.3.0", "f35f61c3f959c9a01b36defaa1f0624edd55b87e236b606664a556d6f72fd2e7", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "02c1007ae393f2b76ec61c1a869b1e617179877984678babde131d716f95b582"},
"phoenix_live_view": {:hex, :phoenix_live_view, "0.15.0", "1bb9b0c230a047cddc32b1708ec4cad4f91aaab0b4688c09702fcf78d7e2df94", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.5.7", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 0.5", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d42ad9b5fe9e874df3a12ea0a806e3f650db99774d597285c07df43f33cab486"},
"phoenix_pubsub": {:hex, :phoenix_pubsub, "2.0.0", "a1ae76717bb168cdeb10ec9d92d1480fec99e3080f011402c0a2d68d47395ffb", [:mix], [], "hexpm", "c52d948c4f261577b9c6fa804be91884b381a7f8f18450c5045975435350f771"},
"plug": {:hex, :plug, "1.11.0", "f17217525597628298998bc3baed9f8ea1fa3f1160aa9871aee6df47a6e4d38e", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "2d9c633f0499f9dc5c2fd069161af4e2e7756890b81adcbb2ceaa074e8308876"},
"plug_cowboy": {:hex, :plug_cowboy, "2.4.1", "779ba386c0915027f22e14a48919a9545714f849505fa15af2631a0d298abf0f", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d72113b6dff7b37a7d9b2a5b68892808e3a9a752f2bf7e503240945385b70507"},
"plug_crypto": {:hex, :plug_crypto, "1.2.0", "1cb20793aa63a6c619dd18bb33d7a3aa94818e5fd39ad357051a67f26dfa2df6", [:mix], [], "hexpm", "a48b538ae8bf381ffac344520755f3007cc10bd8e90b240af98ea29b69683fc2"},
"pointers": {:git, "https://github.com/bonfire-ecosystem/pointers", "c4d120acf4bf78a77ccfde771e89ece074d29d74", [branch: "main"]},
"pointers_ulid": {:hex, :pointers_ulid, "0.2.2", "305df7d45d5227467bb9b9441f7f06fe5386390f8a4daf8084f28a58ea3e14f7", [:mix], [{:ecto, "~> 3.4", [hex: :ecto, repo: "hexpm", optional: false]}, {:ecto_sql, "~> 3.4", [hex: :ecto_sql, repo: "hexpm", optional: true]}], "hexpm", "5cca67c892a9af22030930762340d7ce82a0cc91d75559ca085d855cfed3de5b"},
"poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm", "fec8660eb7733ee4117b85f55799fd3833eb769a6df71ccf8903e8dc5447cfce"},
"postgrex": {:hex, :postgrex, "0.15.7", "724410acd48abac529d0faa6c2a379fb8ae2088e31247687b16cacc0e0883372", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "88310c010ff047cecd73d5ceca1d99205e4b1ab1b9abfdab7e00f5c9d20ef8f9"},
"ranch": {:hex, :ranch, "1.7.1", "6b1fab51b49196860b733a49c07604465a47bdb78aa10c1c16a3d199f7f8c881", [:rebar3], [], "hexpm", "451d8527787df716d99dc36162fca05934915db0b6141bbdac2ea8d3c7afc7d7"},
"recase": {:hex, :recase, "0.7.0", "3f2f719f0886c7a3b7fe469058ec539cb7bbe0023604ae3bce920e186305e5ae", [:mix], [], "hexpm", "36f5756a9f552f4a94b54a695870e32f4e72d5fad9c25e61bc4a3151c08a4e0c"},
"sleeplocks": {:hex, :sleeplocks, "1.1.1", "3d462a0639a6ef36cc75d6038b7393ae537ab394641beb59830a1b8271faeed3", [:rebar3], [], "hexpm", "84ee37aeff4d0d92b290fff986d6a95ac5eedf9b383fadfd1d88e9b84a1c02e1"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
"telemetry": {:hex, :telemetry, "0.4.2", "2808c992455e08d6177322f14d3bdb6b625fbcfd233a73505870d8738a2f4599", [:rebar3], [], "hexpm", "2d1419bd9dda6a206d7b5852179511722e2b18812310d304620c7bd92a13fcef"},
"telemetry_metrics": {:hex, :telemetry_metrics, "0.6.0", "da9d49ee7e6bb1c259d36ce6539cd45ae14d81247a2b0c90edf55e2b50507f7b", [:mix], [{:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "5cfe67ad464b243835512aa44321cee91faed6ea868d7fb761d7016e02915c3d"},
"telemetry_poller": {:hex, :telemetry_poller, "0.5.1", "21071cc2e536810bac5628b935521ff3e28f0303e770951158c73eaaa01e962a", [:rebar3], [{:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "4cab72069210bc6e7a080cec9afffad1b33370149ed5d379b81c7c5f0c663fd4"},
"tesla": {:hex, :tesla, "1.4.0", "1081bef0124b8bdec1c3d330bbe91956648fb008cf0d3950a369cda466a31a87", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: true]}, {:exjsx, ">= 3.0.0", [hex: :exjsx, repo: "hexpm", optional: true]}, {:finch, "~> 0.3", [hex: :finch, repo: "hexpm", optional: true]}, {:fuse, "~> 2.4", [hex: :fuse, repo: "hexpm", optional: true]}, {:gun, "~> 1.3", [hex: :gun, repo: "hexpm", optional: true]}, {:hackney, "~> 1.6", [hex: :hackney, repo: "hexpm", optional: true]}, {:ibrowse, "~> 4.4.0", [hex: :ibrowse, repo: "hexpm", optional: true]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.0", [hex: :mint, repo: "hexpm", optional: true]}, {:poison, ">= 1.0.0", [hex: :poison, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "bf1374a5569f5fca8e641363b63f7347d680d91388880979a33bc12a6eb3e0aa"},
"timex": {:hex, :timex, "3.6.2", "845cdeb6119e2fef10751c0b247b6c59d86d78554c83f78db612e3290f819bc2", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:gettext, "~> 0.10", [hex: :gettext, repo: "hexpm", optional: false]}, {:tzdata, "~> 0.1.8 or ~> 0.5 or ~> 1.0.0", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm", "26030b46199d02a590be61c2394b37ea25a3664c02fafbeca0b24c972025d47a"},
"tzdata": {:hex, :tzdata, "1.0.5", "69f1ee029a49afa04ad77801febaf69385f3d3e3d1e4b56b9469025677b89a28", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "55519aa2a99e5d2095c1e61cc74c9be69688f8ab75c27da724eb8279ff402a5a"},
"unicode_util_compat": {:hex, :unicode_util_compat, "0.5.0", "8516502659002cec19e244ebd90d312183064be95025a319a6c7e89f4bccd65b", [:rebar3], [], "hexpm", "d48d002e15f5cc105a696cf2f1bbb3fc72b4b770a184d8420c8db20da2674b38"},
"unsafe": {:hex, :unsafe, "1.0.1", "a27e1874f72ee49312e0a9ec2e0b27924214a05e3ddac90e91727bc76f8613d8", [:mix], [], "hexpm", "6c7729a2d214806450d29766abc2afaa7a2cbecf415be64f36a6691afebb50e5"},
"web_push_encryption": {:hex, :web_push_encryption, "0.2.3", "a0ceab85a805a30852f143d22d71c434046fbdbafbc7292e7887cec500826a80", [:mix], [{:httpoison, "~> 1.0", [hex: :httpoison, repo: "hexpm", optional: false]}, {:jose, "~> 1.8", [hex: :jose, repo: "hexpm", optional: false]}, {:poison, "~> 3.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm", "9315c8f37c108835cf3f8e9157d7a9b8f420a34f402d1b1620a31aed5b93ecdf"},
}

View file

@ -1,57 +0,0 @@
defmodule Bonfire.Me.AccountsTest do
use Bonfire.DataCase, async: true
alias Bonfire.Me.Accounts
alias Bonfire.Fake
describe "[registration]" do
test "works" do
attrs = Fake.account()
assert {:ok, account} = Accounts.signup(attrs)
assert account.login_credential.identity == attrs[:email]
assert Argon2.verify_pass(attrs[:password], account.login_credential.password_hash)
end
test "emails must be unique" do
attrs = Fake.account()
assert {:ok, account} = Accounts.signup(attrs)
assert account.login_credential.identity == attrs[:email]
assert Argon2.verify_pass(attrs[:password], account.login_credential.password_hash)
assert {:error, :taken} = Accounts.signup(attrs)
end
end
describe "[confirm_email]" do
test "works given an account" do
attrs = Fake.account()
assert {:ok, account} = Accounts.signup(attrs)
assert {:ok, account} = Accounts.confirm_email(account)
assert account.email.confirmed_at
assert is_nil(account.email.confirm_token)
end
end
describe "[login]" do
test "account must have a confirmed email" do
attrs = Fake.account()
assert {:ok, account} = Accounts.signup(attrs)
assert {:error, :email_not_confirmed} == Accounts.login(attrs)
end
test "success" do
attrs = Fake.account()
assert {:ok, account} = Accounts.signup(attrs)
{:ok, _} = Accounts.confirm_email(account)
assert {:ok, account} = Accounts.login(attrs)
assert account.email.email == attrs[:email]
end
end
end

View file

@ -1,9 +1,7 @@
defmodule Bonfire.ActivityPub.AdapterTest do
use Bonfire.DataCase
alias Bonfire.Me.Accounts
alias Bonfire.Me.{Accounts, Fake, Users}
alias Bonfire.ActivityPub.Adapter
alias Bonfire.Me.Users
alias Bonfire.Fake
describe "actor fetching" do
test "by username" do

View file

@ -1,9 +1,6 @@
defmodule Bonfire.ActivityPub.IntegrationTest do
use Bonfire.ConnCase
alias Bonfire.Me.Accounts
alias Bonfire.Me.Users
alias Bonfire.Fake
alias Bonfire.Me.{Accounts, Fake, Users}
test "fetch users from AP API" do
assert {:ok, account} = Accounts.signup(Fake.account())

View file

@ -0,0 +1,94 @@
defmodule Bonfire.Me.Identity.AccountsTest do
use Bonfire.DataCase, async: true
alias Bonfire.Me.Fake
alias Bonfire.Me.Identity.Accounts
describe "signup" do
test "email: :valid" do
attrs = Fake.signup_form()
assert {:ok, account} = Accounts.signup(attrs)
assert account.email.email_address == attrs.email.email_address
assert Argon2.verify_pass(attrs.credential.password, account.credential.password_hash)
end
test "email: :exists" do
attrs = Fake.signup_form()
assert {:ok, account} = Accounts.signup(attrs)
assert account.email.email_address == attrs.email.email_address
assert Argon2.verify_pass(attrs.credential.password, account.credential.password_hash)
assert {:error, changeset} = Accounts.signup(attrs)
assert changeset.changes.email.errors[:email_address]
end
test "email: :valid, must_confirm: false" do
attrs = Fake.signup_form()
assert {:ok, account} = Accounts.signup(attrs, must_confirm: false)
assert account.email.confirmed_at
assert account.email.email_address == attrs.email.email_address
assert Argon2.verify_pass(attrs.credential.password, account.credential.password_hash)
end
end
describe "confirm_email" do
# TODO: with: :token
test "with: :account" do
attrs = Fake.signup_form()
assert {:ok, account} = Accounts.signup(attrs)
assert {:ok, account} = Accounts.confirm_email(account)
assert account.email.confirmed_at
assert is_nil(account.email.confirm_token)
assert {:ok, _account} = Accounts.confirm_email(account)
end
end
describe "login" do
# TODO: by username
test "by: :email, confirmed: false" do
attrs = Fake.signup_form()
assert {:ok, _account} = Accounts.signup(attrs)
assert {:error, :email_not_confirmed} == Accounts.login %{
email_or_username: attrs.email.email_address,
password: attrs.credential.password,
}
end
test "by: :email, confirmed: true" do
attrs = Fake.signup_form()
assert {:ok, account} = Accounts.signup(attrs)
{:ok, _} = Accounts.confirm_email(account)
assert {:ok, account} = Accounts.login %{
email_or_username: attrs.email.email_address,
password: attrs.credential.password,
}
assert account.email.email_address == attrs.email.email_address
end
test "by: :email, confirmed: :auto" do
attrs = Fake.signup_form()
assert {:ok, _account} = Accounts.signup(attrs, must_confirm: false)
assert {:ok, _account} = Accounts.login %{
email_or_username: attrs.email.email_address,
password: attrs.credential.password,
}
end
test "by: :email, must_confirm: false" do
attrs = Fake.signup_form()
assert {:ok, _account} = Accounts.signup(attrs)
assert {:ok, _account} = Accounts.login %{
email_or_username: attrs.email.email_address,
password: attrs.credential.password,
}, must_confirm: false
end
end
end

View file

@ -0,0 +1,37 @@
defmodule Bonfire.Me.Identity.UsersTest do
use Bonfire.DataCase, async: true
alias Bonfire.Me.Fake
alias Bonfire.Me.Identity.{Accounts, Users}
alias Bonfire.Repo
test "creation works" do
assert {:ok, account} = Accounts.signup(Fake.signup_form())
attrs = Fake.create_user_form()
assert {:ok, user} = Users.create(attrs, account)
user = Repo.preload(user, [:profile, :character])
assert attrs.character.username == user.character.username
assert attrs.profile.name == user.profile.name
assert attrs.profile.summary == user.profile.summary
end
test "usernames must be unique" do
assert {:ok, account} = Accounts.signup(Fake.signup_form())
attrs = Fake.create_user_form()
assert {:ok, _user} = Users.create(attrs, account)
assert {:error, changeset} = Users.create(attrs, account)
assert %{character: character, profile: profile} = changeset.changes
assert profile.valid?
assert([username: {_,_}] = character.errors)
end
test "fetching by username" do
assert {:ok, account} = Accounts.signup(Fake.signup_form())
attrs = Fake.create_user_form()
assert {:ok, _user} = Users.create(attrs, account)
assert {:ok, user} = Users.by_username(attrs.character.username)
assert user.character.username == attrs.character.username
assert user.profile.name == attrs.profile.name
assert user.profile.summary == attrs.profile.summary
end
end

View file

@ -2,12 +2,29 @@ defmodule Bonfire.Me.PostsTest do
use Bonfire.DataCase
alias Bonfire.Me.Social.Posts
alias Bonfire.Me.Fake
test "creation works" do
attrs = %{summary: "summary", name: "name", html_content: "<p>epic html message</p>"}
assert {:ok, post} = Posts.create(nil, attrs)
assert post.post_content.html_content == "<p>epic html message</p>"
attrs = %{summary: "summary", name: "name", html_body: "<p>epic html message</p>"}
account = Fake.fake_account!()
user = Fake.fake_user!(account)
assert {:ok, post} = Posts.create(user, attrs)
assert post.post_content.html_body == "<p>epic html message</p>"
assert post.post_content.name == "name"
assert post.post_content.summary == "summary"
assert post.created.creator_id == user.id
end
test "fetching by creator" do
attrs_1 = %{summary: "summary", name: "name", html_body: "<p>epic html message 1</p>"}
attrs_2 = %{summary: "summary", name: "name", html_body: "<p>epic html message 2</p>"}
attrs_3 = %{summary: "summary", name: "name", html_body: "<p>epic html message 3</p>"}
account = Fake.fake_account!()
user = Fake.fake_user!(account)
assert {:ok, _} = Posts.create(user, attrs_1)
assert {:ok, _} = Posts.create(user, attrs_2)
assert {:ok, _} = Posts.create(user, attrs_3)
posts = Posts.by_user(user.id)
assert length(posts) == 3
end
end

View file

@ -26,7 +26,7 @@ defmodule Bonfire.ConnCase do
import Bonfire.ConnCase
import Bonfire.Test.ConnHelpers
import Bonfire.Test.FakeHelpers
alias Bonfire.Fake
alias Bonfire.Me.Fake
alias Bonfire.Web.Router.Helpers, as: Routes
# The default endpoint for testing

View file

@ -1,6 +1,6 @@
defmodule Bonfire.DataHelpers do
# import ExUnit.Assertions
# alias Bonfire.Fake
# alias Bonfire.Me.Fake
end

View file

@ -9,8 +9,7 @@ defmodule Bonfire.Test.FakeHelpers do
@repo Bonfire.Repo
def fake_account!(attrs \\ %{}) do
cs = Accounts.signup_changeset(Fake.account(attrs))
assert {:ok, account} = @repo.insert(cs)
assert {:ok, account} = Accounts.signup(signup_form(attrs), must_confirm: false)
account
end

View file

@ -1,35 +0,0 @@
defmodule Bonfire.Me.UsersTest do
use Bonfire.DataCase, async: true
alias Bonfire.Me.{Accounts, Users}
alias Bonfire.Fake
test "creation works" do
assert {:ok, account} = Accounts.signup(Fake.account())
attrs = Fake.user()
assert {:ok, user} = Users.create(attrs, account)
assert attrs.name == user.profile.name
assert attrs.summary == user.profile.summary
assert attrs.username == user.character.username
end
test "usernames must be unique" do
assert {:ok, account} = Accounts.signup(Fake.account)
attrs = Fake.user()
assert {:ok, user} = Users.create(attrs, account)
assert {:error, changeset} = Users.create(attrs, account)
assert %{character: character, profile: profile} = changeset.changes
assert profile.valid?
assert([username: {_,_}] = character.errors)
end
test "fetching by username" do
assert {:ok, account} = Accounts.signup(Fake.account)
attrs = Fake.user()
assert {:ok, user} = Users.create(attrs, account)
assert {:ok, user} = Users.by_username(attrs.username)
assert user.profile.name == attrs.name
assert user.profile.summary == attrs.summary
assert user.character.username == attrs.username
end
end

View file

@ -1,7 +1,7 @@
defmodule Bonfire.Web.ConfirmEmailController.Test do
use Bonfire.ConnCase
alias Bonfire.Fake
alias Bonfire.Me.Fake
describe "request" do

View file

@ -1,7 +1,7 @@
defmodule Bonfire.Web.ResetPasswordController.Test do
use Bonfire.ConnCase
# alias Bonfire.Fake
# alias Bonfire.Me.Fake
# describe "request" do

View file

@ -1,7 +1,7 @@
defmodule Bonfire.Web.SwitchUserController.Test do
use Bonfire.ConnCase
alias Bonfire.Fake
alias Bonfire.Me.Fake
describe "index" do