• last updated 7 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Replace the lame template::util::get_opts with some homemade utility that will parse arguments reliably, adjust the one upstream use case where arguments other than those documented might be passed to the element creation, introduce a warning when this happens somewhere else

  1. … 1 more file in changeset.
Fix test, the proc behaves as documented (and IMO, it should go away at some point)

New test for template::util::get_opts

This will expose a bug when an argument in an even position is specified that starts with a "-" character

not necessary to check if format is a list

move the check for the provided format on richtext level

increase robustness

Be stricter when validating widgets with restricted options: when no options are specified, treat it as automatic failure

Compute amplitude and wavelength explicitly in pixels and make it stable with respect to the captcha size, introduce a random offset for the wave instead

Fixes acs-templating.tesseract_cannot_crack_catpcha automated test

Minor modernization

- use atomic stack operations to reduce locks and avoid race conditions

- improve spelling

- break overlong lines

- better align comments with actual code

Drop the pointsize parameter, use size instead, yielding more predictable results across Imagemagik versions and more controllable in general, make the wavelength randomized in the distortion

Deprecate template::util::tcl_to_sql_list, completely replaced by ns_dbquotelist, a native NaviServer command

  1. … 15 more files in changeset.
Improve test portability

Baseline test of captcha robustness: challenge the captcha using tesseract, also applying basic normalizations

Fail when no value is specified

Fix tests according to new behavior

Improve behavior: invalidate the captcha when the check fails, cleanup expired captcha also when a new one is generated

Test newly introduced api

file captcha-procs.tcl was initially added on branch oacs-5-10.

    • -0
    • +0
    ./test/captcha-procs.tcl
A simple image captcha implementation:

a random text is converted to a distorted image, its checksum, together with the expected text are stored in a lookup table. Upon validation, the text input by the user is matched against the checksum to determine if the captcha is correct.

Plan is to use it downstream on certain publicly available contact forms.

  1. … 8 more files in changeset.
file captcha-procs.tcl was initially added on branch oacs-5-10.

Make sure widget variable exists for the element

Add multiselect to the widgets we check

Restrict new widget validation of options to select and radio, not every widget must restrict the values to the options property

Implement a hook for widget-specific validation and use it to enforce that widgets that specify a list of options must return a value that belongs to those options

Inform widget: do not render any input element alongside the form value

improve spelling

validate format of richtext field always

Smartify idioms

Fix typo

simplify idioms