Skip to content
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

Group racl #4865

Merged
merged 16 commits into from
Jul 30, 2024
Merged

Group racl #4865

merged 16 commits into from
Jul 30, 2024

Conversation

brong
Copy link
Member

@brong brong commented Mar 25, 2024

This is a little skanky, but "PTS" is basically a key to list lookup protocol, so I'm using it in reverse to map a group to its members.

(This pairs with an MR in Fastmail hm to add the same thing to our lookup)

Copy link
Contributor

@elliefm elliefm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't tell just from looking whether this affects all PTS or just HTTPPTS. If it affects all PTS, might want to update LDAP.pm too

cassandane/Cassandane/Cyrus/HTTPPTS.pm Outdated Show resolved Hide resolved
@brong
Copy link
Member Author

brong commented Mar 25, 2024

I can't tell just from looking whether this affects all PTS or just HTTPPTS. If it affects all PTS, might want to update LDAP.pm too

Yeah, I've updated the data file that LDAP.pm uses as well :)

@brong
Copy link
Member Author

brong commented Apr 1, 2024

I've re-requested review! This now includes the two extra bits; a "raclmodseq" command that only admins can use to touch a user's raclmodseq (needed when group membership changes); and a mode to ptexpire which takes a username or group and nukes the cached lookup immediately.

plus of course fixes to LDAP and to tests.

imap/imapd.c Show resolved Hide resolved
cassandane/Cassandane/Cyrus/HTTPPTS.pm Outdated Show resolved Hide resolved
lib/imapoptions Outdated Show resolved Hide resolved
Comment on lines 41 to 42
hasmember: cassandane
hasmember: otheruser
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually these would be dns, not just uids, because the directory wants to be able to enforce foreign key constraints and so on. Compare for example the memberof attribute within the user objects, whose values are the dns of the groups. Also, I'd expect this attribute to typically be called just "member" too, or perhaps be named to denote a specific kind of member (real world examples from memory: "uniquemember", "rfc822mailmember", etc), but not "hasmember".

We can make directory.ldif say whatever the hell we want, but it's important to remember that if it isn't representative of a plausible real world directory layout, then testing against it doesn't prove anything about whether Cyrus's LDAP support works, and a test that doesn't prove anything is a waste of time

@brong
Copy link
Member Author

brong commented Apr 4, 2024

Hi again @ksmurchison and @elliefm !

I've updated the ldap module to work the way I think it should from my reading of the internets - with "memberof" for the group list in a user, and "member" for the user entry in a group. I've also fixed the HTTPPTS tests with correct group names and memberships, and added the other groups referenced in the tests to the auth daemon, since it's now mandatory for a group to exists (return 200 to a lookup) in order to be valid (and we check it when setting ACLs)

ptclient/ldap.c Outdated Show resolved Hide resolved
Copy link
Contributor

@elliefm elliefm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, but a couple of nits/issues still maybe

imap/mboxlist.c Outdated Show resolved Hide resolved
ptclient/ldap.c Outdated Show resolved Hide resolved
@brong brong requested a review from elliefm June 10, 2024 20:55
@brong
Copy link
Member Author

brong commented Jun 10, 2024

OK, I've re-requested review @elliefm - added fixes for the two nits you have proposed. Still happily passing all the LDAP tests.

@brong brong requested a review from elliefm June 19, 2024 15:09
@dilyanpalauzov
Copy link
Contributor

Should the documentation be updated?

Copy link
Contributor

@elliefm elliefm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last thing: can you add a changes/next/* file please -- copy 0000-TEMPLATE and fill in the fields. I think we're thinking of this as experimental for the time being, so please describe it as such. I'm happy to approve it once that's done.

@dilyanpalauzov asked about documentation. If we're thinking of this as experimental then I don't think that's strictly necessary yet, as long as we're willing to help out anyone else who wants to experiment with it.

It can't return failure, it zeros everything, you only need space
for groups if you're actually adding groups
This matches the behaviour of ptclient/ldap for group:
(though, ptclient/ldap doesn't currently support fetching
group membership)
@brong
Copy link
Member Author

brong commented Jul 25, 2024

Thanks @elliefm - I've added changes/next file and rebased. This is still an old "in upstream" branch :)

Copy link
Contributor

@elliefm elliefm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@brong brong merged commit 1817707 into master Jul 30, 2024
1 check passed
@rsto rsto deleted the group-racl branch July 30, 2024 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants