aboutsummaryrefslogtreecommitdiff
path: root/shard/lib/app/identity.ex
diff options
context:
space:
mode:
Diffstat (limited to 'shard/lib/app/identity.ex')
-rw-r--r--shard/lib/app/identity.ex14
1 files changed, 12 insertions, 2 deletions
diff --git a/shard/lib/app/identity.ex b/shard/lib/app/identity.ex
index 69bed93..59a4b90 100644
--- a/shard/lib/app/identity.ex
+++ b/shard/lib/app/identity.ex
@@ -27,6 +27,9 @@ defmodule SApp.Identity do
defimpl Shard.Manifest do
def module(_m), do: SApp.Identity
+ def is_valid?(m) do
+ byte_size(m.pk) == 32
+ end
end
end
@@ -79,9 +82,16 @@ defmodule SApp.Identity do
end
def handle_cast(:send_deps, state) do
- # TODO: collections
+ deps = if Shard.Keys.have_sk?(state.pk) do
+ [
+ %SApp.Directory.Manifest{owner: state.pk, public: true, name: "collection"},
+ %SApp.Directory.Manifest{owner: state.pk, public: false, name: "collection"}
+ ]
+ else
+ []
+ end
- GenServer.cast(Shard.Manager, {:dep_list, state.id, []})
+ GenServer.cast(Shard.Manager, {:dep_list, state.id, deps})
{:noreply, state}
end