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

Added logic to determine whether the user needs to be validated by Turnstile, and get rid of the extraneous scripts and checks if not #2555

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

joshuastegmaier
Copy link
Collaborator

https://staff.loc.gov/tasks/browse/CONCD-952

This stops the interactive widget from appearing when there's no need to validate the user or when they're can't submit the form (such as when an asset is ready for review but the user is anonymous).

This also prevents a lot of extraneous calls to Turnstile from clients (since the script and widget won't be loaded if not needed), which is obviously preferable if it doesn't otherwise break anything.

…rnstile, and get rid of the extraneous scripts and checks if not
@joshuastegmaier joshuastegmaier marked this pull request as ready for review October 4, 2024 16:04
@jkueloc jkueloc merged commit bd29249 into main Oct 4, 2024
7 checks passed
@joshuastegmaier joshuastegmaier deleted the CONCD-952-jstegmaier-disable-on-review branch October 16, 2024 14:09
jkueloc added a commit that referenced this pull request Oct 18, 2024
* changed db instance type to one compatible withpostgresql v15.5 (#2522)

* CONCD-929 Improve show what I can work on UI (#2523)

* CONCD-929 Change radio button text

* CONCD-929 Align text to right edge of filter

* Bump cryptography in the pip group across 1 directory (#2519)

Bumps the pip group with 1 update in the / directory: [cryptography](https://github.com/pyca/cryptography).


Updates `cryptography` from 43.0.0 to 43.0.1
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](pyca/cryptography@43.0.0...43.0.1)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: indirect
  dependency-group: pip
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* CONCD-919 Change transcription box message on reserved asset pages (#2524)

* Add new service update for test deployments (#2525)

* add feature branch to codeql workflow (#2527)

* Cloudflare Turnstile implementation (#2526)

* initial commit for turnstile module approach

* start integrating turnstile into concordia forms and views

* Update the url for Originally from reference.

* First attempt at adding form widget to form and view and template.

* settings is now passing TURN values, moved view to save transcription - still not the right place....

* clean up - still stuck

* Basic implementation of turnstile to transcription form

* Added turnstile to forms that previously used captcha. Removed captcha from codebase. Updated tests to correctly handle Turnstile. Fixed issue with caching and tests that only appeared when running tests multiple times in the same environment more often than once per hour. Updated docs to include Turnstile info

* Updated error message for when a user fails Turnstile validation

---------

Co-authored-by: Jen Kuenning <jkue@loc.gov>

* Added additional cases for other secret manager errors (#2529)

* CONCD-919 language tweak + padding (#2528)

* CONCD-919 2nd line of text (#2530)

* Added Turnstile URLs to settings. Moved context processor and removed redundant processor (#2532)

* Added logging for errors from Turnstile (#2533)

* CONCD-928 Implement show what I can work on for all users (#2536)

* CONCD-951 User activity alert email iteration (#2537)

* Updated service letter signature (#2538)

* Updated reservation tombstones to be applied after 24 hours, then deleted after another 24 hours (#2539)

* CONCD-956 alert email: header row (#2540)

* Added ability to undo an OCR transcription even if it's the first transcription on an asset (#2541)

* CONCD-955 Add new column with total lifetime numbers (#2542)

* Added resetting to the turnstile widget after form submission (#2543)

* Added resetting to the turnstile widget after form submission. Changed turnstile to only display a widget when interaction is required

* Added storing of validation for anonymous users. Timeout set to the same as captcha, one day

* Reordered service letter signature (#2544)

* CONCD-955 numbers don't look correct (#2545)

* CONCD-956 update the headers, descriptive text (#2546)

* CONCD-939 (#2547)

* CONCD-939 move guide up

* CONCD-939 needs to be dynamic (to accomodate transcriptions with different statuses)

* CONCD-943 Make button corners consistent (#2548)

* Re-create CodeQL configuration

* Reset CodeQL configuration

* Recreate codeql.yml

* Reset CodeQL configuration

* Resync CodeQL with the default template

Codeql started running two separate workflows beginning on Sept 23 for reasons unknown.  a second workflow instance of CodeQL showed up in the workflows giving error, "
Code Scanning could not process the submitted SARIF file: CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled". Attempts to turn off CodeqL or set to advance forced the creation of this workflow.

This tries to port the old configuration logic to the new structure used by GitHub's default template which splits analysis by language.


---------

Co-authored-by: Chris Adams <cadams@loc.gov>

* GitHub Actions: adjust CodeQL trigger conditions

* CONCD-939 we can make this more responsive by actually using bootstrap's grid (#2551)

* CONCD-943 ui2 will use bootstrap default, we should too (#2552)

* CONCD-939 we don't necesarily want the button to fill its container (#2553)

* CONCD-939 changes based on Ki's feedback (#2554)

* Added logic to determine whether the user needs to be validated by Turnstile, and get rid of the extraneous scripts and checks if not (#2555)

* CONCD-928 trying to fix a bug on the campaign detail page (#2556)

* Added next transcription/review field to campaign list view. Removed unlisted and renamed display on homepage columsn. (#2557)

* CONCD-939 vertically align elements (#2558)

* add update for 2nd service when test environment (#2562)

* CONCD-939 remove left padding (#2564)

* CONCD-924 yet more fixes

* Changed abbreviations in the campaign list. Switched abbreviations to model field verbose_name to allow the fields to be list editable. (#2566)

* Updated Pipfile.lock

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Jennifer Kuenning <72825410+jkueloc@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Josh Stegmaier <104993387+joshuastegmaier@users.noreply.github.com>
Co-authored-by: Jen Kuenning <jkue@loc.gov>
Co-authored-by: Chris Adams <cadams@loc.gov>
Co-authored-by: joshuastegmaier <jstegmaier@loc.gov>
jkueloc added a commit that referenced this pull request Oct 29, 2024
* CONCD-924 (#2521)

* CONCD-924 used bootstrap-5-migrate-tool to update templates

* CONCD-924 only import components we need

* CONCD-924 updated django templates

* CONCD-924 a few more components that we need (nav, dropdown, etc.)

* CONCD-924 updating Pipfile.lock

* CONCD-924 updated unit tests

* CONCD-924 additional fixes (#2534)

* CONCD-924 used bootstrap-5-migrate-tool to update templates

* CONCD-924 only import components we need

* CONCD-924 updated django templates

* CONCD-924 a few more components that we need (nav, dropdown, etc.)

* CONCD-924 updating Pipfile.lock

* CONCD-924 updated unit tests

* CONCD-924 various fixes for bootstrap changes

* CONCD-924 additional fixes for bootstrap changes

* CONCD-924 still more fixes for bootsrap 5 (WiP)

* CONCD-924 close button should be white

* CONCD-924 close buttons

* CONCD-924 contrast between foreground and background colors

* CONCD-924 make button corners consistent (#2561)

* CONCD-924 still more fixes (for spacing, etc) (#2563)

* CONCD-924 yet more fixes (#2565)

* CONCD-924 merge main in to feature branch (#2568)

* changed db instance type to one compatible withpostgresql v15.5 (#2522)

* CONCD-929 Improve show what I can work on UI (#2523)

* CONCD-929 Change radio button text

* CONCD-929 Align text to right edge of filter

* Bump cryptography in the pip group across 1 directory (#2519)

Bumps the pip group with 1 update in the / directory: [cryptography](https://github.com/pyca/cryptography).


Updates `cryptography` from 43.0.0 to 43.0.1
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](pyca/cryptography@43.0.0...43.0.1)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: indirect
  dependency-group: pip
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* CONCD-919 Change transcription box message on reserved asset pages (#2524)

* Add new service update for test deployments (#2525)

* add feature branch to codeql workflow (#2527)

* Cloudflare Turnstile implementation (#2526)

* initial commit for turnstile module approach

* start integrating turnstile into concordia forms and views

* Update the url for Originally from reference.

* First attempt at adding form widget to form and view and template.

* settings is now passing TURN values, moved view to save transcription - still not the right place....

* clean up - still stuck

* Basic implementation of turnstile to transcription form

* Added turnstile to forms that previously used captcha. Removed captcha from codebase. Updated tests to correctly handle Turnstile. Fixed issue with caching and tests that only appeared when running tests multiple times in the same environment more often than once per hour. Updated docs to include Turnstile info

* Updated error message for when a user fails Turnstile validation

---------

Co-authored-by: Jen Kuenning <jkue@loc.gov>

* Added additional cases for other secret manager errors (#2529)

* CONCD-919 language tweak + padding (#2528)

* CONCD-919 2nd line of text (#2530)

* Added Turnstile URLs to settings. Moved context processor and removed redundant processor (#2532)

* Added logging for errors from Turnstile (#2533)

* CONCD-928 Implement show what I can work on for all users (#2536)

* CONCD-951 User activity alert email iteration (#2537)

* Updated service letter signature (#2538)

* Updated reservation tombstones to be applied after 24 hours, then deleted after another 24 hours (#2539)

* CONCD-956 alert email: header row (#2540)

* Added ability to undo an OCR transcription even if it's the first transcription on an asset (#2541)

* CONCD-955 Add new column with total lifetime numbers (#2542)

* Added resetting to the turnstile widget after form submission (#2543)

* Added resetting to the turnstile widget after form submission. Changed turnstile to only display a widget when interaction is required

* Added storing of validation for anonymous users. Timeout set to the same as captcha, one day

* Reordered service letter signature (#2544)

* CONCD-955 numbers don't look correct (#2545)

* CONCD-956 update the headers, descriptive text (#2546)

* CONCD-939 (#2547)

* CONCD-939 move guide up

* CONCD-939 needs to be dynamic (to accomodate transcriptions with different statuses)

* CONCD-943 Make button corners consistent (#2548)

* Re-create CodeQL configuration

* Reset CodeQL configuration

* Recreate codeql.yml

* Reset CodeQL configuration

* Resync CodeQL with the default template

Codeql started running two separate workflows beginning on Sept 23 for reasons unknown.  a second workflow instance of CodeQL showed up in the workflows giving error, "
Code Scanning could not process the submitted SARIF file: CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled". Attempts to turn off CodeqL or set to advance forced the creation of this workflow.

This tries to port the old configuration logic to the new structure used by GitHub's default template which splits analysis by language.


---------

Co-authored-by: Chris Adams <cadams@loc.gov>

* GitHub Actions: adjust CodeQL trigger conditions

* CONCD-939 we can make this more responsive by actually using bootstrap's grid (#2551)

* CONCD-943 ui2 will use bootstrap default, we should too (#2552)

* CONCD-939 we don't necesarily want the button to fill its container (#2553)

* CONCD-939 changes based on Ki's feedback (#2554)

* Added logic to determine whether the user needs to be validated by Turnstile, and get rid of the extraneous scripts and checks if not (#2555)

* CONCD-928 trying to fix a bug on the campaign detail page (#2556)

* Added next transcription/review field to campaign list view. Removed unlisted and renamed display on homepage columsn. (#2557)

* CONCD-939 vertically align elements (#2558)

* add update for 2nd service when test environment (#2562)

* CONCD-939 remove left padding (#2564)

* CONCD-924 yet more fixes

* Changed abbreviations in the campaign list. Switched abbreviations to model field verbose_name to allow the fields to be list editable. (#2566)

* Updated Pipfile.lock

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Jennifer Kuenning <72825410+jkueloc@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Josh Stegmaier <104993387+joshuastegmaier@users.noreply.github.com>
Co-authored-by: Jen Kuenning <jkue@loc.gov>
Co-authored-by: Chris Adams <cadams@loc.gov>
Co-authored-by: joshuastegmaier <jstegmaier@loc.gov>

* CONCD-924 I may have forgotten to commit this previously (#2569)

* CONCD-924 I may have forgotten to commit this previously, or maybe it got stomped by the merge

* CONCD-924 stylelint is throwing an error here, but it's suggestion causes sass to throw an error instead

* CONCD-924 not sure if we need both sass and node-sass

* CONCD-924 When the browser window is narrowed, the buttons under the transcription area need a little spacing between the Save and Submit (#2570)

* CONCD-924 resolving merge conflicts (WiP)

* Updated Pipfile.lock

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Jennifer Kuenning <72825410+jkueloc@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Josh Stegmaier <104993387+joshuastegmaier@users.noreply.github.com>
Co-authored-by: Jen Kuenning <jkue@loc.gov>
Co-authored-by: Chris Adams <cadams@loc.gov>
Co-authored-by: joshuastegmaier <jstegmaier@loc.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants