chadtmiller.com/group-host
atmosphere group host
0
0
Approval keeps reading a space the group has yet to make
Merged Approved
The pull makes narrow keep a read-only space:T?action=read scope, with or without a key, when the group has no space of that type and key yet. When such a space exists, the old policy check still applies. I found no defects.
- What stays withheld: writes to a space not yet made, and reads of an existing space the roles can't read.
roomslists all of the group's spaces, not only readable ones, so thepostercase still falls to the policy check. - Foreign authority: the
for_groupfilter runs before this branch, so a scope naming another authority never reaches it. - Safety: each credential still checks that the member reads the space at that moment, so the kept scope grants nothing extra.
- Tests and docs: the
oauth_scopetest is updated, the newtokens.rsend-to-end test covers the Grain case, and the change file andsigning-in.mdare updated asAGENTS.mdasks. - Not run: I didn't run the tests, and the pull says it didn't either.
All checks have passed
8 passed, 1 skipped
Merged as 7bcc3ec
What changes
Approval keeps a scope that only reads spaces of a type,
space:T?action=read(or of a type and key), where the group has no such space yet. Before,narrowkept such a scope only if a space of typeTalready existed and the roles read it, and withheld it otherwise. A scope that writes, or that reads a space the group already has and the roles don't read, is still withheld.signing-in.md's narrowing rules say so.Why
A grant keeps its scope through every refresh. So an app approved before the group made a space could never read that space without a member approving it again. Grain hits this: it connects to a group with
space:social.grain.group.pool?action=read. A group that makes its members-only pool after connecting, whether from Grain,atgrp space createor anything else, leaves Grain's session unable to read it. Grain is about to make that pool itself from its group page, as one approval that asks formanage=createwith its reads. That only works if the same grant reads the pool it then makes.Keeping the read scope gives nothing ahead of time.
getDelegationTokenstill checks that the member reads the space at that moment, under its policy then. So the scope reads nothing its member doesn't, and nothing at all until the group makes the space. The other way, making the app ask again once the space exists, puts the member through a second approval for something the first already said.How it was checked
oauth_scope.rs:keeps_a_space_scope_a_spaces_policy_grantsnow expects a read of a calendar key the group lacks, and of a type it has no space of, to be kept. It still expects a write to a space not yet made to be withheld, and a read of a space whose policy keeps it from the role (poster) to be withheld.tokens.rs:reads_a_space_the_group_made_after_approving_its_sessionapproves an app forspace:com.example.forum?action=readas Bob before the group has a forum. Then it makes one that members read, and buys a credential for it with that session's delegation.testcheck runs them under the gate.Shortcomings
Grants already made keep the scope they were given. An app reads a space made since only once a member approves it again.