Proposal for Atmosphere Groups standard on atproto spaces

Notes from practical experience in Tranquil #36

Open nel.pet
Open opened by nel.pet

For context for those who might not know. A bit over a year ago, during tangleds infancy, there was a lot of talk in the tangled discord about how to approach organisations. I voiced my opinion on that quite early on which essentially boiled/boils down to a delegated/indirected authn mechanism very much like described in the current opensocial proposal. The design work I did then and since has ended up resulting in delegated accounts in Tranquil PDS the basic model of which I had hoped to polish and offer up as a starting point for a community wide spec. As such I'm unsurprisingly very excited about the opensocial.group push! And with the practical experience in this area that working on delegated accounts in Tranquil has given me, reading over the proposal as is there are a few pain points that stick out. Some or most of these likely make sense to peal off into dedicated issues, but I'm starting them here for now for simplicities sake.

Authn and authz #

Currently as described the system is very similar to what we have in Tranquil. A few things of note that haven't been considered yet though:

  • We found in Tranquil that a lot of the time, admins and other really high level members need/want to have permission to call all XRPC methods on all services. However the standard atproto permissions specifically disallow rpc:*?aud=*. In Tranquil we specifically allow this for permissions granted to delegated account members. That solution should be adopted for opensocial in my opinion and should be explicitly called out in the spec/proposal.
  • Attestation of the user that a delegated/group account session is backed by is something I've been experimenting with in Tranquil. I think it's a worthwhile feature for application services to be able to know who is puppeteering the group identity. We don't have anything for this in Tranquil currently, but the plan is likely to put a service auth token (valid for a marker NSID not a real XRPC endpoint) from the backing user account into an act claim on group account service auth tokens. That's the best I've been able to come up with so far. At least that doesn't require massive changes to atprotos authn layer.
  • Another thing I've considered for Tranquils delegated accounts is allowing member users to directly call endpoints on the Tranquil instance holding a delegated account with their own service auth token. This lets them safely make these XRPC calls without requiring them to go through the rigmarole of the two layer OAuth flow.
  • On that same note the proposal currently mentions "shared application sessions" as a pattern to avoid the two layer OAuth flow. However this, as the proposal mentions, would necessitate applications being the ones to implement the permissions. I feel this isn't a great approach to that problem space. Having applications implement permissions like that seems bound to result in permission bugs that could've been avoided, particularly in regards to when permissions change. I don't think the issue of having multiple people do their own two layer OAuth flow is big enough to warrant that kind of approach. And if it's specifically something we want to avoid I think the above option is better. Keeping the permission gate at the group host, as a single source of truth.
  • One could argue that the assignable field is largely unnecessary. In Tranquil, while we don't have roles, you can still add other people and assign them permissions. The permissions you may assign to someone else are simply the permissions you yourself hold. Role assignment could easily do the same. I suppose it's to be able to give people a role that they aren't allowed to pass on?
  • Having roles as the only source of permissions seems a little limiting. I think being able to assign individual permissions directly a person would also be useful.

Group creation #

The proposal currently says, essentially, "OAuth with prompt=create at a group host`. That's not enough if you ask me. At the very least the creation flow should say something about wanting to create specifically a group account and not just any account. This is particularly warranted in cases where a service is a group host but also a standard PDS. eg. Tranquil will almost certainly become a group host since the opensocial covers more or less all the wants I have for what I've been calling "delegated accounts v2". Blocking setups like that at the spec level would be a big misstep if you ask me.

In Tranquil we currently offer account creation via Tranquil specific extensions to the normal createAccount flow. The createAccount flow is authenticated with another existing account and that account will then be the first member/controller of the delegated account once its created. This method is easy to use programmatically from an application and it covers getting the first member on to the account. I'm not saying it's necessarily a perfect method but I really don't think a basic prompt=create OAuth flow is enough. It needs to at least be distinguished from creation of standard atproto accounts.

Wording #

This ones a little more vague but the current wording of the proposal seems quite stuck on a few particular use cases while the actual tech here is much broader in potential use. Particularly the wording focuses a lot on spaces specifically. I think it's worth it to spell out more explicitly that this can absolutely also be used for collective control over an account and its "standard" atproto data not just spaces data. For example tangled has mentioned that they'll likely adopt it for org accounts once it's out and about (replacing the current temporary Tranquil based model). That use would primarily be for collective control over the public repo of the group/org account (even if putting those things in a public space would probably work too) and for auth purposes. This isn't really any technical objection, but I think optics are important. Even in technical documentation like specs, where the way something is presented main inadvertently limit the use cases people think of using it for.

Hi @nel.pet! Thanks for this feedback, and sorry to just see it and be replying to you now. Going to do short bullet-point replies:

  • "any XRPC anywhere permission": one way we have thought about this in the context of regular OAuth would be a special "god-mode" scope, like include:com.atproto.authFullAccount which would be interpreted by the host as a special case. I think this could be added as an evolution/follow-up over time.
  • "member service auth calls on group host": interesting, though feels pretty developer / power-user specific. also kind of leads in to nested service auth. I'd put this in the bucket of "iterate on overall service auth mechanism" (eg, maybe with UCAN)
  • "group creation": I'm very keen for group hosts to expose an API for authenticated app services to create new group accounts. A key thing about this is that it would probably be an explicit partnership with the app service. Which means it doesn't really need to be part of the specified API service. eg, how should auth work? are there quotas and/or rate-limits? I also think it would be cool if this endpoint returned an active OAuth session for the group, but it seems like a pain to specify how that would work in an interoperable way. I think in some ways the PDS createAccount API has been an anti-pattern (!) in that it made it hard for PDS operators and implementations to change how sign-up works.
  • "space-centricity": I am personally pretty excited to use this setup for regular old public data groups and accounts as well! both for the "org account" pattern, and situations where "members" create broadcast records which reference the group account in a more-or-less standard way. we are pretty space-brained overall right now. I'd be happy to chat/collab or take feedback about ways to make the opensocial.group specification more general-purpose though.

Makes a lot of sense to me to shunt the first two to a later evolution!

On group creation. I very much agree on createAccount likely being a bit of an anti-pattern (we've felt that especially hard in Tranquil with all the alternatives to email and password based auth and notifications that we support, which createAccounts standard interface has no hope of dealing with). Especially for standard user accounts and OAuth. prompt=create works much better there. I originally was just thinking in terms of an app wanting to offer group creation on arbitrary hosts. Though to be fair that isn't exactly a thing we generally assume possible for standard accounts either. So it probably makes sense to consider this a case-by-case, app-to-host specific thing to be worked out. Though to be honest this makes me think that maybe this spec shouldnt impose any group creation logic at all? I don't really see where the currently mentioned prompt=create flow would really be used?

However there is also the question of migration. I would be much in favour of entirely dropping createAccount from the wider atproto network too and with the advent of OAuth that should be mostly possible IMO. Except for its usage during migration. I think most of us agree that it's generally been a good thing that the community has been able to make standard migration tools like PDSMoover and given the way migration works those tools need a standard endpoint to create an account. The same problem case is there with group accounts. Most of host migration of group accounts is covered by just standard atproto host migration, but there is not a clear standard way to make the account to migrate to on the new group host. Though I do feel there is probably reason to bring this problem space up in a wider atproto context too. It would be wonderful if we had a prompt=create equivalent for OAuth based migrations! And groups would likely be able to mostly just work with that I feel.

Space centricity wise I think it's honestly mostly the wording for me. The actual design is fine I think but stuff like

An atmospheric group is a network identity (DID) with a bunch of permissioned spaces under it. There is a one-to-one mapping between groups and DIDs.

and

The group account authors the group's profile, rules, roles, memberships, invites, and labels, and sets each space's policy. It can also author modality-specific records. For example, pinning a post at the top of a forum may require the group account to create a pin record in the forum space.

Applications create, update, and delete these records through com.atproto.space.*, using an OAuth session for the group account. The host checks that each write follows the semantics for that record type and that the session permits it.

As well as the fact that there isn't much (though there is a bit!) discussion in the proposal about usage patterns for the shared global/standard repo. Gives, I fear at least, the impression to a reader that groups are inherently space centric in use and design. The design is great! I think the fact that basically this same core concept has been independently thought of at least thrice (here, by me in Tranquil and by Nick in https://discourse.atmosphere.community/t/sketching-com-atproto-server-createactorauth/1140) is testament to that, but I still think the wording really matters and could be a smidge better in this regard.

Sign up or Sign in to add to the discussion.