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

Register user / allow to configured allowed email domains #8186

Merged
merged 5 commits into from
Jun 19, 2024

Conversation

josegar74
Copy link
Member

This change request adds a new setting that allows to configure in the User self registration options a list of comma separated mail domains to restrict the mail addresses that can request an account. If not configured, any email address is allowed.

self-registration-domain-setting

If a user tries to register with an email address from a domain not configured in the previous setting a generic error message is returned.

self-registration-domain-error-message


The change request adds a server side validator for the request account data.

Checklist

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • Clean commit messages, longer verbose messages are encouraged
  • API Changes are identified in commit messages
  • Testing provided for features or enhancements using automatic tests
  • User documentation provided for new features or enhancements in manual
  • Build documentation provided for development instructions in README.md files
  • Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

Thanks to GeoCat Live for implementation and funding by ECCC

@fxprunayre fxprunayre merged commit 76f68d9 into geonetwork:main Jun 19, 2024
7 checks passed
@geonetworkbuild
Copy link
Collaborator

The backport to 4.2.x failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply 22661481b2... Register user / allow to configured allowed email domains
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config advice.mergeConflict false"

stdout
Auto-merging core/src/main/java/org/fao/geonet/kernel/setting/Settings.java
Auto-merging core/src/test/resources/org/fao/geonet/api/Messages.properties
Auto-merging core/src/test/resources/org/fao/geonet/api/Messages_fre.properties
Auto-merging services/src/main/java/org/fao/geonet/api/users/RegisterApi.java
CONFLICT (content): Merge conflict in services/src/main/java/org/fao/geonet/api/users/RegisterApi.java
Auto-merging web-ui/src/main/resources/catalog/locales/en-admin.json
Auto-merging web/src/main/webapp/WEB-INF/classes/org/fao/geonet/api/Messages.properties
Auto-merging web/src/main/webapp/WEB-INF/classes/org/fao/geonet/api/Messages_fre.properties
Auto-merging web/src/main/webapp/WEB-INF/classes/setup/sql/data/data-db-default.sql
CONFLICT (modify/delete): web/src/main/webapp/WEB-INF/classes/setup/sql/migrate/v445/migrate-default.sql deleted in HEAD and modified in 22661481b2 (Register user / allow to configured allowed email domains).  Version 22661481b2 (Register user / allow to configured allowed email domains) of web/src/main/webapp/WEB-INF/classes/setup/sql/migrate/v445/migrate-default.sql left in tree.

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.2.x 4.2.x
# Navigate to the new working tree
cd .worktrees/backport-4.2.x
# Create a new branch
git switch --create backport-8186-to-4.2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 22661481b22f1e7257f2fca069fb06ad8c5d8996,9eab7f5c2178c5d5e609a2b3a85609502f5a8798,fa4210d63bcf82b2421717c106938002463c6136,a13ece4217d8a26373ce757918c748fb5ad821b9,0b43816f53c072ccf40878037803b1e014b3eb57
# Push it to GitHub
git push --set-upstream origin backport-8186-to-4.2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.2.x

Then, create a pull request where the base branch is 4.2.x and the compare/head branch is backport-8186-to-4.2.x.

Copy link
Contributor

@jodygarnett jodygarnett left a comment

Choose a reason for hiding this comment

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

This PR should include an update to the documentation describing new feature

@josegar74
Copy link
Member Author

@jodygarnett there is a brief description added in https://github.com/geonetwork/core-geonetwork/pull/8186/files#diff-7fd4b3d37b3876248657ed00a7fb9c35f9d355d8fb8470b9e4cc0bad6d803867

@jodygarnett
Copy link
Contributor

@jodygarnett there is a brief description added in https://github.com/geonetwork/core-geonetwork/pull/8186/files#diff-7fd4b3d37b3876248657ed00a7fb9c35f9d355d8fb8470b9e4cc0bad6d803867

Understood, I had expected a little more. But yeah mentioning a feature at all is good.

josegar74 added a commit to GeoCat/core-geonetwork that referenced this pull request Jun 20, 2024
…#8186)

* Register user / allow to configured allowed email domains

* Register user / allow to configured allowed email domains - update migration scripts

* Revert accidental change in Messages.properties
josegar74 added a commit that referenced this pull request Jun 20, 2024
)

* Register user / allow to configured allowed email domains

* Register user / allow to configured allowed email domains - update migration scripts

* Revert accidental change in Messages.properties
fxprunayre pushed a commit to SPW-DIG/metawal-core-geonetwork that referenced this pull request Jul 18, 2024
…#8186)

* Register user / allow to configured allowed email domains

* Register user / allow to configured allowed email domains - update migration scripts

* Revert accidental change in Messages.properties
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.

4 participants