-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Full restructure #418
Comments
We still need to address here are system actors (cc @perillamint, if you have any suggestions). Edit: Regarding the keys for the system actor, the design outlined here somewhat incorporates the idea of keys that aren't owned by an actual "account" |
For multiple domains, we could have a table such as this one: CREATE TABLE domains (
domain TEXT PRIMARY KEY,
owner_id UUID REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE,
globally_usable BOOLEAN NOT NULL, -- Name can be bikeshed. Marker on whether anyone from the instance can choose this as "their" domain
verification_token TEXT NOT NULL,
verified_at TIMESTAMPTZ
); And accounts would reference them like so: CREATE TABLE accounts (
[...]
domain TEXT NOT NULL REFERENCES domains(domain)
); References #179 |
(gonna try to land #405 before starting this because rebasing on these planned changes would be a pain) |
If we're doing this then I think it's important to think about how to potentially tie #134 into our future account schema |
Do you have any suggestions on how we can tie this in? CREATE TABLE accounts_proofs (
id UUID PRIMARY KEY,
account_id UUID NOT NULL REFERENCES accounts(id) ON DELETE CASCADE ON UPDATE CASCADE,
type TEXT NOT NULL,
verification_method TEXT NOT NULL,
value TEXT NOT NULL,
purpose TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP
); That way we can have a 1:N relationship with accounts, allowing an account to display N proofs |
In general, I'd only store the "core" functionality inside the
By having that neat separation, we don't need to store everything into a single gigantic table |
The relationship between actors and proof subjects (DIDs) is "many to many". Each actor can have multiple proofs, and different actors can be linked to a single subject (this enables migration procedures like the one described in FEP-7628 (sub-type 2)). ActivityPub 2.0 may look like that: https://codeberg.org/fediverse/fep/src/branch/main/fep/ae97/fep-ae97.md#server-independent-ids (DIDs instead of URLs). I haven't yet decided how to represent all these possibilities in the database... Moving non-core functionality into separate tables sounds like a good idea. |
Yeah, I focussed way too much on the Something like: CREATE TABLE accounts_proofs (
id UUID PRIMARY KEY,
type TEXT NOT NULL,
verification_method TEXT NOT NULL,
value TEXT NOT NULL,
purpose TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE accounts_identities (
id TEXT NOT NULL, -- Where this is the "id" value embedded in the identity attachment
account_id UUID NOT NULL REFERENCES accounts(id) ON DELETE CASCADE ON UPDATE CASCADE,
proof_id UUID NOT NULL REFERENCES accounts_proofs(id),
created_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id, account_id)
); That way we can map accounts to identities in an M:N way, and attach a link to a proof as metadata. |
Technically this design would be a logical 1:1 relationship between an identity and proof, while you could technically generate multiple proofs of the same identity. |
I guess system actors could be implemented using some kind of roles table for the accounts, like Mastodon's Also, I noticed there is a definition of |
This doc gives a good idea of alternative protocol requirements: |
So, Kitsune right now is pretty intertwined with ActivityPub and Webfinger. Kinda makes sense since it started out by being built around those standards, but I think we can do better with minimal performance impact.
References #201 and #415
Rough plan
kitsune-activitypub
kitsune-core
, such as theFederator
,FederationFetcher
, andResolver
traitFetcher
orDeliverer
, we give them a vector of these which they iterate over and perform the appropriate actions in the different federated networksactor_type
field to something more generic (such as justtype
)protocol
marker to each account, post, like, etc. to identify from what network they originate fromI invite some bikeshedding to this issue since this is a large undertaking and will make significant changes to all parts of Kitsune
PRs:
The text was updated successfully, but these errors were encountered: