Skip to content

validate users with input types in shared.db - #318

Merged
mschwoer merged 27 commits into
refactor_validation2_Ifrom
refactor_validation2_II
Nov 19, 2026
Merged

mschwoer merged 27 commits into
refactor_validation2_Ifrom
refactor_validation2_II

Conversation

@mschwoer

Copy link
Copy Markdown
Contributor
  • NewUser and UserUpdate replace the cleaning on the admin page
  • emails are stored and looked up stripped and lower-cased
  • set_status rejects the current and unknown statuses
  • the initials and email uniqueness checks query the backend
  • the form limits are read from the input type

mschwoer and others added 27 commits November 13, 2026 16:41
- `NewUser` and `UserUpdate` replace the cleaning on the admin page
- emails are stored and looked up stripped and lower-cased
- `set_status` rejects the current and unknown statuses
- the initials and email uniqueness checks query the backend
- the form limits are read from the input type

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- `NewProject` replaces the project id check of the projects page,
  the id rule is one regex
- a project needs an active owner, if one is given
- only active projects can be archived or deleted
- the form limits are read from the input type

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…k in shared

- `check_config_params` is the one check of unresolved `config_params`,
  used by the settings page and at job time; its helpers are private
- move the runner check to shared/runner_checks.py, it also rejects an unknown runner
- remove the unused `allow_absolute_paths` of `check_for_malicious_content`

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- `NewSettings` replaces the validation on submit of the settings page
- `settings.create` checks the runner and the owner, reports all rule errors
  together and archives the previous version itself (`archive_previous`)
- only active settings can be archived or deleted
- the form limits are read from the input type
- remove `empty_to_none` of the webapp, the input types do it

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- `NewAssignment` validates scopes and file name filters
- `assign`, `unassign` and `update_to_latest` take `allow_fallback`: the caller
  states whether it may change the assignments of the fallback project
- `assign` reports all rule errors together
- `update_to_latest` points the assignment to the latest version in one write
- `known_scopes` is the one list of scopes, also for the form

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- unknown scopes: neither the default scope, a vendor nor an instrument of the yaml
- scopes whose instruments are all excluded
- the default scope excluded, a scope both included and excluded
- file name filters that always match an exclude filter

`update_to_latest` does not re-check the stored scopes and filters.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A scope or file name filter that would never apply is rejected even if
other entries of the assignment still apply. Messages and docstrings said
"they would never apply", which read as the whole assignment.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`fully_excluded_scopes` already rejects an excluded default scope and a scope
that is both included and excluded, for every scope with an instrument in the
yaml. Remove the two rules from `NewAssignment`.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A scope in both `scopes` and `excluded_scopes` was listed twice.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`get_instrument_types` in shared/yamlsettings.py replaces the separate reads
in the scope resolver and the projects, overview and admin pages.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`KNOWN_VENDOR_NAMES` becomes `KNOWN_INSTRUMENT_TYPES`; comments, docstrings,
test names, an error message and the texts of the projects page follow.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The page only knows the active versions, so "current + 1" was wrong whenever
a newer version was archived or deleted. Add a test that the archive checkbox
names the version `settings.create` archives, the latest active one.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…arams

The gap is in that check, which every client and the processor run.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The field declares the lengths, the regex only the characters. A too short
id now gets the length message, like a too long one.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Project.id and User.initials mixed a constant with a literal.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Only the projects page left it out; other clients could archive or delete it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The toasts no longer repeat the entered text; the bulk add report names the
initials of the stored users.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
reject settings assignments that can never apply
validate settings assignments with an input type in shared.db
validate new settings with an input type in shared.db
prepare the settings validation: one config_params check, runner chec…
validate new projects with an input type in shared.db
@mschwoer
mschwoer merged commit 752eab7 into refactor_validation2_I Nov 19, 2026
@mschwoer
mschwoer deleted the refactor_validation2_II branch November 19, 2026 14:39
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.

1 participant