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

captcha on request copy #9235

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

GauravD2t
Copy link

@GauravD2t GauravD2t commented Dec 18, 2023

References

Add references/links to any related issues or PRs. These may include:

Description

requestCopy.verification.enabled=true/false in the configuration file

Instructions for Reviewers

Please add a more detailed description of the changes made by your PR. At a minimum, providing a bulleted list of changes in your PR is helpful to reviewers.

List of changes in this PR:

  • First, ...
  • Second, ...

Include guidance for how to test or review your PR. This may include: steps to reproduce a bug, screenshots or description of a new feature, or reasons behind specific changes.

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & integration tests). Exceptions may be made if previously agreed upon.
  • My PR passes Checkstyle validation based on the Code Style Guide.
  • My PR includes Javadoc for all new (or modified) public methods and classes. It also includes Javadoc for large or complex private methods.
  • My PR passes all tests and includes new/updated Unit or Integration Tests based on the Code Testing Guide.
  • If my PR includes new libraries/dependencies (in any pom.xml), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR modifies REST API endpoints, I've opened a separate REST Contract PR related to this change.
  • If my PR includes new configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

@tdonohue tdonohue self-requested a review January 11, 2024 15:44
@@ -1579,6 +1579,12 @@ solr-database-resync.cron = 0 15 2 * * ?

registration.verification.enabled = false

#---------------------------------------------------------------#
Copy link
Contributor

Choose a reason for hiding this comment

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

could you consider to add a new modules/google-captcha.cfg file? I think there are several configurations for Google Captcha. Perhaps it already deserves a single configuration file for it.

And also add a reference for it on dspace.cfg:

include = ${module_dir}/google-captcha.cfg

Copy link
Member

Choose a reason for hiding this comment

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

I think this configuration can remain in dspace.cfg for now, unless you want to move everything related to Google Captcha to the same google-captcha.cfg file (as @paulo-graca mentions above). So, I'd say that new google-captcha.cfg is optional. It's nice to have, but it can be done by in a different PR if needed.

However, I'd ask that you please group these related configurations together by removing the new "GOOGLE CAPTCHA CONFIGURATION" header on lines 1582-1584. That's not necessary to add again because that same header already exists on lines 1575-1577 in this same file.

Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

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

@GauravD2t : I reviewed/tested this today alongside the frontend PR. See more details in my review of that PR

I have some additional suggestions in this PR... see inline below.

} catch (InvalidReCaptchaException e) {
throw new InvalidReCaptchaException(e.getMessage(), e);
}
}
Copy link
Member

Choose a reason for hiding this comment

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

As noted by Codecov (in the "Files Changed" tab on this PR), this new code doesn't have any tests written for it.

We should add tests for Captchas to the RequestItemRepositoryIT. These tests could be similar to / modeled on the Captcha tests that also exist in RegistrationRestRepositoryIT (search for "captcha" in this file): https://github.com/DSpace/DSpace/blob/main/dspace-server-webapp/src/test/java/org/dspace/app/rest/RegistrationRestRepositoryIT.java

@@ -1579,6 +1579,12 @@ solr-database-resync.cron = 0 15 2 * * ?

registration.verification.enabled = false

#---------------------------------------------------------------#
Copy link
Member

Choose a reason for hiding this comment

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

I think this configuration can remain in dspace.cfg for now, unless you want to move everything related to Google Captcha to the same google-captcha.cfg file (as @paulo-graca mentions above). So, I'd say that new google-captcha.cfg is optional. It's nice to have, but it can be done by in a different PR if needed.

However, I'd ask that you please group these related configurations together by removing the new "GOOGLE CAPTCHA CONFIGURATION" header on lines 1582-1584. That's not necessary to add again because that same header already exists on lines 1575-1577 in this same file.

@tdonohue
Copy link
Member

tdonohue commented Mar 4, 2024

@GauravD2t : Unfortunately this feature missed our feature merger deadlines for 8.0 (as feedback was not addressed in time). It will need to be rescheduled for 9.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ❓ Stalled/On Hold
Development

Successfully merging this pull request may close these issues.

add CAPTCHA to request-a-copy form
3 participants