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

7344 mailgroup regex #7351

Merged
merged 15 commits into from
Oct 28, 2020
Merged

7344 mailgroup regex #7351

merged 15 commits into from
Oct 28, 2020

Conversation

poikilotherm
Copy link
Contributor

What this PR does / why we need it:
Per #7344, @scolapasta asked for regex support in mail domain groups. Sounded like this would be a use case for Harvard Dataverse.

Which issue(s) this PR closes:

Closes #7344

Special notes for your reviewer:
None.

Suggestions on how to test this:
Create a group with a regex, create users with mail addresses matching the regex and some with non-matching. Assign perms to the group and test with different users.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:
None.

Is there a release notes update needed for this change?:
This might be worth a short note.

Additional documentation:
None.

@poikilotherm poikilotherm self-assigned this Oct 23, 2020
@poikilotherm poikilotherm added Feature: Admin Guide Feature: Permissions Type: Feature a feature request User Role: API User Makes use of APIs User Role: Sysadmin Installs, upgrades, and configures the system, connects via ssh labels Oct 23, 2020
@poikilotherm poikilotherm marked this pull request as ready for review October 23, 2020 14:17
@poikilotherm poikilotherm added this to the 5.2 milestone Oct 23, 2020
@poikilotherm
Copy link
Contributor Author

@scolapasta as promised, here you go. 🛩️

Some hints:

- Due to their excessive CPU usage, regular expressions should be used rarely.
- Also due to their CPU usage, all domain groups are cached. Cache updates when groups change via API.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain a little more what you mean by this? what is cached and when?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The singleton has a copy of the groups in memory (instance variables).

Everytime authorization happens, the regular expressions aren't recompiled, which would be a huge waste of CPU resources. In other words: the singleton is a facade for the rarely changing group data.

This "cache" is updated (compiling the regex) on startup and when domain groups are changed via CRUD API actions (not during read, obviously).

This might not be necessary to mention in the guides, as an admin should never notice anything of it. I left it there for FWIW.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, yeah, I think Admins won't care about that detail - I think it's safe to remove.

@djbrooke djbrooke self-assigned this Oct 26, 2020
@poikilotherm
Copy link
Contributor Author

@djbrooke I just merged your PR. Thx for polishing my bad style and writing!

@scolapasta would you pass this along to @kcondon for QA?

Thank you guys!

@djbrooke djbrooke removed their assignment Oct 27, 2020
@kcondon kcondon self-assigned this Oct 27, 2020
@kcondon kcondon merged commit 666768a into IQSS:develop Oct 28, 2020
@poikilotherm
Copy link
Contributor Author

Thx for merging @kcondon 🥳

@poikilotherm poikilotherm deleted the 7344-mailgroup-regex branch October 28, 2020 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Admin Guide Feature: Permissions Type: Feature a feature request User Role: API User Makes use of APIs User Role: Sysadmin Installs, upgrades, and configures the system, connects via ssh
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mail Domain Groups require exact domain match
4 participants