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

auth_mboxgroups: a new in-cyrus group mechanism #4895

Merged
merged 22 commits into from
Jun 10, 2024
Merged

auth_mboxgroups: a new in-cyrus group mechanism #4895

merged 22 commits into from
Jun 10, 2024

Conversation

brong
Copy link
Member

@brong brong commented Apr 22, 2024

This takes groups into Cyrus. I want to add a JMAP-style management interface as well, but that's for v2.

It also adds additional pusher info to push a list of all users who can see the change, for handy pusher/notify extensions.

imap/imapd.c Outdated Show resolved Hide resolved
lib/auth_mboxgroups.c Outdated Show resolved Hide resolved
Copy link
Member Author

@brong brong left a comment

Choose a reason for hiding this comment

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

Missing replication for usergroups - we need a way to do that before this can be shipped!

@brong brong changed the title WIP: Mboxgroups auth_mboxgroups: a new in-cyrus group mechanism May 8, 2024
@brong brong requested review from rsto, ksmurchison and elliefm and removed request for rsto May 8, 2024 05:55
@brong
Copy link
Member Author

brong commented May 8, 2024

Missing replication for usergroups - we need a way to do that before this can be shipped!

Did that :)

@brong
Copy link
Member Author

brong commented May 8, 2024

damn I need to do some rebasery to make this merge correctly with other branches

Copy link
Contributor

@ksmurchison ksmurchison left a comment

Choose a reason for hiding this comment

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

This all looks sane to me

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.

Looks good generally, but I have a bunch of nits of varying severity, details inline.

Also, I'd especially like to see tests for the replication functionality, probably in Replication.pm. I assume this code is already minimally exercised by the existing tests just because the new key/value will be in their MAILBOX dlists. But it would be good to see some tests that tinker with the user's groups and then verify that the expected changes actually appear on the replica

cassandane/Cassandane/Cyrus/Mboxgroups.pm Outdated Show resolved Hide resolved
lib/auth_mboxgroups.c Show resolved Hide resolved
lib/auth_mboxgroups.c Outdated Show resolved Hide resolved
lib/auth_mboxgroups.c Outdated Show resolved Hide resolved
lib/imapoptions Outdated Show resolved Hide resolved
lib/imapoptions Outdated Show resolved Hide resolved
@brong
Copy link
Member Author

brong commented May 29, 2024

@elliefm I've addressed the things you mentioned, and also add the Replication test (which raised that in some configs we won't send the groups due to missing RACLs, so I've made it that we always send them.

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.

Looks good, couple of details in the new tests that could be streamlined (details inline), but it's not crucial.

But! This is failing the Backups.xbackup_shared and Backups.shared_mailbox tests in CI, look like the sync_client side is crashing. It might be that backupd doesn't recognise the changed protocol and rejects it, and sync_client doesn't know how to proceed after that? It's not real clear from the CI output, would need to be looked at closely in action.

I might be tempted to say just ignore these failures, since we're getting rid of all the backups code and tests soon anyway (#4896). But I notice that both of the failing tests are something to do with shared mailboxes, and we have a bad habit of accidentally breaking shared mailboxes code, so I think in this case it warrants a deeper look. If it is really broken, it would be good to get a regression test for it added to Replication, so we don't lose that coverage when we throw out the Backups stuff.

Comment on lines +24 to +31
$mastertalk->create("INBOX.Test") || die;
$mastertalk->create("INBOX.Test.Sub") || die;
$mastertalk->create("INBOX.Test Foo") || die;

my $ldata = $mastertalk->list("", "*");
$self->assert_deep_equals($ldata, [
[
[
Copy link
Contributor

Choose a reason for hiding this comment

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

You could use setup_mailbox_structure() and assert_mailbox_structure() here to remove a lot of clutter. See the List tests for lots of examples.

Comment on lines +79 to +85
$self->assert_deep_equals($rdata, [
[
[
'\\HasChildren'
],
'.',
'INBOX'
Copy link
Contributor

Choose a reason for hiding this comment

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

Likewise wrt assert_mailbox_structure(). It would make it easier to see at a glance that the test expects to see brandnew's own mailboxes, plus cassandane's Inbox, without those details getting lost in all the lines of [[[]]]

@brong
Copy link
Member Author

brong commented Jun 3, 2024

@elliefm yes - you're right - it was broken for shared! I've added a test - Replication.shared_folder so we catch this if it happens again, and fixed it.

@brong brong requested a review from elliefm June 3, 2024 11:21
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.

Looks good :)

@brong brong merged commit 0bae325 into master Jun 10, 2024
2 checks passed
@brong brong deleted the mboxgroups branch June 10, 2024 20:25
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.

3 participants