You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@caldera.apache.org by "dasokkk (via GitHub)" <gi...@apache.org> on 2026/06/28 01:00:34 UTC
[PR] fix: require full string match in is_uuid4 [caldera]
dasokkk opened a new pull request, #3395:
URL: https://github.com/apache/caldera/pull/3395
## Summary
`BaseWorld.is_uuid4` used `re.match`, which only anchors the start of the
string, so any value that begins with a UUID was treated as valid (e.g.
`"<uuid>-extra"` returned `True`). The helper decides identifier handling
in a few input-sensitive spots: payload lookup from the agent `file`
header in `file_svc`, fact source classification in `fact_api_manager`,
and `#{payload:...}` resolution in `c_agent`.
This switches the check to `re.fullmatch` so the whole string must be a
UUID. Identifiers are generated with `uuid.uuid4()` and still validate;
only trailing or leading junk is rejected.
## Test plan
- [ ] `is_uuid4` returns True for a valid uuid4 string
- [ ] `is_uuid4` returns False when extra characters follow a valid uuid
- [ ] existing base_world unit tests pass
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@caldera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org